/* ==========================================================================
   MADHAV KANNAN K — ART-DIRECTED EDITORIAL PAPER DESIGN SYSTEM
   Extracted from hero composition (DESIGN.md)
   ========================================================================== */

:root {
    /* Step 0 Tokens: Sampled directly from hero composition */
    --paper: #EFE6D2;          /* Page background below hero */
    --paper-deep: #E4D7BC;     /* Deeper paper tint for panels/highlight */
    --cream: #F6EFDF;          /* Cream paper note & sticker borders */
    --ink: #1B1612;            /* Deepest warm charcoal ink (AAA contrast) */
    --ink-soft: #4A4036;       /* Softened ink for body copy (AA contrast >= 4.5:1) */

    /* Accent System: Poppy is the ONE primary accent below the hero */
    --poppy: #C0281D;          /* Links, big numerals, kickers */
    --poppy-hover: #9E1F15;
    --fabric: #4A1459;         /* Hero purple fabric & rare small details */
    --cta: #E0623F;            /* Primary hero CTA button only */
    --cta-hover: #C54C2B;

    /* Typography Scale */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    --font-hand: 'Caveat', cursive, sans-serif;

    /* Spacing Scale (8px Base) */
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-6: 48px;
    --space-8: 64px;
    --space-10: 80px;
    --space-16: 128px;

    /* Section padding: 128px top/bottom desktop, 80px mobile */
    --section-pad-y: 128px;

    /* Borders & Hard Shadows */
    --border-ink-thin: 1px solid rgba(27, 22, 18, 0.2);
    --border-ink-solid: 1px solid var(--ink);
    --border-ink-rule: 2px solid var(--ink);
    --shadow-hard: 6px 6px 0 var(--ink);
    --shadow-hard-sm: 4px 4px 0 var(--ink);
    --shadow-hard-btn: 3px 3px 0 var(--ink);

    /* Sticker Style */
    --sticker-border: 6px solid var(--cream);
    --sticker-radius: 14px;
}

/* Step 4: Dark Mode Inversion (Warm Ink-Black Paper) */
[data-theme="dark"] {
    --paper: #161210;          /* Warm ink-black background */
    --paper-deep: #231E1B;     /* Deeper surface tint */
    --cream: #28221D;          /* Dark cream surface */
    --ink: #F6EFDF;            /* Aged cream ink (AAA contrast on #161210) */
    --ink-soft: #C7BDB1;       /* Soft cream pencil (AA contrast) */

    --poppy: #E64A38;          /* Lightened poppy to guarantee AA contrast */
    --poppy-hover: #F86A58;
    --fabric: #C084FC;         /* Luminous purple accent */
    --cta: #E8704F;
    --cta-hover: #F58364;

    --border-ink-thin: 1px solid rgba(246, 239, 223, 0.2);
    --border-ink-solid: 1px solid var(--ink);
    --border-ink-rule: 2px solid var(--ink);
    --shadow-hard: 6px 6px 0 rgba(0, 0, 0, 0.9);
    --shadow-hard-sm: 4px 4px 0 rgba(0, 0, 0, 0.9);
    --shadow-hard-btn: 3px 3px 0 rgba(0, 0, 0, 0.9);

    /* Stickers keep their cream border as requested */
    --sticker-border: 6px solid #F6EFDF;
}

/* ==========================================================================
   Base Resets & Paper Texture Grain
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    font-size: 19px;
    line-height: 1.65;
    color: var(--ink-soft);
    background-color: var(--paper);
    /* Subtle procedural SVG paper noise grain */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.035'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-attachment: fixed;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Accessibility: Visible Focus Rings */
:focus-visible {
    outline: 3px solid var(--poppy);
    outline-offset: 2px;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

img, picture {
    max-width: 100%;
    display: block;
}

/* Reading Progress Bar (Poppy) */
.scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 1000;
    pointer-events: none;
    background: transparent;
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--poppy);
    transition: width 0.08s ease-out;
}

/* ==========================================================================
   Header & Floating Pill Navigation
   ========================================================================== */

.header {
    position: fixed;
    top: 20px;
    left: 0;
    width: 100%;
    z-index: 990;
    pointer-events: none;
    padding: 0 20px;
}

.navbar {
    max-width: 980px;
    margin: 0 auto;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto;
    background: rgba(24, 9, 34, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(246, 239, 223, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    border-radius: 999px;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.02em;
    color: #F6EFDF;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    color: #F6EFDF;
    padding: 6px 4px;
    position: relative;
    transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--poppy);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 4px;
    right: 4px;
    height: 2px;
    background: var(--poppy);
}

.mobile-only-cv {
    display: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-cv-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: #F6EFDF;
    background: transparent;
    border: 1px solid rgba(246, 239, 223, 0.25);
    border-radius: 999px;
    transition: all 0.15s ease;
}

.nav-cv-btn:hover {
    background: rgba(246, 239, 223, 0.15);
    color: #FFFFFF;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(246, 239, 223, 0.25);
    background: transparent;
    color: #F6EFDF;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.15s ease;
}

.theme-toggle:hover {
    background: rgba(246, 239, 223, 0.15);
    color: #FFFFFF;
}

.hamburger .line {
    width: 100%;
    height: 2px;
    background: #F6EFDF;
    transition: all 0.25s ease;
}

/* Scrolled state over content */
header.scrolled .navbar {
    background: rgba(246, 239, 223, 0.92);
    border: var(--border-ink-solid);
    box-shadow: var(--shadow-hard-sm);
}

header.scrolled .logo-text,
header.scrolled .nav-links a,
header.scrolled .nav-cv-btn,
header.scrolled .theme-toggle {
    color: var(--ink);
    border-color: var(--border-ink-solid);
}

header.scrolled .hamburger .line {
    background: var(--ink);
}

[data-theme="dark"] header.scrolled .navbar {
    background: rgba(22, 18, 16, 0.92);
    border: var(--border-ink-solid);
    box-shadow: var(--shadow-hard-sm);
}

[data-theme="dark"] header.scrolled .logo-text,
[data-theme="dark"] header.scrolled .nav-links a,
[data-theme="dark"] header.scrolled .nav-cv-btn,
[data-theme="dark"] header.scrolled .theme-toggle {
    color: var(--ink);
    border-color: var(--border-ink-solid);
}

[data-theme="dark"] header.scrolled .hamburger .line {
    background: var(--ink);
}

/* ==========================================================================
   SECTION 1: HERO
   ========================================================================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 80px 20px;
    background-color: #180922; /* Deep purple fabric background */
    overflow: hidden;
}

.hero-parallax-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.hero-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
}

.hero-bg-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-person-layer {
    z-index: 2;
    pointer-events: none;
}

.hero-person-layer img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left bottom;
}

.hero-overlay-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(24, 9, 34, 0.2) 0%, rgba(24, 9, 34, 0.65) 60%, rgba(24, 9, 34, 0.85) 100%);
    z-index: 3;
}

.hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: flex-end;
}

/* Transparent Hero Note: Translucent scrim with backdrop blur revealing the purple velvet and vintage artwork */
.hero-paper-note {
    background: rgba(24, 9, 34, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #F6EFDF;
    border: 1px solid rgba(246, 239, 223, 0.2);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    transform: rotate(0deg);
    border-radius: 12px;
    padding: clamp(28px, 4vw, 44px);
    width: 100%;
    max-width: 620px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.hero-paper-note:hover {
    background: rgba(24, 9, 34, 0.5);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}

.hero-mobile-portrait {
    display: none;
    margin-bottom: 16px;
}

.hero-badge-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.hero-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: #F6EFDF;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(246, 239, 223, 0.25);
    padding: 6px 14px;
    border-radius: 999px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16A34A;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.3);
}

.handwritten-note {
    font-family: var(--font-hand);
    color: var(--poppy);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(32px, 4.5vw, 48px);
    font-weight: 800;
    line-height: 1.1;
    color: #FFFFFF;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.hero-name-highlight {
    color: var(--poppy);
}

.hero-subtitle {
    font-family: var(--font-sans);
    font-size: clamp(20px, 2.5vw, 24px);
    font-weight: 600;
    color: #F6EFDF;
    line-height: 1.35;
    text-wrap: balance;
    margin-bottom: 16px;
}

.hero-description {
    font-size: 18px;
    line-height: 1.6;
    color: rgba(246, 239, 223, 0.88);
    margin-bottom: 28px;
}

.hero-cta-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-cta-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 700;
    color: #FFFFFF;
    background: var(--cta);
    border: 1px solid rgba(246, 239, 223, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    transition: all 0.15s ease;
}

.hero-cta-primary:hover {
    background: var(--cta-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.hero-cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 700;
    color: #FFFFFF;
    background: transparent;
    border: 1px solid rgba(246, 239, 223, 0.35);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    transition: all 0.15s ease;
}

.hero-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.scroll-hint {
    position: absolute;
    bottom: 64px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #F6EFDF;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    z-index: 20;
    opacity: 0.85;
    pointer-events: none;
}

.scroll-hint-arrow {
    animation: bounceDown 2s infinite;
}

@keyframes bounceDown {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(6px); }
    60% { transform: translateY(3px); }
}

/* Step 1: Real irregular, fibrous torn-paper edge SVG transition */
.hero-torn-edge {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 52px;
    z-index: 15;
    pointer-events: none;
    line-height: 0;
}

.hero-torn-edge svg {
    width: 100%;
    height: 100%;
    fill: var(--paper);
    transition: fill 0.25s ease;
}

/* ==========================================================================
   STEP 2: GLOBAL EDITORIAL DESIGN SYSTEM (BELOW HERO)
   ========================================================================== */

.editorial-section {
    padding: var(--section-pad-y) 0;
    position: relative;
}

.editorial-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-kicker-header {
    margin-bottom: 56px;
}

.section-kicker {
    display: block;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--poppy);
    margin-bottom: 8px;
}

.section-heading {
    font-family: var(--font-heading);
    font-size: clamp(48px, 7vw, 96px);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.04em;
    color: var(--ink);
}

.lead-text {
    font-size: 22px;
    line-height: 1.5;
    color: var(--ink);
    font-weight: 500;
}

.body-text {
    font-size: 19px;
    line-height: 1.65;
    color: var(--ink-soft);
}

.big-numeral {
    font-family: var(--font-mono);
    font-size: clamp(56px, 9vw, 120px);
    font-weight: 700;
    line-height: 0.9;
    color: var(--poppy);
    letter-spacing: -0.04em;
}

/* Reusable Sticker Style */
.sticker {
    border: var(--sticker-border);
    border-radius: var(--sticker-radius);
    box-shadow: var(--shadow-hard);
    transform: rotate(-1.5deg);
    object-fit: cover;
    transition: transform 200ms ease;
}

.sticker:hover {
    transform: rotate(0deg);
}

/* Editorial Links: Poppy, underlined 2px offset, arrow glyph */
.editorial-link {
    color: var(--poppy);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s ease;
}

.editorial-link:hover {
    color: var(--poppy-hover);
}

/* ==========================================================================
   SECTION A: ABOUT & SKILLS (#about)
   ========================================================================== */

.about-grid {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: 48px;
    align-items: start;
}

.about-left-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-paragraph-2 {
    margin-bottom: 12px;
}

/* Plain Definition List: dt in mono, dd in body */
.about-def-list {
    margin-top: 16px;
    border-top: var(--border-ink-rule);
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.def-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 20px;
    align-items: baseline;
}

.def-label {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
}

.def-value {
    font-size: 19px;
    line-height: 1.55;
    color: var(--ink);
}

.about-script-note {
    margin-left: 10px;
    font-size: 20px;
    display: inline-block;
}

/* Right (5 cols): Skills as four labeled groups, plain mono list with " / " separators. No boxes. */
.skills-editorial-block {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding-left: 24px;
    border-left: var(--border-ink-rule);
}

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

.skill-group-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.skill-mono-list {
    font-family: var(--font-mono);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink-soft);
}

/* ==========================================================================
   SECTION B: OPEN SOURCE (#open-source)
   ========================================================================== */

.os-rows-list {
    border-top: var(--border-ink-rule);
}

.os-editorial-row {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    padding: 44px 0;
    border-bottom: var(--border-ink-rule);
    align-items: start;
    transition: transform 200ms ease;
}

.os-editorial-row:hover {
    transform: translateY(-2px);
}

.os-numeral-col {
    display: flex;
    align-items: flex-start;
    min-width: 280px;
}

.os-content-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.os-header-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.os-repo-name {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-soft);
}

.mono-status-badge {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border: var(--border-ink-solid);
    border-radius: 4px;
    background: var(--paper-deep);
    color: var(--ink);
}

.mono-status-badge.merged {
    border-color: #16A34A;
    color: #16A34A;
}

.mono-status-badge.open {
    border-color: var(--poppy);
    color: var(--poppy);
}

.mono-status-badge.own {
    border-color: var(--fabric);
    color: var(--fabric);
}

[data-theme="dark"] .mono-status-badge.merged {
    color: #4ADE80;
    border-color: #4ADE80;
}

[data-theme="dark"] .mono-status-badge.own {
    color: #C084FC;
    border-color: #C084FC;
}

.os-row-title {
    font-family: var(--font-heading);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 800;
    line-height: 1.2;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.os-row-why {
    font-size: 19px;
    line-height: 1.6;
    color: var(--ink-soft);
}

.os-row-why code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--paper-deep);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--ink);
}

.os-metrics-line {
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--ink);
    font-weight: 600;
}

.os-tools-line {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--ink-soft);
}

/* ==========================================================================
   SECTION C: FEATURED PROJECTS (#projects)
   ========================================================================== */

.projects-editorial-list {
    display: flex;
    flex-direction: column;
    gap: 96px;
}

.project-editorial-row {
    display: block;
    border-top: var(--border-ink-rule);
    padding-top: 48px;
    position: relative;
    transition: transform 200ms ease;
}

.project-editorial-row::after {
    content: "";
    display: table;
    clear: both;
}

.project-editorial-row:hover {
    transform: translateY(-2px);
}

/* Project Display Title: Floated media card with text wrapping around it */
.project-media-col {
    float: left;
    width: clamp(260px, 34vw, 420px);
    height: 240px;
    background: var(--paper-deep);
    border: var(--border-ink-solid);
    box-shadow: var(--shadow-hard);
    border-radius: 8px;
    padding: 24px;
    margin: 6px 36px 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: transform 200ms ease;
}

.project-editorial-row.reverse-row .project-media-col {
    float: right;
    margin: 6px 0 20px 36px;
}

.project-display-title {
    font-family: var(--font-heading);
    font-size: clamp(48px, 6vw, 76px);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    color: transparent;
    -webkit-text-stroke: 2px var(--ink);
    text-stroke: 2px var(--ink);
    user-select: none;
    text-align: center;
    transition: transform 200ms ease;
}

.project-media-col:hover .project-display-title {
    transform: scale(1.04);
}

.project-text-col {
    display: contents;
}

.project-category-kicker {
    display: block;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--poppy);
    margin-bottom: 8px;
}

.project-header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.project-row-title {
    font-family: var(--font-heading);
    font-size: clamp(26px, 3.2vw, 36px);
    font-weight: 800;
    line-height: 1.15;
    color: var(--ink);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.project-row-desc {
    font-size: 19px;
    line-height: 1.55;
    color: var(--ink-soft);
    margin-bottom: 20px;
}

/* Big Numbers (Stats Grid) */
.project-stats-grid {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    padding: 16px 0;
    margin-bottom: 20px;
    border-top: var(--border-ink-thin);
    border-bottom: var(--border-ink-thin);
}

.stat-unit {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: var(--font-mono);
    font-size: clamp(28px, 3.5vw, 42px);
    font-weight: 800;
    color: var(--poppy);
    line-height: 1;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--ink-soft);
    margin-top: 4px;
}

/* KCI Class Table: Plain 2-column table with ink hairlines */
.kci-class-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    border-top: var(--border-ink-solid);
    border-bottom: var(--border-ink-solid);
}

.kci-class-table th,
.kci-class-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: var(--border-ink-thin);
    font-size: 17px;
}

.kci-class-table th {
    font-family: var(--font-mono);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
}

.kci-class-table td strong {
    font-family: var(--font-mono);
    color: var(--poppy);
}

.kci-caveat-mono,
.guido-status-mono {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-soft);
}

/* Problem / Approach / Result Block */
.project-par-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.par-item {
    font-size: 18px;
    line-height: 1.55;
}

.par-label {
    font-weight: 700;
    color: var(--ink);
    margin-right: 6px;
}

.par-text {
    color: var(--ink-soft);
}

.par-text code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--paper-deep);
    padding: 2px 6px;
    border-radius: 3px;
}

.project-tools-mono {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--ink-soft);
    margin-top: 4px;
}

.project-link-row {
    margin-top: 8px;
}

/* Expandable Architecture: Simple "+ Architecture" Row */
.arch-accordion {
    border-top: var(--border-ink-thin);
    border-bottom: var(--border-ink-thin);
    margin-top: 24px;
    margin-bottom: 16px;
    clear: both;
}

.arch-accordion-summary {
    cursor: pointer;
    padding: 12px 0;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.arch-accordion-summary:hover {
    color: var(--poppy);
}

.arch-accordion-content {
    padding: 16px 0 20px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.arch-step {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 16px;
    align-items: start;
}

.arch-step-num {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--poppy);
    padding-top: 2px;
}

.arch-step-title {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}

.arch-step-desc {
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink-soft);
}

/* ==========================================================================
   SECTION D: MORE PROJECTS (Plain 4-Line List, Hairlines, NO Cards)
   ========================================================================== */

.more-projects-block {
    margin-top: 96px;
    border-top: var(--border-ink-rule);
    padding-top: 48px;
}

.more-projects-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

.more-projects-list {
    display: flex;
    flex-direction: column;
}

.more-project-line {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 24px;
    align-items: baseline;
    padding: 24px 0;
    border-bottom: var(--border-ink-thin);
    transition: transform 200ms ease;
}

.more-project-line:hover {
    transform: translateY(-2px);
}

.more-project-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.more-project-name {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: var(--ink);
}

.more-project-desc {
    font-size: 18px;
    line-height: 1.5;
    color: var(--ink-soft);
}

.more-project-tools {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--ink-soft);
}

.more-project-links {
    display: inline-flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

/* ==========================================================================
   SECTION E: EXPERIENCE (#experience)
   ========================================================================== */

.editorial-timeline {
    border-left: var(--border-ink-rule);
    padding-left: 36px;
    margin-left: 8px;
    display: flex;
    flex-direction: column;
    gap: 64px;
}

.timeline-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    align-items: start;
    position: relative;
}

.timeline-row::before {
    content: '';
    position: absolute;
    left: -42px;
    top: 6px;
    width: 10px;
    height: 10px;
    background: var(--paper);
    border: 3px solid var(--poppy);
    border-radius: 50%;
}

.timeline-date-col {
    display: flex;
    align-items: flex-start;
}

.timeline-mono-date {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--poppy);
}

.timeline-content-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-org {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
}

.timeline-role-title {
    font-family: var(--font-heading);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 800;
    line-height: 1.2;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.timeline-lead {
    font-size: 19px;
    line-height: 1.6;
    color: var(--ink-soft);
}

.timeline-bullets {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.timeline-bullets li {
    font-size: 18px;
    line-height: 1.6;
    color: var(--ink-soft);
    position: relative;
    padding-left: 20px;
}

.timeline-bullets li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--poppy);
    font-weight: 700;
}

.timeline-highlight-box {
    margin-top: 24px;
    padding: 24px;
    background: var(--paper-deep);
    border: var(--border-ink-solid);
    box-shadow: var(--shadow-hard-sm);
    border-radius: 4px;
}

.highlight-kicker {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--poppy);
    display: block;
    margin-bottom: 6px;
}

.highlight-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 8px;
}

.highlight-body {
    font-size: 18px;
    line-height: 1.6;
    color: var(--ink-soft);
}

/* ==========================================================================
   SECTION F: CONTACT (#contact)
   ========================================================================== */

.contact-editorial-layout {
    display: flex;
    flex-direction: column;
    gap: 36px;
    border-top: var(--border-ink-rule);
    padding-top: 48px;
}

.contact-internship-line {
    font-size: 22px;
    line-height: 1.5;
    color: var(--ink);
    font-weight: 600;
}

.contact-email-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.contact-giant-email {
    font-family: var(--font-heading);
    font-size: clamp(26px, 4.3vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--poppy);
    text-decoration: underline;
    text-underline-offset: 4px;
    word-break: normal;
    overflow-wrap: anywhere;
    transition: color 0.15s ease;
}

.contact-giant-email:hover {
    color: var(--poppy-hover);
}

.copy-email-button {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    background: var(--cream);
    border: var(--border-ink-solid);
    box-shadow: var(--shadow-hard-btn);
    border-radius: 4px;
    padding: 10px 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.copy-email-button:hover {
    transform: translateY(-2px);
    box-shadow: 5px 5px 0 var(--ink);
}

.contact-links-list {
    display: flex;
    gap: 36px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.contact-channel-link {
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.15s ease;
}

.contact-channel-link:hover {
    color: var(--poppy);
}

.link-url-text {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-soft);
}

/* ==========================================================================
   FOOTER (Strictly "© 2026 Madhav Kannan K")
   ========================================================================== */

.footer {
    padding: 48px 0;
    border-top: var(--border-ink-rule);
    background: var(--paper);
}

.footer-wrapper {
    display: flex;
    justify-content: flex-start;
}

.footer p {
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--ink-soft);
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--cream);
    color: var(--ink);
    border: var(--border-ink-solid);
    box-shadow: var(--shadow-hard-sm);
    padding: 12px 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    z-index: 1050;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-icon {
    color: #16A34A;
}

/* ==========================================================================
   RESPONSIVE DESIGN (390, 768, 1280, 1920)
   ========================================================================== */

/* Max 1280px */
@media (max-width: 1280px) {
    .editorial-wrapper {
        max-width: 1100px;
    }
}

/* Max 992px */
@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .skills-editorial-block {
        padding-left: 0;
        border-left: none;
        border-top: var(--border-ink-rule);
        padding-top: 32px;
    }

    .more-project-line {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Mobile: Max 768px */
@media (max-width: 768px) {
    :root {
        --section-pad-y: 80px;
    }

    .navbar {
        padding: 8px 16px;
    }

    .nav-links {
        position: fixed;
        top: 76px;
        left: 20px;
        right: 20px;
        background: var(--cream);
        border: var(--border-ink-solid);
        box-shadow: var(--shadow-hard);
        border-radius: 12px;
        flex-direction: column;
        padding: 24px;
        gap: 18px;
        align-items: flex-start;
        display: none;
    }

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

    .mobile-only-cv {
        display: block;
        margin-top: 8px;
        border-top: var(--border-ink-thin);
        padding-top: 12px;
        width: 100%;
    }

    .nav-cv-btn {
        display: none;
    }

    .project-media-col,
    .project-editorial-row.reverse-row .project-media-col {
        float: none;
        width: 100%;
        max-width: 100%;
        height: 180px;
        margin: 0 0 20px 0;
    }

    .hamburger {
        display: flex;
    }

    .hero {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 100px 20px 70px 20px;
        min-height: auto;
    }

    .scroll-hint {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin: 28px auto 16px auto;
        z-index: 20;
    }

    .hero-person-layer {
        display: none; /* Portrait is moved inside the note on mobile */
    }

    .hero-mobile-portrait {
        display: block;
        margin-bottom: 20px;
        margin-left: 14px;
    }

    .hero-mobile-portrait .sticker {
        width: 124px;
        height: 124px;
        object-fit: cover;
        object-position: center;
        border-radius: 16px;
    }

    .hero-content {
        justify-content: center;
    }

    .hero-paper-note {
        transform: rotate(0deg);
        padding: 24px 20px;
    }

    .def-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .os-editorial-row {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 32px 0;
    }

    .timeline-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .timeline-bullets li {
        font-size: 17px;
    }

    .contact-links-list {
        flex-direction: column;
        gap: 16px;
    }
}

/* Smallest Mobile: Max 390px */
@media (max-width: 390px) {
    .editorial-wrapper {
        padding: 0 20px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .body-text,
    .lead-text,
    .def-value,
    .os-row-why,
    .project-row-desc {
        font-size: 17px; /* Strict rule: never under 17px */
    }

    .project-display-title {
        font-size: 52px;
    }
}

/* Prefers Reduced Motion: Disable all motion transforms & animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .sticker,
    .hero-paper-note,
    .os-editorial-row,
    .project-editorial-row,
    .more-project-line {
        transform: none !important;
    }

    .scroll-hint-arrow {
        animation: none !important;
    }
}
