/* ============================================================
   DEIJS.EU — APP SHELL (2026-09-25)
   Loaded LAST (after main.css + page CSS) by includes/header.php.
   Owns ONLY the chrome: top bar, iPad rail, phone tab bar, menu
   sheet/drawer, section dots, footer polish. Page content styles
   stay in main.css / career.css / <page>.css.

   Three distinct device layouts:
     phone   ≤ 767px      compact top bar + floating tab bar + bottom sheet
     iPad    768–1199px   floating side rail (no top bar) + side drawer
     desktop ≥ 1200px     glass top bar with inline nav + side drawer
   Palette = the existing "Night in the Forest" (dark) and
   "At the Office" (light) tokens from main.css.
   ============================================================ */

:root {
    --sh-accent: var(--primary-accent, #6ee7b7);
    --sh-accent-rgb: var(--primary-accent-rgb, 110, 231, 183);
    --sh-mint: #a8d5ba;
    --sh-pistachio: #aacbc4;
    --sh-text: var(--text-primary, #faf8f5);
    --sh-muted: #b8c4b8;
    --sh-glass: rgba(20, 22, 21, 0.72);
    --sh-glass-strong: rgba(18, 21, 20, 0.92);
    --sh-surface: rgba(255, 255, 255, 0.04);
    --sh-surface-2: rgba(255, 255, 255, 0.08);
    --sh-border: rgba(170, 203, 196, 0.16);
    --sh-border-2: rgba(170, 203, 196, 0.28);
    --sh-tint: rgba(110, 231, 183, 0.12);
    --sh-shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.25);
    --sh-light-a: #aacbc4;
    --sh-light-b: #f1f7f6;

    --sh-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --sh-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --sh-safe-t: env(safe-area-inset-top, 0px);
    --sh-safe-b: env(safe-area-inset-bottom, 0px);
    --sh-safe-l: env(safe-area-inset-left, 0px);

    /* device chrome sizes — overridden per breakpoint */
    --sh-top-h: 72px;
    --sh-rail-w: 0px;
    --sh-bot-h: 0px;
}

[data-theme="light"] {
    --sh-accent: #059669;
    --sh-accent-rgb: 5, 150, 105;
    --sh-text: #1a2f28;
    --sh-muted: #4a5f56;
    --sh-glass: rgba(241, 247, 246, 0.76);
    --sh-glass-strong: rgba(248, 250, 249, 0.95);
    --sh-surface: rgba(6, 48, 40, 0.035);
    --sh-surface-2: rgba(6, 48, 40, 0.07);
    --sh-border: rgba(6, 48, 40, 0.12);
    --sh-border-2: rgba(6, 48, 40, 0.22);
    --sh-tint: rgba(5, 150, 105, 0.12);
    --sh-shadow: 0 18px 50px -22px rgba(6, 48, 40, 0.35), 0 2px 6px rgba(6, 48, 40, 0.08);
    --sh-light-a: #063028;
    --sh-light-b: #333333;
}

@media (max-width: 767px) {
    :root { --sh-top-h: calc(58px + var(--sh-safe-t)); --sh-bot-h: calc(88px + var(--sh-safe-b)); }
}
@media (min-width: 768px) and (max-width: 1199px) {
    :root { --sh-top-h: 0px; --sh-rail-w: calc(108px + var(--sh-safe-l)); }
}

/* Smooth theme cross-fade only while toggling (never on load) */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
    transition: background-color .5s var(--sh-ease), color .5s var(--sh-ease), border-color .5s var(--sh-ease), fill .5s, stroke .5s !important;
}

/* ------------------------------------------------------------
   0. BASE / A11Y
   ------------------------------------------------------------ */
body { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--sh-accent); outline-offset: 3px; border-radius: 8px; }
.skip-link {
    position: fixed; left: -9999px; top: 12px; z-index: 10001;
    padding: .8rem 1.1rem; border-radius: 12px;
    background: var(--sh-glass-strong); color: var(--sh-text);
    font: 600 .9rem var(--font-heading, Montserrat, sans-serif);
}
.skip-link:focus { left: 12px; }
#main-content { display: block; height: 0; outline: none; }
.phone-only { display: none !important; }

/* Legacy chrome that pages may still reference — never shown now */
.hud-container, .viewpoint-nav, .mobile-bottom-bar, .theme-toggle { display: none !important; }

/* Shared: brand mark + icon buttons */
.brand-mark {
    width: 40px; height: 40px; flex: none; display: grid; place-items: center;
    border-radius: 12px; text-decoration: none;
    font: 800 1.15rem/1 var(--font-heading, Montserrat, sans-serif); letter-spacing: 0;
    color: #0f1a16;
    background: linear-gradient(135deg, #6ee7b7 0%, #a8d5ba 55%, #bef264 100%);
    box-shadow: 0 8px 22px -10px rgba(110, 231, 183, .8), inset 0 1px 0 rgba(255,255,255,.45);
    transition: transform .5s var(--sh-spring);
}
[data-theme="light"] .brand-mark {
    color: #f1f7f6;
    background: linear-gradient(135deg, #063028 0%, #0d5c4a 60%, #059669 100%);
    box-shadow: 0 8px 22px -10px rgba(6, 48, 40, .6), inset 0 1px 0 rgba(255,255,255,.2);
}

.icon-btn {
    position: relative; width: 44px; height: 44px; flex: none;
    display: grid; place-items: center; padding: 0; cursor: pointer;
    border-radius: 13px; border: 1px solid var(--sh-border);
    background: var(--sh-surface); color: var(--sh-text);
    font-size: 1.05rem;
    transition: transform .35s var(--sh-spring), background-color .25s, border-color .25s, color .25s;
}
.icon-btn:hover { border-color: var(--sh-border-2); background: var(--sh-surface-2); color: var(--sh-accent); }
.icon-btn:active { transform: scale(.9); }

.theme-ico { position: relative; width: 18px; height: 18px; display: block; }
.theme-ico i { position: absolute; inset: 0; display: grid; place-items: center; transition: transform .6s var(--sh-spring), opacity .35s; }
[data-theme="dark"] .theme-ico .ico-sun,
[data-theme="light"] .theme-ico .ico-moon { opacity: 0; transform: rotate(-90deg) scale(.4); }

/* Pulsing light (kept from the original header, reused on every bar) */
.header-border-light, .tabbar-light, .rail-light { position: absolute; overflow: hidden; pointer-events: none; }
.header-border-light::before, .tabbar-light::before, .rail-light::before {
    content: ''; position: absolute;
    background: linear-gradient(90deg, transparent 0%, var(--sh-light-a) 30%, var(--sh-light-b) 50%, var(--sh-light-a) 70%, transparent 100%);
}
.header-border-light::before, .tabbar-light::before {
    top: 0; left: -100%; width: 100%; height: 100%;
    animation: borderLightPulse 4s ease-in-out infinite;
}
.rail-light::before {
    left: 0; top: -100%; width: 100%; height: 100%;
    background: linear-gradient(180deg, transparent 0%, var(--sh-light-a) 30%, var(--sh-light-b) 50%, var(--sh-light-a) 70%, transparent 100%);
    animation: shRailLight 5s ease-in-out infinite;
}
@keyframes shRailLight { 0% { top: -100%; } 100% { top: 100%; } }

/* ------------------------------------------------------------
   1. TOP BAR (desktop + phone)
   ------------------------------------------------------------ */
.topbar {
    position: fixed; z-index: 1000; top: 0; left: 0; right: 0;
    height: var(--sh-top-h); padding-top: var(--sh-safe-t);
    padding-inline: clamp(16px, 3vw, 40px);
    display: flex; align-items: center; gap: 1rem;
    background: var(--sh-glass);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    backdrop-filter: blur(22px) saturate(170%);
    border-bottom: 1px solid var(--sh-border);
    transition: transform .45s var(--sh-ease), background-color .4s, border-color .4s, box-shadow .4s;
}
.topbar[data-solid="true"] { background: var(--sh-glass-strong); box-shadow: 0 10px 30px -20px rgba(0,0,0,.6); }
.topbar .header-border-light { left: 0; right: 0; bottom: -1px; height: 2px; }

/* Floating peachy clouds (kept from the original dark header) */
[data-theme="dark"] .topbar::before,
[data-theme="dark"] .topbar::after {
    content: ''; position: absolute; pointer-events: none; z-index: 0;
    border-radius: 50%;
}
[data-theme="dark"] .topbar::before {
    top: -60%; left: -10%; width: 55%; height: 220%;
    background: radial-gradient(ellipse at center, rgba(255,180,120,.08) 0%, rgba(255,200,150,.035) 40%, transparent 70%);
    animation: floatCloud 15s ease-in-out infinite;
}
[data-theme="dark"] .topbar::after {
    top: -40%; right: -8%; width: 45%; height: 200%;
    background: radial-gradient(ellipse at center, rgba(255,220,180,.06) 0%, rgba(255,180,120,.03) 50%, transparent 70%);
    animation: floatCloud 20s ease-in-out infinite reverse;
}
.topbar > * { position: relative; z-index: 1; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; min-width: 0; margin-right: auto; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-word {
    font: 700 1.2rem/1 var(--font-heading, Montserrat, sans-serif);
    letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}
.brand-word .logo-highlight { color: #a8d5ba; }
.brand-word .logo-eu { color: #ffffff; }
[data-theme="light"] .brand-word .logo-highlight { color: #3d4d1c; }
[data-theme="light"] .brand-word .logo-eu { color: #333333; }

.topnav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: center; gap: 2px; padding: 4px; border-radius: 16px; background: var(--sh-surface); border: 1px solid var(--sh-border); }
.topnav a {
    position: relative; padding: .6rem .95rem; border-radius: 12px; text-align: center;
    font: 500 .9rem/1 var(--font-heading, Montserrat, sans-serif); letter-spacing: .02em;
    color: var(--sh-muted); text-decoration: none; white-space: nowrap;
    transition: color .25s, background-color .25s;
}
.topnav a:hover { color: var(--sh-text); background: var(--sh-surface-2); }
.topnav a[aria-current="page"] {
    color: var(--sh-text); background: var(--sh-tint);
    box-shadow: inset 0 0 0 1px rgba(var(--sh-accent-rgb), .28);
}
.topnav a[aria-current="page"]::after {
    content: ''; position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; margin-left: -2.5px;
    border-radius: 50%; background: var(--sh-accent); box-shadow: 0 0 10px var(--sh-accent);
}

.topbar-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.mode-chip {
    display: flex; align-items: center; gap: .65rem; height: 44px; padding: 0 1rem 0 .8rem;
    border-radius: 13px; border: 1px solid var(--sh-border); background: var(--sh-surface);
    color: var(--sh-text); cursor: pointer; text-align: left;
    transition: border-color .25s, background-color .25s, transform .35s var(--sh-spring);
}
.mode-chip:hover { border-color: rgba(var(--sh-accent-rgb), .5); background: var(--sh-tint); }
.mode-chip:active { transform: scale(.96); }
.mode-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sh-accent); box-shadow: 0 0 0 4px rgba(var(--sh-accent-rgb), .16); animation: shPulse 2.4s ease-in-out infinite; }
@keyframes shPulse { 50% { box-shadow: 0 0 0 7px rgba(var(--sh-accent-rgb), 0); } }
.mode-text { display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.mode-label { font: 700 .66rem/1 var(--font-heading, Montserrat, sans-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--sh-accent); white-space: nowrap; }
.mode-time { font: 500 .8rem/1 var(--font-body, Roboto, sans-serif); font-variant-numeric: tabular-nums; color: var(--sh-muted); letter-spacing: .06em; }

/* desktop tightening */
@media (min-width: 1200px) and (max-width: 1379px) {
    .brand-word { display: none; }
    .topnav a { padding: .6rem .75rem; }
}
/* hide the top bar's inline nav below desktop */
@media (max-width: 1199px) { .topnav, .mode-chip { display: none !important; } }

/* phone top bar: compact + auto-hide */
@media (max-width: 767px) {
    .phone-only { display: grid !important; }
    .topbar { padding-inline: 16px; gap: 8px; }
    .topbar[data-hidden="true"] { transform: translateY(-105%); }
    .brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 1.05rem; }
    .brand-word { font-size: 1.02rem; }
    .topbar .icon-btn { width: 42px; height: 42px; border-radius: 12px; }
    #navToggle { display: none; } /* "More" lives in the tab bar on phones */
}
/* iPad: rail instead of a top bar */
@media (min-width: 768px) and (max-width: 1199px) { .topbar { display: none !important; } }

/* ------------------------------------------------------------
   2. iPAD SIDE RAIL
   ------------------------------------------------------------ */
.rail { display: none; }
@media (min-width: 768px) and (max-width: 1199px) {
    .rail {
        position: fixed; z-index: 1000;
        left: calc(12px + var(--sh-safe-l)); top: calc(12px + var(--sh-safe-t)); bottom: calc(12px + var(--sh-safe-b));
        width: 84px; padding: 12px 8px;
        display: flex; flex-direction: column; align-items: center; gap: 6px;
        border-radius: 28px; border: 1px solid var(--sh-border);
        background: var(--sh-glass);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
        backdrop-filter: blur(24px) saturate(180%);
        box-shadow: var(--sh-shadow);
        overflow: hidden;
        animation: shRailIn .9s var(--sh-ease) .15s both;
    }
    body { padding-left: var(--sh-rail-w); }
}
@keyframes shRailIn { from { transform: translateX(-140%); } }
.rail-light { top: 18px; bottom: 18px; right: -1px; width: 2px; }
.rail-brand { margin-bottom: 8px; width: 48px; height: 48px; border-radius: 15px; font-size: 1.3rem; }
.rail-brand:hover { transform: rotate(-8deg) scale(1.06); }
.rail-nav { display: flex; flex-direction: column; gap: 4px; width: 100%; overflow-y: auto; scrollbar-width: none; flex: 1 1 auto; min-height: 0; }
.rail-nav::-webkit-scrollbar { display: none; }
.rail-tools {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    width: 100%; padding-top: 10px; border-top: 1px solid var(--sh-border);
}
.rail-tools .icon-btn { width: 52px; height: 52px; border-radius: 16px; }
.rail-time { font: 600 .72rem/1 var(--font-body, Roboto, sans-serif); font-variant-numeric: tabular-nums; letter-spacing: .08em; color: var(--sh-accent); padding: 4px 0 2px; }
@media (min-width: 768px) and (max-width: 1199px) and (max-height: 700px) {
    .rail-time { display: none; }
    .rail .tab { min-height: 52px; }
    .rail .tab span { display: none; }
}

/* Tabs — shared by the rail and the phone bar */
.tab {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    min-height: 60px; width: 100%; padding: 6px 2px;
    border: 0; border-radius: 18px; background: none; cursor: pointer;
    font: 600 .7rem/1.1 var(--font-heading, Montserrat, sans-serif); letter-spacing: .02em;
    color: var(--sh-muted); text-decoration: none; text-align: center;
    transition: color .25s, background-color .25s, transform .35s var(--sh-spring);
}
.tab i { font-size: 1.15rem; transition: transform .45s var(--sh-spring), color .25s; }
.tab:hover { color: var(--sh-text); }
.tab:active { transform: scale(.9); }
.tab[aria-current="page"] { color: var(--sh-text); }
.tab[aria-current="page"] i { color: var(--sh-accent); transform: translateY(-1px) scale(1.1); }
.rail .tab:hover { background: var(--sh-surface-2); }
.rail .tab[aria-current="page"] { background: var(--sh-tint); box-shadow: inset 0 0 0 1px rgba(var(--sh-accent-rgb), .25); }
.rail .tab[aria-current="page"]::before {
    content: ''; position: absolute; left: -8px; top: 50%; width: 4px; height: 26px; margin-top: -13px;
    border-radius: 0 4px 4px 0; background: var(--sh-accent); box-shadow: 0 0 12px var(--sh-accent);
}

/* ------------------------------------------------------------
   3. PHONE FLOATING TAB BAR
   ------------------------------------------------------------ */
.tabbar { display: none; }
@media (max-width: 767px) {
    .tabbar {
        position: fixed; z-index: 1000;
        left: 12px; right: 12px; bottom: calc(10px + var(--sh-safe-b));
        height: 70px; padding: 7px;
        display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
        border-radius: 26px; border: 1px solid var(--sh-border);
        background: var(--sh-glass);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
        backdrop-filter: blur(24px) saturate(180%);
        box-shadow: var(--sh-shadow);
        overflow: hidden;
        animation: shBarIn .9s var(--sh-ease) .2s both;
    }
    .tabbar .tab { min-height: 56px; border-radius: 19px; font-size: .68rem; }
    body { padding-bottom: var(--sh-bot-h); }
}
@keyframes shBarIn { from { transform: translateY(150%); } }
.tabbar-light { top: 0; left: 22px; right: 22px; height: 1.5px; }
.tabbar-ind {
    position: absolute; z-index: 0; left: 0; top: 7px; height: 56px; width: 0;
    border-radius: 19px; opacity: 0;
    background: var(--sh-tint); box-shadow: inset 0 0 0 1px rgba(var(--sh-accent-rgb), .25);
    transition: transform .55s var(--sh-spring), width .35s var(--sh-ease), opacity .3s;
}
body.menu-open #mobileMenuBtn { color: var(--sh-text); }
body.menu-open #mobileMenuBtn i { color: var(--sh-accent); }

/* ------------------------------------------------------------
   4. MENU: bottom sheet (phone) / side drawer (iPad + desktop)
   ------------------------------------------------------------ */
.sheet-scrim {
    position: fixed; inset: 0; z-index: 1990;
    background: rgba(5, 10, 8, .5);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    opacity: 0; transition: opacity .4s var(--sh-ease);
}
body.menu-open .sheet-scrim { opacity: 1; }
body.menu-open { overflow: hidden; }

/* override the old full-screen .menu-overlay from main.css */
.menu-overlay.sheet {
    position: fixed; z-index: 2000; inset: auto;
    top: calc(12px + var(--sh-safe-t)); right: 12px; bottom: calc(12px + var(--sh-safe-b)); left: auto;
    width: min(420px, calc(100vw - 24px)); height: auto;
    padding: 0; margin: 0;
    display: flex; flex-direction: column;
    border-radius: 28px; border: 1px solid var(--sh-border);
    background: var(--sh-glass-strong) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    backdrop-filter: blur(28px) saturate(180%);
    box-shadow: 0 40px 100px -30px rgba(0,0,0,.8);
    color: var(--sh-text);
    opacity: 1; visibility: hidden;
    transform: translateX(calc(100% + 24px));
    transition: transform .55s var(--sh-ease), visibility 0s linear .55s;
    overflow: hidden;
}
.menu-overlay.sheet.active { visibility: visible; transform: none; transition: transform .55s var(--sh-ease), visibility 0s; }

.sheet-grip { display: none; }
.sheet-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 18px 18px 12px 24px; flex: none;
}
.sheet-title { font: 800 1.35rem/1 var(--font-heading, Montserrat, sans-serif); letter-spacing: .02em; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 18px 22px; -webkit-overflow-scrolling: touch; }
.sheet-row { margin-bottom: 14px; }

.seg { display: flex; width: 100%; gap: 3px; padding: 4px; border-radius: 16px; background: var(--sh-surface); border: 1px solid var(--sh-border); }
.seg button {
    flex: 1; min-height: 46px; padding: 0 .5rem; border: 0; border-radius: 12px; background: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    font: 600 .8rem/1.1 var(--font-heading, Montserrat, sans-serif); letter-spacing: .02em; color: var(--sh-muted);
    transition: background-color .3s, color .3s, box-shadow .3s;
}
.seg button[aria-pressed="true"] { background: var(--sh-tint); color: var(--sh-text); box-shadow: inset 0 0 0 1px rgba(var(--sh-accent-rgb), .35); }
.seg button[aria-pressed="true"] i { color: var(--sh-accent); }

.header-translator { margin: 0 0 8px; min-height: 0; }
.header-translator:empty { display: none; }

.sheet-group { margin-top: 18px; }
.sheet-group h3 {
    margin: 0 0 10px 4px; font: 700 .7rem/1 var(--font-heading, Montserrat, sans-serif);
    letter-spacing: .18em; text-transform: uppercase; color: var(--sh-accent);
}
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet-link {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
    min-height: 88px; padding: 14px; border-radius: 18px;
    background: var(--sh-surface); border: 1px solid var(--sh-border);
    color: var(--sh-text); text-decoration: none;
    font: 600 .86rem/1.25 var(--font-heading, Montserrat, sans-serif);
    transition: transform .35s var(--sh-spring), border-color .25s, background-color .25s;
}
.sheet-link i {
    width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px;
    background: var(--sh-tint); color: var(--sh-accent); font-size: .95rem;
}
.sheet-link:hover { border-color: rgba(var(--sh-accent-rgb), .45); background: var(--sh-surface-2); }
.sheet-link:active { transform: scale(.96); }
.sheet-link[aria-current="page"] { border-color: rgba(var(--sh-accent-rgb), .55); background: var(--sh-tint); }
.sheet-link.is-danger, .sheet-link.is-danger i { color: #ff6b6b; }

/* staggered entrance of groups */
.menu-overlay.sheet .sheet-group, .menu-overlay.sheet .sheet-row { opacity: 0; transform: translateY(10px); transition: opacity .4s, transform .5s var(--sh-ease); }
.menu-overlay.sheet.active .sheet-group, .menu-overlay.sheet.active .sheet-row { opacity: 1; transform: none; }
.menu-overlay.sheet.active .sheet-group:nth-of-type(1) { transition-delay: .08s; }
.menu-overlay.sheet.active .sheet-group:nth-of-type(2) { transition-delay: .13s; }
.menu-overlay.sheet.active .sheet-group:nth-of-type(3) { transition-delay: .18s; }
.menu-overlay.sheet.active .sheet-group:nth-of-type(4) { transition-delay: .23s; }
.menu-overlay.sheet.active .sheet-group:nth-of-type(5) { transition-delay: .28s; }
.menu-overlay.sheet.active .sheet-group:nth-of-type(6) { transition-delay: .33s; }
.menu-overlay.sheet.active .sheet-group:nth-of-type(7) { transition-delay: .38s; }

/* iPad: drawer slides out from beside the rail */
@media (min-width: 768px) and (max-width: 1199px) {
    .menu-overlay.sheet { left: calc(108px + var(--sh-safe-l)); right: auto; transform: translateX(calc(-100% - 140px)); }
}

/* phone: true bottom sheet */
@media (max-width: 767px) {
    .menu-overlay.sheet {
        top: auto; left: 0; right: 0; bottom: 0;
        width: 100%; max-height: calc(92dvh - var(--sh-safe-t));
        border-radius: 30px 30px 0 0; border-bottom: 0;
        transform: translateY(105%);
    }
    .sheet-grip { display: block; width: 40px; height: 5px; border-radius: 3px; margin: 10px auto 0; background: var(--sh-border-2); flex: none; }
    .sheet-head { padding: 10px 16px 10px 22px; cursor: grab; }
    .sheet-body { padding: 4px 16px calc(24px + var(--sh-safe-b)); }
    .sheet-link { min-height: 80px; }
}

/* ------------------------------------------------------------
   5. SECTION NAVIGATOR
      desktop: vertical dots with hover labels (right edge)
      iPad + phone: compact pill  [ ↑  02/08  ↓ ]  bottom-right
   ------------------------------------------------------------ */
.dots {
    position: fixed; z-index: 990;
    display: flex; align-items: center;
    border-radius: 999px;
    background: var(--sh-glass); border: 1px solid var(--sh-border);
    -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
    box-shadow: var(--sh-shadow);
    transition: opacity .35s, transform .45s var(--sh-ease);
}
.dots[hidden] { display: none; }
.dots-track { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dots-track button { position: relative; width: 26px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.dots-track i {
    display: block; width: 7px; height: 7px; border-radius: 99px;
    background: transparent; border: 1.5px solid var(--sh-muted);
    transition: height .5s var(--sh-spring), background-color .3s, border-color .3s, box-shadow .3s;
}
.dots-track button[aria-current="true"] { height: 34px; }
.dots-track button[aria-current="true"] i { height: 22px; background: var(--sh-accent); border-color: var(--sh-accent); box-shadow: 0 0 12px rgba(var(--sh-accent-rgb), .6); }
.dots-track button::before {
    content: attr(data-label); position: absolute; right: 38px; top: 50%;
    transform: translate(8px, -50%); opacity: 0; pointer-events: none;
    padding: .45rem .75rem; border-radius: 10px; white-space: nowrap;
    background: var(--sh-glass-strong); border: 1px solid var(--sh-border); box-shadow: var(--sh-shadow);
    font: 600 .78rem/1 var(--font-heading, Montserrat, sans-serif); letter-spacing: .04em; color: var(--sh-text);
    transition: opacity .2s, transform .3s var(--sh-ease);
}
@media (hover: hover) { .dots-track button:hover::before { opacity: 1; transform: translate(0, -50%); } }
.dots-count { font: 600 .66rem/1 var(--font-body, Roboto, sans-serif); letter-spacing: .04em; color: var(--sh-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dots-count b { color: var(--sh-text); font-weight: 700; }
.dots-step {
    width: 40px; height: 40px; flex: none; display: grid; place-items: center; padding: 0; cursor: pointer;
    border: 0; border-radius: 50%; background: none; color: var(--sh-text); font-size: .85rem;
    transition: background-color .25s, color .25s, transform .3s var(--sh-spring), opacity .25s;
}
.dots-step:hover { background: var(--sh-surface-2); color: var(--sh-accent); }
.dots-step:active { transform: scale(.88); }
.dots-step:disabled { opacity: .3; pointer-events: none; }

/* desktop: vertical dots */
@media (min-width: 1200px) {
    .dots { right: clamp(10px, 1.2vw, 22px); top: 50%; transform: translateY(-50%); flex-direction: column; gap: 6px; padding: 10px 4px; animation: shDotsIn .8s var(--sh-ease) .5s both; }
    .dots-step { display: none; }
    .dots-count { writing-mode: vertical-rl; margin-top: 2px; }
    .dots-count span { opacity: .7; }
}
@keyframes shDotsIn { from { opacity: 0; transform: translate(20px, -50%); } }

/* iPad + phone: vertical stepper at the right middle, thumb-sized */
@media (max-width: 1199px) {
    .dots {
        flex-direction: column; gap: 2px; padding: 5px;
        right: 10px; top: 50%; bottom: auto; transform: translateY(-50%);
        border-radius: 22px;
        animation: shStepIn .8s var(--sh-ease) .6s both;
    }
    .dots-track { display: none; }
    .dots-step { width: 48px; height: 48px; border-radius: 16px; font-size: 1rem; }
    .dots-count { min-width: 0; padding: 4px 0; text-align: center; font-size: .72rem; line-height: 1.25; display: flex; flex-direction: column; }
    .dots-count span { opacity: .7; }
}
@keyframes shStepIn { from { opacity: 0; transform: translate(24px, -50%); } }
@keyframes shPillIn { from { opacity: 0; transform: translateY(24px); } }
@media (max-width: 767px) {
    .dots { right: 6px; padding: 4px; border-radius: 20px; }
    .dots-step { width: 44px; height: 44px; border-radius: 14px; }
    body.menu-open .dots { opacity: 0; pointer-events: none; }
}

/* Loader: only on the first page of a visit */
html.is-returning #loading-screen { display: none !important; }

/* ------------------------------------------------------------
   6. FOOTER POLISH (same content, cleaner layout per device)
   ------------------------------------------------------------ */
footer { padding: clamp(40px, 6vw, 72px) clamp(20px, 4vw, 48px) 28px !important; }
.footer-content { max-width: 1200px; display: grid !important; grid-template-columns: minmax(240px, 1.2fr) 3fr; gap: clamp(28px, 4vw, 64px) !important; }
.footer-links { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px !important; }
.footer-column-title { font-family: var(--font-heading, Montserrat, sans-serif); letter-spacing: .16em; text-transform: uppercase; font-size: .72rem !important; color: var(--sh-accent) !important; margin-bottom: 14px !important; }
.footer-column-list { list-style: none; margin: 0; padding: 0; }
.footer-column-list li { margin: 0 0 10px; }
.footer-column-list a { color: var(--text-secondary); text-decoration: none; font-size: .92rem; transition: color .2s; }
.footer-column-list a:hover { color: var(--sh-accent); }
.footer-bottom { max-width: 1200px; margin: 36px auto 0 !important; padding-top: 20px !important; border-top: 1px solid var(--sh-border); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.social-link, .back-to-top { border-radius: 13px !important; }

@media (min-width: 768px) and (max-width: 1199px) {
    .footer-content { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
    footer { padding: 36px 20px 20px !important; }
    .footer-content { grid-template-columns: 1fr; }
    .footer-links { grid-template-columns: 1fr 1fr; gap: 22px 16px !important; }
    .footer-tagline { max-width: none !important; }
}

/* ------------------------------------------------------------
   7. SMALL GLOBAL NICETIES
   ------------------------------------------------------------ */
/* Section anchors land below the fixed chrome */
[data-viewpoint], section[id] { scroll-margin-top: var(--sh-top-h); }
/* Loading screen fades a little quicker */
#loading-screen { transition: opacity .6s var(--sh-ease), visibility .6s var(--sh-ease) !important; }
/* Custom cursor only on real mice */
@media (hover: none), (pointer: coarse) { .cursor-dot { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
    .rail, .tabbar, .dots { animation: none !important; }
    .header-border-light::before, .tabbar-light::before, .rail-light::before,
    [data-theme="dark"] .topbar::before, [data-theme="dark"] .topbar::after, .mode-dot { animation: none !important; }
}

/* Print: never print the chrome */
@media print {
    .topbar, .rail, .tabbar, .dots, .sheet, .sheet-scrim, .skip-link, #particles-canvas, #loading-screen, .cursor-dot { display: none !important; }
    body { padding: 0 !important; }
}

/* ------------------------------------------------------------
   8. SPECIFICITY GUARDS — some page CSS styles every <a>
      (e.g. ".timeline-page a { color: accent }"); keep the chrome neutral.
   ------------------------------------------------------------ */
body .rail .tab, body .tabbar .tab { color: var(--sh-muted); }
body .rail .tab[aria-current="page"], body .tabbar .tab[aria-current="page"] { color: var(--sh-text); }
body .rail .tab:hover, body .tabbar .tab:hover { color: var(--sh-text); }
body .topbar .topnav a { color: var(--sh-muted); }
body .topbar .topnav a:hover, body .topbar .topnav a[aria-current="page"] { color: var(--sh-text); }
body .sheet .sheet-link { color: var(--sh-text); }
body .sheet .sheet-link.is-danger { color: #ff6b6b; }
body .rail a.rail-brand, body .topbar a.brand-mark { color: #0f1a16; }
[data-theme="light"] body .rail a.rail-brand { color: #f1f7f6; }
body .topbar a.brand { color: inherit; }

/* Pages with many sections (e.g. timelines): vertical stepper on desktop too */
@media (min-width: 1200px) {
    .dots.dots--many { top: 50%; bottom: auto; right: 16px; transform: translateY(-50%); flex-direction: column; gap: 2px; padding: 5px; border-radius: 22px; animation: shStepIn .8s var(--sh-ease) .6s both; }
    .dots.dots--many .dots-track { display: none; }
    .dots.dots--many .dots-step { display: grid; width: 48px; height: 48px; border-radius: 16px; }
    .dots.dots--many .dots-count { writing-mode: horizontal-tb; margin: 0; padding: 4px 0; text-align: center; font-size: .72rem; line-height: 1.25; display: flex; flex-direction: column; }
}

/* Touch targets: nothing tappable under 44px on touch screens */
@media (pointer: coarse) {
    .topbar .icon-btn { width: 44px; height: 44px; }
    .footer-column-list a { display: inline-flex; align-items: center; min-height: 44px; }
    .footer-column-list li { margin: 0; }
    .social-link, .back-to-top { min-width: 44px; min-height: 44px; }
}

/* ------------------------------------------------------------
   9. TOUCH FLOOR (2026-09-26) — every tappable thing ≥ 44px on
      touch screens (Apple HIG / WCAG 2.5.5), found by an audit
      of all pages at 390px.
   ------------------------------------------------------------ */
@media (pointer: coarse) {
    .topbar a.brand, a.footer-logo-link { min-height: 44px; display: inline-flex; align-items: center; }
    .footer-column-list a { min-width: 44px; }
    .inline-btn { min-width: 44px; min-height: 44px; }
    .ctl { min-width: 44px !important; min-height: 44px !important; }
    .filter-btn { min-height: 44px; padding-inline: 1rem; }
    .day-btn { min-height: 44px; }
    .text-link, .btn.btn-ghost, .btn-download { min-height: 44px; display: inline-flex; align-items: center; }
    .resume-doc a, .resume-fallback a { min-height: 44px; display: inline-flex; align-items: center; }
    input[type="checkbox"], input[type="radio"] { width: 24px !important; height: 24px !important; flex: none; }
    /* carousel dots: keep them small visually, give them a 44px hit area */
    .swiper-pagination-bullet { position: relative; margin: 0 10px !important; }
    .swiper-pagination-bullet::after { content: ''; position: absolute; inset: -18px; }
    /* scroll-down chevrons become real buttons */
    .timeline-hero-scroll-hint, .scroll-hint, .hero-scroll-btn {
        min-width: 48px; min-height: 48px; display: grid; place-items: center; border-radius: 16px;
    }
    /* timeline links inside cards */
    .timeline-page .content-left a, .timeline-page .content-right a { display: inline-flex; min-height: 44px; align-items: center; }
}

/* Contact / CV button on both timelines: larger rounded square, top right */
.btn-cta-tl { min-height: 50px; border-radius: 16px !important; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: 0 1.15rem !important; }
.private-timeline-page .nav-overlay-timeline { top: calc(var(--sh-top-h, 72px) + 16px); right: 24px; }
@media (min-width: 768px) and (max-width: 1199px) { .private-timeline-page .nav-overlay-timeline { top: 20px; right: 20px; } }
@media (max-width: 767px) { .private-timeline-page .nav-overlay-timeline { top: calc(var(--sh-top-h, 58px) + 12px); right: 12px; } }
