/* ==========================================================================
   Design Tokens
   ========================================================================== */

:root {
    color-scheme: light dark;

    /* Colors — Light */
    --color-bg: #fafaf7;
    --color-surface: #ffffff;
    --color-surface-alt: #f4f4ef;
    --color-text: #1a1a1a;
    --color-text-muted: #555555;
    --color-text-subtle: #888888;
    --color-accent: #c5a572;
    --color-accent-strong: #a88b5a;
    --color-border: #e6e3db;
    --color-nav-bg: #1a1a1a;
    --color-nav-text: #ffffff;
    --color-hero-from: #1a1a1a;
    --color-hero-to: #2c3e50;
    --color-code-bg: #f6f6f2;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-accent: 0 6px 18px rgba(197, 165, 114, 0.3);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-pill: 999px;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', Monaco, Menlo, Consolas, 'Liberation Mono', monospace;

    /* Layout */
    --max-width: 1200px;
    --section-padding: 50px;

    /* Motion */
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] {
    --color-bg: #0f0f11;
    --color-surface: #18181b;
    --color-surface-alt: #1f1f23;
    --color-text: #f0f0ef;
    --color-text-muted: #b8b8b0;
    --color-text-subtle: #888880;
    --color-accent: #d4b682;
    --color-accent-strong: #e4cd9f;
    --color-border: #2a2a2e;
    --color-nav-bg: #0a0a0c;
    --color-nav-text: #f0f0ef;
    --color-hero-from: #0a0a0c;
    --color-hero-to: #1a1f2a;
    --color-code-bg: #1a1a1e;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

a {
    color: inherit;
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-accent);
    color: #1a1a1a;
    padding: 12px 20px;
    z-index: 2000;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
    top: 0;
}

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: 3px;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

nav {
    background: var(--color-nav-bg);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    gap: 10px;
}

.logo {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--color-accent);
    padding: 20px 0;
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0;
}

.nav-links a {
    color: var(--color-nav-text);
    text-decoration: none;
    padding: 28px 22px;
    display: block;
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
    border-bottom: 3px solid transparent;
    font-size: 0.98em;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255, 255, 255, 0.04);
    border-bottom-color: var(--color-accent);
}

[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a.active {
    background: rgba(255, 255, 255, 0.06);
}

/* Theme toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--color-nav-text);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    margin-left: 8px;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--color-nav-text);
    font-size: 1.5em;
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius-sm);
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   Hero & Page Headers
   ========================================================================== */

.hero {
    background: linear-gradient(135deg, var(--color-hero-from) 0%, var(--color-hero-to) 100%);
    color: #ffffff;
    padding: 110px 30px 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(197, 165, 114, 0.12), transparent 50%);
    pointer-events: none;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.6em;
    margin-bottom: 16px;
    font-weight: 300;
    letter-spacing: 2px;
}

.hero .subtitle {
    font-size: 1.3em;
    color: var(--color-accent);
    margin-bottom: 28px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.hero p {
    font-size: 1.1em;
    max-width: 720px;
    margin: 0 auto 40px;
    line-height: 1.75;
    color: #e0e0e0;
}

.hero .cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.page-header {
    background: linear-gradient(135deg, var(--color-hero-from) 0%, var(--color-hero-to) 100%);
    color: #ffffff;
    padding: 80px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(197, 165, 114, 0.1), transparent 50%);
    pointer-events: none;
}

.page-header > * {
    position: relative;
    z-index: 1;
}

.page-header h1 {
    font-size: 2.8em;
    margin-bottom: 12px;
    font-weight: 300;
    letter-spacing: 1px;
}

.page-header p {
    font-size: 1.15em;
    color: var(--color-accent);
    max-width: 700px;
    margin: 0 auto;
}

/* ==========================================================================
   Contact Bar
   ========================================================================== */

.contact-bar {
    background: var(--color-surface);
    padding: 22px 30px;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--color-border);
}

.contact-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.25s var(--ease);
    font-size: 0.98em;
}

.contact-item:hover {
    color: var(--color-accent);
}

.contact-item svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Layout / Containers
   ========================================================================== */

.container {
    max-width: var(--max-width);
    margin: 60px auto;
    padding: 0 30px;
}

.section {
    background: var(--color-surface);
    padding: var(--section-padding);
    margin-bottom: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.section h2 {
    font-size: 2.1em;
    margin-bottom: 28px;
    color: var(--color-text);
    font-weight: 300;
    border-bottom: 2px solid var(--color-accent);
    padding-bottom: 14px;
    letter-spacing: 0.5px;
}

.section-intro {
    font-size: 1.05em;
    color: var(--color-text-muted);
    line-height: 1.8;
    margin-bottom: 24px;
    max-width: 820px;
}

.about-paragraph {
    font-size: 1.08em;
    line-height: 1.85;
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

.about-paragraph:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Stats
   ========================================================================== */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin: 20px 0;
}

.stat-card {
    text-align: center;
    padding: 30px 24px;
    background: linear-gradient(135deg, var(--color-hero-from) 0%, var(--color-hero-to) 100%);
    color: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.stat-number {
    font-size: 2.8em;
    font-weight: 700;
    color: var(--color-accent);
    display: block;
    line-height: 1.1;
    letter-spacing: 0.5px;
}

.stat-label {
    font-size: 1em;
    margin-top: 10px;
    opacity: 0.85;
    display: block;
}

/* ==========================================================================
   Feature Cards (Home)
   ========================================================================== */

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.feature-card {
    padding: 28px;
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-accent);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 40px;
    height: 40px;
    color: var(--color-accent);
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.feature-icon svg {
    width: 100%;
    height: 100%;
}

.feature-card h3 {
    color: var(--color-text);
    margin-bottom: 12px;
    font-size: 1.22em;
    font-weight: 600;
}

.feature-card p {
    color: var(--color-text-muted);
    line-height: 1.7;
    font-size: 0.98em;
}

/* ==========================================================================
   Featured Projects preview (Home)
   ========================================================================== */

.featured-projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
    margin: 20px 0 30px;
}

.featured-project-card {
    padding: 26px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.featured-project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.featured-project-card .tag {
    font-size: 0.75em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    font-weight: 600;
}

.featured-project-card h3 {
    font-size: 1.15em;
    color: var(--color-text);
    font-weight: 600;
}

.featured-project-card p {
    color: var(--color-text-muted);
    font-size: 0.95em;
    line-height: 1.6;
}

.projects-cta {
    text-align: center;
    margin-top: 10px;
}

/* ==========================================================================
   Timeline (Experience)
   ========================================================================== */

.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--color-accent);
}

.timeline-item {
    position: relative;
    margin-bottom: 44px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -46px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-accent);
    border: 3px solid var(--color-surface);
    box-shadow: 0 0 0 2px var(--color-accent);
}

.timeline-date {
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9em;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.timeline-content {
    background: var(--color-surface);
    padding: 26px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.timeline-content h3 {
    font-size: 1.4em;
    color: var(--color-text);
    margin-bottom: 4px;
    font-weight: 600;
}

.timeline-content h4 {
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 16px;
    font-size: 1em;
    letter-spacing: 0.3px;
}

.timeline-content ul {
    margin-left: 20px;
    margin-top: 12px;
}

.timeline-content li {
    margin-bottom: 8px;
    color: var(--color-text-muted);
    line-height: 1.65;
}

.relevance-note {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--color-surface-alt);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius-sm);
    font-size: 0.92em;
    color: var(--color-text-muted);
}

.relevance-note strong {
    color: var(--color-text);
}

.skills-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.skills-tags span {
    background: var(--color-surface-alt);
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.82em;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

/* ==========================================================================
   Skills Page
   ========================================================================== */

.skills-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
}

.skill-category-card {
    background: var(--color-surface);
    padding: 36px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--color-accent);
}

.category-icon {
    width: 32px;
    height: 32px;
    color: var(--color-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-icon svg {
    width: 100%;
    height: 100%;
}

.category-header h3 {
    font-size: 1.5em;
    color: var(--color-text);
    font-weight: 400;
}

.skill-list {
    display: grid;
    gap: 18px;
}

.skill-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skill-name {
    font-weight: 500;
    color: var(--color-text);
    font-size: 1em;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.skill-level {
    color: var(--color-text-subtle);
    font-size: 0.82em;
    font-weight: 400;
    white-space: nowrap;
}

.skill-bar {
    height: 8px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-strong) 100%);
    border-radius: var(--radius-pill);
    transition: width 1.2s var(--ease);
}

.coursework-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 28px;
    margin-top: 24px;
}

.coursework-category h4 {
    color: var(--color-text);
    margin-bottom: 14px;
    font-size: 1.1em;
    font-weight: 600;
}

.coursework-category ul {
    list-style: none;
}

.coursework-category li {
    padding: 7px 0 7px 16px;
    border-left: 2px solid var(--color-border);
    margin-bottom: 6px;
    color: var(--color-text-muted);
    font-size: 0.96em;
    transition: border-color 0.25s var(--ease);
}

.coursework-category li:hover {
    border-left-color: var(--color-accent);
}

/* ==========================================================================
   Projects Page
   ========================================================================== */

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 26px;
}

.project-card {
    background: var(--color-surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-ribbon {
    position: absolute;
    top: 18px;
    right: -40px;
    transform: rotate(35deg);
    background: var(--color-accent);
    color: #1a1a1a;
    padding: 4px 46px;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.project-type {
    font-size: 0.78em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent);
    font-weight: 600;
}

.project-card h3 {
    font-size: 1.3em;
    color: var(--color-text);
    font-weight: 600;
    line-height: 1.3;
}

.project-hook {
    color: var(--color-text-muted);
    line-height: 1.65;
    font-size: 0.98em;
}

.project-tools {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.project-tools span {
    background: var(--color-surface-alt);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.78em;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.project-details {
    margin-top: 6px;
    border-top: 1px solid var(--color-border);
    padding-top: 14px;
}

.project-details summary {
    cursor: pointer;
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.95em;
    padding: 4px 0;
    user-select: none;
    list-style: none;
}

.project-details summary::-webkit-details-marker { display: none; }

.project-details summary::after {
    content: '→';
    margin-left: 6px;
    display: inline-block;
    transition: transform 0.3s var(--ease);
}

.project-details[open] summary::after {
    transform: rotate(90deg);
}

.project-details summary:hover {
    color: var(--color-accent-strong);
}

.project-details-content {
    padding-top: 12px;
    color: var(--color-text-muted);
    line-height: 1.7;
    font-size: 0.95em;
}

.project-details-content p {
    margin-bottom: 10px;
}

.project-details-content p:last-child {
    margin-bottom: 0;
}

.project-details-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
    background: white;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.project-details-content .project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.project-details-content .project-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.9em;
    border-radius: 6px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.project-details-content .project-links a:hover {
    border-color: var(--color-accent);
    color: var(--color-accent-strong);
}

.project-details-content .project-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.project-details-content .project-kpi {
    padding: 10px 12px;
    background: var(--color-surface);
    border-left: 3px solid var(--color-accent);
    border-radius: 4px;
}

.project-details-content .project-kpi-label {
    display: block;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.project-details-content .project-kpi-value {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--color-text);
}

/* ==========================================================================
   Contact Page
   ========================================================================== */

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
    margin-bottom: 40px;
}

.contact-card {
    background: var(--color-surface);
    padding: 36px 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    text-align: center;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.contact-icon {
    color: var(--color-accent);
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.contact-card h3 {
    font-size: 1.3em;
    margin-bottom: 12px;
    color: var(--color-text);
    font-weight: 600;
}

.contact-card p {
    font-size: 1em;
    margin-bottom: 4px;
    color: var(--color-text-muted);
}

.contact-card p.description {
    color: var(--color-text-subtle);
    font-size: 0.88em;
    margin-top: 10px;
}

.contact-card a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.25s var(--ease);
}

.contact-card a:hover {
    color: var(--color-accent);
}

.cta-section {
    text-align: center;
    background: linear-gradient(135deg, var(--color-surface-alt) 0%, var(--color-bg) 100%);
}

[data-theme="dark"] .cta-section {
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-alt) 100%);
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Page-bottom CTA block for Experience/Skills */
.cta-block {
    text-align: center;
    background: linear-gradient(135deg, var(--color-surface-alt) 0%, var(--color-bg) 100%);
    padding: 48px 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    margin-top: 40px;
}

[data-theme="dark"] .cta-block {
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-alt) 100%);
}

.cta-block h3 {
    font-size: 1.6em;
    color: var(--color-text);
    margin-bottom: 14px;
    font-weight: 400;
}

.cta-block p {
    color: var(--color-text-muted);
    margin-bottom: 26px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
    margin-top: 24px;
}

.quick-link-card {
    padding: 26px;
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-accent);
}

.quick-link-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.quick-link-card h4 {
    color: var(--color-text);
    margin-bottom: 8px;
    font-size: 1.1em;
    font-weight: 600;
}

.quick-link-card p {
    color: var(--color-text-muted);
    font-size: 0.94em;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    padding: 13px 30px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.25s var(--ease), color 0.25s var(--ease),
                transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
    display: inline-block;
    font-size: 0.98em;
    letter-spacing: 0.3px;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: var(--color-accent);
    color: #1a1a1a;
    border-color: var(--color-accent);
}

.btn-primary:hover {
    background: var(--color-accent-strong);
    border-color: var(--color-accent-strong);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-text);
}

.btn-secondary:hover {
    background: var(--color-text);
    color: var(--color-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Hero buttons always on dark background */
.hero .btn-secondary {
    color: #ffffff;
    border-color: #ffffff;
}

.hero .btn-secondary:hover {
    background: #ffffff;
    color: #1a1a1a;
}

/* ==========================================================================
   Resume Page (PDF viewer)
   ========================================================================== */

.resume-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 36px 0 24px;
}

.pdf-embed-wrapper {
    max-width: 900px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.pdf-embed-wrapper iframe {
    width: 100%;
    height: 1100px;
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: block;
    background: #ffffff;
}

.pdf-fallback-note {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.95em;
    margin: 16px auto 40px;
    max-width: 900px;
    padding: 0 20px;
}

/* ==========================================================================
   404 / error page
   ========================================================================== */

.error-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 80px 24px 100px;
    text-align: center;
}

.error-code {
    font-size: clamp(5em, 15vw, 9em);
    font-weight: 700;
    line-height: 1;
    color: var(--color-accent);
    letter-spacing: -0.04em;
    margin-bottom: 12px;
}

.error-page h1 {
    font-size: 2em;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 14px;
}

.error-page p {
    color: var(--color-text-muted);
    font-size: 1.1em;
    margin-bottom: 32px;
}

.error-links {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==========================================================================
   Print — when someone prints the resume page, suppress nav/footer chrome
   ========================================================================== */

@media print {
    nav, footer, .skip-link, .theme-toggle, .mobile-menu-btn,
    .page-header, .resume-actions, .pdf-fallback-note {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    .pdf-embed-wrapper {
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }

    .pdf-embed-wrapper iframe {
        box-shadow: none !important;
        border-radius: 0 !important;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
    background: var(--color-nav-bg);
    color: var(--color-nav-text);
    padding: 34px 30px;
    text-align: center;
    margin-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer p {
    opacity: 0.7;
    font-size: 0.92em;
}

/* ==========================================================================
   Animations (fade-in on scroll)
   ========================================================================== */

.fade-in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    .fade-in {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
        will-change: opacity, transform;
    }

    .fade-in.is-visible {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-nav-bg);
        flex-direction: column;
        padding: 16px 0;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: 14px 30px;
    }

    .nav-right {
        gap: 0;
    }

    .theme-toggle {
        margin-left: 0;
        margin-right: 4px;
    }

    .hero {
        padding: 70px 24px 60px;
    }

    .hero h1 {
        font-size: 2.4em;
        letter-spacing: 1px;
    }

    .hero .subtitle {
        font-size: 1.1em;
    }

    .hero p {
        font-size: 1em;
    }

    .page-header {
        padding: 60px 24px;
    }

    .page-header h1 {
        font-size: 2.1em;
    }

    .page-header p {
        font-size: 1em;
    }

    .contact-container {
        flex-direction: column;
        align-items: center;
        gap: 14px;
    }

    .container {
        margin: 40px auto;
    }

    .section {
        padding: 32px 24px;
    }

    .section h2 {
        font-size: 1.7em;
    }

    .timeline {
        padding-left: 28px;
    }

    .timeline-item::before {
        left: -34px;
    }

    .skill-category-card {
        padding: 28px 22px;
    }

    .coursework-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .quick-links-grid {
        grid-template-columns: 1fr;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .cta-block {
        padding: 36px 24px;
    }

    /* Resume: hide iframe on mobile — iOS Safari can't reliably render embedded
       PDFs. The "Open in new tab" action button above the iframe handles mobile. */
    .pdf-embed-wrapper {
        display: none;
    }

    .pdf-fallback-note {
        display: block;
    }
}

.pdf-fallback-note {
    display: none;
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2em;
    }
}
