/* =====================================================================
   SamuelButcher.Net — three-sided site stylesheet
   Sides: attorney (light, maroon, EB Garamond) · tech (blue-black console,
   Source Code Pro) · personal (cream cards in a starfield, maroon, Source Sans 3)
   Edit the TOKENS blocks below; everything else reads from them.
   ===================================================================== */


/* =====================================================================
   1. TOKENS — global layout & motion
   ===================================================================== */
:root {
    /* Layout */
    --sidebar-width: 280px;
    --backdrop-left: var(--sidebar-width);
    --mobile-header-height: 84px;
    --logo-size: clamp(96px, 16vh, 140px);
    --card-padding: 40px;
    --term-bar-height: 28px;

    /* Side switch buttons (pill thumb slides between them) */
    --switch-w: 40px;
    --switch-h: 36px;

    /* Easing curves */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in: cubic-bezier(0.55, 0, 0.75, 0.25);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);

    /* Side switch: colours morph over --theme-duration; fonts swap at peak blur */
    --theme-duration: 900ms;
    --switch-out: 300ms;          /* blur-out time before fonts/content swap (read by JS) */
    --switch-in: 560ms;           /* blur-in time after the swap */
    --switch-blur: 12px;
    --switch-dim: 0.25;

    /* Section (nav) transitions */
    --section-duration: 650ms;
    --section-blur: 8px;
    --reveal-stagger: 80ms;

    /* Hover timing */
    --hover-duration: 320ms;

    /* Resume hover card */
    --cv-logo-size: 78px;
    --cv-logo-opacity: 0.18;
}


/* =====================================================================
   2. TOKENS — ATTORNEY (light, maroon, pewter, EB Garamond)
   ===================================================================== */
:root {
    /* Colours */
    --attorney-bg: #eeebe5;
    --attorney-surface: rgba(255, 253, 249, 0.94);
    --attorney-surface-raised: #fffdf9;
    --attorney-text: #2c2723;
    --attorney-heading: #1a1512;
    --attorney-muted: #7a716a;
    --attorney-accent: #800000;
    --attorney-on-accent: #fffaf3;
    --attorney-ornament: #7d7873;              /* pewter: rules, seals, § marks */
    --attorney-border: rgba(50, 30, 20, 0.13);
    --attorney-shadow: rgba(45, 25, 15, 0.22);
    --attorney-spot: rgba(128, 0, 0, 0.07);
    --attorney-scrim: rgba(20, 12, 8, 0.4);

    /* Backdrop: soft paper light + five falling lines */
    --attorney-paper: radial-gradient(1200px 700px at 70% -10%, rgba(255, 255, 255, 0.85), transparent 60%),
                      radial-gradient(900px 600px at 0% 110%, rgba(128, 0, 0, 0.05), transparent 60%);
    --attorney-line-track: rgba(40, 25, 20, 0.08);
    --attorney-line-length: 15vh;
    --attorney-line-duration: 7s;
    --attorney-line-ease: cubic-bezier(0.4, 0.26, 0, 0.97);

    /* Fonts */
    --attorney-mainfont: "EB Garamond", Garamond, Georgia, serif;
    --attorney-displayfont: "EB Garamond", Garamond, Georgia, serif;
    --attorney-headingfont: "EB Garamond", Garamond, Georgia, serif;
    --attorney-uifont: "EB Garamond", Garamond, Georgia, serif;

    /* Type tuning */
    --attorney-body-size: 1.12rem;
    --attorney-body-leading: 1.75;
    --attorney-ui-scale: 1.12;
    --attorney-ui-tracking: 0.12em;
    --attorney-ui-transform: none;
    --attorney-ui-caps: all-small-caps;         /* nav, labels, chips in small caps */
    --attorney-ui-weight: 600;
    --attorney-heading-style: normal;
    --attorney-heading-weight: 500;
    --attorney-heading-tracking: 0.08em;
    --attorney-heading-transform: uppercase;
    --attorney-title-weight: 600;
    --attorney-headline-weight: 500;

    /* 3D title */
    --attorney-brand-weight: 600;
    --attorney-brand-tracking: 0.01em;
    --attorney-brand-color: #800000;
    --attorney-brand-shadow:
        0.012em 0.012em 0 #6c0000, 0.024em 0.024em 0 #5e0000, 0.036em 0.036em 0 #500000,
        0.048em 0.048em 0 #430000, 0.06em 0.06em 0 #370000, 0.072em 0.072em 0 #2b0000,
        0.1em 0.14em 0.14em rgba(30, 10, 5, 0.35);

    /* Ornaments */
    --attorney-divider-glyph: "§";
    --attorney-caret: "";
    --attorney-chip-prefix: "";
    --attorney-nav-prefix: "";
    --attorney-h2-prefix: "";
    --attorney-lede-prefix: "";
    --attorney-bullet: "•";
    --attorney-h2-rule:
        linear-gradient(var(--accent), var(--accent)) left bottom / 100% 1px no-repeat,
        linear-gradient(var(--accent), var(--accent)) left calc(100% - 4px) / 100% 1px no-repeat;

    /* Shapes */
    --attorney-card-radius: 4px;
    --attorney-chip-radius: 2px;
    --attorney-icon-radius: 50%;
    --attorney-inner-bg: transparent;

    /* Drop cap */
    --attorney-dropcap-float: left;
    --attorney-dropcap-size: 4.1em;
    --attorney-dropcap-leading: 0.8;
    --attorney-dropcap-padding: 0.05em 0.1em 0 0;
    --attorney-dropcap-weight: 500;

    /* Portrait: pewter double-ring medallion */
    --attorney-photo-radius: 50%;
    --attorney-photo-img-radius: 50%;
    --attorney-photo-pad: 6px;
    --attorney-photo-bg: #fffdf9;
    --attorney-photo-ring: 4px double #7d7873;
    --attorney-photo-tilt: 0deg;
    --attorney-photo-filter: none;

    /* Resume */
    --attorney-cv-lift: -6px;
    --attorney-cv-role-style: italic;
    --attorney-cv-rest-bg: transparent;
    --attorney-cv-rest-border: 1px solid transparent;
    --attorney-cv-shadow: 0 22px 40px -22px rgba(45, 25, 15, 0.38), 0 3px 10px -6px rgba(45, 25, 15, 0.25);
    --attorney-logo-filter: grayscale(1) sepia(0.3);
}


/* =====================================================================
   3. TOKENS — TECHNOLOGIST (blue-black console, Source Code Pro)
   ===================================================================== */
:root {
    /* Colours */
    --tech-bg: #0a0d13;
    --tech-surface: rgba(14, 18, 27, 0.9);
    --tech-surface-raised: #131a27;
    --tech-text: #c3ccd8;
    --tech-heading: #f1f5fa;
    --tech-muted: #7c8899;
    --tech-accent: #3ee0d0;
    --tech-on-accent: #03110f;
    --tech-ornament: #3ee0d0;
    --tech-border: rgba(120, 200, 220, 0.14);
    --tech-shadow: rgba(0, 0, 0, 0.7);
    --tech-spot: rgba(62, 224, 208, 0.1);
    --tech-scrim: rgba(2, 4, 8, 0.65);

    /* Backdrop: a terminal printing this site's own source, line by line (read by JS) */
    --tech-stream-color: rgba(124, 136, 153, 0.55);
    --tech-stream-active: #3ee0d0;
    --tech-stream-size: 13px;
    --tech-stream-leading: 1.65;
    --tech-stream-speed: 28ms;                  /* delay between typed chunks */
    --tech-stream-glow: radial-gradient(900px 520px at 85% -5%, rgba(62, 224, 208, 0.09), transparent 60%);

    /* Fonts */
    --tech-mainfont: "Source Code Pro", Consolas, ui-monospace, monospace;
    --tech-displayfont: "Source Code Pro", Consolas, ui-monospace, monospace;
    --tech-headingfont: "Source Code Pro", Consolas, ui-monospace, monospace;
    --tech-uifont: "Source Code Pro", Consolas, ui-monospace, monospace;

    /* Type tuning */
    --tech-body-size: 0.93rem;
    --tech-body-leading: 1.75;
    --tech-ui-scale: 0.88;
    --tech-ui-tracking: 0.02em;
    --tech-ui-transform: lowercase;
    --tech-ui-caps: normal;
    --tech-ui-weight: 500;
    --tech-heading-style: normal;
    --tech-heading-weight: 600;
    --tech-heading-tracking: 0;
    --tech-heading-transform: lowercase;
    --tech-title-weight: 600;
    --tech-headline-weight: 500;

    /* 3D title */
    --tech-brand-weight: 700;
    --tech-brand-tracking: -0.03em;
    --tech-brand-color: #3ee0d0;
    --tech-brand-shadow:
        0.012em 0.012em 0 #31b8ab, 0.024em 0.024em 0 #279489, 0.036em 0.036em 0 #1e726a,
        0.048em 0.048em 0 #16544e, 0.06em 0.06em 0 #0f3935, 0.072em 0.072em 0 #08221f,
        0 0 0.35em rgba(62, 224, 208, 0.3);

    /* Ornaments */
    --tech-divider-glyph: "//";
    --tech-caret: "_";
    --tech-chip-prefix: "--";
    --tech-nav-prefix: "./";
    --tech-h2-prefix: "> ";
    --tech-lede-prefix: "> ";
    --tech-bullet: ">";
    --tech-h2-rule: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 12px) left bottom / 100% 2px no-repeat;

    /* Shapes */
    --tech-card-radius: 3px;
    --tech-chip-radius: 2px;
    --tech-icon-radius: 4px;
    --tech-inner-bg: rgba(255, 255, 255, 0.015);

    /* Drop cap (off: the console uses a prompt instead) */
    --tech-dropcap-float: none;
    --tech-dropcap-size: 1em;
    --tech-dropcap-leading: inherit;
    --tech-dropcap-padding: 0;
    --tech-dropcap-weight: inherit;

    /* Portrait: cyan monochrome monitor */
    --tech-photo-radius: 3px;
    --tech-photo-img-radius: 0;
    --tech-photo-pad: 4px;
    --tech-photo-bg: #000000;
    --tech-photo-ring: 1px solid #3ee0d0;
    --tech-photo-tilt: 0deg;
    --tech-photo-filter: grayscale(1) sepia(1) hue-rotate(130deg) saturate(1.8) brightness(0.92) contrast(1.1);

    /* Resume: no lift, glow + scan sweep instead */
    --tech-cv-lift: 0px;
    --tech-cv-role-style: normal;
    --tech-cv-rest-bg: transparent;
    --tech-cv-rest-border: 1px solid transparent;
    --tech-cv-shadow: inset 3px 0 0 #3ee0d0, 0 0 0 1px rgba(62, 224, 208, 0.4), 0 0 26px -6px rgba(62, 224, 208, 0.35);
    --tech-logo-filter: grayscale(1) invert(1) sepia(1) hue-rotate(130deg) saturate(2.5);
}


/* =====================================================================
   4. TOKENS — HUMAN / PERSONAL (warm paper, maroon, Source Sans 3)
   ===================================================================== */
:root {
    /* Colours */
    --personal-bg: #050506;
    --personal-surface: rgba(252, 248, 240, 0.97);
    --personal-surface-raised: #fffaf1;
    --personal-text: #33291f;
    --personal-heading: #1d140e;
    --personal-muted: #8a7a68;
    --personal-accent: #800000;
    --personal-on-accent: #fdf6ec;
    --personal-ornament: #800000;
    --personal-border: rgba(80, 40, 20, 0.15);
    --personal-shadow: rgba(70, 35, 15, 0.24);
    --personal-spot: rgba(128, 0, 0, 0.07);
    --personal-scrim: rgba(40, 20, 10, 0.35);

    /* Backdrop: drifting starfield (star counts are read by JS) */
    --personal-space: radial-gradient(ellipse at bottom, #16181d 0%, #050506 100%);
    --personal-star-color: #ffffff;
    --personal-star-field: 2000px;               /* height of one star tile */
    --personal-star-count-sm: 700;
    --personal-star-count-md: 200;
    --personal-star-count-lg: 100;
    --personal-star-speed-sm: 50s;
    --personal-star-speed-md: 100s;
    --personal-star-speed-lg: 150s;

    /* Fonts */
    --personal-mainfont: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
    --personal-displayfont: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
    --personal-headingfont: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
    --personal-uifont: "Source Sans 3", "Segoe UI", system-ui, sans-serif;

    /* Type tuning */
    --personal-body-size: 1.06rem;
    --personal-body-leading: 1.75;
    --personal-ui-scale: 1;
    --personal-ui-tracking: 0.03em;
    --personal-ui-transform: none;
    --personal-ui-caps: normal;
    --personal-ui-weight: 600;
    --personal-heading-style: normal;
    --personal-heading-weight: 700;
    --personal-heading-tracking: -0.01em;
    --personal-heading-transform: none;
    --personal-title-weight: 700;
    --personal-headline-weight: 600;

    /* 3D title */
    --personal-brand-weight: 900;
    --personal-brand-tracking: -0.01em;
    --personal-brand-color: #2a1d15;
    --personal-brand-shadow:
        0.012em 0.012em 0 #800000, 0.024em 0.024em 0 #730000, 0.036em 0.036em 0 #660000,
        0.048em 0.048em 0 #590000, 0.06em 0.06em 0 #4c0000,
        0.09em 0.12em 0.12em rgba(70, 35, 15, 0.3);

    /* Ornaments */
    --personal-divider-glyph: "♞";               /* the Réti knight */
    --personal-caret: "";
    --personal-chip-prefix: "";
    --personal-nav-prefix: "";
    --personal-h2-prefix: "";
    --personal-lede-prefix: "";
    --personal-bullet: "•";
    --personal-h2-rule: linear-gradient(var(--accent), var(--accent)) center bottom / 100% 3px no-repeat;

    /* Shapes */
    --personal-card-radius: 14px;
    --personal-chip-radius: 999px;
    --personal-icon-radius: 50%;
    --personal-inner-bg: #fffaf1;

    /* Drop cap */
    --personal-dropcap-float: left;
    --personal-dropcap-size: 3.9em;
    --personal-dropcap-leading: 0.82;
    --personal-dropcap-padding: 0.04em 0.1em 0 0;
    --personal-dropcap-weight: 900;

    /* Portrait: polaroid */
    --personal-photo-radius: 3px;
    --personal-photo-img-radius: 1px;
    --personal-photo-pad: 10px 10px 36px;
    --personal-photo-bg: #fffaf1;
    --personal-photo-ring: 1px solid rgba(80, 40, 20, 0.15);
    --personal-photo-tilt: -2.5deg;
    --personal-photo-filter: none;

    /* Resume: postcards with postmarks */
    --personal-cv-lift: -6px;
    --personal-cv-role-style: normal;
    --personal-cv-rest-bg: #fffaf1;
    --personal-cv-rest-border: 1px dashed rgba(80, 40, 20, 0.22);
    --personal-cv-shadow: 0 22px 38px -22px rgba(70, 35, 15, 0.45), 0 2px 0 rgba(80, 40, 20, 0.06);
    --personal-logo-filter: grayscale(0.4) sepia(0.6);
}


/* =====================================================================
   5. THEME WIRING
   Colours follow [data-theme] (set instantly, then morph).
   Fonts/shapes follow [data-side] (set at peak blur so the swap is hidden).
   ===================================================================== */

/* Registered colour properties so they interpolate smoothly */
@property --bg { syntax: '<color>'; inherits: true; initial-value: #eeebe5; }
@property --surface { syntax: '<color>'; inherits: true; initial-value: #ffffff; }
@property --surface-raised { syntax: '<color>'; inherits: true; initial-value: #ffffff; }
@property --text { syntax: '<color>'; inherits: true; initial-value: #2c2723; }
@property --heading { syntax: '<color>'; inherits: true; initial-value: #1a1512; }
@property --muted { syntax: '<color>'; inherits: true; initial-value: #7a716a; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: #800000; }
@property --on-accent { syntax: '<color>'; inherits: true; initial-value: #ffffff; }
@property --ornament { syntax: '<color>'; inherits: true; initial-value: #9a7636; }
@property --border { syntax: '<color>'; inherits: true; initial-value: rgba(0, 0, 0, 0.1); }
@property --shadow { syntax: '<color>'; inherits: true; initial-value: rgba(0, 0, 0, 0.2); }
@property --spot { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --scrim { syntax: '<color>'; inherits: true; initial-value: rgba(0, 0, 0, 0.4); }

:root {
    transition:
        --bg var(--theme-duration) var(--ease-in-out),
        --surface var(--theme-duration) var(--ease-in-out),
        --surface-raised var(--theme-duration) var(--ease-in-out),
        --text var(--theme-duration) var(--ease-in-out),
        --heading var(--theme-duration) var(--ease-in-out),
        --muted var(--theme-duration) var(--ease-in-out),
        --accent var(--theme-duration) var(--ease-in-out),
        --on-accent var(--theme-duration) var(--ease-in-out),
        --ornament var(--theme-duration) var(--ease-in-out),
        --border var(--theme-duration) var(--ease-in-out),
        --shadow var(--theme-duration) var(--ease-in-out),
        --spot var(--theme-duration) var(--ease-in-out),
        --scrim var(--theme-duration) var(--ease-in-out);
}

/* Colours: Attorney */
:root[data-theme="attorney"] {
    --side-index: 0;
    --bg: var(--attorney-bg);
    --surface: var(--attorney-surface);
    --surface-raised: var(--attorney-surface-raised);
    --text: var(--attorney-text);
    --heading: var(--attorney-heading);
    --muted: var(--attorney-muted);
    --accent: var(--attorney-accent);
    --on-accent: var(--attorney-on-accent);
    --ornament: var(--attorney-ornament);
    --border: var(--attorney-border);
    --shadow: var(--attorney-shadow);
    --spot: var(--attorney-spot);
    --scrim: var(--attorney-scrim);
    color-scheme: light;
}

/* Colours: Technologist */
:root[data-theme="tech"] {
    --side-index: 1;
    --bg: var(--tech-bg);
    --surface: var(--tech-surface);
    --surface-raised: var(--tech-surface-raised);
    --text: var(--tech-text);
    --heading: var(--tech-heading);
    --muted: var(--tech-muted);
    --accent: var(--tech-accent);
    --on-accent: var(--tech-on-accent);
    --ornament: var(--tech-ornament);
    --border: var(--tech-border);
    --shadow: var(--tech-shadow);
    --spot: var(--tech-spot);
    --scrim: var(--tech-scrim);
    color-scheme: dark;
}

/* Colours: Human */
:root[data-theme="personal"] {
    --side-index: 2;
    --bg: var(--personal-bg);
    --surface: var(--personal-surface);
    --surface-raised: var(--personal-surface-raised);
    --text: var(--personal-text);
    --heading: var(--personal-heading);
    --muted: var(--personal-muted);
    --accent: var(--personal-accent);
    --on-accent: var(--personal-on-accent);
    --ornament: var(--personal-ornament);
    --border: var(--personal-border);
    --shadow: var(--personal-shadow);
    --spot: var(--personal-spot);
    --scrim: var(--personal-scrim);
    color-scheme: light;
}

/* Type & shapes: Attorney */
:root[data-side="attorney"] {
    --font-body: var(--attorney-mainfont);
    --font-display: var(--attorney-displayfont);
    --font-heading: var(--attorney-headingfont);
    --font-ui: var(--attorney-uifont);
    --body-size: var(--attorney-body-size);
    --body-leading: var(--attorney-body-leading);
    --ui-scale: var(--attorney-ui-scale);
    --ui-tracking: var(--attorney-ui-tracking);
    --ui-transform: var(--attorney-ui-transform);
    --ui-caps: var(--attorney-ui-caps);
    --ui-weight: var(--attorney-ui-weight);
    --heading-style: var(--attorney-heading-style);
    --heading-weight: var(--attorney-heading-weight);
    --heading-tracking: var(--attorney-heading-tracking);
    --heading-transform: var(--attorney-heading-transform);
    --title-weight: var(--attorney-title-weight);
    --headline-weight: var(--attorney-headline-weight);
    --brand-weight: var(--attorney-brand-weight);
    --brand-tracking: var(--attorney-brand-tracking);
    --brand-color: var(--attorney-brand-color);
    --brand-shadow: var(--attorney-brand-shadow);
    --divider-glyph: var(--attorney-divider-glyph);
    --caret: var(--attorney-caret);
    --chip-prefix: var(--attorney-chip-prefix);
    --nav-prefix: var(--attorney-nav-prefix);
    --h2-prefix: var(--attorney-h2-prefix);
    --lede-prefix: var(--attorney-lede-prefix);
    --bullet: var(--attorney-bullet);
    --h2-rule: var(--attorney-h2-rule);
    --card-radius: var(--attorney-card-radius);
    --chip-radius: var(--attorney-chip-radius);
    --icon-radius: var(--attorney-icon-radius);
    --inner-bg: var(--attorney-inner-bg);
    --dropcap-float: var(--attorney-dropcap-float);
    --dropcap-size: var(--attorney-dropcap-size);
    --dropcap-leading: var(--attorney-dropcap-leading);
    --dropcap-padding: var(--attorney-dropcap-padding);
    --dropcap-weight: var(--attorney-dropcap-weight);
    --photo-radius: var(--attorney-photo-radius);
    --photo-img-radius: var(--attorney-photo-img-radius);
    --photo-pad: var(--attorney-photo-pad);
    --photo-bg: var(--attorney-photo-bg);
    --photo-ring: var(--attorney-photo-ring);
    --photo-tilt: var(--attorney-photo-tilt);
    --photo-filter: var(--attorney-photo-filter);
    --cv-lift: var(--attorney-cv-lift);
    --cv-role-style: var(--attorney-cv-role-style);
    --cv-rest-bg: var(--attorney-cv-rest-bg);
    --cv-rest-border: var(--attorney-cv-rest-border);
    --cv-shadow: var(--attorney-cv-shadow);
    --logo-filter: var(--attorney-logo-filter);
}

/* Type & shapes: Technologist */
:root[data-side="tech"] {
    --font-body: var(--tech-mainfont);
    --font-display: var(--tech-displayfont);
    --font-heading: var(--tech-headingfont);
    --font-ui: var(--tech-uifont);
    --body-size: var(--tech-body-size);
    --body-leading: var(--tech-body-leading);
    --ui-scale: var(--tech-ui-scale);
    --ui-tracking: var(--tech-ui-tracking);
    --ui-transform: var(--tech-ui-transform);
    --ui-caps: var(--tech-ui-caps);
    --ui-weight: var(--tech-ui-weight);
    --heading-style: var(--tech-heading-style);
    --heading-weight: var(--tech-heading-weight);
    --heading-tracking: var(--tech-heading-tracking);
    --heading-transform: var(--tech-heading-transform);
    --title-weight: var(--tech-title-weight);
    --headline-weight: var(--tech-headline-weight);
    --brand-weight: var(--tech-brand-weight);
    --brand-tracking: var(--tech-brand-tracking);
    --brand-color: var(--tech-brand-color);
    --brand-shadow: var(--tech-brand-shadow);
    --divider-glyph: var(--tech-divider-glyph);
    --caret: var(--tech-caret);
    --chip-prefix: var(--tech-chip-prefix);
    --nav-prefix: var(--tech-nav-prefix);
    --h2-prefix: var(--tech-h2-prefix);
    --lede-prefix: var(--tech-lede-prefix);
    --bullet: var(--tech-bullet);
    --h2-rule: var(--tech-h2-rule);
    --card-radius: var(--tech-card-radius);
    --chip-radius: var(--tech-chip-radius);
    --icon-radius: var(--tech-icon-radius);
    --inner-bg: var(--tech-inner-bg);
    --dropcap-float: var(--tech-dropcap-float);
    --dropcap-size: var(--tech-dropcap-size);
    --dropcap-leading: var(--tech-dropcap-leading);
    --dropcap-padding: var(--tech-dropcap-padding);
    --dropcap-weight: var(--tech-dropcap-weight);
    --photo-radius: var(--tech-photo-radius);
    --photo-img-radius: var(--tech-photo-img-radius);
    --photo-pad: var(--tech-photo-pad);
    --photo-bg: var(--tech-photo-bg);
    --photo-ring: var(--tech-photo-ring);
    --photo-tilt: var(--tech-photo-tilt);
    --photo-filter: var(--tech-photo-filter);
    --cv-lift: var(--tech-cv-lift);
    --cv-role-style: var(--tech-cv-role-style);
    --cv-rest-bg: var(--tech-cv-rest-bg);
    --cv-rest-border: var(--tech-cv-rest-border);
    --cv-shadow: var(--tech-cv-shadow);
    --logo-filter: var(--tech-logo-filter);
}

/* Type & shapes: Human */
:root[data-side="personal"] {
    --font-body: var(--personal-mainfont);
    --font-display: var(--personal-displayfont);
    --font-heading: var(--personal-headingfont);
    --font-ui: var(--personal-uifont);
    --body-size: var(--personal-body-size);
    --body-leading: var(--personal-body-leading);
    --ui-scale: var(--personal-ui-scale);
    --ui-tracking: var(--personal-ui-tracking);
    --ui-transform: var(--personal-ui-transform);
    --ui-caps: var(--personal-ui-caps);
    --ui-weight: var(--personal-ui-weight);
    --heading-style: var(--personal-heading-style);
    --heading-weight: var(--personal-heading-weight);
    --heading-tracking: var(--personal-heading-tracking);
    --heading-transform: var(--personal-heading-transform);
    --title-weight: var(--personal-title-weight);
    --headline-weight: var(--personal-headline-weight);
    --brand-weight: var(--personal-brand-weight);
    --brand-tracking: var(--personal-brand-tracking);
    --brand-color: var(--personal-brand-color);
    --brand-shadow: var(--personal-brand-shadow);
    --divider-glyph: var(--personal-divider-glyph);
    --caret: var(--personal-caret);
    --chip-prefix: var(--personal-chip-prefix);
    --nav-prefix: var(--personal-nav-prefix);
    --h2-prefix: var(--personal-h2-prefix);
    --lede-prefix: var(--personal-lede-prefix);
    --bullet: var(--personal-bullet);
    --h2-rule: var(--personal-h2-rule);
    --card-radius: var(--personal-card-radius);
    --chip-radius: var(--personal-chip-radius);
    --icon-radius: var(--personal-icon-radius);
    --inner-bg: var(--personal-inner-bg);
    --dropcap-float: var(--personal-dropcap-float);
    --dropcap-size: var(--personal-dropcap-size);
    --dropcap-leading: var(--personal-dropcap-leading);
    --dropcap-padding: var(--personal-dropcap-padding);
    --dropcap-weight: var(--personal-dropcap-weight);
    --photo-radius: var(--personal-photo-radius);
    --photo-img-radius: var(--personal-photo-img-radius);
    --photo-pad: var(--personal-photo-pad);
    --photo-bg: var(--personal-photo-bg);
    --photo-ring: var(--personal-photo-ring);
    --photo-tilt: var(--personal-photo-tilt);
    --photo-filter: var(--personal-photo-filter);
    --cv-lift: var(--personal-cv-lift);
    --cv-role-style: var(--personal-cv-role-style);
    --cv-rest-bg: var(--personal-cv-rest-bg);
    --cv-rest-border: var(--personal-cv-rest-border);
    --cv-shadow: var(--personal-cv-shadow);
    --logo-filter: var(--personal-logo-filter);
}

/* Console terminal titles, one per section (Technologist cards) */
#home { --term-title: "sb@net:~$ whoami"; }
#about { --term-title: "sb@net:~$ cat about.md"; }
#resume { --term-title: "sb@net:~$ less resume.txt"; }
#skills { --term-title: "sb@net:~$ ls ./skills"; }
#positions { --term-title: "sb@net:~$ cat ideals.md"; }
#contact { --term-title: "sb@net:~$ ./contact --open"; }


/* =====================================================================
   6. BASE
   ===================================================================== */
html, body { height: 100%; }

body {
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--body-size);
    line-height: var(--body-leading);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); color: var(--heading); }
a { color: var(--accent); }
a:hover { color: var(--accent); text-decoration: none; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button { font: inherit; }

.container-85 { width: 85%; margin-left: auto; margin-right: auto; }

/* Scrollbars follow the side's accent */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 65%, transparent) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Shared UI type (nav, labels, chips, meta) */
.ui-type,
.nav-link,
.pillar,
.knowledges li,
.cv-place,
.cv-date,
.cv-badge,
.position-kicker,
.position-more,
.send-btn,
.info-box h4,
.bar-status,
.essay-kicker {
    font-family: var(--font-ui);
    font-weight: var(--ui-weight);
    letter-spacing: var(--ui-tracking);
    text-transform: var(--ui-transform);
    font-variant-caps: var(--ui-caps);
}


/* =====================================================================
   7. SIDE SWITCHING
   ===================================================================== */

/* Only the current side's blocks render (`revert` keeps each tag's natural display) */
[data-only] { display: none; }
:root[data-side="attorney"] [data-only~="attorney"],
:root[data-side="tech"] [data-only~="tech"],
:root[data-side="personal"] [data-only~="personal"] { display: revert; }

/* Blur-out / blur-in that hides the font swap */
.main-content,
.switch-blur {
    transition:
        filter var(--switch-in) var(--ease-out),
        opacity var(--switch-in) var(--ease-out);
}
:root.switch-prep .main-content,
:root.switch-prep .switch-blur { will-change: filter, opacity; }
:root.is-switching .main-content,
:root.is-switching .switch-blur {
    filter: blur(var(--switch-blur));
    opacity: var(--switch-dim);
    transition-duration: var(--switch-out);
    transition-timing-function: var(--ease-in);
}


/* =====================================================================
   8. BACKDROPS — one scene per side
   ===================================================================== */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.texture {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--backdrop-left);
    right: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity var(--theme-duration) var(--ease-in-out);
}
:root[data-theme="attorney"] .texture-attorney,
:root[data-theme="tech"] .texture-tech,
:root[data-theme="personal"] .texture-personal { opacity: 1; }

/* Backdrop animations only run while their side is showing */
:root:not([data-theme="attorney"]) .line::after,
:root:not([data-theme="personal"]) .stars { animation-play-state: paused; }

/* --- Attorney: soft paper light with five falling maroon lines --- */
.texture-attorney { background: var(--attorney-paper); }
.lines { position: absolute; inset: 0; }
.line { position: absolute; top: 0; width: 1px; height: 100%; background: var(--attorney-line-track); overflow: hidden; }
.line::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--attorney-line-length);
    background: linear-gradient(to bottom, transparent, var(--attorney-accent) 75%, var(--attorney-accent));
    transform: translateY(-100%);
    animation: line-drop var(--attorney-line-duration) var(--attorney-line-ease) infinite;
    will-change: transform;
}
.line:nth-child(1) { left: 16.66%; }
.line:nth-child(2) { left: 33.33%; }
.line:nth-child(3) { left: 50%; }
.line:nth-child(4) { left: 66.66%; }
.line:nth-child(5) { left: 83.33%; }
.line:nth-child(1)::after { animation-delay: 0s; }
.line:nth-child(2)::after { animation-delay: 4.2s; }
.line:nth-child(3)::after { animation-delay: 1.4s; }
.line:nth-child(4)::after { animation-delay: 5.6s; }
.line:nth-child(5)::after { animation-delay: 2.8s; }
@keyframes line-drop {
    from { transform: translateY(-100%); }
    to { transform: translateY(110vh); }
}

/* --- Technologist: the site's own source printed like a terminal (filled by JS) --- */
.texture-tech { background: var(--tech-stream-glow), var(--tech-bg); }
.code-stream {
    position: absolute;
    left: 4vw;
    right: 4vw;
    bottom: 0;
    margin: 0;
    padding-bottom: 24px;
    overflow: hidden;
    font-family: var(--tech-mainfont);
    font-size: var(--tech-stream-size);
    line-height: var(--tech-stream-leading);
    color: var(--tech-stream-color);
    white-space: pre;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 45%);
    mask-image: linear-gradient(to bottom, transparent, #000 45%);
}
.code-stream .is-typing { color: var(--tech-stream-active); }
.code-stream .is-typing::after { content: "▋"; margin-left: 1px; animation: caret-blink 1s steps(1) infinite; }

/* --- Human: three layers of drifting stars (shadows generated by JS) --- */
.texture-personal { background: var(--personal-space); }
.stars { position: absolute; top: 0; left: 0; border-radius: 50%; background: transparent; will-change: transform; }
.stars::after {                                             /* second copy below for a seamless loop */
    content: "";
    position: absolute;
    top: var(--personal-star-field);
    left: 0;
    width: inherit;
    height: inherit;
    border-radius: 50%;
    box-shadow: inherit;
}
.stars-sm { width: 1px; height: 1px; animation: star-drift var(--personal-star-speed-sm) linear infinite; }
.stars-md { width: 2px; height: 2px; animation: star-drift var(--personal-star-speed-md) linear infinite; }
.stars-lg { width: 3px; height: 3px; animation: star-drift var(--personal-star-speed-lg) linear infinite; }
@keyframes star-drift { to { transform: translateY(calc(var(--personal-star-field) * -1)); } }


/* =====================================================================
   9. PRELOADER
   ===================================================================== */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    transition: opacity 0.9s var(--ease-out), visibility 0s linear 0.9s;
}
.preloader.is-hidden { opacity: 0; visibility: hidden; }
.loader {
    width: 60px;
    aspect-ratio: 2;
    --_g: no-repeat radial-gradient(farthest-side, var(--accent) 90%, #0000);
    background: var(--_g) 0 50%, var(--_g) 50% 50%, var(--_g) 100% 50%;
    background-size: 25% 50%;
    animation: loader-dots 1s infinite linear;
}
@keyframes loader-dots {
    33% { background-position: 0 0, 50% 100%, 100% 0; }
    66% { background-position: 50% 0, 0 100%, 100% 100%; }
    100% { background-position: 50% 50%, 0 50%, 100% 50%; }
}


/* =====================================================================
   10. LAYOUT — sidebar, main, sections, cards
   ===================================================================== */
.sidebar {
    position: relative;
    z-index: 1000;
    width: var(--sidebar-width);
    flex-shrink: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    text-align: center;
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 30px -18px var(--shadow);
}

.main-content { position: relative; z-index: 1; flex-grow: 1; overflow: hidden; }

/* Sections stack in place and cross-fade with a soft focus pull */
.content-section {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    filter: blur(var(--section-blur));
    transform: scale(0.985);
    transition:
        opacity var(--section-duration) var(--ease-out),
        filter var(--section-duration) var(--ease-out),
        transform var(--section-duration) var(--ease-out),
        visibility 0s linear var(--section-duration);
    z-index: 1;
}
.content-section.active-section {
    opacity: 1;
    visibility: visible;
    filter: none;
    transform: none;
    transition-delay: 0s;
    z-index: 2;
}

.content-wrapper { width: 100%; max-height: 100%; overflow-y: auto; padding: 50px; }

.content-card {
    position: relative;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: var(--card-padding);
    margin-bottom: 2rem;
    box-shadow: 0 18px 40px -28px var(--shadow), 0 2px 6px -4px var(--shadow);
}
.content-card:last-child { margin-bottom: 0; }

/* Per-side card flourishes */
.content-card::before,
.content-card::after { content: none; position: absolute; pointer-events: none; }

:root[data-side="attorney"] .content-card::after {          /* letterhead rule in pewter and maroon */
    content: "";
    top: -1px;
    left: 50%;
    width: 72px;
    height: 3px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, var(--ornament) 0 18%, var(--accent) 18% 82%, var(--ornament) 82%);
    border-radius: 0 0 3px 3px;
}

:root[data-side="tech"] .content-card { padding-top: calc(var(--term-bar-height) + 34px); }
:root[data-side="tech"] .content-card::before {             /* terminal window title bar */
    content: var(--term-title, "sb@net:~$");
    top: 0;
    left: 0;
    right: 0;
    height: var(--term-bar-height);
    padding-left: 62px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-ui);
    font-size: 0.72rem;
    line-height: var(--term-bar-height);
    text-align: left;
    color: var(--muted);
    background:
        radial-gradient(circle at 16px 50%, var(--accent) 0 4px, transparent 4.5px),
        radial-gradient(circle at 30px 50%, color-mix(in srgb, var(--accent) 55%, transparent) 0 4px, transparent 4.5px),
        radial-gradient(circle at 44px 50%, color-mix(in srgb, var(--accent) 25%, transparent) 0 4px, transparent 4.5px),
        color-mix(in srgb, var(--accent) 5%, transparent);
}

:root[data-side="personal"] .content-card::after {          /* stationery inner frame */
    content: "";
    inset: 8px;
    border: 1px solid var(--border);
    border-radius: calc(var(--card-radius) - 6px);
}


/* =====================================================================
   11. SIDEBAR — logo, nav, side switch
   ===================================================================== */
.sidebar-header { flex-shrink: 0; padding: clamp(18px, 4vh, 40px) 0 clamp(8px, 2vh, 18px); }

/* Two logos stacked; theme decides which is visible. Hover: grow + drop shadow */
.logo-container { position: relative; display: inline-block; width: var(--logo-size); height: var(--logo-size); }
.logo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition:
        opacity var(--theme-duration) var(--ease-in-out),
        transform 0.5s var(--ease-out),
        filter 0.5s var(--ease-out);
}
.logo-on-dark { opacity: 0; }
:root[data-theme="tech"] .logo-on-dark { opacity: 1; }
:root[data-theme="tech"] .logo-on-light { opacity: 0; }
.logo-container:hover .logo { transform: scale(1.08); filter: drop-shadow(0 10px 14px var(--shadow)); }

/* Nav list */
.nav-container { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; overflow-y: auto; }
.nav { display: flex; flex-direction: column; flex-wrap: nowrap; padding: 0 20px; margin: 0; list-style: none; }
.nav-link {
    display: inline-block;
    padding: 6px 4px;
    font-size: calc(1.12rem * var(--ui-scale));
    color: var(--text);
    transition: color var(--hover-duration) ease;
}
.nav-link::before { content: var(--nav-prefix); opacity: 0.55; }
.nav-link:hover,
.nav-link.active { color: var(--accent); }

/* Dividers: neutral at rest; the one under the current section takes the accent */
.navdivider-line {
    position: relative;
    width: 56%;
    height: 2px;
    margin: 6px auto;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--muted) 35%, transparent), transparent);
}
.navdivider-line::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.45s var(--ease-out);
}
.nav-item.is-current + .nav-item-divider .navdivider-line::after { opacity: 1; }

/* Footer */
.sidebar-footer { flex-shrink: 0; padding: 14px 0 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.side-status { display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.25; }
.side-status-name {
    font-family: var(--font-display);
    font-weight: var(--title-weight);
    font-size: 1.25rem;
    color: var(--accent);
}
.side-status-tag { font-size: calc(0.72rem * var(--ui-scale)); color: var(--muted); }
.copyright { font-size: 0.72rem; color: var(--muted); margin: 2px 0 0; }

/* Three-way switch: a pill thumb slides under the active icon */
.side-switch {
    position: relative;
    display: inline-grid;
    grid-template-columns: repeat(3, var(--switch-w));
    padding: 4px;
    border-radius: 999px;
    background-color: var(--surface-raised);
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 4px -1px var(--shadow);
}
.side-switch-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: var(--switch-w);
    height: var(--switch-h);
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 6px 14px -6px var(--accent);
    transform: translateX(calc(var(--side-index, 0) * var(--switch-w)));
    transition: transform 0.7s var(--ease-spring);
}
.side-switch-btn {
    position: relative;
    z-index: 1;
    width: var(--switch-w);
    height: var(--switch-h);
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
    transition: color 0.45s ease, transform 0.3s var(--ease-out);
}
.side-switch-btn:hover { color: var(--accent); transform: scale(1.08); }
.side-switch-btn[aria-checked="true"],
.side-switch-btn[aria-checked="true"]:hover { color: var(--on-accent); transform: none; }


/* =====================================================================
   12. TYPOGRAPHY — headers, dividers, prose, drop caps
   ===================================================================== */
.header-page { text-align: center; margin-bottom: 30px; }
.header-page h2 {
    position: relative;
    display: inline-block;
    margin: 0;
    padding: 0 14px 12px;
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.4vw, 2.6rem);
    font-weight: var(--heading-weight);
    font-style: var(--heading-style);
    letter-spacing: var(--heading-tracking);
    text-transform: var(--heading-transform);
    line-height: 1.05;
    color: var(--heading);
}
.header-page h2::before { content: var(--h2-prefix); color: var(--accent); }
.header-page h2::after {                                    /* side-specific rule, drawn on entry */
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 6px;
    background: var(--h2-rule);
    transform-origin: center;
}
:root.is-loaded .active-section .header-page h2::after { animation: rule-draw 0.9s var(--ease-out) 0.25s backwards; }
@keyframes rule-draw { from { transform: scaleX(0); } }

.subsection-title { text-align: center; margin-bottom: 1rem; }
.subsection-title h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.55rem;
    font-weight: var(--title-weight);
    font-style: var(--heading-style);
    color: var(--heading);
}
:root[data-side="attorney"] .subsection-title h3 { font-variant-caps: all-small-caps; letter-spacing: 0.08em; font-size: 1.8rem; }
:root[data-side="tech"] .subsection-title h3::before { content: "## "; color: var(--muted); }
.subsection-sub { margin: 2px 0 0; font-style: italic; font-size: 0.98rem; line-height: 1.2; color: var(--accent); }

/* Divider: one smooth fade, a gap, and a side-specific ornament */
.divider { position: relative; width: min(90%, 520px); height: 14px; margin: 10px auto 22px; }
.divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ornament) 30%, var(--ornament) 70%, transparent);
    opacity: 0.75;
    -webkit-mask: linear-gradient(90deg, #000 calc(50% - 20px), transparent calc(50% - 20px), transparent calc(50% + 20px), #000 calc(50% + 20px));
    mask: linear-gradient(90deg, #000 calc(50% - 20px), transparent calc(50% - 20px), transparent calc(50% + 20px), #000 calc(50% + 20px));
}
.divider::after {
    content: var(--divider-glyph);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -54%);
    font-family: var(--font-display);
    font-size: 1.05rem;
    line-height: 1;
    color: var(--ornament);
}
:root[data-side="personal"] .divider::after { font-size: 1.3rem; color: var(--accent); }

/* Prose */
.prose p { margin-bottom: 1.25em; text-align: left; }
.prose p:last-child { margin-bottom: 0; }
.prose.lede > p:first-child::before { content: var(--lede-prefix); color: var(--accent); font-weight: 700; }
:root:not([data-side="tech"]) .prose.lede > p:first-child::first-letter {
    float: var(--dropcap-float);
    margin: 0.04em 0.1em 0 0;
    padding: var(--dropcap-padding);
    font-family: var(--font-display);
    font-size: var(--dropcap-size);
    font-weight: var(--dropcap-weight);
    line-height: var(--dropcap-leading);
    color: var(--accent);
}


/* =====================================================================
   13. HOME
   ===================================================================== */
.brand-card { text-align: center; overflow: hidden; }

/* 3D extruded title: layered shadows per side (see --*-brand-shadow) */
#brand-name {
    margin: 0 0 30px;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5.2vw, 4.6rem);
    font-weight: var(--brand-weight);
    letter-spacing: var(--brand-tracking);
    line-height: 1.1;
    color: var(--brand-color);
    text-shadow: var(--brand-shadow);
    transform: translate(-0.03em, -0.03em);                 /* recentre after the extrusion */
}

/* Side picker: each option previews its own side's type */
.side-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 760px; margin: 0 auto; }
.side-picker-btn {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    background-color: transparent;
    color: var(--text);
    cursor: pointer;
    transition:
        transform var(--hover-duration) var(--ease-out),
        border-color var(--hover-duration) ease,
        box-shadow var(--hover-duration) ease,
        background-color var(--hover-duration) ease;
}
.side-picker-btn i {
    width: 44px;
    height: 44px;
    line-height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background-color: var(--surface-raised);
    color: var(--muted);
    font-size: 16px;
    transition: background-color 0.4s ease, color 0.35s ease, border-color 0.4s ease;
}
.side-picker-name { font-size: 1.2rem; line-height: 1.2; color: var(--heading); }
.side-picker-tag { font-size: 0.8rem; line-height: 1.3; color: var(--muted); }
.side-picker-btn:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 16px 30px -20px var(--shadow); }
.side-picker-btn:hover i { color: var(--accent); border-color: var(--accent); }
.side-picker-btn[aria-checked="true"] { border-color: var(--accent); background-color: var(--surface-raised); }
.side-picker-btn[aria-checked="true"] i { background-color: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.side-picker-btn[data-side-target="attorney"] .side-picker-name { font-family: var(--attorney-displayfont); font-weight: 600; font-size: 1.35rem; }
.side-picker-btn[data-side-target="attorney"] .side-picker-tag { font-family: var(--attorney-uifont); font-variant-caps: all-small-caps; letter-spacing: 0.1em; font-size: 0.95rem; }
.side-picker-btn[data-side-target="tech"] .side-picker-name { font-family: var(--tech-displayfont); font-weight: 600; font-size: 1.05rem; }
.side-picker-btn[data-side-target="tech"] .side-picker-tag { font-family: var(--tech-uifont); font-size: 0.7rem; text-transform: lowercase; }
.side-picker-btn[data-side-target="personal"] .side-picker-name { font-family: var(--personal-displayfont); font-weight: 700; }
.side-picker-btn[data-side-target="personal"] .side-picker-tag { font-family: var(--personal-uifont); font-style: italic; }

/* Headline */
.dynamic-headline {
    margin-bottom: 1.6rem;
    text-align: center;
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 2.2vw, 1.8rem);
    font-weight: var(--headline-weight);
    font-style: var(--heading-style);
    line-height: 1.35;
    color: var(--heading);
}
:root[data-side="tech"] .dynamic-headline { font-size: clamp(1.05rem, 1.7vw, 1.4rem); min-height: 2.7em; }
.dynamic-headline .sep { display: inline-block; margin: 0 0.35em; color: var(--accent); }
.dynamic-headline::after {                                  /* blinking caret (tech only) */
    content: var(--caret);
    margin-left: 0.12em;
    font-family: var(--font-ui);
    color: var(--accent);
    animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

/* Human: the route so far, stop by stop */
.route { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 0; margin: 30px 0 0; padding: 0; list-style: none; }
.route li { display: flex; align-items: center; font-size: 0.9rem; font-weight: 600; color: var(--heading); }
.route li::before {
    content: "";
    width: 9px;
    height: 9px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--spot);
}
.route li:last-child::before {                              /* home for now: a map pin */
    content: "\f3c5";
    width: auto;
    height: auto;
    background: none;
    box-shadow: none;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: var(--accent);
}
.route li:not(:last-child)::after { content: ""; width: 26px; margin: 0 10px; border-top: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent); }
:root.is-loaded .active-section .route li { animation: chip-in 0.5s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 90ms + 500ms); }


/* =====================================================================
   14. ABOUT — portrait, info list, expertise tabs
   ===================================================================== */
.about-info-sb { display: flow-root; }
.about-sb { float: right; width: min(300px, 40%); margin: 0 0 20px 32px; }
.about-sb .img-in {
    position: relative;
    padding: var(--photo-pad);
    border: var(--photo-ring);
    border-radius: var(--photo-radius);
    background-color: var(--photo-bg);
    transform: rotate(var(--photo-tilt));
    box-shadow: 0 18px 36px -20px var(--shadow);
    transition: transform 0.6s var(--ease-out);
}
.about-sb .img-in:hover { transform: rotate(0deg) scale(1.02); }
.about-sb .img-in img { display: block; width: 100%; height: auto; border-radius: var(--photo-img-radius); filter: var(--photo-filter); }

/* Tech: monitor glow + scanlines over the portrait */
:root[data-side="tech"] .about-sb .img-in { box-shadow: 0 0 0 6px var(--spot), 0 0 30px -8px var(--accent); }
:root[data-side="tech"] .about-sb .img-in::after {
    content: "";
    position: absolute;
    inset: var(--photo-pad);
    background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.35) 2px 3px);
    pointer-events: none;
}

/* Human-only "passport" details */
.info-list {
    margin: 22px 0 0;
    padding: 14px 16px 4px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background-color: var(--surface-raised);
    transform: rotate(0.6deg);
}
.info-row { padding: 6px 0 10px; border-bottom: 1px dotted var(--border); }
.info-row:last-child { border-bottom: 0; }
.info-list dt { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.2; color: var(--accent); }
.info-list dd { margin: 2px 0 0; font-size: 0.92rem; line-height: 1.5; color: var(--text); }
.info-list small { display: block; color: var(--muted); }
.info-list .anatext { min-height: 1.5em; font-weight: 700; font-size: 1.1rem; color: var(--heading); }
.anatext .dud { color: var(--accent); opacity: 0.55; }

/* Tiny political-compass plot */
.compass-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.compass {
    position: relative;
    flex: none;
    width: 46px;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background:
        linear-gradient(var(--border), var(--border)) center / 1px 100% no-repeat,
        linear-gradient(var(--border), var(--border)) center / 100% 1px no-repeat;
}
.compass i {
    position: absolute;
    left: calc((var(--x) + 10) / 20 * 100%);
    top: calc((10 - var(--y)) / 20 * 100%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    transform: translate(-50%, -50%);
    animation: dot-pulse 2.4s var(--ease-out) infinite;
}
@keyframes dot-pulse {
    0% { box-shadow: 0 0 0 0 var(--spot); }
    70%, 100% { box-shadow: 0 0 0 8px transparent; }
}

/* Expertise tabs */
.pillars { display: flex; flex-direction: column; gap: 12px; }
.pillar {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--chip-radius);
    background-color: transparent;
    color: var(--text);
    font-size: calc(0.92rem * var(--ui-scale));
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
    transition:
        background-color var(--hover-duration) ease,
        border-color var(--hover-duration) ease,
        color var(--hover-duration) ease,
        box-shadow var(--hover-duration) ease;
}
:root[data-side="personal"] .pillar { border-radius: 10px; }
.pillar:hover { border-color: var(--accent); color: var(--accent); }
.pillar.active { background-color: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 10px 22px -12px var(--accent); }

.pane { display: none; }
.pane.active { display: block; animation: pane-in 0.5s var(--ease-out); }
@keyframes pane-in { from { opacity: 0; transform: translateY(8px); } }

/* Metrics: bars fill with scaleX (compositor-only), values count up in JS */
.metric { margin: 20px 0; }
.metric-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; font-size: 0.96rem; color: var(--heading); }
.metric-value { flex: none; font-family: var(--font-ui); font-size: calc(0.92rem * var(--ui-scale)); color: var(--accent); font-variant-numeric: tabular-nums; }
.metric-track { height: 6px; border-radius: 6px; background-color: var(--border); overflow: hidden; }
:root[data-side="tech"] .metric-track { height: 8px; border-radius: 0; }
.metric-bar {
    position: relative;
    height: 100%;
    background: var(--accent);
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 45%, transparent), var(--accent));
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 1.2s var(--ease-out);
    overflow: hidden;
}
:root[data-side="tech"] .metric-bar { background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 8px); }
.metric-bar::after {                                        /* one-shot shimmer after filling */
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: translateX(-100%);
}
.pane.is-shown .metric-bar { transform: scaleX(calc(var(--value) / 100)); }
.pane.is-shown .metric-bar::after { animation: shimmer 1.4s var(--ease-out) 1.1s; }
.pane.is-shown .metric:nth-child(2) .metric-bar { transition-delay: 90ms; }
.pane.is-shown .metric:nth-child(3) .metric-bar { transition-delay: 180ms; }
@keyframes shimmer { to { transform: translateX(100%); } }


/* =====================================================================
   15. RESUME — bar strip, experience timeline, compact education, chips
   ===================================================================== */
.section-aside { margin: -14px 0 22px; text-align: center; font-style: italic; color: var(--accent); }

/* Bar admission strip */
.bar-admissions { margin-bottom: 18px; }
.bar-card {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    height: 100%;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--card-radius);
    background-color: var(--inner-bg);
}
.bar-card i { flex: none; margin-top: 4px; font-size: 1.3rem; color: var(--ornament); }
.bar-card h4 { margin: 0; font-size: 1.05rem; font-weight: var(--title-weight); line-height: 1.3; }
.bar-status { margin: 2px 0 4px; font-size: calc(0.82rem * var(--ui-scale)); color: var(--accent); }
.bar-card p:last-child { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--muted); }

/* Experience timeline down the left */
.cv { position: relative; padding-left: 30px; }
.cv::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(to bottom, transparent, var(--accent) 6%, var(--accent) 94%, transparent);
    opacity: 0.5;
}
:root[data-side="tech"] .cv::before { background: repeating-linear-gradient(to bottom, var(--accent) 0 4px, transparent 4px 8px); opacity: 0.45; }

.cv-item {
    position: relative;
    isolation: isolate;
    margin: 14px 0;
    padding: 20px 24px 22px;
    border: var(--cv-rest-border);
    border-radius: var(--card-radius);
    background-color: var(--cv-rest-bg);
    transition:
        transform 0.45s var(--ease-out),
        box-shadow 0.45s var(--ease-out),
        background-color 0.35s ease,
        border-color 0.35s ease;
    outline: none;
}
:root[data-side="personal"] .cv .cv-item:nth-child(odd) { transform: rotate(0.4deg); }
:root[data-side="personal"] .cv .cv-item:nth-child(even) { transform: rotate(-0.4deg); }
.cv-item:hover,
.cv-item:focus-visible {
    transform: translateY(var(--cv-lift)) rotate(0deg) !important;
    background-color: var(--surface-raised);
    border-color: var(--border);
    box-shadow: var(--cv-shadow);
}
:root[data-side="tech"] .cv-item:hover,
:root[data-side="tech"] .cv-item:focus-visible { background-color: color-mix(in srgb, var(--accent) 5%, var(--surface-raised)); }

/* Timeline dot + tick (experience only) */
.cv .cv-head::before {
    content: "";
    position: absolute;
    left: -26px;
    top: 26px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background-color: var(--surface-raised);
    transition: background-color 0.35s ease, box-shadow 0.45s var(--ease-out), transform 0.45s var(--ease-spring);
}
:root[data-side="tech"] .cv .cv-head::before { border-radius: 0; }
.cv .cv-head::after { content: ""; position: absolute; left: -12px; top: 32px; width: 12px; height: 2px; background: var(--accent); opacity: 0.5; }
.cv .cv-item:hover .cv-head::before,
.cv .cv-item:focus-visible .cv-head::before { background-color: var(--accent); box-shadow: 0 0 0 5px var(--spot); transform: scale(1.1); }

/* Entry header: "Org · Location" over "Title · Dates", like the PDF */
.cv-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 16px; }
.cv-head h4 { margin: 0; font-family: var(--font-heading); font-size: 1.14rem; font-weight: var(--title-weight); line-height: 1.3; color: var(--heading); }
.cv-sub { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 16px; margin-top: 4px; }
.cv-role { font-size: 0.98rem; font-weight: 600; font-style: var(--cv-role-style); line-height: 1.4; color: var(--accent); }
.cv-place, .cv-date { font-size: calc(0.82rem * var(--ui-scale)); line-height: 1.5; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cv-place::before { content: "\f3c5"; margin-right: 6px; font-family: "Font Awesome 5 Free"; font-weight: 900; font-size: 0.85em; color: var(--accent); }

.cv-points { position: relative; z-index: 1; margin: 12px 0 0; padding: 0; list-style: none; }
.cv-points li { position: relative; padding-left: 1.2em; margin-bottom: 6px; font-size: 0.96rem; line-height: 1.65; color: var(--text); }
.cv-points li:last-child { margin-bottom: 0; }
.cv-points li::before { content: var(--bullet); position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 700; }
.cv-desc { position: relative; z-index: 1; margin: 12px 0 0; font-size: 0.95rem; line-height: 1.7; color: var(--text); }

/* Compact education cards */
.cv-grid .cv-item { height: 100%; margin: 0; border: 1px solid var(--border); }
.cv-compact .cv-head h4 { font-size: 1rem; }
.cv-compact .cv-sub { flex-direction: column; gap: 0; }
.cv-compact .cv-desc { font-size: 0.88rem; line-height: 1.6; }
.cv-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.cv-badge { padding: 0 8px; border: 1px solid var(--accent); border-radius: var(--chip-radius); font-size: calc(0.76rem * var(--ui-scale)); line-height: 1.7; color: var(--accent); }

/* Logo watermark: hidden at rest, eases in at the bottom-right on hover */
.cv-logo {
    position: absolute;
    right: 14px;
    bottom: 12px;
    z-index: 0;
    width: var(--cv-logo-size);
    height: var(--cv-logo-size);
    object-fit: contain;
    opacity: 0;
    filter: var(--logo-filter);
    transform: translate(8px, 8px) scale(0.88);
    transition: opacity 0.45s var(--ease-out), transform 0.6s var(--ease-out);
    pointer-events: none;
}
.cv-item:hover .cv-logo,
.cv-item:focus-visible .cv-logo { opacity: var(--cv-logo-opacity); transform: none; }

/* Human: postmark stamped on each postcard */
:root[data-side="personal"] .cv-item[data-stamp] .cv-head { padding-right: 130px; }
:root[data-side="personal"] .cv-item[data-stamp]::after {
    content: attr(data-stamp);
    position: absolute;
    top: 14px;
    right: 16px;
    padding: 5px 10px;
    border: 2px solid var(--accent);
    border-radius: 6px;
    box-shadow: inset 0 0 0 2px var(--surface-raised), inset 0 0 0 3px var(--accent);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.5;
    transform: rotate(-7deg);
    pointer-events: none;
    transition: transform 0.5s var(--ease-spring), opacity 0.35s ease;
}
:root[data-side="personal"] .cv-item[data-stamp]:hover::after { opacity: 0.85; transform: rotate(-3deg) scale(1.06); }

/* Proficiency chips */
.knowledges { list-style: none; padding: 0; margin: 0; text-align: center; }
.knowledges li {
    display: inline-block;
    margin: 5px;
    padding: 5px 14px;
    border: 1px solid var(--accent);
    border-radius: var(--chip-radius);
    color: var(--accent);
    font-size: calc(0.82rem * var(--ui-scale));
    line-height: 1.5;
    cursor: default;
    transition:
        transform var(--hover-duration) var(--ease-spring),
        background-color var(--hover-duration) ease,
        color var(--hover-duration) ease,
        box-shadow var(--hover-duration) ease;
}
.knowledges li::before { content: var(--chip-prefix); margin-right: 2px; opacity: 0.6; }
.knowledges li:hover { transform: translateY(-4px); background-color: var(--accent); color: var(--on-accent); box-shadow: 0 10px 18px -10px var(--accent); }
:root.is-loaded .active-section .knowledges li { animation: chip-in 0.5s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 35ms + 250ms); }
@keyframes chip-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } }


/* =====================================================================
   16. SKILLS — service cards (hover differs per side)
   ===================================================================== */
.service {
    position: relative;
    isolation: isolate;
    height: calc(100% - 30px);
    margin-bottom: 30px;
    padding: 30px 26px 26px;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    background-color: var(--inner-bg);
    text-align: center;
    overflow: hidden;
    transition:
        transform 0.45s var(--ease-out),
        box-shadow 0.45s var(--ease-out),
        border-color 0.35s ease,
        background-color 0.35s ease;
}
.service-icon {
    display: inline-block;
    width: 64px;
    height: 64px;
    line-height: 64px;
    margin-bottom: 22px;
    border-radius: var(--icon-radius);
    background-color: var(--accent);
    color: var(--on-accent);
    font-size: 26px;
    box-shadow: 0 12px 24px -14px var(--accent);
    transition:
        transform 0.5s var(--ease-spring),
        background-color 0.4s ease,
        color 0.4s ease,
        box-shadow 0.4s ease;
}
.service-title { margin-bottom: 12px; font-family: var(--font-heading); font-size: 1.08rem; font-weight: var(--title-weight); line-height: 1.35; color: var(--heading); }
.service-desc { margin: 0; text-align: left; font-size: 0.92rem; line-height: 1.65; color: var(--text); }
/* Attorney + Human: a slight rise, a softer shadow, and the icon eases from filled to outlined */
.service:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: 0 18px 34px -24px var(--shadow); }
.service:hover .service-icon { background-color: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.service-title { transition: color 0.4s ease; }
.service:hover .service-title { color: var(--accent); }

/* Attorney: pewter-ringed seal at rest; the ring warms to maroon on hover */
:root[data-side="attorney"] .service-icon { box-shadow: 0 0 0 4px var(--surface-raised), 0 0 0 5px var(--ornament), 0 12px 24px -12px var(--accent); }
:root[data-side="attorney"] .service:hover .service-icon { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px var(--surface-raised), 0 0 0 5px var(--accent); }


/* =====================================================================
   17. TECH HOVERS — scan sweep + glow + glitch (skills, resume, ideals)
   ===================================================================== */
:root[data-side="tech"] .service:hover,
:root[data-side="tech"] .position-card:hover,
:root[data-side="tech"] .position-card:focus-visible {
    transform: none;
    border-color: var(--accent);
    background-color: color-mix(in srgb, var(--accent) 5%, var(--surface-raised));
    box-shadow: var(--cv-shadow);
}
/* A bright scan line sweeps the card once on hover (background-position, no overflow needed) */
:root[data-side="tech"] .service::after,
:root[data-side="tech"] .position-card::after,
:root[data-side="tech"] .cv-item::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--accent) 10%, transparent) 85%, color-mix(in srgb, var(--accent) 55%, transparent)) no-repeat;
    background-size: 100% 40%;
    background-position: 0 -100%;
}
:root[data-side="tech"] .service:hover::after,
:root[data-side="tech"] .position-card:hover::after,
:root[data-side="tech"] .cv-item:hover::after,
:root[data-side="tech"] .cv-item:focus-visible::after { animation: scan-sweep 0.9s var(--ease-out); }
@keyframes scan-sweep {
    from { background-position: 0 -100%; }
    to { background-position: 0 200%; }
}
:root[data-side="tech"] .service:hover .service-icon {
    background-color: transparent;
    color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent), 0 0 18px -4px var(--accent);
    animation: glitch 0.42s steps(2) 1;
}
:root[data-side="tech"] .service:hover .service-title,
:root[data-side="tech"] .cv-item:hover .cv-head h4 { text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent); }
@keyframes glitch {
    0% { transform: none; }
    20% { transform: translate(-2px, 1px); text-shadow: 2px 0 var(--accent), -2px 0 var(--heading); }
    40% { transform: translate(2px, -1px); }
    60% { transform: translate(-1px, 0); text-shadow: -2px 0 var(--accent), 2px 0 var(--heading); }
    80% { transform: translate(1px, 1px); }
    100% { transform: none; }
}


/* =====================================================================
   18. POSITIONS / IDEALS — essay cards + modal
   ===================================================================== */
.position-card {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 26px 24px 22px;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    background-color: var(--inner-bg);
    cursor: pointer;
    overflow: hidden;
    outline: none;
    transition:
        transform 0.45s var(--ease-out),
        box-shadow 0.45s var(--ease-out),
        border-color 0.35s ease,
        background-color 0.35s ease;
}
.position-card:hover,
.position-card:focus-visible { transform: translateY(-6px); border-color: var(--accent); box-shadow: var(--cv-shadow); }
.position-kicker { margin-bottom: 10px; font-size: calc(0.76rem * var(--ui-scale)); color: var(--muted); }
.position-card h4 { margin-bottom: 12px; font-family: var(--font-heading); font-size: 1.2rem; font-weight: var(--title-weight); line-height: 1.3; color: var(--accent); }
.position-card p { flex: 1; margin-bottom: 16px; font-size: 0.93rem; line-height: 1.6; color: var(--text); }
.position-more { font-size: calc(0.82rem * var(--ui-scale)); color: var(--accent); }
.position-more i { margin-left: 6px; transition: transform 0.35s var(--ease-out); }
.position-card:hover .position-more i { transform: translateX(5px); }

/* Shared essay modal: scrim + focus-pull entrance */
.essay-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear 0.55s;
}
.essay-modal.is-open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.essay-backdrop {
    position: absolute;
    inset: 0;
    background-color: var(--scrim);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.45s var(--ease-out);
}
.essay-dialog {
    position: relative;
    width: min(860px, 100%);
    max-height: 86vh;
    overflow-y: auto;
    padding: 52px clamp(22px, 5vw, 64px) 52px;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    background-color: var(--surface-raised);
    color: var(--text);
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    filter: blur(6px);
    transform: translateY(18px) scale(0.98);
    transition:
        opacity 0.45s var(--ease-out),
        filter 0.45s var(--ease-out),
        transform 0.55s var(--ease-out);
    outline: none;
}
.essay-modal.is-open .essay-backdrop { opacity: 1; }
.essay-modal.is-open .essay-dialog { opacity: 1; filter: none; transform: none; }
.essay-close {
    position: absolute;
    top: 12px;
    right: 18px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 2.2rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.25s ease, transform 0.4s var(--ease-out);
}
.essay-close:hover { color: var(--accent); transform: scale(1.15); }
.essay-header { text-align: center; }
.essay-kicker { font-size: calc(0.8rem * var(--ui-scale)); color: var(--accent); }
.essay-title { margin: 6px 0 0; font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: var(--title-weight); color: var(--heading); }
.essay-body p { font-size: 1.03rem; line-height: 1.85; }
.verse {
    margin: 1.6em auto;
    padding: 1.1em 1.6em;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--card-radius) var(--card-radius) 0;
    background-color: var(--spot);
    font-style: italic;
    font-size: 1.08rem;
}
.verse p { margin-bottom: 0.8em; line-height: 1.6; }


/* =====================================================================
   19. CONTACT
   ===================================================================== */
.contact-prompt { margin-bottom: 26px; text-align: center; color: var(--text); }
.contact-form .form-control {
    height: auto;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--chip-radius);
    background-color: transparent;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.98rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
:root[data-side="personal"] .contact-form .form-control { border-radius: 10px; }
.contact-form .form-control::placeholder { color: var(--muted); }
.contact-form .form-control:focus { background-color: transparent; color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 3px var(--spot); }
.required-text { margin-top: 4px; font-size: 0.8rem; text-align: left; color: var(--muted); }

/* Send button: accent wipes in from the left */
.send-btn {
    position: relative;
    z-index: 0;
    overflow: hidden;
    padding: 12px 30px;
    border: 1.5px solid var(--accent);
    border-radius: var(--chip-radius);
    background: transparent;
    color: var(--accent);
    font-size: calc(0.95rem * var(--ui-scale));
    cursor: pointer;
    transition: color 0.4s ease;
}
.send-btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease-out); }
.send-btn:hover { color: var(--on-accent); }
.send-btn:hover::before { transform: scaleX(1); }
.send-btn i { margin-left: 8px; transition: transform 0.45s var(--ease-out); }
.send-btn:hover i { transform: translate(4px, -3px); }

.info-box {
    position: relative;
    isolation: isolate;
    margin-bottom: 16px;
    padding: 18px 14px;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    background-color: var(--inner-bg);
    text-align: center;
    overflow: hidden;
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), border-color 0.3s ease;
}
.info-box:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--cv-shadow); }
:root[data-side="tech"] .info-box:hover { transform: none; }
.info-box i { margin-bottom: 8px; font-size: 1.5rem; color: var(--accent); transition: transform 0.5s var(--ease-spring); }
.info-box:hover i { transform: scale(1.15); }
.info-box h4 { margin-bottom: 4px; font-size: calc(0.9rem * var(--ui-scale)); color: var(--heading); }
.info-box p { margin: 0; font-size: 0.9rem; word-break: break-word; color: var(--text); }


/* =====================================================================
   20. FLOURISHES — cursor spotlight + staggered reveal
   ===================================================================== */

/* Soft radial glow that follows the pointer (JS sets --mx / --my) */
.spot::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), var(--spot), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
    pointer-events: none;
}
.spot:hover::before { opacity: 1; }

/* Cards rise in, one after another, whenever their section opens */
:root.is-loaded .active-section .reveal {
    animation: reveal-up 0.8s var(--ease-out) backwards;
    animation-delay: calc(var(--i, 0) * var(--reveal-stagger) + 120ms);
}
@keyframes reveal-up { from { opacity: 0; transform: translateY(18px); } }


/* =====================================================================
   21. RESPONSIVE — mid widths, mobile header & nav
   ===================================================================== */
.mobile-header, .mobile-nav-dropdown { display: none; }

/* Below Bootstrap's xl the sidebar leaves too little room for side-by-side layouts */
@media (max-width: 1199.98px) {
    .about-sb { float: none; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 24px; width: 100%; margin: 0 0 28px; }
    .about-sb .img-in { width: min(260px, 100%); }
    .info-list { flex: 1 1 260px; max-width: 380px; margin: 0; }
    .pillars { flex-direction: row; flex-wrap: wrap; justify-content: center; margin-bottom: 8px; }
    .contact-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-top: 12px; }
    .contact-info .info-box { margin-bottom: 0; }
}

@media (max-width: 768px) {
    :root { --backdrop-left: 0px; }
    .sidebar { display: none; }
    .container-85 { width: 100%; }

    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 2000;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: var(--mobile-header-height);
        padding: 0 16px;
        background-color: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 8px 24px -16px var(--shadow);
    }
    .mobile-header .logo-container { --logo-size: 50px; z-index: 2; }
    .mobile-toggle-container { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
    .mobile-header .side-switch { --switch-w: 54px; --switch-h: 42px; }
    .mobile-header .side-switch-btn { font-size: 16px; }

    .hamburger-btn { position: relative; z-index: 2; width: 30px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; }
    .hamburger-btn span { position: absolute; left: 0; display: block; width: 100%; height: 2px; border-radius: 3px; background: var(--accent); transition: 0.25s ease-in-out; }
    .hamburger-btn span:nth-child(1) { top: 0; }
    .hamburger-btn span:nth-child(2), .hamburger-btn span:nth-child(3) { top: 10px; }
    .hamburger-btn span:nth-child(4) { top: 20px; }
    .hamburger-btn.is-open span:nth-child(1), .hamburger-btn.is-open span:nth-child(4) { top: 10px; width: 0; left: 50%; }
    .hamburger-btn.is-open span:nth-child(2) { transform: rotate(45deg); }
    .hamburger-btn.is-open span:nth-child(3) { transform: rotate(-45deg); }

    .mobile-nav-dropdown {
        position: fixed;
        inset: 0;
        z-index: 1500;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: var(--surface-raised);
        transform: translateY(-100%);
        visibility: hidden;
        transition: transform 0.55s cubic-bezier(0.77, 0, 0.175, 1), visibility 0s linear 0.55s;
    }
    .mobile-nav-dropdown.is-open { transform: none; visibility: visible; transition-delay: 0s; }
    .mobile-nav-dropdown .nav { text-align: center; }
    .mobile-nav-dropdown .nav-link { padding: 12px 20px; font-size: calc(1.45rem * var(--ui-scale)); }

    .content-section { padding-top: var(--mobile-header-height); }
    .content-wrapper { padding: 20px 14px 32px; }
    .content-card { --card-padding: 26px 20px; }
    :root[data-side="tech"] .content-card { padding-top: calc(var(--term-bar-height) + 22px); }
    .side-picker { grid-template-columns: 1fr; }
    .side-picker-btn { flex-direction: row; justify-content: flex-start; gap: 14px; padding: 12px 16px; text-align: left; }
    .side-picker-btn i { flex: none; }
    .side-picker-tag { margin-left: auto; text-align: right; }
    .cv { padding-left: 24px; }
    .cv::before { left: 6px; }
    .cv .cv-head::before { left: -24px; }
    .cv .cv-head::after { left: -10px; width: 10px; }
    .cv-item { padding: 18px 16px 20px; }
    :root[data-side="personal"] .cv-item[data-stamp] .cv-head { padding-right: 0; padding-top: 30px; }
}


/* =====================================================================
   22. REDUCED MOTION
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
    :root {
        --switch-out: 1ms;
        --switch-in: 1ms;
        --switch-blur: 0px;
        --section-blur: 0px;
        --theme-duration: 1ms;
    }
    .code-stream, .lines { display: none; }
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
}
