/* Exercise Book Design - CSS */

:root {
    /* Light theme colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --text-primary: #2c3e50;
    --text-secondary: #34495e;
    --text-muted: #7f8c8d;
    --accent-primary: #2196f3;
    --accent-light: #e3f2fd;
    --border-color: #e3f2fd;
    --shadow: rgba(0, 0, 0, 0.1);
    --header-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --binding-color: #2c3e50;
    --ring-color: #34495e;
    --ring-bg: #ecf0f1;
}

[data-theme="dark"] {
    /* Dark theme colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-gradient: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --accent-primary: #64b5f6;
    --accent-light: #1e3a5f;
    --border-color: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
    --header-gradient: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    --binding-color: #1a202c;
    --ring-color: #2d3748;
    --ring-bg: #4a5568;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease;
}

.exercise-book {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: 15px;
    box-shadow: 0 20px 40px var(--shadow);
    overflow: hidden;
    position: relative;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.theme-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.theme-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.theme-btn:hover .theme-icon {
    transform: rotate(20deg);
}

/* Notebook Header with Binding */
.notebook-header {
    background: var(--header-gradient);
    color: white;
    padding: 40px 30px;
    position: relative;
    transition: background 0.3s ease;
    background-size: 200% 200%;
    animation: headerGradientShift 28s ease-in-out infinite alternate;
    /* Parallax variables (updated via JS) */
    --bind-shift-x: 0px;
    --bind-shift-y: 0px;
    --bind-rot: 0deg;
    --bind-shadow: rgba(0,0,0,0.15);
}

@keyframes headerGradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 50% 50%; }
    100% { background-position: 100% 50%; }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 30px;
    max-width: 600px;
    margin: 0;
    padding-left: 90px; /* bring content closer to the left/binding */
}

.profile-photo-container {
    flex-shrink: 0;
}

.profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 4px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: default; /* not clickable */
}

.profile-photo:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.profile-photo img.show {
    display: block;
}

.profile-photo img.show + .photo-placeholder {
    display: none;
}

.photo-placeholder {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-placeholder span {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}

.photo-placeholder p {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}

.header-text {
    text-align: left;
}

/* Signature animation */
/* Scroll-scrub timeline track */
.experience-timeline {
    position: relative;
    padding-left: 24px;
}

.experience-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(var(--accent-light), var(--accent-light));
    border-radius: 2px;
    opacity: 0.6;
}

.experience-timeline::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    width: 4px;
    height: 0;
    background: var(--accent-primary);
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(33, 150, 243, 0.25);
    transition: height 600ms ease;
}

.timeline-filled .experience-timeline::after {
    height: var(--timeline-fill, 0%);
}

.experience-item {
    position: relative;
}

.experience-item .experience-marker {
    position: relative;
    box-shadow: 0 0 0 0 rgba(33,150,243,0.35);
    transition: box-shadow 400ms ease;
}

.experience-item.reveal--visible .experience-marker {
    box-shadow: 0 0 0 8px rgba(33,150,243,0.0);
    animation: markerPop 600ms ease forwards;
}

@keyframes markerPop {
    0% { transform: scale(0.6); box-shadow: 0 0 0 0 rgba(33,150,243,0.35); }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(33,150,243,0); }
}

.binding {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%) translate(var(--bind-shift-x), var(--bind-shift-y)) rotate(var(--bind-rot));
    width: 40px;
    height: 120px;
    background: var(--binding-color);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 25px var(--bind-shadow);
}

.binding-rings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ring {
    width: 20px;
    height: 20px;
    border: 3px solid var(--ring-color);
    border-radius: 50%;
    background: var(--ring-bg);
    transition: border-color 0.3s ease, background 0.3s ease, transform 0.2s ease;
}

.binding .ring:nth-child(1) { transform: translateY(calc(var(--bind-shift-y) * 0.3)); }
.binding .ring:nth-child(2) { transform: translateY(calc(var(--bind-shift-y) * 0.6)); }
.binding .ring:nth-child(3) { transform: translateY(calc(var(--bind-shift-y) * 0.9)); }

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.9;
}

/* Main Content Area */
.notebook-content {
    padding: 0;
}

.page-section {
    margin-bottom: 0;
}

.lined-paper {
    padding: 48px 30px 40px;
    position: relative;
    background-color: var(--bg-primary);
    /* Subtle paper noise texture */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/></svg>");
    background-size: 200px 200px;
    background-repeat: repeat;
    min-height: 400px;
    transition: background 0.3s ease;
    /* Very light inner shadow for depth */
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.03),
                inset 0 -1px 0 rgba(0, 0, 0, 0.03),
                inset 0 0 40px rgba(0, 0, 0, 0.04);
}

/* Horizontal Blue Lines - Exercise Book Style */
.lined-paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(to right, var(--accent-light) 1px, transparent 1px),
        linear-gradient(to bottom, var(--accent-primary) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

.lined-paper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(to bottom, var(--accent-light) 1px, transparent 1px);
    background-size: 100% 24px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
}

/* Content positioning above lines */
.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
    border-bottom: 3px solid var(--accent-primary);
    padding-bottom: 10px;
    display: inline-block;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.content-text {
    position: relative;
    z-index: 2;
    margin-bottom: 30px;
}

.content-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

/* Scroll-reveal base */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 800ms ease, transform 800ms ease;
    will-change: opacity, transform;
}

.reveal--visible {
    opacity: 1;
    transform: none;
}

/* Typewriter caret */
.content-text h4 {
    position: relative;
    display: inline-block;
    color: var(--text-primary);
}

.typing-caret {
    display: inline-block;
    width: 1ch;
    margin-left: 1px;
    border-right: 2px solid currentColor;
    animation: caret-blink 0.9s steps(1) infinite;
    height: 1em;
    vertical-align: -0.15em;
}

.typing-caret--done {
    animation: caret-blink 1.1s steps(1) infinite;
}

@keyframes caret-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Social Links */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
    z-index: 2;
    margin-top: 30px;
}

.social-link {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent-light);
    color: var(--accent-primary);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.social-link:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

/* Experience Timeline */
.experience-timeline {
    position: relative;
    z-index: 2;
}

.experience-item {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border-left: 4px solid var(--accent-primary);
    box-shadow: 0 2px 10px var(--shadow);
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.experience-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 20px;
    flex-shrink: 0;
}

.experience-marker.yellow { background: #ffc107; }
.experience-marker.blue { background: #2196f3; }
.experience-marker.red { background: #f44336; }
.experience-marker.green { background: #4caf50; }

.experience-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.experience-content p {
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s ease;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    position: relative;
    z-index: 2;
}

.skill-category {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.skill-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-primary);
    transition: color 0.3s ease, border-color 0.3s ease;
}

.skill-list {
    list-style: none;
}

.skill-list li {
    padding: 8px 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 20px;
    transition: color 0.3s ease;
}

.skill-list li::before {
    content: '•';
    color: var(--accent-primary);
    font-weight: bold;
    position: absolute;
    left: 0;
    transition: color 0.3s ease;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    position: relative;
    z-index: 2;
}

.project-card {
    perspective: 1000px;
    outline: none;
    border-radius: 12px;
    position: relative;
    height: var(--project-card-height, 190px);
}

.project-card-inner {
    position: relative;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 300ms ease;
    border-radius: 12px;
}

.project-card-face {
    position: absolute;
    inset: 0;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    backface-visibility: hidden;
    overflow: hidden;
}

.project-card-front {
    /* Page curl hint using radial gradient */
    --curl-size: 36px;
    background:
      radial-gradient( circle at 100% 0%, rgba(0,0,0,0.18) 0, rgba(0,0,0,0.12) 20%, rgba(0,0,0,0.06) 40%, rgba(0,0,0,0.0) 60% ) top right / var(--curl-size) var(--curl-size) no-repeat,
      var(--bg-secondary);
}

.project-card-front::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 0;
    height: 0;
    border-top: var(--curl-size) solid rgba(255,255,255,0.9);
    border-left: var(--curl-size) solid transparent;
    border-top-right-radius: 4px;
    opacity: 0.7;
}

.project-card-back {
    transform: rotateY(180deg);
}

.project-card:hover .project-card-inner {
    transform: rotateX(2deg) rotateY(-6deg);
    box-shadow: 0 14px 35px rgba(0,0,0,0.15);
}

.project-card.is-flipped .project-card-inner {
    transform: rotateY(180deg);
}

.project-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(33, 150, 243, 0.2);
}

.project-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.project-line {
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), #64b5f6);
    border-radius: 2px;
    margin: 0 auto;
    width: 60%;
    transition: background 0.3s ease;
}

.project-card-back p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.project-link {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.project-link:hover { 
    background: var(--accent-primary);
    color: white;
    border-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
    .project-card:hover .project-card-inner,
    .project-card.is-flipped .project-card-inner {
        transform: none;
        box-shadow: none;
    }
}

/* Notebook Footer */
.notebook-footer {
    background: var(--bg-secondary);
    padding: 20px 30px;
    text-align: center;
    border-top: 2px solid var(--border-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.page-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .exercise-book {
        border-radius: 10px;
    }
    
    .notebook-header {
        padding: 30px 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        align-items: center;
        justify-content: center;
        padding-left: 0;
    }
    
    .profile-photo {
        width: 100px;
        height: 100px;
    }
    
    .header-text {
        text-align: center;
    }
    
    .binding {
        display: none;
    }
    
    .theme-toggle {
        top: 15px;
        right: 15px;
    }
    
    .theme-btn {
        width: 45px;
        height: 45px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .lined-paper {
        padding: 38px 20px 30px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .notebook-header {
        animation: none;
        background-size: auto;
    }
    .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .lined-paper {
        padding: 28px 15px 20px;
    }
    
    .experience-item {
        flex-direction: column;
        text-align: center;
    }
    
    .experience-marker {
        margin-right: 0;
        margin-bottom: 10px;
    }
} 