        @import url(https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,100..900;1,100..900&family=Lora:ital,wght@0,400;0,500;1,400&display=swap);

        @keyframes fadeIn {
            to {
                opacity: 1
            }
        }

        .no-transition,
        .no-transition * {
            transition: none !important;
        }

        :root {
            --bright-rgb: 255, 255, 255;
            --bg-rgb: 5, 5, 5;
            --bg: rgb(var(--bg-rgb));
            --bg-trans: #050505;
            --header-bg: #0f0f0f;
            --card-bg: #111111;
            --card-bg-hover: #1a1a1a;
            --code-bg: #1e1e1e;
            --text-bright: rgb(var(--bright-rgb));
            --text-main: #adadad;
            --text-dim: #888888;
            --text-muted: #adadad;
            --text-low: #777777;
            --text-inv: #000000;
            --code-fg: #e6cd69;
            --border-subtle: rgba(var(--bright-rgb), 0.08);
            --border-strong: rgba(var(--bright-rgb), 0.2);
            --border-header: #1a1a1a;
            --search-bg: #111111;
            --search-glow: rgba(var(--bright-rgb), 0.1);
            --search-border: rgba(var(--bright-rgb), 0.3);
            --accent-personal: #00ffa3;
            --accent-personal-rgb: 0, 255, 163;
            --accent-prof: #00f2ff;
            --accent-projects: #ff9100;
            --shadow-subtle: 0 0 15px rgba(0, 0, 0, 0.1);
            --shadow-medium: 0 0 30px rgba(0, 0, 0, 0.2);
            --shadow-heavy: 0 0 80px 20px rgba(0, 0, 0, 0.95);
            --placeholder-gradient: linear-gradient(135deg, #0a0a0a 0%, #0c0c0c 25%, #0f0f0f 50%, #131313 75%, #161616 100%);
            --placeholder-hover: linear-gradient(135deg, #1a1a1a 0%, #151515 50%, #111111 100%);
            --brand-row-h: 30px;
            --main-row-h: 25px;
            --sub-row-h: 25px;
            --gap: 5px;
            --header-pad-top: 6px;
            --header-pad-bottom: 6px;
            --header-gap: 5px;
            --brand-font-size: 28px;
            --brand-letter-spacing: 1.5px;
            --nav-font-size: 15px;
            --card-radius: 18px;
            --card-padding: 12px;
            --media-radius: calc(var(--card-radius) - var(--card-padding));
            --radius-md: 12px;
            --radius-sm: 4px;
            --space-xs: 6px;
            --space-sm: 10px;
            --space-md: 16px;
            --space-lg: 20px;
            --space-xl: 30px;
            --space-2xl: 40px;
            --anim-primary: 0.50s;
            --anim-layout: 0.40s;
            --anim-quick: 0.30s;
            --anim-instant: 0.20s;
            --ease: cubic-bezier(0.25, 1, 0.5, 1);
            --op-line: 0.25;
            --op-high: 0.8;
            --op-subtle: 0.05;
            --op-low: 0.1;
            --music-fallback-opacity: 0.25; /* Boosted High-Fidelity ghost intensity for Dark mode */
            --surface-subtle: #222222;
            --surface-strong: #333333;
            --card-bg-dark: #0a0a0a;
            --border-hover: var(--border-strong);
            --accent-strava: #FC6100;
            --nav-bar-h: 0px;
            --glass-blur: 12px;
            --glass-saturate: 180%;
            --header-glass: rgba(15, 15, 15, 0.7);
            /* GLOBAL SPACING SYSTEM (8px Multiplier Rule) */
            --site-gap: 1rem;           /* 16px: Standard distance */
            --site-gap-nav: 3px;        /* 3px: Header navigation */
            --rhythm-gap: 1rem;          /* Master rhythm unit */
            --rhythm-gap-tight: 0.125rem; /* 2px: Ultra-tight structural anchoring */
            --rhythm-gap-wide: 1.5rem;   /* 24px: Clean section breaks */
            color-scheme: light dark;
        }

        @media (min-width: 1024px) {
            :root {
                --site-gap: 1.25rem;    /* Scale up slightly on desktop */
            }
        }

        :root[data-theme="light"] {
            --bright-rgb: 0, 0, 0;
            --bg-rgb: 238, 238, 242;
            --bg: #eeeef2;
            --bg-trans: #eeeef2;
            --header-bg: #e6e6ea;
            --card-bg: #f7f7f9;
            --card-bg-hover: #e8e8ed;
            --code-bg: #eaeaef;
            --text-bright: #000000;
            --text-main: #6b6b6b;
            --text-dim: #888888;
            --text-muted: #6b6b6b;
            --text-low: #999999;
            --text-inv: #ffffff;
            --code-fg: #bf8d00;
            --border-subtle: rgba(0, 0, 0, 0.08);
            --border-strong: rgba(0, 0, 0, 0.18);
            --border-header: #e2e2e6;
            --search-bg: #f7f7f9;
            --search-glow: rgba(0, 0, 0, 0.06);
            --search-border: rgba(0, 0, 0, 0.15);
            --accent-personal: #00d66b;
            --accent-prof: #00b4d8;
            --accent-projects: #ff8500;
            --shadow-subtle: none;
            --shadow-medium: none;
            --shadow-heavy: none;
            --placeholder-gradient: linear-gradient(135deg, #f0f0f0 0%, #ececec 25%, #e8e8e8 50%, #e4e4e4 75%, #e0e0e0 100%);
            --placeholder-hover: linear-gradient(135deg, #ffffff 0%, #fcfcfc 50%, #f9f9f9 100%);
            --border-hover: var(--border-strong);
            --surface-subtle: #eeeeee;
            --surface-strong: #dddddd;
            --card-bg-dark: #e8e8ed;
            --header-glass: rgba(230, 230, 234, 0.7);
            --music-fallback-opacity: 0.18;
            --music-fallback-inv: 0;
        }

        #main-header,
        #nav-bar,
        .layout-grid,
        .layout-quote,
        footer,
        #search-overlay {
            transition: background-color var(--anim-quick) var(--ease), border-color var(--anim-quick) var(--ease), color var(--anim-quick) var(--ease), box-shadow var(--anim-quick) var(--ease);
        }

        /* Intelligent Image Inversion */
        .theme-invert {
            transition: filter var(--anim-quick) var(--ease);
        }

        /* SOLID IMAGES (No transparency) */
        /* If the image was detected as Bright (white background), invert it ONLY in Dark mode */
        [data-theme="dark"] .theme-invert.is-bright:not(.is-transparent) {
            filter: invert(1) hue-rotate(180deg);
        }

        /* If the image was detected as Dark (dark background), invert it ONLY in Light mode */
        [data-theme="light"] .theme-invert.is-dark:not(.is-transparent) {
            filter: invert(1) hue-rotate(180deg);
        }

        /* TRANSPARENT IMAGES */
        /* If a transparent image is mostly white/bright, invert it in Light mode so it's visible on white BG */
        [data-theme="light"] .theme-invert.is-bright.is-transparent {
            /* The brightness and contrast boost mathematically repairs the "washed out" or pale effect 
               that invert() causes on mid-tone colors like Red, keeping them vibrant while ensuring black turns white. */
            filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(1.5);
        }

        /* If a transparent image is mostly black/dark, invert it in Dark mode so it's visible on dark BG */
        [data-theme="dark"] .theme-invert.is-dark.is-transparent {
            filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(1.5);
        }

        /* THEMED LOGO TOGGLE */
        [data-theme="dark"] .themed-logo-light {
            display: none !important;
        }
        [data-theme="light"] .themed-logo-dark {
            display: none !important;
        }

        .loader-overlay {
            position: absolute; /* Default to parent context */
            inset: 0;
            background: var(--bg);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10;
            pointer-events: none;
            transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
            visibility: visible;
            opacity: 1;
        }

        /* Global boot loader override */
        #boot-loader.loader-overlay {
            position: fixed;
            z-index: 20000;
        }

        .loader-overlay.hide,
        .loader-overlay.finished {
            opacity: 0;
            visibility: hidden;
        }

        .row-media .loader-overlay {
            background: var(--card-bg-dark); /* Match card interior for cleaner reveal */
        }

        .spinner {
            width: 32px;
            height: 32px;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Outer dashed ring */
        .spinner::before {
            content: '';
            position: absolute;
            inset: 0;
            border: 1.5px dashed var(--text-muted);
            border-radius: 50%;
            opacity: 0.3;
            animation: spinner-rotate 4s linear infinite;
        }

        /* Inner solid 'active' arc */
        .spinner::after {
            content: '';
            position: absolute;
            inset: 0;
            border: 2px solid transparent;
            border-top-color: var(--text-bright);
            border-radius: 50%;
            animation: spinner-rotate 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
        }

        @keyframes spinner-rotate {
            to { transform: rotate(360deg); }
        }

        .slide-in-right {
            animation: slideInRight 0.4s var(--ease) forwards;
        }

        * {
            box-sizing: border-box;
            outline: 0;
            -webkit-tap-highlight-color: transparent;
            margin: 0;
            padding: 0
        }

        html {
            /* Smooth scroll disabled for reliability across mobile engines */
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            /* Prevents page shift when search is engaged and scrollbar disappears */
            scrollbar-gutter: stable;
        }

        hr {
            border: 0;
            height: 1px;
            background-color: var(--text-muted);
            opacity: 0.3; /* Subtle divider */
            margin: var(--site-gap) 0;
            width: 100%;
        }

        body {
            margin: 0;
            padding: 0;
            background-color: var(--bg);
            color: var(--text-muted);
            font-family: "Jost", sans-serif;
            line-height: 1.5;
            padding-top: 0;
            min-height: 100vh;
            width: 100%;
            position: relative;
            /* clip ensures position: sticky works while preventing horizontal overshoot */
            overflow-x: clip;
            display: flex;
            flex-direction: column;
            padding-bottom: var(--nav-bar-h, 0);
        }
        a,
        h1,
        h2,
        h3,
        p {
            overflow-wrap: break-word;
            margin: 0;
            line-height: 1.6;
        }



        .article-title,
        .layout-grid h3,
        h1,
        h2,
        h3,
        h4 {
            user-select: text;
            -webkit-user-select: text;
            -webkit-touch-callout: none;
            -webkit-tap-highlight-color: transparent;
            line-height: 1.25;
            padding-bottom: 0.05em;
            margin: 0 0 -0.05em 0;
            color: var(--text-muted);
            scroll-margin-top: 120px;
        }

        del,
        s {
            /* 1. System Strike: subtle native line so the clipboard (Docs/Gmail) detects it */
            text-decoration: line-through;
            text-decoration-thickness: 1px;
            text-decoration-color: rgba(var(--bright-rgb), 0.15);
            
            /* 2. Visual Strike: the pretty, perfectly-aligned line */
            background-image: linear-gradient(transparent 58%, currentColor 58%, currentColor 64%, transparent 64%);
            background-repeat: repeat-x;
        }

        /* Keep decorations stable during selection without overriding site colors */
        del::selection,
        s::selection {
            text-decoration-color: currentColor;
        }

        #brand-name {
            user-select: text;
            -webkit-user-select: text;
            -webkit-touch-callout: none
        }


        .fill-anim {
            background: linear-gradient(to top, var(--text-hover, var(--text-bright)) 50%, var(--text-base, var(--text-dim)) 50.5%);
            background-size: 100% 205%;
            background-position: 0 0;
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            transition: background-position var(--anim-primary) var(--ease), color var(--anim-primary) var(--ease), border-color var(--anim-instant);
            text-decoration: none;
            display: inline-block;
            padding-bottom: 0.05em;
            margin-bottom: -0.05em;
            color: var(--text-base, var(--text-dim))
        }

        .fill-anim.active {
            background-position: 0 100%;
            color: var(--text-hover, var(--text-bright))
        }

        @media (hover: hover) {
            .fill-anim:not(h1):not(h2):not(h3):hover {
                background-position: 0 100%;
                color: var(--text-hover, var(--text-bright))
            }
        }

        .header-fade-anim {
            color: var(--text-muted);
        }

        a:not(.fill-anim) {
            text-decoration: none;
            color: inherit;
            transition: color 0.2s ease;
        }

        .chip {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0 10px;
            line-height: 1;
            border: 1px solid var(--border-strong);
            border-radius: 50px;
            font-size: 11px;
            color: var(--text-muted);
            text-decoration: none !important;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            font-weight: 500;
            background: transparent;
            transition: all var(--anim-quick) var(--ease);
            position: relative; /* Anchor for bloom */
            cursor: pointer;
            height: 21px; /* SUBPIXEL FIX: 21px height ensures equal distribution for 11px font on most screens */
            box-sizing: border-box;
            white-space: nowrap;
        }

        .chip-featured {
            border-width: 1px;
            font-weight: 500;
        }

        .cat-projects .chip-featured {
            border-color: var(--accent-projects);
            color: var(--accent-projects);
        }

        .cat-professional .chip-featured {
            border-color: var(--accent-prof);
            color: var(--accent-prof);
        }

        .cat-personal .chip-featured {
            border-color: var(--accent-personal);
            color: var(--accent-personal);
        }

        .chip.date {
            background: transparent;
            color: var(--text-low);
            font-weight: 500;
        }

        /* Prevent links inside chips from inheriting global text styles or alignment */
        .chip a,
        .chip strong,
        .chip em {
            display: inline-block;
            line-height: inherit;
            vertical-align: middle;
            text-decoration: none !important;
            margin: 0;
            padding: 0;
        }

        .chip::before {
            content: '';
            position: absolute;
            inset: -1px;
            border: 2px solid rgba(var(--bright-rgb), 0.95); /* High-contrast 2px ground truth */
            border-radius: inherit;
            pointer-events: none;
            transition: opacity var(--anim-quick) var(--ease);
            opacity: 0;
            z-index: 5;
        }

        .chip:hover,
        .chip:active {
            text-decoration: none !important;
        }

        .chip:not(.no-hover):hover::before,
        .chip:not(.no-hover):active::before {
            opacity: 1;
        }

        .chip.no-hover {
            cursor: default;
        }

        .chip.no-hover:hover {
            background: var(--surface-subtle);
            color: var(--text-muted);
        }

        a:not(.chip):not(.btn-cta):not(.fill-anim):not(.chip *) {
            color: var(--text-muted);
            text-decoration: underline;
            text-decoration-color: rgba(var(--bright-rgb), var(--op-line));
            text-decoration-thickness: 1px;
            text-underline-offset: 3px;
            display: inline;
            vertical-align: baseline;
            font-weight: inherit;
            transition: text-decoration-color var(--anim-quick) var(--ease), text-decoration-thickness var(--anim-quick) var(--ease), color var(--anim-quick) var(--ease);
        }

        @media (hover: hover) {
            a:not(.chip):not(.btn-cta):not(.fill-anim):hover {
                text-decoration-color: rgba(var(--bright-rgb));
                text-decoration-thickness: 2px;
            }
        }

        /* --- Tables --- */
        .table-wrapper {
            width: 100%;
            overflow-x: auto;
            margin: var(--site-gap) 0;
            -webkit-overflow-scrolling: touch;
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-md);
            overflow: hidden;
            background: transparent;
        }

        table {
            border-collapse: separate;
            border-spacing: 0;
            width: 100%;
            max-width: 100%;
            font-family: 'Jost', sans-serif;
            font-size: 14px;
            color: var(--text-main);
        }

        th, td {
            text-align: left;
            padding: 10px 14px;
            border-bottom: 1px solid var(--border-subtle);
            border-right: 1px solid var(--border-subtle);
        }

        /* Prevent double borders on last column/row */
        th:last-child, td:last-child {
            border-right: 0;
        }

        tr:last-child td {
            border-bottom: 0;
        }

        thead th {
            background: rgba(var(--bright-rgb), 0.05);
            color: var(--text-muted);
            font-weight: 600;
            text-transform: uppercase;
            font-size: 11px;
            letter-spacing: 0.5px;
        }

        tbody tr:nth-child(even) {
            background: rgba(var(--bright-rgb), 0.02);
        }

        h1,
        h2,
        h3 {
            font-weight: 600;
            margin: 0;
        }

        h1.fill-anim,
        h2.fill-anim {
            --text-base: var(--text-bright);
            --text-hover: var(--text-bright)
        }

        #main-header {
            position: sticky;
            top: 0;
            left: 0;
            width: 100%;
            background: var(--header-glass);
            backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
            -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
            z-index: 10000;
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: center;
            padding: var(--header-pad-top) 0 var(--header-pad-bottom) 0;
            min-height: calc(var(--brand-row-h) + var(--header-pad-top) + var(--header-pad-bottom));
            border-bottom: 1px solid var(--border-header);
            overflow: visible;
            isolation: isolate;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }

        /* Bottom nav bar — contains only the nav rows */
        #nav-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background: var(--header-glass);
            backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
            -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
            z-index: 10000;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: var(--header-pad-top) 0 var(--header-pad-bottom) 0;
            /* Safe area: respects iPhone home bar; is 0 when browser UI already covers it
               (e.g. Safari bottom tabs) so no empty space is added unnecessarily */
            padding-bottom: max(var(--header-pad-bottom), env(safe-area-inset-bottom));
            gap: var(--header-gap);
            border-top: 1px solid var(--border-header);
            overflow: visible;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }

        #brand-name,
        .nav-row.level-1 .nav-link,
        .nav-row.level-n .nav-link,
        .nav-row.level-n .sub-link {
            font-weight: 700;
            text-transform: uppercase;
            user-select: none;
            -webkit-tap-highlight-color: transparent;
            --text-base: var(--text-muted);
        }

        #brand-name {
            border: none;
            padding: 0;
            font-family: inherit;
            display: flex;
            align-items: center;
            justify-content: center;
            width: auto;
            flex: 0 0 auto;
            align-self: center;
            height: var(--brand-row-h);
            font-size: 30px;
            letter-spacing: 2px;
            line-height: 1;
            cursor: pointer;
            transition: height .6s cubic-bezier(.2, 0, 0, 1), opacity var(--anim-layout) var(--ease), transform .6s cubic-bezier(.2, 0, 0, 1), margin .6s cubic-bezier(.2, 0, 0, 1), background-position var(--anim-primary) var(--ease);
            opacity: 1;
            transform: translateY(0);
            margin-bottom: 0;
            --text-hover: var(--text-bright);
        }

        #brand-name.active {
            background-position: 0 100%;
        }

        @media (hover: hover) {
            #brand-name:hover {
                background-position: 0 100%
            }
        }

        #nav-stack,
        .nav-row {
            width: 100%;
            display: flex;
            align-items: center
        }

        #nav-stack {
            flex-direction: column-reverse;
            gap: var(--site-gap-nav);
            transition: gap var(--anim-layout) var(--ease);
        }

        .nav-row {
            max-width: 900px;
            gap: 20px;
            overflow-x: auto;
            overflow-y: hidden;
            flex: 0 0 auto;
            overscroll-behavior-x: none;
            white-space: nowrap;
            scrollbar-width: none;
            transition: height var(--anim-layout) var(--ease), opacity var(--anim-layout) var(--ease), margin var(--anim-layout) var(--ease);
            opacity: 1;
            cursor: grab;
            user-select: none; /* Prevent accidental text selection while dragging */
            display: flex;
            align-items: center;
            justify-content: flex-start; /* Flex-start allows scrolling to the left overflow */
        }

        /* Centering technique that doesn't break overflow scrolling: 
           auto margins on both ends will center the group if it can, 
           but won't block access to negative scroll positions. */
        .nav-row > *:first-child {
            margin-left: auto;
        }

        .nav-row > *:last-child {
            margin-right: auto;
        }

        .nav-row.grabbing {
            cursor: grabbing;
        }

        .nav-row.level-1 {
            height: var(--main-row-h);
            min-height: var(--main-row-h);
            gap: 30px;
            justify-content: center
        }

        .nav-row.level-1 .nav-link {
            font-size: var(--nav-font-size);
            letter-spacing: 1px;
            line-height: 1.2;
            padding-bottom: 0
        }

        .cat-projects,
        [href="#Projects"] {
            --cat-accent: var(--accent-projects);
        }

        .cat-professional,
        [href="#Professional"] {
            --cat-accent: var(--accent-prof);
        }

        .cat-personal,
        [href="#Personal"] {
            --cat-accent: var(--accent-personal);
        }

        .cat-projects,
        .cat-professional,
        .cat-personal,
        [href="#Projects"],
        [href="#Professional"],
        [href="#Personal"] {
            --text-hover: var(--cat-accent);
        }

        .nav-row.level-n {
            height: var(--sub-row-h);
            font-size: 13px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            line-height: normal;
            /* scroll-snap-type removed to prevent fighting with JS scrollTo; managed in haptic system */
            mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
            -webkit-mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%)
        }

        .nav-row.level-n .sub-link {
            scroll-snap-align: center;
        }

        .nav-row.level-n .nav-link,
        .nav-row.level-n .sub-link {
            --text-base: var(--text-muted);
            --text-hover: var(--text-bright)
        }

        .nav-row.level-n .nav-link.active {
            background-position: 0 100%;
        }

        .nav-row.level-n::after,
        .nav-row.level-n::before {
            content: "";
            display: block;
            width: 50%;
            flex-shrink: 0;
            cursor: pointer;
        }

        .nav-row.level-n::before {
            margin-right: -10px;
        }

        .nav-row.level-n::after {
            margin-left: -10px;
        }

        .nav-row,
        .nav-row>* {
            flex-shrink: 0
        }

        #search-controls,
        #search-overlay {
            display: flex;
            align-items: center;
            justify-content: center
        }

        #left-controls,
        #search-controls {
            position: absolute;
            top: var(--header-pad-top);
            height: var(--brand-row-h);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10002;
            transition: opacity var(--anim-layout) var(--ease);
        }

        #left-controls {
            left: 12px;
        }

        #search-controls {
            right: 12px;
            gap: 12px;
        }

        .icon-btn {
            width: 28px;
            height: 28px;
            padding: 4px;
            cursor: pointer;
            fill: var(--text-muted);
            color: var(--text-muted);
            transition: all var(--anim-layout);
            transform-origin: center center;
            position: relative;
            -webkit-tap-highlight-color: transparent;
            display: flex;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
        }

        .icon-btn-wrapper {
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            position: relative;
        }

        .icon-btn:hover {
            fill: var(--text-bright)
        }

        .fill-anim-mask {
            background: linear-gradient(to top, var(--text-hover, var(--text-bright)) 50%, var(--text-base, var(--text-muted)) 50.5%);
            background-size: 100% 205%;
            background-position: 0 0;
            transition: background-position var(--anim-primary) var(--ease);
            width: 100%;
            height: 100%;
            display: block
        }

        .icon-search-mask {
            -webkit-mask: url('data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"%3E%3Ccircle cx="10" cy="10" r="6"/%3E%3Cpath d="M14.5 14.5l5 5"/%3E%3C/svg%3E') no-repeat center;
            mask: url('data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"%3E%3Ccircle cx="10" cy="10" r="6"/%3E%3Cpath d="M14.5 14.5l5 5"/%3E%3C/svg%3E') no-repeat center;
            -webkit-mask-size: 26px;
            mask-size: 26px;
        }

        .icon-theme-mask {
            -webkit-mask: url('data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"%3E%3Ccircle cx="12" cy="12" r="7.5"/%3E%3Cpath d="M12 4.5v15a7.5 7.5 0 0 0 0-15z" fill="black"/%3E%3C/svg%3E') no-repeat center;
            mask: url('data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"%3E%3Ccircle cx="12" cy="12" r="7.5"/%3E%3Cpath d="M12 4.5v15a7.5 7.5 0 0 0 0-15z" fill="black"/%3E%3C/svg%3E') no-repeat center;
            -webkit-mask-size: 22px;
            mask-size: 22px;
            background: var(--text-muted) !important;
            opacity: 1 !important;
            width: 28px;
            height: 28px;
            padding: 0 !important;
            box-sizing: border-box;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            -webkit-transform-style: preserve-3d;
            transform-style: preserve-3d;
            transform-origin: center center !important;
            transition: transform var(--anim-quick) var(--ease);
        }

        .icon-btn-wrapper:hover .icon-theme-mask {
            opacity: 1 !important;
            background: var(--text-muted) !important;
        }

        #left-controls .fill-anim-mask,
        #search-controls .fill-anim-mask {
            --text-base: var(--text-muted);
            --text-hover: var(--text-bright);
        }

        .icon-btn-wrapper:hover .fill-anim-mask {
            background-position: 0 100%;
        }

        .theme-toggle-icon {
            transition: transform var(--anim-quick) var(--ease);
        }

        :root[data-theme="light"] .theme-toggle-icon {
            transform: rotate(180deg);
        }

        .theme-toggle-symbol {
            fill: currentColor;
        }

        #search-overlay {
            position: fixed;
            top: 60px;
            left: 50%;
            width: 400px;
            max-width: 90%;
            height: 50px;
            transform-origin: center top;
            transform: translate3d(-50%, -20px, 0) scale(.95);
            background: var(--header-glass);
            backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
            -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
            z-index: 30000;
            border-radius: 999px;
            border: 1px solid var(--border-subtle);
            transition: transform var(--anim-layout) cubic-bezier(.16, 1, .3, 1), opacity var(--anim-layout) ease;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            will-change: transform, opacity;
            box-shadow: none;
        }

        #search-overlay.active {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transform: translate3d(-50%, 0, 0) scale(1);
            box-shadow: var(--shadow-heavy, 0 0 100px 40px rgba(0, 0, 0, 0.95));
        }

        #search-input::-webkit-search-cancel-button {
            display: none;
            -webkit-appearance: none;
        }

        #search-input {
            width: 100%;
            height: 100%;
            background: 0 0;
            border: 0;
            color: var(--text-bright);
            font-size: 20px;
            font-family: "Jost", sans-serif;
            padding: 0 20px;
            outline: 0;
            text-align: center;
            font-weight: 500
        }

        body.search-active footer,
        body.search-active #nav-bar {
            display: none !important;
        }

        body.search-active #main-header {
            pointer-events: none;
        }

        body.search-active #app {
            display: none !important;
        }

        @media (max-width:768px) {
            :root {
                --brand-row-h: 34px;
                --main-row-h: 25px;
                --sub-row-h: 25px;
                --gap: 1px;
                --header-pad-top: 3px;
                --header-pad-bottom: 3px;
                --header-gap: 0px;
                --nav-font-size: 16px;
            }

            #brand-name {
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: var(--brand-font-size);
                letter-spacing: var(--brand-letter-spacing);
                line-height: 1;
            }

            #search-controls {
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .nav-row.level-n {
                justify-content: flex-start
            }

            .nav-row.level-n::after,
            .nav-row.level-n::before {
                display: block
            }
        }

        .nav-row.level-1 .nav-link {
            font-size: var(--nav-font-size);
            line-height: 1.2;
        }

        .nav-row.level-n {
            font-size: 14px;
            line-height: 1.2;
        }

        footer {
            flex-direction: column;
            gap: 20px;
            text-align: center
        }



        @media (max-width: 360px) {
            .nav-row.level-1 {
                justify-content: flex-start;
            }
        }

        .content-container {
            max-width: 1200px; /* Capped at 1200px to strictly allow max 4 cards per row (4x275px + gaps) */
            width: 100%;
            margin: 0 auto;
            padding: var(--site-gap) 20px 0;
            flex: 1;
            position: relative;
            box-sizing: border-box;
        }

        @media (max-width:768px) {
            .content-container {
                padding: var(--site-gap) 10px 0;
            }
        }

        .section {
            margin-bottom: var(--site-gap);
            opacity: 0;
            animation: fadeIn .4s forwards;
            position: relative;
            content-visibility: auto;
            contain-intrinsic-size: 1px 500px;
        }

        .layout-hero {
            text-align: center;
            max-width: 800px;
            margin-left: auto;
            margin-right: auto;
            grid-column: 1 / -1;
            display: flex;
            flex-direction: column;
            gap: 16px;
            align-items: center;
            padding: 0;
        }

        .layout-text {
            width: 100%;
            max-width: none;
            margin-left: auto;
            margin-right: auto;
            grid-column: 1 / -1;
            display: flex;
            flex-direction: column;
            gap: 16px;
            padding: 0;
        }

        .grid-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 275px));
            justify-content: center;
            gap: 16px;
            margin-bottom: 16px;
            width: 100%;
        }

        .markdown-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 275px));
            justify-content: center;
            gap: 16px;
            margin: 12px 0;
            width: 100%;
        }

        @media (max-width:600px) {
            .grid-container, .markdown-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }
        }

        footer {
            padding: 1rem;
            border-top: 1px solid var(--border-subtle);
            margin-top: auto;
            width: 100%;
            max-width: 1200px;
            margin-left: auto;
            margin-right: auto;
            text-align: center;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
        }

        #footer-links {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 1.25rem 2rem;
            padding: 0;
            margin: 0;
        }

        #footer-links a,
        #footer-links span {
            font-size: 14px;
            line-height: 1;
            font-weight: 500;
        }

        #footer-links a {
            --text-base: var(--text-muted);
            --text-hover: var(--text-bright);
        }

        #footer-links span {
            color: var(--text-muted);
            user-select: text;
        }

        #footer-meta {
            display: flex;
            justify-content: center;
            align-items: center;
            margin: 0;
        }

        @media (min-width: 768px) {
            footer {
                flex-wrap: nowrap;
                justify-content: center;
                gap: 2rem;
            }
        }

        .layout-quote {
            margin: 0 auto 16px;
            -webkit-tap-highlight-color: transparent;
            padding: 40px clamp(15px, 6%, 60px);
            height: 250px; /* FIXED HEIGHT: Never changes size, no page jumps */
            width: 100%;
            max-width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            flex-direction: column;
            /* Performance: Promote to layer and skip rendering if off-screen */
            content-visibility: auto;
            contain-intrinsic-size: 1px 250px;
            will-change: transform;
            /* Transition colors, but height is now static */
            transition: background var(--anim-quick) var(--ease);
            border-radius: var(--card-radius);
            position: relative;
            overflow: hidden;
            box-sizing: border-box;
        }

        .layout-quote.loading blockquote,
        .layout-quote.loading .quote-footer {
            opacity: 0;
            pointer-events: none;
        }

        .layout-quote blockquote,
        .layout-quote .quote-footer {
            transition: opacity var(--anim-primary) var(--ease);
        }

        .layout-quote blockquote {
            font-family: "Lora", serif;
            font-style: normal;
            color: var(--text-bright);
            margin-bottom: 12px;
            line-height: 1.35;
            transition: opacity var(--anim-primary) var(--ease);
            width: 100%;
            font-size: clamp(22px, 3.5vw, 30px)
        }

        .layout-quote blockquote.short {
            font-size: clamp(28px, 5vw, 42px)
        }

        .layout-quote blockquote.medium {
            font-size: clamp(24px, 4vw, 34px)
        }

        .layout-quote blockquote.long {
            font-size: clamp(20px, 3vw, 26px)
        }

        .layout-quote blockquote.xl {
            font-size: clamp(15px, 2.5vw, 20px)
        }

        .layout-quote blockquote.xxl {
            font-size: clamp(14px, 2vw, 18px);
            line-height: 1.3
        }

        .quote-footer {
            display: block;
            text-align: center;
            width: 100%;
            margin-top: 16px
        }

        .layout-quote .author {
            display: inline-block;
            margin: 0;
            padding: 0;
            font-size: 13px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 2px;
            line-height: normal
        }



        @keyframes dice-spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .dice-icon {
            position: absolute;
            bottom: 18px;
            right: 18px;
            width: 28px;
            height: 28px;
            cursor: pointer;
            color: var(--text-bright);
            opacity: 0.5;
            transition: transform 0.4s cubic-bezier(.175, .885, .32, 1.275), opacity 0.3s var(--ease), color 0.3s var(--ease);
            -webkit-tap-highlight-color: transparent;
            outline: 0;
            z-index: 10;
        }

        .dice-icon:hover,
        .dice-icon:active {
            opacity: 1;
            transform: none;
            color: var(--text-bright);
        }

        .layout-quote.loading .dice-icon {
            opacity: 1;
            color: var(--text-bright);
            animation: dice-spin 0.6s cubic-bezier(.175, .885, .32, 1.275);
        }


        .layout-grid {
            display: flex;
            flex-direction: column;
            gap: 0;
            padding: 0;
            border-radius: var(--card-radius);
            border: 1px solid var(--border-subtle);
            height: 100%;
            width: 100%;
            min-width: 0; /* CRITICAL: Allows grid items to shrink below content size (like nowrap text) */
            justify-content: flex-start;
            position: relative;
            cursor: pointer;
            -webkit-tap-highlight-color: transparent;
            transition: background var(--anim-instant), border-color var(--anim-instant);

            background: var(--card-bg);
            box-shadow: var(--shadow-subtle, none);
            overflow: hidden;
            text-decoration: none;
            color: inherit;
        }

        @media (hover: hover) {
            .layout-grid:hover {
                background: var(--card-bg-hover);
                border-color: rgba(var(--bright-rgb), 0.15);
            }
        }

        .layout-grid h3,
        .layout-grid h3.fill-anim {
            font-size: 20px;
            margin: 0;
            padding: 0;
            display: flex;
            align-items: center;
            gap: var(--space-xs);
            --text-base: var(--text-muted);
            --text-hover: var(--cat-accent, var(--text-bright));
            font-weight: 600;
            line-height: 1.2;
        }

        .layout-grid:hover .row-media.placeholder span {
            color: var(--cat-accent);
        }

        @media (hover: hover) {
            .layout-grid:hover h3:not(.fill-anim) {
                color: var(--text-hover, var(--text-bright));
            }

            .layout-grid:hover h3.fill-anim {
                background-position: 0 100%;
            }
        }

        .layout-grid p {
            font-size: 14px;
            color: var(--text-main);
            font-weight: 400;
            line-height: 1.4;
            margin: 0;
        }

        .card-description {
            font-size: 13.5px;
            color: var(--text-main);
            opacity: 1;
            margin-top: -2px;
            line-height: 1.35;
            display: block;
            font-weight: 400;
        }

        .card-description a {
            display: inline !important;
            vertical-align: baseline !important;
            opacity: 1;
            color: var(--text-bright);
            text-decoration-color: var(--cat-accent, var(--text-muted));
            line-height: inherit;
        }

        .card-info {
            padding: var(--card-padding); /* Standardized card-wide padding */
            display: flex;
            flex-direction: column;
            gap: var(--card-padding); /* Unified rhythm: gaps match outer padding exactly */
            width: 100%;
            box-sizing: border-box;
            flex-grow: 1;
            justify-content: flex-start;
            position: relative;
            overflow: hidden;
        }

        .card-info::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            /* Tighter falloff (35%) and anchored bottom-right to keep it far from the thumbnail */
            background: radial-gradient(circle at 90% 90%, var(--cat-accent), transparent 35%);
            opacity: 0;
            transition: opacity var(--anim-quick) var(--ease);
            pointer-events: none;
            z-index: 0;
        }

        .layout-grid:hover .card-info::before {
            opacity: 0.05;
        }

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

        .card-breadcrumb {
            display: block;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-low);
            font-weight: 500;
            margin: 0;
            padding: 0;
            line-height: 1.2; /* Match title line-height to ensure equal visual footprint */
        }

        .meta-row {
            display: flex;
            gap: 6px;
            flex-wrap: wrap; /* Standard wrap maintains order: Tags -> Date */
            align-items: center;
            justify-content: flex-start;
            padding: 0;
            margin: 0;
            margin-top: auto; /* Pins the entire row assembly to the bottom of the card */
        }

        .article-meta-row {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            align-items: center;
            padding: 0;
            margin: 0;
        }

        .article-tags {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            align-items: center;
        }

        .row-media {
            aspect-ratio: 4/3;
            width: 100%;
            overflow: hidden;
            border-radius: var(--card-radius) var(--card-radius) 0 0;
            background: transparent;
            margin-bottom: 0;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 0; /* CRITICAL: Prevent intrinsic flex sizing from breaking grid width via aspect-ratio */
            min-width: 0;
        }

        /* Square Guard: Music Album Art must remain 1/1 to prevent distortion */
        .cat-music .row-media {
            aspect-ratio: 1/1;
        }

        .row-media img,
        .row-media video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: filter 0.6s var(--ease), opacity 0.4s var(--ease);
        }

        /* Unified media-to-info blend - for images/videos */
        .row-media.media-fade {
            /* 
               The dither and blur effects have been removed to restore 
               a clean, hard edge between media and card information.
            */
        }

        /* 1. The CAD Graph Paper Background - UNIFIED BLOCK */
        .row-media.placeholder {
            /* Changed to match the main card background color */
            background-color: var(--card-bg);
            /* Keeps the subtle engineering grid */
            background-image:
                linear-gradient(rgba(var(--bright-rgb), 0.04) 1px, transparent 1px),
                linear-gradient(90deg, rgba(var(--bright-rgb), 0.04) 1px, transparent 1px);
            background-size: 24px 24px;
            background-position: center center;
            /* Border removed so it blends seamlessly with the content below */
            border-bottom: none;
            padding: 12px;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            z-index: 1;
            overflow: hidden;
            /* Matches the main card transition speed */
            transition: background-color var(--anim-layout) var(--ease);
        }

        /* Ensures no cheap glow effects exist */
        .row-media.placeholder::after {
            display: none;
        }

        /* 2. Chunky Jost Typography (No scaling animation) */
        .row-media.placeholder span {
            font-family: "Jost", sans-serif;
            font-size: 18px;
            font-weight: 700;
            text-transform: uppercase;
            color: var(--text-muted);
            letter-spacing: 1.5px;
            line-height: 1.2;
            transition: color 0.4s var(--ease), opacity 0.4s var(--ease);
            max-width: 90%;
            display: block;
            z-index: 2;
            opacity: 0.6;
        }

        /* 3. Unified Hover States */
        @media (hover: hover) {

            /* Now changes to the exact same hover color as the rest of the card */
            .layout-grid:hover .row-media.placeholder {
                background-color: var(--card-bg-hover);
            }

            .layout-grid:hover .row-media.placeholder span {
                opacity: 1;
                color: var(--text-dim);
            }

            /* Crisp Accent Colors on Hover */
            .layout-grid.cat-projects:hover .row-media.placeholder span {
                color: var(--accent-projects);
            }

            .layout-grid.cat-professional:hover .row-media.placeholder span {
                color: var(--accent-prof);
            }

            .layout-grid.cat-personal:hover .row-media.placeholder span {
                color: var(--accent-personal);
            }
        }

        .unified-media-wrapper {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .embed-wrapper:not(.video),
        .model-viewer-wrapper,
        .strava-embed-placeholder {
            position: relative;
            width: 100%;
            aspect-ratio: 4/3;
            max-width: none;
            margin: 0;
            background: transparent;
            border-radius: var(--card-radius);
            overflow: hidden;
            display: block;
            /* Force hardware acceleration and clipping for difficult embeds like Strava */
            -webkit-mask-image: -webkit-radial-gradient(white, black);
            mask-image: radial-gradient(white, black);
            transform: translateZ(0);
        }

        .embed-wrapper.video {
            position: relative;
            width: 100%;
            aspect-ratio: auto;
            /* Let content (img/video) define the height to avoid huge gaps */
            max-width: 100%;
            margin-left: auto;
            margin-right: auto;
            background: transparent;
            border-radius: var(--card-radius);
            overflow: hidden;
            display: block;
            transform: translateZ(0);
        }

        .strava-embed-placeholder iframe {
            border-radius: var(--card-radius) !important;
            border: none !important;
            width: 100% !important;
            height: 100% !important;
        }

        .media-container {
            position: relative;
            width: 100%;
            max-width: none;
            margin: 0;
            background: transparent;
            border-radius: var(--card-radius);
            overflow: hidden;
            display: block;
        }

        .model-viewer-wrapper {
            position: relative;
            aspect-ratio: 4/3;
            width: 100%;
            border-radius: var(--card-radius);
            overflow: hidden;
            background: transparent;
        }

        .model-viewer-wrapper.card-preview {
            background: transparent;
            border-bottom: none;
        }

        .model-viewer-wrapper.card-preview::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: var(--placeholder-hover);
            opacity: 0;
            transition: opacity 0.5s var(--ease);
            z-index: 1;
            pointer-events: none;
        }

        #app .model-viewer-wrapper.card-preview canvas {
            position: relative;
            z-index: 2;
        }

        .model-viewer-wrapper canvas {
            width: 100% !important;
            height: 100% !important;
            display: block;
            opacity: 0;
            transition: opacity 0.4s var(--ease);
            background: transparent;
        }

        #app .model-viewer-wrapper .loader-overlay,
        #app .row-media .loader-overlay,
        #app .embed-wrapper .loader-overlay {
            background: transparent;
            position: absolute;
        }

        .model-viewer-wrapper.loaded canvas {
            opacity: 1;
        }

        .row-media img,
        .row-media video,
        .media-container img,
        .embed-wrapper img,
        .embed-wrapper video,
        .embed-wrapper iframe {
            opacity: 0;
            transition: opacity 0.7s var(--ease);
        }

        .row-media img.loaded,
        .row-media video.loaded,
        .media-container img.loaded,
        .embed-wrapper img.loaded,
        .embed-wrapper video.loaded,
        .embed-wrapper iframe.loaded {
            opacity: 1;
        }

        .embed-wrapper iframe {
            transform: none;
        }

        .embed-wrapper iframe.loaded {
            opacity: 1;
        }



        .media-container img {
            width: auto;
            max-width: 100%;
            height: auto;
            display: block;
            max-height: 800px;
            object-fit: contain;
            margin: 0 auto;
            border-radius: var(--card-radius);
        }

        .embed-wrapper.video {
            position: relative;
            padding-top: 0;
            max-width: 100%;
            margin-left: auto;
            margin-right: auto;
            background: var(--card-bg);
            border-radius: var(--card-radius);
            overflow: hidden;
        }

        .embed-wrapper iframe {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: 0;
            display: block;
            object-fit: cover;
        }

        .embed-wrapper video {
            position: relative;
            width: 100% !important;
            height: auto;
            border: 0;
            display: block;
            border-radius: inherit;
        }

        .image-caption {
            display: block;
            padding: 2px 12px 0 12px;
            background: transparent;
            color: var(--text-dim);
            font-size: 15px;
            line-height: 1.4;
            border: none !important;
            box-shadow: none !important;
            text-align: center;
            position: relative;
            z-index: 5;
            margin: 0;
        }

        .media-gallery {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: var(--site-gap-media);
            margin: 0;
            width: 100%;
        }

        .gallery-item-wrapper {
            display: flex;
            flex-direction: column;
            width: 100%;
        }
        .gallery-item {
            overflow: hidden;
            border-radius: var(--card-radius);
            background: transparent;
            display: flex;
            flex-direction: column;
            width: 100%;
            position: relative;
        }

        .gallery-item img,
        .gallery-item iframe,
        .gallery-item canvas,
        .gallery-item .unified-media-wrapper,
        .gallery-item .media-container,
        .gallery-item .embed-wrapper,
        .gallery-item .model-viewer-wrapper {
            width: 100%;
            display: block;
            margin: 0;
            border-radius: inherit;
            background: transparent;
            overflow: hidden;
        }

        .gallery-item .embed-wrapper.gallery-embed {
            flex: 1;
            width: 100%;
            aspect-ratio: auto;
            height: auto;
            position: relative;
            display: block;
        }

        .media-gallery.uniform-height .gallery-item .embed-wrapper.gallery-embed {
            height: 100%;
        }

        .gallery-item img,
        .gallery-item video,
        .gallery-item iframe {
            object-fit: cover;
            height: 100%;
        }

        .media-gallery .shared-caption {
            display: block;
            flex-basis: 100%;
            width: 100%;
            padding: 2px 12px 0 12px;
            text-align: center;
            color: var(--text-dim);
            font-size: 15px;
            border: none !important;
            background: transparent;
            margin: 0;
        }

        .media-gallery.uniform-height {
            display: flex;
            flex-wrap: wrap;
            gap: var(--space-sm);
            align-items: flex-start; /* Respect individual image/caption heights */
            padding: 0;
        }

        .media-gallery.uniform-height .gallery-item-wrapper {
            display: flex;
            flex-direction: column;
            flex: 1 1 300px;
            height: auto;
            margin: 0;
            min-width: 0;
        }
        .media-gallery.uniform-height .gallery-item {
            height: auto; 
            flex: 0 0 auto;
        }

        @media (max-width: 767px) {
            /* Mobile Card Density - Hide non-essential metadata chips */
            .meta-row .chip:not(.chip-featured),
            .meta-row:not(.has-featured) {
                display: none;
            }

            .card-info {
                padding: 10px;
                gap: 6px;
            }

            .cat-music .card-info {
                padding-right: 35px; /* Adjust for smaller YT overlay footprint on mobile */
                min-height: 0;
            }

            .layout-text,
            .layout-hero {
                gap: 16px;
            }

            .media-gallery {
                gap: 16px;
                margin-top: 25px;
            }

            .media-gallery.uniform-height .gallery-item-wrapper {
                flex: 0 0 calc(50% - 8px);
                max-width: calc(50% - 8px);
                min-width: 0;
            }
            .media-gallery.uniform-height .gallery-item {
                height: auto; 
            }
            .media-gallery.uniform-height .gallery-item img {
                height: auto;
                object-fit: contain;
                aspect-ratio: auto;
            }

            .start-hidden {
                opacity: 1 !important;
                animation: none !important;
            }
        }

        @media (min-width: 769px) {

            .gallery-item img,
            .gallery-item .unified-media-wrapper,
            .gallery-item .model-viewer-wrapper,
            .gallery-item canvas {
                height: 100%;
                width: 100%;
                object-fit: cover;
                flex: 1;
            }

            .gallery-item .embed-wrapper {
                width: 100%;
                aspect-ratio: auto;
                flex: 1;
                display: flex;
                flex-direction: column;
            }

            .gallery-item .model-viewer-wrapper {
                display: flex;
                flex-direction: column;
                aspect-ratio: auto;
            }
        }

        .media-gallery .gallery-item .image-caption {
            flex: 0 0 auto;
            width: 100%;
            background: transparent;
        }

        .media-gallery .embed-wrapper iframe {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            border-radius: 0;
        }

        .media-gallery .model-viewer-wrapper canvas {
            display: block;
            width: 100%;
            height: 100%;
            outline: none;
            opacity: 0;
            transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .media-gallery .model-viewer-wrapper.loaded canvas {
            opacity: 1;
        }

        .model-viewer-wrapper {
            height: 450px;
            opacity: 1;
            position: relative;
            background: transparent;
            border: none;
            border-radius: var(--card-radius);
            box-sizing: border-box;
            overflow: hidden;
        }

        .model-bg-watermark {
            position: absolute;
            inset: 18%;
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
            opacity: 0.15;
            z-index: 1;
            pointer-events: none;
            filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
            transition: opacity 1.2s var(--ease);
        }

        /* Intelligent Watermark Reactivity: Logos must NOT match the background (contrast-first) */

        /* If logo is Bright (white), invert it only in Light mode to stay dark */
        [data-theme="light"] .model-bg-watermark.is-bright {
            filter: invert(1) hue-rotate(180deg) drop-shadow(0 4px 8px rgba(0,0,0,0.15));
            opacity: 0.16;
        }

        /* If logo is Dark (black), invert it only in Dark mode to stay light */
        [data-theme="dark"] .model-bg-watermark.is-dark {
            filter: invert(1) hue-rotate(180deg) drop-shadow(0 4px 12px rgba(255,255,255,0.1));
            opacity: 0.18;
        }

        /* Base states for matching themes (ensure they have some contrast/popping) */
        [data-theme="dark"] .model-bg-watermark.is-bright {
            filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
            opacity: 0.18;
        }

        [data-theme="light"] .model-bg-watermark.is-dark {
            filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
            opacity: 0.14;
        }

        .model-viewer-wrapper canvas {
            position: absolute;
            inset: 0;
            z-index: 2;
            opacity: 0;
            transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .model-viewer-wrapper.loaded canvas {
            opacity: 1;
        }

        .gallery-item .model-viewer-wrapper {
            background: transparent !important;
            border-radius: 0 !important;
            height: 100%;
        }

        .model-viewer-wrapper.card-preview canvas {
            pointer-events: none !important;
            border-radius: var(--card-radius) var(--card-radius) 0 0;
        }

        .section-title-wrapper {
            display: flex;
            justify-content: center;
            margin-bottom: var(--site-gap);
            margin-top: var(--site-gap);
            scroll-margin-top: 120px;
        }

        .section-title-wrapper h2 {
            display: inline-block;
            font-weight: 600;
            font-size: 24px;
            --text-base: var(--text-dim);
            --text-hover: var(--text-bright);
            text-align: center;
        }

        @media (max-width: 600px) {
            .section-title-wrapper {
                margin-top: var(--site-gap); /* Match .section margin-bottom for perfect rhythm */
                margin-bottom: var(--site-gap);
            }
            .section-title-wrapper h2 {
                font-size: 20px;
                line-height: 1.2;
                max-width: 90%; /* Prevent long titles from hitting edges */
            }
        }

        .btn-cta-wrapper {
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            text-align: center;
            flex-wrap: wrap;
            gap: 12px;
            padding: 0;
            margin: 0;
            mask: none;
            -webkit-mask: none;
            opacity: 1;
            background: none;
            overflow: visible;
        }

        .article-body .btn-cta-wrapper,
        .layout-hero .btn-cta-wrapper,
        .layout-text .btn-cta-wrapper,
        .article-body p:has(> .btn-cta),
        .layout-hero p:has(> .btn-cta),
        .layout-text p:has(> .btn-cta) {
            margin: 0 auto !important; /* No extra margin; relies on layout gap (16px) for spacing */
        }

        .btn-cta {
            -webkit-text-fill-color: initial;
            -webkit-background-clip: initial;
            background-clip: padding-box;
            background-image: none;
            mask: none;
            -webkit-mask: none;
            transform: none;
            opacity: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            vertical-align: middle;
            line-height: normal;
            padding: 8px 24px;
            font-size: 17px;
            font-weight: 400;
            color: var(--text-muted);
            background: var(--card-bg);
            border: 1px solid var(--border-strong);
            border-radius: 50px;
            text-decoration: none !important;
            cursor: pointer;
            overflow: visible;
            margin: 5px;
            position: relative;
            transition: all var(--anim-quick) var(--ease);
            height: auto;
            max-width: 100%;
            white-space: normal;
            text-align: center;
            word-break: break-word;
        }

        .btn-cta::before {
            content: '';
            position: absolute;
            inset: -1px;
            border: 2px solid rgba(var(--bright-rgb), 0.95); /* High-contrast 2px ground truth */
            border-radius: inherit;
            pointer-events: none;
            transition: opacity var(--anim-quick) var(--ease);
            opacity: 0;
            z-index: 5;
        }

        .btn-cta:hover,
        .btn-cta:active {
            text-decoration: none !important;
        }

        .btn-cta:not(.no-hover):hover::before,
        .btn-cta:not(.no-hover):active::before {
            opacity: 1;
        }

        /* Standard Button Colors & States: Neutrals only */

        .markdown-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 275px));
            justify-content: center;
            gap: 16px;
            margin: 12px 0;
            width: 100%;
        }

        .markdown-grid .layout-grid {
            margin-bottom: 0;
            height: 100%;
        }

        /* 1. Mobile & Interaction Logic */
        @media (max-width: 767px) {

            /* Disable internal canvas rotation on mobile to allow scrolling, 
               but keep pointer-events active so the fullscreen button works! */
            .model-viewer-wrapper:not(.card-preview) canvas {
                pointer-events: auto;
            }

            .model-viewer-wrapper:not(.card-preview) {
                aspect-ratio: 16/9;
                height: auto;
            }
        }

        @media (min-width: 769px) {
            .model-viewer-wrapper:not(.card-preview) canvas {
                cursor: grab;
            }

            .model-viewer-wrapper:not(.card-preview) canvas:active {
                cursor: grabbing;
            }
        }

        /* 1. Base Button Style (Normal State) */
        .model-viewer-wrapper .fs-btn {
            position: absolute;
            top: 16px;
            right: 16px;
            width: 42px;
            height: 42px;
            padding: 0;
            background: var(--header-glass);
            backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
            -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
            color: var(--text-bright);
            border: 1px solid var(--border-subtle);
            border-radius: 50%;
            cursor: pointer;
            z-index: 100;
            display: grid;
            place-items: center;
            will-change: transform, opacity;
            /* Only transition colors/shadows to prevent jumping */
            transition: border-color var(--anim-quick) var(--ease),
                box-shadow var(--anim-quick) var(--ease),
                background var(--anim-quick) var(--ease);
        }

        /* 2. Hover State (Normal & Fullscreen) */
        .model-viewer-wrapper .fs-btn:hover,
        .model-viewer-wrapper:fullscreen .fs-btn:hover {
            border-color: rgba(var(--bright-rgb), 0.8);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 0 0 1px var(--text-bright);
            background: var(--card-bg-hover);
            color: var(--text-bright);
        }

        /* 3. Icon Sizing */
        .model-viewer-wrapper .fs-btn svg {
            width: 20px;
            height: 20px;
            fill: currentColor;
            display: block;
        }

        /* 4. Fullscreen Layout Overrides */
        .model-viewer-wrapper:fullscreen .fs-btn {
            top: 20px;
            right: 20px;
        }

        /* 5. Fullscreen Container Behavior */
        .model-viewer-wrapper.fullscreen {
            border-radius: 0 !important;
            aspect-ratio: auto !important;
            width: 100vw !important;
            height: 100vh !important;
            background: var(--bg) !important;
        }

        .model-viewer-wrapper.fullscreen canvas {
            pointer-events: auto !important;
        }


        .model-viewer-wrapper .fs-btn svg {
            width: 20px;
            height: 20px;
            fill: currentColor;
            display: block;
            margin: 0;
        }

        .model-viewer-wrapper.fullscreen .fs-btn {
            top: 24px;
            right: 24px;
            bottom: auto;
            left: auto;
            width: 54px;
            height: 54px;
            background: rgba(var(--bg-rgb), 0.2); /* Subtle fill enough to be interactive in full */
            border-color: rgba(var(--bright-rgb), 0.6);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        }
        
        .model-viewer-wrapper.fullscreen .fs-btn:hover {
            background: rgba(var(--bg-rgb), 0.4);
            opacity: 1;
        }

        .model-viewer-wrapper.fullscreen .fs-btn svg {
            width: 28px;
            height: 28px;
        }



        .model-viewer-wrapper.card-preview .fs-btn {
            display: none;
        }

        .resume-container {
            max-width: 1000px;
            margin: 0 auto;
            padding: 0;
        }

        /* Video / YouTube Play Button Glassmorphism */
        .yt-glass-btn {
            width: 72px;
            height: 72px;
            border-radius: 50%;
            background: var(--header-glass);
            backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
            -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
            border: 1px solid var(--border-subtle);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all var(--anim-quick) var(--ease);
            box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        }

        .yt-glass-btn:hover {
            background: var(--card-bg-hover);
            border-color: rgba(var(--bright-rgb), 0.8);
            box-shadow: 0 4px 20px rgba(0,0,0,0.3), inset 0 0 0 1px var(--text-bright);
            transform: scale(1.05);
        }

        .resume-sub-row .btn-cta {
            margin: 0;
            align-self: center;
        }

        .resume-sub-row {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            margin-bottom: 10px;
        }

        .resume-sub-row .btn-cta {
            font-size: 13px;
            padding: 4px 12px;
            border-radius: 999px;
            background: transparent;
            border-color: rgba(var(--bright-rgb), 0.3);
            box-shadow: none;
        }

        .resume-sub-row .resume-sub {
            white-space: nowrap;
            margin: 0;
            line-height: 1.2;
        }

        .resume-header {
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-bottom: 30px;
        }

        .resume-grid {
            display: grid;
            grid-template-columns: 1fr 2fr;
            gap: 40px;
        }

        .resume-section {
            margin-bottom: 30px;
        }

        .resume-section h3 {
            margin-bottom: 8px;
        }

        .resume-entry {
            margin-bottom: 25px;
        }

        .resume-entry ul {
            margin-top: 8px;
            padding-left: 20px;
            list-style-type: disc;
        }

        .resume-entry li {
            margin-bottom: 6px;
            line-height: 1.5;
        }

        .resume-entry p,
        .resume-entry li {
            font-weight: 400;
        }

        .resume-entry-header {
            margin-bottom: 6px;
        }

        .resume-skill-block {
            margin-bottom: 16px;
        }

        .resume-skill-row {
            margin-bottom: 6px;
            margin-left: 20px;
            line-height: 1.5;
            display: list-item;
            list-style-type: disc;
            list-style-position: outside;
        }

        .resume-skill-cat {
            font-weight: 600;
        }

        .resume-skill-list {
            font-weight: 400;
        }

        .resume-sub {
            display: inline-block;
            font-size: 16px;
            color: var(--text-dim);
            font-weight: 500;
            margin-bottom: 16px;
        }

        .resume-contact {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 16px;
            flex-wrap: wrap;
            font-size: 14px;
            line-height: 1.4;
        }

        .resume-role {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-dim);
        }

        .resume-company {
            font-size: 15px;
            font-weight: 400;
            color: var(--text-dim);
        }

        .resume-date-slot,
        .resume-loc-slot {
            font-size: 14px;
            font-weight: 500;
            color: var(--text-muted);
            text-align: right;
        }

        @media (max-width: 767px) {
            .resume-grid {
                display: flex !important;
                flex-direction: column;
                gap: 20px;
            }
        }

        .contact-sep {
            margin: 0 12px;
            color: var(--text-dim);
            user-select: text;
            vertical-align: top;
        }

        .article-view {
            max-width: 800px;
            margin: 0 auto;
            padding: 0 40px 20px 40px;
            content-visibility: visible; /* CRITICAL: Override .section's content-visibility: auto to prevent clipping of breakout elements */
        }

        /* Hide trailing dividers above sub-page cards or at end of content */
        .article-body > hr:last-child {
            display: none;
        }

        .article-title,
        h1.header-fade-anim,
        .article-body h1,
        .article-body h2,
        .article-body h3,
        .article-body h4 {
            color: var(--text-muted);
            font-weight: 600;
            line-height: 1.25;
            padding-bottom: 0.05em;
            margin: 0 0 -0.05em 0; /* Stack system handles layout */
        }

        .article-title,
        h1.header-fade-anim { font-size: 35px; }
        .article-body h1 { font-size: 34px; font-weight: 700; }
        .article-body h2 { font-size: 28px; }
        .article-body h3 { font-size: 24px; }
        .article-body h4 { font-size: 20px; }

        /* High-Visibility Hierarchy: 0-Based Baseline, 40px (2.5rem) steps */
        /* Note: Using positive opt-in child combinator to prevent indentation bleeding into nested components or embeds */
        .article-view > :is(h1, h2), .article-view > :is(h1, h2) ~ :is(p, ul, ol, blockquote, .toc-container, hr),
        .article-body > :is(h1, h2), .article-body > :is(h1, h2) ~ :is(p, ul, ol, blockquote, .toc-container, hr) { margin-left: 0 !important; }

        .article-view > h3, .article-view > h3 ~ :is(p, ul, ol, blockquote, .toc-container, hr),
        .article-body > h3, .article-body > h3 ~ :is(p, ul, ol, blockquote, .toc-container, hr) { margin-left: 40px !important; }

        .article-view > h4, .article-view > h4 ~ :is(p, ul, ol, blockquote, .toc-container, hr),
        .article-body > h4, .article-body > h4 ~ :is(p, ul, ol, blockquote, .toc-container, hr) { margin-left: 80px !important; }

        /* Container Reset: Prevent the article-body div from compounding the margin of its previous header */
        .article-body { margin-left: 0 !important; }

        @media (max-width: 767px) {
            .article-title,
            h1.header-fade-anim { font-size: 28px; }
            .article-body h1 { font-size: 28px; }
            .article-body h2 { font-size: 24px; }
            .article-body h3 { font-size: 20px; }
            .article-body h4 { font-size: 18px; }

            /* Mobile: Steep 20px steps, 0-Based */
            .article-view > :is(h1, h2), .article-view > :is(h1, h2) ~ :is(p, ul, ol, blockquote, .toc-container, hr),
            .article-body > :is(h1, h2), .article-body > :is(h1, h2) ~ :is(p, ul, ol, blockquote, .toc-container, hr) { margin-left: 0 !important; }

            .article-view > h3, .article-view > h3 ~ :is(p, ul, ol, blockquote, .toc-container, hr),
            .article-body > h3, .article-body > h3 ~ :is(p, ul, ol, blockquote, .toc-container, hr) { margin-left: 20px !important; }

            .article-view > h4, .article-view > h4 ~ :is(p, ul, ol, blockquote, .toc-container, hr),
            .article-body > h4, .article-body > h4 ~ :is(p, ul, ol, blockquote, .toc-container, hr) { margin-left: 40px !important; }
        }

        /* THE STACK SYSTEM: Declarative Vertical Rhythm */
        /* 1. Reset ONLY vertical margins for internal elements to avoid stacking */
        .article-view > *,
        .article-body > * {
            margin-top: 0 !important;
            margin-bottom: 0 !important;
        }

        /* 2. Default gap (1x) between siblings */
        .article-view > * + *,
        .article-body > * + * {
            margin-top: var(--rhythm-gap) !important;
        }

        /* 3. Tight gap (0.125rem) below headings AND header subtitles (The 'Lead' Group) */
        .article-view > :is(h1, h2, h3, h4, .article-subtitle) + *,
        .article-body > :is(h1, h2, h3, h4, .article-subtitle) + * {
            margin-top: var(--rhythm-gap-tight) !important;
        }

        /* 4. Wide gap (1.5x) before headings */
        .article-body > :not(h1, h2, h3, h4) + :is(h1, h2, h3, h4) {
            margin-top: var(--rhythm-gap-wide) !important;
        }

        /* 5. Start of container reset */
        .article-view > :first-child,
        .article-body > :first-child {
            margin-top: 0 !important;
        }

        /* Logic: Standard gap is 1rem. Headings have tight local margins. */


        /* Clean resets */
        .article-body > p, .article-body > ul, .article-body > ol,
        .article-body > blockquote, .article-body > .unified-media-wrapper,
        .article-body > .media-gallery, .article-body > .btn-cta-wrapper {
            margin: 0;
        }

        .article-body p {
            margin: 0;
        }

        /* Unified block spacing for media elements in articles */
        .article-body .unified-media-wrapper,
        .layout-hero .unified-media-wrapper {
            margin: 0;
        }

        @media (max-width: 767px) {
            .article-view {
                padding: 0 10px 20px 10px;
            }

            .article-body .unified-media-wrapper,
            .layout-hero .unified-media-wrapper {
                margin: 0;
            }
        }

        .article-body ul,
        .article-body ol,
        .layout-hero ul,
        .layout-hero ol,
        .layout-text ul,
        .layout-text ol {
            margin: 0;
            padding-left: 24px;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .article-body li,
        .layout-hero li,
        .layout-text li {
            margin-bottom: 0;
            line-height: 1.6;
        }

        .article-body ul ul,
        .article-body ol ol,
        .layout-hero ul ul,
        .layout-text ul ul {
            margin: 8px 0;
            padding-left: 20px;
        }

        .checkbox {
            display: inline-flex;
            justify-content: center;
            align-items: center;
            width: 16px;
            height: 16px;
            border: 2px solid var(--text-muted);
            border-radius: 3px;
            margin-right: 8px;
            vertical-align: middle;
            position: relative;
            top: -2px;
            transition: all 0.2s ease;
        }

        .checkbox.checked {
            background: var(--text-bright);
            border-color: var(--text-bright);
        }

        .checkbox.checked::after {
            content: '';
            width: 4px;
            height: 8px;
            border: 0 solid var(--text-inv);
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
            margin-top: -2px;
        }

        .article-body li.checkbox-item,
        .layout-hero li.checkbox-item,
        .layout-text li.checkbox-item,
        .resume-entry li.checkbox-item {
            list-style: none;
            position: relative;
            margin-left: 0;
            padding-left: 0;
        }

        .article-body li.checkbox-item .checkbox,
        .layout-hero li.checkbox-item .checkbox,
        .layout-text li.checkbox-item .checkbox,
        .resume-entry li.checkbox-item .checkbox {
            position: absolute;
            left: -24px;
            top: var(--header-pad-top);
            margin-right: 0;
        }

        .back-link {
            display: inline-block;
            margin-bottom: 20px;
            color: var(--text-dim);
            text-decoration: none;
            font-size: 14px;
            transition: color var(--anim-instant);
        }

        .back-link:hover {
            opacity: 1;
        }

        @media (hover: none) {
            .fill-anim:not(.active):not(:active) {
                background-position: 0 0;
                --text-hover: var(--text-base);
            }

            .nav-link:active,
            .sub-link:active,
            .icon-btn:active,
            #brand-name:active,
            .icon-btn:active .fill-anim-mask {
                background-position: 0 100%;
                color: var(--text-hover, var(--text-bright));
            }
        }

        .nav-row.hidden {
            display: none !important;
        }

        /* Settlement Phase: Keep new rows invisible until perfectly centered */
        .nav-row.settling {
            opacity: 0 !important;
            transition: none !important;
        }

        /* Music Component - Vinyl Sleeve Edition */
        .music-card {
            display: flex;
            align-items: center;
            background: var(--card-bg-dark);
            border: 1px solid var(--border-subtle);
            border-radius: 20px;
            padding: 16px 24px;
            gap: 28px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
            margin: 40px 0;
            width: 100%;
            box-sizing: border-box;

            -webkit-user-drag: none;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        }

        .music-card:hover {
            background: var(--card-bg-hover);
            border-color: var(--text-dim);
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
        }

        .music-art-wrapper {
            position: relative;
            width: 90px;
            height: 90px;
            flex-shrink: 0;
            perspective: 1000px;
        }

        /* The "Vinyl" peeking from behind */
        .music-vinyl-disc {
            position: absolute;
            top: 4px;
            right: -15px;
            width: 82px;
            height: 82px;
            background: #050505;
            background: repeating-radial-gradient(circle at center, #050505, #050505 1px, #0f0f0f 2px, #050505 3px);
            border-radius: 50%;
            z-index: 1;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
            animation: record-spin 8s linear infinite;
            transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s ease;
        }

        .music-card:hover .music-vinyl-disc {
            right: -30px;
        }

        .music-art {
            width: 100%;
            height: 100%;
            border-radius: 6px;
            overflow: hidden;
            position: relative;
            z-index: 2;
            /* Sits on top of the vinyl */
            background: #111;
            box-shadow: 4px 0 15px rgba(0, 0, 0, 0.4);
            transform-style: preserve-3d;
            transition: transform 0.3s ease;
        }

        .music-art img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            opacity: 0;
            transition: opacity 0.5s ease;
        }

        .music-art img.loaded {
            opacity: 1;
        }



        .music-info {
            flex-grow: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            z-index: 3;
        }

        .music-track {
            font-size: 20px;
            font-weight: 700;
            color: var(--text-bright);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 2px;
            font-family: 'Jost', sans-serif;
            letter-spacing: -0.3px;
        }

        .music-artist {
            font-size: 15px;
            color: var(--text-dim);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            opacity: 0.85;
        }

        .music-logo-wrapper {
            width: 48px;
            height: 48px;
            flex-shrink: 0;
        }

        /* Music Component - Native Card Integration */
        .music-sections-container {
            display: flex;
            flex-direction: column;
            gap: 20px;
            margin: 12px auto;
            max-width: 1200px;
            width: 100%;
            align-items: stretch;
        }

        /* Breakout for articles: Let music grids expand beyond 800px to act like standard 1200px grids */
        .article-view .music-sections-container {
            width: 100vw;
            max-width: 1200px;
            position: relative;
            left: 50%;
            transform: translateX(-50%);
            padding: 0;
            margin-top: 40px;
            margin-bottom: 40px;
        }

        @media (max-width: 1220px) {
            .article-view .music-sections-container {
                width: calc(100vw - 20px); /* Safely account for scrollbars */
            }
        }

        @media (max-width: 767px) {
            .music-sections-container,
            .article-view .music-sections-container {
                margin: 20px auto;
                width: 100%;
                left: 0;
                transform: none;
            }
        }

        .music-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 275px));
            gap: var(--card-padding, 12px);
            width: 100%;
            max-width: 1200px;
            justify-content: center;
        }

        /* Allow music cards placed in markdown grid cells to span the full width of the article */
        .markdown-grid > .markdown-single-card:has(.music-sections-container),
        .markdown-grid > .markdown-single-card:has(.music-embed-container) {
            grid-column: 1 / -1;
            width: 100%;
        }

        @media (max-width: 767px) {
            .music-grid {
                grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
                gap: 12px;
            }
        }

        .layout-grid.cat-music {
            position: relative;
            overflow: hidden;
            width: 100%;
            margin: 0 auto;
            box-sizing: border-box;
            transition: all var(--anim-quick) var(--ease);
            border-radius: var(--card-radius);
        }

        .layout-grid.cat-music::before {
            content: '';
            position: absolute;
            inset: -1px;
            border: 2px solid rgba(var(--bright-rgb), 0.95); /* High-contrast 2px ground truth */
            border-radius: inherit;
            pointer-events: none;
            transition: opacity var(--anim-quick) var(--ease);
            opacity: 0;
            z-index: 20;
        }

        .layout-grid.cat-music.is-playing {
            background: var(--card-bg-hover);
            z-index: 10;
            overflow: visible;
        }

        .layout-grid.cat-music.is-playing::before,
        .layout-grid.cat-music:active::before {
            opacity: 1;
        }

        .layout-grid.cat-music .row-media {
            aspect-ratio: 1/1 !important; /* Force square for album art */
            overflow: hidden;
            background: transparent;
            position: relative;
        }

        .layout-grid.cat-music .row-media iframe {
            aspect-ratio: 1/1 !important;
            width: 100% !important;
            height: 100% !important;
            border: none !important;
            outline: none !important;
            background: transparent !important;
            position: absolute;
            inset: 0;
            z-index: 2;
            /* Instant switch - no transition */
        }

        /* High-Fidelity Music Card Fallback Logic */
        .layout-grid.cat-music .row-media .music-card-fallback {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--card-bg-dark);
            opacity: 0.8; /* Restore original high-visibility punchiness */
            filter: grayscale(1);
            z-index: 1;
            box-sizing: border-box;
        }

        /* Target ONLY the placeholder icon (via class) */
        .yt-placeholder-icon {
            width: 50%;
            height: auto;
            object-fit: contain;
            display: block;
            opacity: 0.18;
            filter: grayscale(100%) brightness(0.7);
        }


        /* --- UNIFIED MEDIA ENTER TRANSITIONS (High-Fidelity) --- */
        /* This ensures that all images, videos, and embeds fade and slide into place gracefully. */
        .media-enter {
            opacity: 0;
            transform: translateY(8px) scale(0.99); /* Subtle "rising into place" effect */
            transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
            will-change: opacity, transform;
            backface-visibility: hidden;
        }

        .media-enter.loaded {
            opacity: 1;
            transform: translateY(0) scale(1);
        }

        /* The actual album art image (when loaded) */
        .layout-grid.cat-music .row-media img.media-enter {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            z-index: 2;
        }

        /* Branding Lockout: No '!important' as per Rule #1. 
           Uses parent specificity to force SVG Logo-as-Thumbnail into a centered 50% neutral state. */
        .music-sections-container .row-media img[src*="Youtube_Music_icon.svg" i] {
            width: 50%;
            height: auto;
            aspect-ratio: 1/1;
            object-fit: contain;
            position: absolute;
            inset: 0;
            margin: auto;
            opacity: 0.18;
            filter: grayscale(100%) brightness(0.7);
            transition: opacity var(--anim-quick) var(--ease), filter var(--anim-quick) var(--ease);
        }

        .music-yt-overlay {
            display: none;
            position: absolute;
            bottom: 12px;
            right: 12px;
            width: 24px;
            height: 24px;
            align-items: center;
            justify-content: center;
            z-index: 10;
            opacity: 1;
            transition: opacity 0.3s var(--ease), transform 0.2s var(--ease);
            pointer-events: auto;
            transform-origin: bottom right;
        }

        .music-yt-overlay:hover {
            transform: scale(1.15);
            opacity: 1 !important;
        }

        .layout-grid.cat-music:hover .music-yt-overlay {
            opacity: 1;
        }

        .music-yt-overlay img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        /* Marquee Effect with Selective Soft Fades (High-Fidelity) */
        .marquee-container {
            width: 100%;
            overflow: hidden;
            white-space: nowrap;
            position: relative;
            min-width: 0; /* CRITICAL: Prevent nested flex items from forcing width */
        }

        /* Show both fades only during actual scroll animation on hover */
        .layout-grid.cat-music:hover .marquee-container.has-marquee {
            mask-image: linear-gradient(to right, transparent 0%, black 30px, black calc(100% - 30px), transparent 100%);
            -webkit-mask-image: linear-gradient(to right, transparent 0%, black 30px, black calc(100% - 30px), transparent 100%);
        }

        /* If not hovering, only keep the right-hand fade to hint at more text */
        .marquee-container.has-marquee {
            mask-image: linear-gradient(to right, black 0%, black calc(100% - 30px), transparent 100%);
            -webkit-mask-image: linear-gradient(to right, black 0%, black calc(100% - 30px), transparent 100%);
        }

        .marquee-content {
            display: inline-block;
            transition: transform 0.8s ease-in-out;
            padding-right: 15px;
        }

        .layout-grid.cat-music:hover .marquee-content.should-scroll {
            animation: marquee-scroll 8s linear infinite;
        }

        @keyframes marquee-scroll {
            0% {
                transform: translateX(0);
            }

            100% {
                transform: translateX(-50%);
            }
        }

        .cat-music .card-info {
            gap: 2px; /* Tight vertical rhythm for music metadata */
            padding: var(--card-padding);
            padding-right: 45px;
            min-height: 60px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            overflow: hidden;
            position: relative;
            z-index: 2;
            background: transparent;
            min-width: 0;
        }

        .cat-music h3 {
            width: fit-content;
            display: inline-block;
            white-space: nowrap;
        }

        .cat-music .music-artist-label {
            font-size: 0.85em;
            color: var(--text-dim);
            opacity: 0.8;
            margin-top: 2px;
            font-weight: 400;
            display: inline-flex;
            align-items: center;
            white-space: nowrap;
        }

        .cat-music h3 {
            margin-bottom: 0px;
            font-size: 20px !important;
            line-height: 1.25;
            opacity: 1;
            font-weight: 600;
        }

        @media (max-width: 480px) {
            .music-card-container {
                max-width: 100%;
                margin: 20px auto;
            }
        }

        /* Mapbox & GPS Art Styles */
        .mapbox-container {
            width: 100%;
            height: 100%;
            min-height: 300px;
            background: var(--card-bg-dark);
            position: relative;
            overflow: hidden;
            border-radius: var(--card-radius);
        }

        @media (max-width: 767px) {
            .mapbox-container {
                aspect-ratio: 16 / 9;
                min-height: auto;
            }
        }

        .mapbox-container.card-preview {
            aspect-ratio: 16 / 9;
            min-height: auto;
            border-bottom: 1px solid var(--border-subtle);
            border-radius: var(--card-radius) var(--card-radius) 0 0;
        }

        .strava-link {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            color: var(--accent-strava) !important;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            text-decoration: none;
            transition: opacity 0.2s ease;
        }

        .strava-link:hover {
            opacity: 0.8;
            text-decoration: underline;
        }

        .strava-icon {
            width: 16px;
            height: 16px;
            fill: currentColor;
        }

        /* Responsive Map sizing for articles */
        .article-body .mapbox-container {
            margin: 0; /* Margin is now handled by .unified-media-wrapper for consistency */
            aspect-ratio: 16 / 9; /* Allow wide view in articles */
            min-height: 300px; 
        }

        @media (max-width: 767px) {
            .article-body .mapbox-container {
                min-height: auto;
            }
        }



        /* High-Fidelity Play Count Chip (Metadata Badge) */
        .music-stat-chip {
            margin-left: 0;
            vertical-align: middle;
            pointer-events: none;
            /* Inherit standard chip sizing but force smaller text for density */
            font-size: 10px;
            padding: 2px 8px;
            height: auto;
            line-height: 1.2;
            opacity: 0.7;
            border-radius: 50px;
            text-transform: uppercase;
            font-weight: 600;
            background: var(--surface-subtle);
            border: 1px solid var(--border-strong);
            color: var(--text-muted);
        }

        /* Ensure chips don't cause layout jumps in marquees */
        .music-artist-label {
            display: flex;
            align-items: center;
            flex-wrap: nowrap;
            gap: 8px;
        }

        /* Site Archive / Time Machine Styles */
        .archive-list-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
            justify-content: center;
            gap: 20px;
            padding: 20px 0 60px;
        }

        .archive-item-card {
            background: var(--card-bg);
            border: 1px solid var(--border-subtle);
            border-radius: var(--card-radius);
            padding: var(--card-padding);
            padding-top: 14px;
            padding-bottom: 14px;
            transition: all var(--anim-quick) var(--ease);
            cursor: pointer;
            display: flex;
            flex-direction: column;
            gap: 8px;
            position: relative;
            overflow: hidden;
            animation: fadeIn var(--anim-primary) var(--ease) forwards;
            opacity: 0;
            font-family: 'Jost', sans-serif;
        }

        .archive-item-card:hover {
            border-color: var(--border-strong);
            background: var(--card-bg-hover);
            box-shadow: var(--shadow-medium);
        }

        .archive-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .archive-item-card .hash {
            font-family: monospace;
            font-size: 10px;
            opacity: 0.9;
            letter-spacing: 0.5px;
            font-weight: 700;
        }

        .archive-item-card .date {
            font-size: 10px;
            color: var(--text-dim);
            font-weight: 500;
            font-family: 'Jost', sans-serif;
        }

        .archive-item-card .message {
            font-size: 14px;
            font-weight: 500;
            color: var(--text-bright);
            line-height: 1.3;
            margin: 0;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            font-family: 'Jost', sans-serif;
        }

        @media (max-width: 768px) {
            .archive-list-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }
            .archive-item-card {
                padding: 10px;
                gap: 6px;
            }
            .archive-item-card .message {
                font-size: 13px;
            }
        }
        
        .media-error-placeholder {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
            min-height: 180px;
            background: var(--card-bg-hover);
            color: var(--text-muted);
            gap: 12px;
            padding: 20px;
            box-sizing: border-box;
            border-radius: var(--card-radius) var(--card-radius) 0 0;
            border: none;
            text-align: center;
            user-select: none;
        }
        
        .gallery-item .media-error-placeholder {
            border-radius: 0; 
            border: none;
        }

        /* Feedback Toast Notification - Modelled after .btn-cta */
        .feedback-toast {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            padding: 10px 28px;
            border-radius: 50px; /* Pill shape to match buttons */
            font-weight: 500;
            font-size: 17px;
            z-index: 10005;
            animation: toast-flash 2.5s var(--ease) forwards;
            white-space: normal;
            text-align: center;
            max-width: 85%;
            background: var(--card-bg);
            border: 1px solid var(--border-strong);
            box-shadow: var(--shadow-medium);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            pointer-events: none;
        }

        .feedback-toast::before {
            content: '';
            position: absolute;
            inset: -1px;
            border: 2px solid transparent;
            border-radius: inherit;
            pointer-events: none;
            opacity: 0.8;
        }

        .feedback-toast.success {
            color: #00ffa3;
        }
        .feedback-toast.success::before {
            border-color: rgba(0, 255, 163, 0.4);
        }

        .feedback-toast.error {
            color: #e74c3c;
        }
        .feedback-toast.error::before {
            border-color: rgba(231, 76, 60, 0.4);
        }

        @keyframes toast-flash {
            0% { opacity: 0; transform: translate(-50%, -45%) scale(0.95); }
            10% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
            90% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
            100% { opacity: 0; transform: translate(-50%, -55%) scale(0.98); }
        }
