/* =====================================================================
   THE ECKERSLEYS — "GRID" theme (TRON-inspired)  ·  tron.css  ·  v1
   Shared by the hub (/) and the lightshow (/lightshow/).

   Contents
     0  Registered properties
     1  Design tokens  (colours, type, timing — tweak neon HERE)
     2  Base + background layers
     3  Navigation
     4  Hero
     5  Buttons
     6  Holographic panels
     7  Hub cards
     8  Lightshow sections
     9  Footer
    10  Motion (keyframes, scroll reveals)
    11  Responsive
    12  "Daylight" theme (the light-mode toggle)
    13  FX off / reduced motion

   Tuning cheat-sheet
     Neon colours ........ --cyan / --blue / --ice / --orange / --purple below
                           (+ the --fx-* RGB triplets, which drive the canvas)
     Effect intensity .... --fx-intensity (0 = none, 1 = default, 1.4 = punchy)
     Intro speed ......... --ts (1 = full 2s intro, 0.3 = quick)
     Or use the "FX" button in the nav: Full → Calm → Off
   ===================================================================== */

/* ---------------------------------------------------------------------
   0 · Registered properties (lets gradients/colours animate + transition)
   --------------------------------------------------------------------- */
@property --a    { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --hl   { syntax: '<color>'; inherits: false; initial-value: rgba(0, 245, 255, 0); }
@property --edge { syntax: '<color>'; inherits: true;  initial-value: rgba(0, 245, 255, 0.3); }

/* ---------------------------------------------------------------------
   1 · Design tokens
   --------------------------------------------------------------------- */
:root {
    /* surfaces */
    --void:     #020408;
    --midnight: #050D18;
    --steel:    #0A1828;

    /* illumination */
    --cyan: #00F5FF;
    --blue: #00AFFF;
    --ice:  #8AEEFF;

    /* accents — use sparingly */
    --orange: #FF6A00;
    --purple: #8A2BE2;
    --white:  #F2FCFF;

    /* the family's bulb colours (kept for the little LED / diamond accents) */
    --bulb-yellow: #ffc72c;
    --bulb-green:  #2eb85c;
    --bulb-red:    #e5382e;
    --bulb-blue:   #2f7fe0;
    --bulb-purple: #8e44e0;

    /* semantic */
    --bg:          var(--void);
    --text:        #E4F6FA;
    --text-strong: var(--white);
    --text-muted:  #9DC0CC;
    --accent:      var(--cyan);        /* accent used for TEXT */
    --accent-rgb:  0, 245, 255;        /* accent used for GLOWS */
    --edge:        rgba(0, 245, 255, 0.30);
    --edge-hot:    rgba(0, 245, 255, 0.95);
    --panel:       rgba(5, 13, 24, 0.93);
    --panel-2:     rgba(10, 24, 40, 0.93);
    --nav-bg:      rgba(2, 4, 8, 0.74);
    --nav-solid:   rgba(3, 8, 16, 0.98);
    --btn-ink:     #E9FDFF;
    --btn-fill:    rgba(2, 10, 20, 0.86);
    --grid-line:   rgba(0, 245, 255, 0.07);
    --halo:        var(--void);        /* text-halo colour over moving light */

    /* per-card accent (overridden by [data-accent]) */
    --cr: 0, 245, 255;                 /* glow rgb */
    --ct: 0, 245, 255;                 /* text rgb */

    /* canvas engine (fx.js reads these) */
    --fx-cyan:   0, 245, 255;
    --fx-blue:   0, 175, 255;
    --fx-ice:    138, 238, 255;
    --fx-orange: 255, 106, 0;
    --fx-purple: 138, 43, 226;
    --fx-blend:  lighter;
    --fx-intensity: 1;

    /* intro time-scale: 1 = full cinematic intro, smaller = faster */
    --ts: 1;

    /* type */
    --font-display: "Orbitron", "Eurostile", "Bank Gothic", "Segoe UI", system-ui, sans-serif;
    --font-body:    "Exo 2", "Segoe UI", system-ui, sans-serif;
    --font-label:   "Rajdhani", "Arial Narrow", "Segoe UI", sans-serif;

    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    color-scheme: dark;
}

[data-accent="cyan"]   { --cr: 0, 245, 255;   --ct: 0, 245, 255; }
[data-accent="orange"] { --cr: 255, 106, 0;   --ct: 255, 138, 56; }
[data-accent="purple"] { --cr: 138, 43, 226;  --ct: 196, 160, 255; }
[data-accent="ice"]    { --cr: 138, 238, 255; --ct: 138, 238, 255; }
[data-accent="blue"]   { --cr: 0, 175, 255;   --ct: 110, 205, 255; }

/* the intro plays once per session; a quick version on routine navigation */
html.intro-seen { --ts: 0.3; }

/* ---------------------------------------------------------------------
   2 · Base + background layers
   --------------------------------------------------------------------- */
* { box-sizing: border-box; }

html {
    background: var(--void);
    scroll-behavior: smooth;
    scrollbar-color: rgba(0, 245, 255, 0.45) var(--void);
}

body {
    margin: 0;
    position: relative;
    isolation: isolate;
    overflow-x: clip;
    min-height: 100vh;
    font: 400 1.02rem/1.65 var(--font-body);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(0, 245, 255, 0.28); color: #fff; }

h1, h2, h3 { margin: 0; }
img { max-width: 100%; }

/* atmosphere: deep gradient + soft coloured bloom (cheap, always on) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background:
        radial-gradient(1100px 620px at 50% -8%, rgba(0, 175, 255, 0.17), transparent 62%),
        radial-gradient(800px 560px at 92% 108%, rgba(138, 43, 226, 0.11), transparent 62%),
        radial-gradient(800px 560px at 6% 104%, rgba(255, 106, 0, 0.06), transparent 62%),
        linear-gradient(180deg, var(--midnight), var(--void) 58%);
}

/* fallback grid for no-JS / FX off / reduced motion */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 56px 56px,
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 56px 56px;
    -webkit-mask-image: linear-gradient(180deg, transparent 8%, #000 62%, transparent 100%);
            mask-image: linear-gradient(180deg, transparent 8%, #000 62%, transparent 100%);
}
html.fx-on body::after { display: none; }

/* the canvas engine's surface */
#fx {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* decorative light rails down both edges (wide screens) */
.rail {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 1px;
    z-index: 5;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(0, 245, 255, 0.22) 14%, rgba(0, 245, 255, 0.22) 86%, transparent);
    display: none;
}
.rail::after {
    content: "";
    position: absolute;
    left: -1px;
    width: 3px;
    height: 130px;
    top: 0;
    border-radius: 3px;
    background: linear-gradient(180deg, transparent, var(--ice), #fff 55%, transparent);
    box-shadow: 0 0 14px 2px rgba(0, 245, 255, 0.7);
    transform: translateY(calc(var(--p, 0) * (100vh - 130px)));
    opacity: 0.85;
}
.rail-l { left: 18px; }
.rail-r { right: 18px; }
@media (min-width: 1180px) { .rail { display: block; } }

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    left: 1rem;
    top: -4rem;
    z-index: 300;
    padding: 0.7rem 1.1rem;
    background: var(--midnight);
    color: var(--ice);
    border: 1px solid var(--edge-hot);
    font: 600 0.9rem var(--font-label);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus { top: 0.8rem; }

:focus-visible {
    outline: 2px solid var(--ice);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px rgba(0, 245, 255, 0.22);
    border-radius: 2px;
}

a { color: var(--accent); }

section[id] { scroll-margin-top: 84px; }

/* ---------------------------------------------------------------------
   3 · Navigation
   --------------------------------------------------------------------- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem clamp(0.9rem, 3vw, 2rem);
    background: var(--nav-bg);
    -webkit-backdrop-filter: blur(10px) saturate(1.25);
            backdrop-filter: blur(10px) saturate(1.25);
}

/* the illuminated border — draws itself in from the centre */
.site-nav::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 245, 255, 0.5) 18%, var(--ice) 50%, rgba(0, 245, 255, 0.5) 82%, transparent);
    box-shadow: 0 0 14px rgba(0, 245, 255, 0.35);
    transform-origin: 50% 50%;
    animation: nav-line calc(0.95s * var(--ts)) var(--ease) both;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-strong);
    text-decoration: none;
    white-space: nowrap;
}
.brand img { filter: drop-shadow(0 0 8px rgba(0, 245, 255, 0.45)); }
.brand span {
    font: 700 0.92rem/1 var(--font-display);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.site-nav nav {
    position: relative;
    margin-left: auto;
    display: flex;
    gap: 0.15rem;
    align-items: center;
}

.site-nav nav a {
    position: relative;
    padding: 0.5rem 0.85rem;
    font: 600 0.95rem/1 var(--font-label);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
    animation: rise calc(0.6s * var(--ts)) var(--ease) calc((0.25s + var(--i, 0) * 0.08s) * var(--ts)) both;
}
.site-nav nav a:nth-child(1) { --i: 0; }
.site-nav nav a:nth-child(2) { --i: 1; }
.site-nav nav a:nth-child(3) { --i: 2; }
.site-nav nav a:nth-child(4) { --i: 3; }
.site-nav nav a:nth-child(5) { --i: 4; }

.site-nav nav a:hover,
.site-nav nav a:focus-visible,
.site-nav nav a[aria-current="true"] { color: var(--text-strong); }

/* hover: a light travels along the underline */
.site-nav nav a::before {
    content: "";
    position: absolute;
    left: 0.85rem; right: 0.85rem; bottom: 0.18rem;
    height: 1px;
    background: rgba(0, 245, 255, 0.5);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--ease);
}
.site-nav nav a::after {
    content: "";
    position: absolute;
    left: 0.85rem; right: 0.85rem; bottom: 0.16rem;
    height: 3px;
    opacity: 0;
    background: linear-gradient(90deg, transparent, #fff, var(--cyan), transparent) -60% 0 / 45% 100% no-repeat;
    filter: blur(0.4px);
}
.site-nav nav a:hover::before,
.site-nav nav a:focus-visible::before { transform: scaleX(1); }
.site-nav nav a:hover::after,
.site-nav nav a:focus-visible::after { opacity: 1; animation: travel-x 0.85s var(--ease) both; }

/* the sliding active-page indicator (positioned by tron.js) */
.nav-indicator {
    position: absolute;
    left: 0; bottom: -0.45rem;
    height: 2px;
    width: var(--iw, 0px);
    transform: translateX(var(--ix, 0px));
    opacity: var(--io, 0);
    background: linear-gradient(90deg, transparent, var(--cyan) 20%, #fff 50%, var(--cyan) 80%, transparent);
    box-shadow: 0 0 10px 1px rgba(0, 245, 255, 0.75);
    transition: transform 0.4s var(--ease), width 0.4s var(--ease), opacity 0.3s;
    pointer-events: none;
}

.nav-tools { display: flex; align-items: center; gap: 0.5rem; }

.nav-tools button {
    --c: 8px;
    position: relative;
    display: inline-grid;
    place-items: center;
    min-width: 40px;
    height: 36px;
    padding: 0 0.55rem;
    color: var(--ice);
    background: none;
    border: 0;
    cursor: pointer;
    font: 600 0.82rem/1 var(--font-label);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    isolation: isolate;
    transition: color 0.2s, filter 0.25s;
}
.nav-tools button::before,
.nav-tools button::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
    background: var(--edge);
    transition: background 0.25s;
}
.nav-tools button::after {
    inset: 1px;
    z-index: -1;
    background: var(--btn-fill);
}
.nav-tools button:hover { color: #fff; filter: drop-shadow(0 0 8px rgba(0, 245, 255, 0.5)); }
.nav-tools button:hover::before { background: var(--edge-hot); }

#theme-toggle { font-size: 1.05rem; }
#fx-toggle[data-state="calm"] { color: var(--ice); }
#fx-toggle[data-state="off"]  { color: var(--text-muted); }
#fx-toggle .fx-dots { display: inline-flex; gap: 2px; margin-left: 0.4rem; }
#fx-toggle .fx-dots i { width: 4px; height: 10px; background: currentColor; opacity: 0.25; }
#fx-toggle[data-state="on"]   .fx-dots i { opacity: 1; }
#fx-toggle[data-state="calm"] .fx-dots i:nth-child(-n+2) { opacity: 1; }
#fx-toggle[data-state="off"]  .fx-dots i:nth-child(1) { opacity: 1; }

.nav-toggle { display: none !important; }
.nav-toggle .bars { display: grid; gap: 4px; width: 18px; }
.nav-toggle .bars i { display: block; height: 2px; background: currentColor; transition: transform 0.25s, opacity 0.2s; }
.site-nav.is-open .nav-toggle .bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-nav.is-open .nav-toggle .bars i:nth-child(2) { opacity: 0; }
.site-nav.is-open .nav-toggle .bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------------------------------------------------------------------
   4 · Hero
   --------------------------------------------------------------------- */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    text-align: center;
    padding: clamp(3.6rem, 9vw, 6.6rem) 1.25rem clamp(3.2rem, 8vw, 5.6rem);
}
.hero-hub { padding-top: clamp(4rem, 10vw, 7.4rem); padding-bottom: clamp(3.4rem, 8vw, 6rem); }

/* fine scanlines + a slow scan band */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px);
    -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 45%, #000 20%, transparent 75%);
            mask-image: radial-gradient(ellipse 70% 80% at 50% 45%, #000 20%, transparent 75%);
}
.hero::after {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 150px;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), 0.05) 45%, rgba(var(--accent-rgb), 0.15) 50%, rgba(var(--accent-rgb), 0.05) 55%, transparent);
    animation: scan 9s linear 2s infinite;
}

/* HUD corner brackets + tiny technical labels */
.hud {
    position: absolute;
    inset: 0.9rem clamp(0.6rem, 2vw, 1.4rem);
    pointer-events: none;
    --b: var(--edge-hot);
    background:
        linear-gradient(var(--b), var(--b)) top left / 30px 1px no-repeat,
        linear-gradient(var(--b), var(--b)) top left / 1px 30px no-repeat,
        linear-gradient(var(--b), var(--b)) top right / 30px 1px no-repeat,
        linear-gradient(var(--b), var(--b)) top right / 1px 30px no-repeat,
        linear-gradient(var(--b), var(--b)) bottom left / 30px 1px no-repeat,
        linear-gradient(var(--b), var(--b)) bottom left / 1px 30px no-repeat,
        linear-gradient(var(--b), var(--b)) bottom right / 30px 1px no-repeat,
        linear-gradient(var(--b), var(--b)) bottom right / 1px 30px no-repeat;
    opacity: 0.55;
    animation: fade-in calc(1.2s * var(--ts)) ease calc(0.2s * var(--ts)) both;
}
.hud span {
    position: absolute;
    font: 600 0.68rem/1 var(--font-label);
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--ice);
    opacity: 0.75;
}
.hud .tl { top: 0.8rem; left: 1.2rem; }
.hud .tr { top: 0.8rem; right: 1.2rem; }
.hud .bl { bottom: 0.8rem; left: 1.2rem; }
.hud .br { bottom: 0.8rem; right: 1.2rem; }
.led {
    display: inline-block;
    width: 6px; height: 6px;
    margin-right: 0.55em;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 8px 1px var(--cyan);
    vertical-align: 0.08em;
    animation: blink 2.6s ease-in-out infinite;
}

/* circuit-board decoration with pulses of energy running along it */
.hero-circuit {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 24%, transparent 42%, transparent 58%, #000 76%, #000 100%);
            mask-image: linear-gradient(90deg, #000 0, #000 24%, transparent 42%, transparent 58%, #000 76%, #000 100%);
    animation: fade-in calc(1.4s * var(--ts)) ease calc(0.15s * var(--ts)) both;
}
/* NB: these are deliberately STANDALONE selectors. The traces are cloned through
   <use>, and descendant selectors (".hero-circuit .trace") do not match inside a
   <use> shadow tree. Colours come from inherited custom properties instead. */
.hero-circuit { --circ-trace: rgba(0, 245, 255, 0.2); --circ-node: #00F5FF; --circ-pulse: #8AEEFF; --circ-glow: #00F5FF; }
.trace { fill: none; stroke: var(--circ-trace); stroke-width: 1.2; }
.node  { fill: var(--circ-node); opacity: 0.8; }
.pulse,
.pulse-glow {
    fill: none;
    stroke: var(--circ-pulse);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 55 945;
    stroke-dashoffset: 55;
    animation: pulse-run 5.2s linear infinite;
    animation-delay: var(--d, 0s);
}
.pulse-glow { stroke: var(--circ-glow); stroke-width: 7; opacity: 0.2; }

.hero-emblem {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: min(250px, 58vw);
    aspect-ratio: 1;
    margin-bottom: 0.6rem;
}
.hero-emblem .hero-logo {
    position: relative;
    width: 78%;
    height: auto;
    filter: drop-shadow(0 0 22px rgba(0, 245, 255, 0.35));
}
.orbit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px dashed rgba(0, 245, 255, 0.35);
    animation: spin 38s linear infinite;
}
.orbit.o2 {
    inset: 9%;
    border: 1px solid rgba(138, 238, 255, 0.18);
    border-top-color: rgba(138, 238, 255, 0.9);
    border-right-color: rgba(138, 238, 255, 0.3);
    animation-duration: 14s;
    animation-direction: reverse;
}

.eyebrow {
    margin: 0 0 1rem;
    font: 600 0.82rem/1 var(--font-label);
    letter-spacing: 0.42em;
    text-indent: 0.42em;
    text-transform: uppercase;
    color: var(--ice);
}

.h1-wrap { position: relative; }
.hero h1 {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: 0.015em;
    color: var(--text-strong);
    animation: h1-reveal calc(0.95s * var(--ts)) cubic-bezier(0.65, 0, 0.25, 1) calc(0.55s * var(--ts)) both;
}
.h1-pre {
    display: block;
    margin-bottom: 0.85rem;
    font: 600 clamp(0.82rem, 1.9vw, 1.05rem)/1 var(--font-label);
    letter-spacing: 0.5em;
    text-indent: 0.5em;
    text-transform: uppercase;
    color: var(--ice);
}
.glow {
    display: inline-block;
    font-size: clamp(1.4rem, 8vw, 3.7rem);
    white-space: nowrap;
    background: linear-gradient(100deg, var(--ice) 0%, var(--cyan) 32%, #ffffff 50%, var(--cyan) 68%, var(--blue) 100%);
    background-size: 260% 100%;
    background-position: 0% 0;
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 16px rgba(0, 245, 255, 0.35));
    animation: sweep 8s ease-in-out 2.4s infinite;
}
.hero-lightshow .glow { font-size: clamp(2rem, 8.4vw, 4.4rem); }

/* the reveal beam: a vertical line of light that sweeps across the headline */
.beam {
    position: absolute;
    top: -14%; bottom: -14%;
    left: 0;
    width: 2px;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, #fff 22%, var(--ice) 50%, #fff 78%, transparent);
    box-shadow: 0 0 16px 3px rgba(0, 245, 255, 0.85), 0 0 70px 16px rgba(0, 245, 255, 0.3);
    animation: beam calc(0.95s * var(--ts)) cubic-bezier(0.65, 0, 0.25, 1) calc(0.55s * var(--ts)) both;
}

.tagline {
    max-width: 36em;
    margin: 1.4rem auto 2.1rem;
    font-size: clamp(1.02rem, 2.4vw, 1.26rem);
    color: var(--text-muted);
    text-shadow: 0 0 14px var(--halo), 0 0 28px var(--halo);
    animation: rise calc(0.8s * var(--ts)) var(--ease) calc(1.35s * var(--ts)) both;
}

.hero-actions {
    display: flex;
    gap: 0.9rem;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-actions .btn { animation: ignite calc(0.9s * var(--ts)) var(--ease) calc(var(--d, 1.55s) * var(--ts)) both; }
.hero-actions .btn:nth-child(2) { --d: 1.75s; }

.divider {
    position: relative;
    height: 1px;
    max-width: 720px;
    margin: 0 auto;
    background: linear-gradient(90deg, transparent, var(--edge), transparent);
}
.divider::before {
    content: "";
    position: absolute;
    left: 50%; top: -4px;
    width: 8px; height: 8px;
    background: var(--cyan);
    box-shadow: 0 0 12px 2px rgba(0, 245, 255, 0.8);
    transform: translateX(-50%) rotate(45deg);
}
.divider::after {
    content: "";
    position: absolute;
    left: 0; right: 0; top: -1px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #fff, var(--cyan), transparent) -50% 0 / 30% 100% no-repeat;
    animation: travel-x 5.5s linear infinite;
}

/* ---------------------------------------------------------------------
   5 · Buttons
   --------------------------------------------------------------------- */
.btn {
    --c: 12px;
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 46px;
    padding: 0.85rem 1.7rem;
    font: 700 0.8rem/1 var(--font-display);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--btn-ink);
    background: none;
    border: 0;
    cursor: pointer;
    transition: transform 0.15s, color 0.2s, filter 0.25s;
}
.btn::before,
.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
}
/* edge ring + the light that travels around it */
.btn::before {
    background:
        conic-gradient(from var(--a), transparent 0 70%, var(--hl) 88%, rgba(255, 255, 255, 0.95) 94%, transparent 97% 100%),
        linear-gradient(var(--edge), var(--edge));
    transition: --hl 0.3s;
}
.btn::after {
    inset: 1px;
    z-index: -1;
    background: var(--btn-fill);
    transition: background 0.25s;
}

.btn-primary { --edge: rgba(0, 245, 255, 0.85); --hl: rgba(255, 255, 255, 0.55); }
.btn-primary::after { background: linear-gradient(180deg, rgba(0, 245, 255, 0.2), rgba(0, 245, 255, 0.05)), var(--btn-fill); }
html[data-fx="on"] .btn-primary::before { animation: edge-spin 3.6s linear infinite; }

.btn-ghost { --edge: rgba(0, 245, 255, 0.34); color: var(--ice); }

.btn:hover,
.btn:focus-visible {
    transform: translateY(-2px);
    color: #fff;
    filter: drop-shadow(0 0 12px rgba(0, 245, 255, 0.5));
}
.btn:hover::before,
.btn:focus-visible::before {
    --hl: rgba(0, 245, 255, 0.95);
    --edge: rgba(0, 245, 255, 0.95);
    animation: edge-spin 1.5s linear infinite;
}
.btn:hover::after { background: linear-gradient(180deg, rgba(0, 245, 255, 0.28), rgba(0, 245, 255, 0.08)), var(--btn-fill); }
.btn:active { transform: translateY(0) scale(0.98); }

/* click = a brief pulse of energy (spawned by tron.js) */
.btn .rip {
    position: absolute;
    inset: 1px;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
}
.btn .rip i {
    position: absolute;
    width: 12px; height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    border: 2px solid var(--ice);
    background: rgba(0, 245, 255, 0.25);
    animation: ripple 0.6s ease-out forwards;
}

/* ---------------------------------------------------------------------
   6 · Holographic panels
   --------------------------------------------------------------------- */
.container {
    position: relative;
    max-width: 1060px;
    margin: 0 auto;
    padding: 3.4rem 1.4rem;
}
.container-wide { max-width: 1240px; }

/* a small system tag above each section */
.container[data-tag]::before {
    content: "// " attr(data-tag) / "";
    display: block;
    margin-bottom: 0.55rem;
    font: 600 0.72rem/1 var(--font-label);
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--ice);
    opacity: 0.7;
}

.container > h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font: 700 clamp(1.25rem, 3.2vw, 1.75rem)/1.2 var(--font-display);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-strong);
    margin-bottom: 0.7rem;
}
/* a line of light runs out from the heading as it appears */
.container > h2::after {
    content: "";
    flex: 1;
    height: 2px;
    min-width: 30px;
    background: linear-gradient(90deg, var(--cyan), rgba(0, 245, 255, 0.35) 45%, transparent);
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.45);
    transform-origin: left;
}
.js .container > h2.reveal:not(.is-in)::after { transform: scaleX(0); }
.container > h2.reveal.is-in::after { animation: draw-line 1.1s var(--ease) 0.15s both; }

/* family bulb colours live on as small glowing diamonds */
.mini-bulb {
    flex-shrink: 0;
    width: 11px; height: 11px;
    transform: rotate(45deg);
    border-radius: 1px;
}
.mini-bulb.red    { background: var(--bulb-red);    box-shadow: 0 0 12px 1px var(--bulb-red); }
.mini-bulb.green  { background: var(--bulb-green);  box-shadow: 0 0 12px 1px var(--bulb-green); }
.mini-bulb.blue   { background: var(--bulb-blue);   box-shadow: 0 0 12px 1px var(--bulb-blue); }
.mini-bulb.purple { background: var(--bulb-purple); box-shadow: 0 0 12px 1px var(--bulb-purple); }

.section-sub { margin: 0 0 1.6rem; color: var(--text-muted); }

/* the panel itself: chamfered, translucent, edge-lit */
.panel {
    --c: 16px;
    position: relative;
    isolation: isolate;
    color: var(--text);
    text-decoration: none;
    transform: perspective(1100px) translate3d(0, var(--lift, 0px), 0) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.28s var(--ease), filter 0.3s, opacity 0.7s var(--ease) calc(var(--rd, 0) * 80ms), translate 0.7s var(--ease) calc(var(--rd, 0) * 80ms);
}
.panel::before,
.panel::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, var(--c) 100%, 0 calc(100% - var(--c)));
}
.panel::before {
    background:
        conic-gradient(from var(--a), transparent 0 74%, var(--hl) 90%, rgba(255, 255, 255, 0.95) 95.5%, transparent 97% 100%),
        linear-gradient(var(--edge), var(--edge));
    transition: --hl 0.35s, --edge 0.3s;
}
.panel::after {
    inset: 1px;
    z-index: -1;
    background:
        radial-gradient(280px circle at var(--mx, 50%) var(--my, -30%), rgba(var(--cr), 0.15), transparent 70%),
        linear-gradient(160deg, var(--panel-2), var(--panel));
}

@media (hover: hover) {
    .panel:hover {
        --lift: -6px;
        --edge: rgba(var(--cr), 0.6);
        filter: drop-shadow(0 0 14px rgba(var(--cr), 0.32));
    }
    .panel:hover::before { --hl: rgba(var(--cr), 0.95); animation: edge-spin 2.3s linear infinite; }
}
.panel:focus-visible { --lift: -6px; --edge: rgba(var(--cr), 0.6); outline: 2px solid var(--ice); outline-offset: 5px; box-shadow: none; filter: drop-shadow(0 0 14px rgba(var(--cr), 0.4)); }
.panel:focus-visible::before { --hl: rgba(var(--cr), 0.95); animation: edge-spin 2.3s linear infinite; }

/* energy pulse when a panel first scrolls into view */
.panel.is-in::before { animation: edge-pulse 1.5s ease-out both; }
@media (hover: hover) { .panel.is-in:hover::before { animation: edge-spin 2.3s linear infinite; } }

/* ---------------------------------------------------------------------
   7 · Hub cards
   --------------------------------------------------------------------- */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.4rem;
}

.hub-card { display: flex; flex-direction: column; --c: 20px; }

.hub-thumb {
    position: relative;
    height: 188px;
    margin: 1px 1px 0;
    display: grid;
    place-items: center;
    background:
        radial-gradient(ellipse 80% 90% at 50% 108%, rgba(var(--cr), 0.34), transparent 70%),
        linear-gradient(rgba(var(--cr), 0.08) 1px, transparent 1px) 0 0 / 22px 22px,
        linear-gradient(90deg, rgba(var(--cr), 0.08) 1px, transparent 1px) 0 0 / 22px 22px,
        #030a14;
    clip-path: polygon(0 0, calc(100% - var(--c) + 1px) 0, 100% calc(var(--c) - 1px), 100% 100%, 0 100%);
    border-bottom: 1px solid rgba(var(--cr), 0.28);
}
.hub-thumb img { max-height: 148px; width: auto; transition: transform 0.4s var(--ease), filter 0.4s; }
.hub-card:hover .hub-thumb img,
.hub-card:hover .hub-thumb-svg { transform: scale(1.05); }
/* NoteAdapt's logo is transparent now, so it sits on the same grid thumb as the other cards */
.hub-thumb-notes img { max-width: 92%; }
.hub-thumb-svg { transition: transform 0.4s var(--ease); }

.hub-thumb .tech {
    position: absolute;
    top: 0.65rem; left: 0.8rem;
    font: 600 0.66rem/1 var(--font-label);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(var(--ct), 0.85);
}
.hub-thumb .led {
    position: absolute;
    top: 0.62rem; right: 1.6rem;
    margin: 0;
    background: rgb(var(--ct));
    box-shadow: 0 0 8px 1px rgba(var(--cr), 0.9);
}

.hub-body { display: flex; flex-direction: column; flex: 1; padding: 1.25rem 1.45rem 1.5rem; }
.hub-body h2 {
    margin: 0 0 0.55rem;
    font: 700 1.08rem/1.32 var(--font-display);
    letter-spacing: 0.03em;
    color: var(--text-strong);
}
.hub-body p { margin: 0 0 1.1rem; font-size: 0.97rem; color: var(--text-muted); }
.hub-link {
    margin-top: auto;
    font: 700 0.8rem/1 var(--font-label);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgb(var(--ct));
}
.hub-link::after { content: ""; }
.hub-card:hover .hub-link { text-shadow: 0 0 12px rgba(var(--cr), 0.7); letter-spacing: 0.27em; }
.hub-link { transition: letter-spacing 0.3s var(--ease), text-shadow 0.3s; }

/* the NoteAdapt brand wordmark — kept exactly as the brand defines it */
.wordmark-na {
    background: linear-gradient(90deg, #e5382e 0%, #f5892b 20%, #ffc72c 38%, #2eb85c 58%, #2f7fe0 78%, #8e44e0 100%);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

/* three cards across, then the company card (with the KaoTech shop inside it) full width underneath.
   Opt-in via .hub-grid-feature. Tablets: two columns, and Learn + the company card each take a full row; phones: one column. */
@media (min-width: 1101px) {
    .hub-grid-feature { grid-template-columns: repeat(3, 1fr); }
    .hub-grid-feature > .hub-card-company { grid-column: 1 / -1; }
}
@media (min-width: 641px) and (max-width: 1100px) {
    .hub-grid-feature > .hub-card:nth-child(3),
    .hub-grid-feature > .hub-card-company { grid-column: 1 / -1; }
}
/* inline SVG wordmarks pick up the site's label face (inline <text> cannot use a CSS variable as an attribute) */
.hub-thumb-svg text { font-family: var(--font-label); }

/* ---- the company card and its sub-card ----
   A link cannot sit inside a link: the company card is a container, its heading link is stretched over the whole card,
   and the sub-card is a second link stacked above that. */
.hub-stretch { color: inherit; text-decoration: none; }
.hub-stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.hub-stretch:focus-visible { outline: none; box-shadow: none; }
.hub-stretch:focus-visible::after { outline: 2px solid var(--ice); outline-offset: 5px; }

.sub-card {
    --c: 14px;
    position: relative;
    z-index: 2;
    isolation: isolate;
    display: grid;
    grid-template-columns: 150px 1fr;
    margin: 0 1.45rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    transition: transform 0.28s var(--ease), filter 0.3s;
}
.sub-card::before,
.sub-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, var(--c) 100%, 0 calc(100% - var(--c)));
}
.sub-card::before { background: rgba(var(--cr), 0.4); transition: background 0.3s; }
.sub-card::after {
    inset: 1px;
    z-index: -1;
    background:
        linear-gradient(rgba(var(--cr), 0.07), rgba(var(--cr), 0.07)),
        linear-gradient(160deg, var(--panel-2), var(--panel));
}
.sub-thumb {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 132px;
    margin: 1px 0 1px 1px;
    background:
        radial-gradient(ellipse 90% 90% at 50% 108%, rgba(var(--cr), 0.34), transparent 70%),
        linear-gradient(rgba(var(--cr), 0.08) 1px, transparent 1px) 0 0 / 22px 22px,
        linear-gradient(90deg, rgba(var(--cr), 0.08) 1px, transparent 1px) 0 0 / 22px 22px,
        #030a14;
    border-right: 1px solid rgba(var(--cr), 0.28);
    clip-path: polygon(0 0, 100% 0, 100% 100%, var(--c) 100%, 0 calc(100% - var(--c)));
}
.sub-thumb img { max-height: 92px; max-width: 80%; width: auto; transition: transform 0.4s var(--ease); }
.sub-thumb .tech {
    position: absolute;
    top: 0.55rem; left: 0.7rem;
    font: 600 0.6rem/1 var(--font-label);
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(var(--ct), 0.85);
}
.sub-body { display: flex; flex-direction: column; padding: 1.05rem 1.3rem 1.15rem; }
.sub-body h3 {
    margin: 0 0 0.4rem;
    font: 700 0.98rem/1.32 var(--font-display);
    letter-spacing: 0.03em;
    color: var(--text-strong);
}
.sub-body p { margin: 0 0 0.9rem; font-size: 0.92rem; color: var(--text-muted); }
.sub-card:focus-visible { outline: 2px solid var(--ice); outline-offset: 4px; box-shadow: none; filter: drop-shadow(0 0 12px rgba(var(--cr), 0.38)); }
.sub-card:focus-visible::before { background: rgba(var(--cr), 0.9); }
@media (hover: hover) {
    .sub-card:hover { transform: translateY(-3px); filter: drop-shadow(0 0 12px rgba(var(--cr), 0.38)); }
    .sub-card:hover::before { background: rgba(var(--cr), 0.9); }
    .sub-card:hover .sub-thumb img { transform: scale(1.06); }
    .sub-card:hover .hub-link { text-shadow: 0 0 12px rgba(var(--cr), 0.7); letter-spacing: 0.27em; }
    /* hovering the sub-card must not also light up the company card around it, and the reverse */
    .hub-card-company:hover .sub-card:not(:hover) .hub-link { text-shadow: none; letter-spacing: 0.22em; }
    .hub-card-company:has(.sub-card:hover) { --lift: 0px; --edge: inherit; filter: none; }
    .hub-card-company:has(.sub-card:hover)::before { --hl: rgba(0, 245, 255, 0); animation: none; }
    .hub-card-company:has(.sub-card:hover) .hub-thumb-svg { transform: none; }
    .hub-card-company:has(.sub-card:hover) > .hub-body .hub-link { text-shadow: none; letter-spacing: 0.22em; }
}

/* wide cards: the logo panel runs down the left, the text and the sub-card stack on the right */
@media (min-width: 761px) {
    .hub-card-company { display: grid; grid-template-columns: minmax(250px, 34%) 1fr; grid-template-rows: auto 1fr; }
    .hub-card-company > .hub-thumb {
        grid-row: 1 / -1;
        height: auto;
        min-height: 200px;
        margin: 1px 0 1px 1px;
        border-bottom: 0;
        border-right: 1px solid rgba(var(--cr), 0.28);
        clip-path: polygon(0 0, 100% 0, 100% 100%, var(--c) 100%, 0 calc(100% - var(--c)));
    }
    .hub-card-company > .hub-body { grid-column: 2; padding-bottom: 1rem; }
    .hub-card-company > .sub-card { grid-column: 2; align-self: end; }
}
/* phones: the sub-card stacks too, the logo panel above the text */
@media (max-width: 520px) {
    .sub-card { grid-template-columns: 1fr; margin: 0 1.1rem 1.3rem; }
    .sub-thumb {
        min-height: 112px;
        margin: 1px 1px 0;
        border-right: 0;
        border-bottom: 1px solid rgba(var(--cr), 0.28);
        clip-path: polygon(0 0, calc(100% - var(--c) + 1px) 0, 100% calc(var(--c) - 1px), 100% 100%, 0 100%);
    }
}

/* ---------------------------------------------------------------------
   8 · Lightshow sections
   --------------------------------------------------------------------- */
/* the string of lights becomes a row of glowing LEDs */
.light-string {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    padding: 6px clamp(0.9rem, 3vw, 2rem) 0;
    background: var(--void);
}
.bulb {
    width: 6px; height: 6px;
    border-radius: 50%;
    animation: twinkle 1.8s ease-in-out infinite;
}
.bulb.yellow { background: var(--bulb-yellow); box-shadow: 0 0 9px 1px var(--bulb-yellow); }
.bulb.green  { background: var(--bulb-green);  box-shadow: 0 0 9px 1px var(--bulb-green);  animation-delay: 0.3s; }
.bulb.red    { background: var(--bulb-red);    box-shadow: 0 0 9px 1px var(--bulb-red);    animation-delay: 0.6s; }
.bulb.blue   { background: var(--bulb-blue);   box-shadow: 0 0 9px 1px var(--bulb-blue);   animation-delay: 0.9s; }
.bulb.purple { background: var(--bulb-purple); box-shadow: 0 0 9px 1px var(--bulb-purple); animation-delay: 1.2s; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.3rem;
    margin-top: 1.5rem;
}
.card { --c: 14px; padding: 1.6rem 1.6rem 1.7rem; }
.card-icon {
    display: grid;
    place-items: center;
    width: 52px; height: 52px;
    margin-bottom: 0.9rem;
    font-size: 1.55rem;
    background: radial-gradient(circle, rgba(0, 245, 255, 0.2), rgba(0, 245, 255, 0.05) 70%);
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.card h3 {
    margin: 0 0 0.5rem;
    font: 700 0.98rem/1.3 var(--font-display);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-strong);
}
.card p { margin: 0; color: var(--text-muted); }
.card strong { color: var(--text); font-weight: 600; }
.card .map-link { color: inherit; text-decoration-color: rgba(0, 245, 255, 0.6); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.card .map-link:hover strong { color: var(--cyan); text-shadow: 0 0 10px rgba(0, 245, 255, 0.6); }
.card .fm {
    color: var(--cyan);
    font: 700 1.1em var(--font-display);
    white-space: nowrap;
    text-shadow: 0 0 14px rgba(0, 245, 255, 0.55);
}
.download-card .card-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.3rem; }

.playlist {
    list-style: none;
    counter-reset: track;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 0.55rem;
}
.playlist li {
    counter-increment: track;
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.85rem;
    align-items: baseline;
    padding: 0.7rem 1.4rem 0.7rem 1rem;
    background: linear-gradient(90deg, rgba(10, 24, 40, 0.92), rgba(5, 13, 24, 0.8));
    border: 1px solid rgba(0, 245, 255, 0.12);
    border-left: 2px solid rgba(0, 245, 255, 0.5);
    clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s, opacity 0.6s var(--ease) calc(var(--rd, 0) * 40ms), translate 0.6s var(--ease) calc(var(--rd, 0) * 40ms);
}
.playlist li:hover {
    transform: translateX(5px);
    border-left-color: var(--cyan);
    background: linear-gradient(90deg, rgba(0, 245, 255, 0.14), rgba(5, 13, 24, 0.82));
}
.playlist li::before {
    content: counter(track, decimal-leading-zero);
    grid-row: 1 / span 2;
    align-self: center;
    font: 700 0.9rem/1 var(--font-label);
    letter-spacing: 0.12em;
    color: var(--cyan);
}
.playlist .song { grid-column: 2; font-weight: 600; line-height: 1.3; color: var(--text-strong); }
.playlist .artist {
    grid-column: 2;
    margin: 0.1rem 0 0;
    font: 500 0.9rem/1.2 var(--font-label);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.3rem;
    margin-top: 1.5rem;
}
.media-card { --c: 18px; margin: 0; display: flex; flex-direction: column; }
.media-card img { display: block; width: calc(100% - 2px); height: auto; margin: 1px 1px 0; background: #000; clip-path: polygon(0 0, calc(100% - var(--c) + 1px) 0, 100% calc(var(--c) - 1px), 100% 100%, 0 100%); }
.media-card-full img { flex: 1; min-height: 0; object-fit: cover; }
.media-card figcaption { padding: 0.75rem 1rem; text-align: center; color: var(--text-muted); font-size: 0.92rem; }

.stream-placeholder { align-items: center; justify-content: center; }
.stream-box { position: relative; text-align: center; padding: 2.6rem 1.6rem; margin: 1.2rem; outline: 1px dashed rgba(0, 245, 255, 0.28); outline-offset: 0; }
.stream-box .stream-icon { display: block; font-size: 2.8rem; margin-bottom: 0.9rem; filter: drop-shadow(0 0 14px rgba(0, 245, 255, 0.35)); }
.stream-box p { margin: 1rem 0 0; color: var(--text-muted); }

.badge {
    display: inline-block;
    padding: 0.42rem 0.9rem;
    font: 700 0.74rem/1 var(--font-label);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #FFB074;
    background: rgba(255, 106, 0, 0.1);
    border: 1px solid rgba(255, 106, 0, 0.55);
    box-shadow: 0 0 16px rgba(255, 106, 0, 0.15), inset 0 0 12px rgba(255, 106, 0, 0.08);
}
.badge-big { font-size: 0.8rem; padding: 0.5rem 1.1rem; }

/* ---------------------------------------------------------------------
   9 · Footer
   --------------------------------------------------------------------- */
footer {
    position: relative;
    margin-top: 3rem;
    padding: 2.8rem 1.25rem 3.2rem;
    text-align: center;
    background: linear-gradient(180deg, transparent, rgba(3, 8, 16, 0.92) 45%);
}
footer::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--edge-hot) 50%, transparent);
}
footer::after {
    content: "";
    position: absolute;
    left: 0; right: 0; top: -1px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #fff, var(--cyan), transparent) -40% 0 / 28% 100% no-repeat;
    animation: travel-x 7s linear infinite;
}
footer img { filter: drop-shadow(0 0 8px rgba(0, 245, 255, 0.4)); }
footer p { margin: 0.3rem 0; }
.footer-note { font: 500 0.82rem var(--font-label); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted); }

/* ---------------------------------------------------------------------
   10 · Motion
   --------------------------------------------------------------------- */
@keyframes rise      { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade-in   { from { opacity: 0; } }
@keyframes ignite    { 0% { opacity: 0; transform: translateY(10px); filter: brightness(0.3); }
                       55% { opacity: 1; filter: brightness(1.9); }
                       100% { filter: brightness(1); } }
@keyframes nav-line  { from { transform: scaleX(0); opacity: 0; } 40% { opacity: 1; } }
@keyframes beam      { from { left: 0; opacity: 1; } 90% { opacity: 1; } to { left: 100%; opacity: 0; } }
@keyframes h1-reveal { from { clip-path: inset(-30% 100% -30% -2%); } to { clip-path: inset(-30% -2% -30% -2%); } }
@keyframes sweep     { 0%, 55% { background-position: 0% 0; } 100% { background-position: 100% 0; } }
@keyframes scan      { from { transform: translateY(-150px); } to { transform: translateY(680px); } }
@keyframes blink     { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes twinkle   { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes spin      { to { transform: rotate(360deg); } }
@keyframes edge-spin { to { --a: 360deg; } }
@keyframes edge-pulse { 0% { --a: 0deg; --hl: rgba(0, 245, 255, 0.95); } 100% { --a: 360deg; --hl: rgba(0, 245, 255, 0); } }
@keyframes pulse-run { to { stroke-dashoffset: -945; } }
@keyframes travel-x  { from { background-position: -60% 0; } to { background-position: 170% 0; } }
@keyframes draw-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ripple    { to { transform: scale(18); opacity: 0; } }
@keyframes reveal-failsafe { to { opacity: 1; translate: 0 0; } }

/* scroll reveals: content is visible by default. JS marks elements pending,
   and a CSS-only failsafe reveals them anyway if no script ever runs. */
.js .reveal:not(.is-in) { opacity: 0; translate: 0 24px; animation: reveal-failsafe 0.01s 4.2s forwards; }
.reveal { transition: opacity 0.7s var(--ease) calc(var(--rd, 0) * 80ms), translate 0.7s var(--ease) calc(var(--rd, 0) * 80ms); }

/* ---------------------------------------------------------------------
   11 · Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .hub-grid { grid-template-columns: repeat(2, 1fr); }
}

/* The five-link nav needs ~1020px to sit on one row beside the brand and tools, so the phone-style menu takes over
   below 1080px (it was 860px with four links). Measured 2026-10-19: at 861-960px the header overflowed sideways. */
@media (max-width: 1080px) {
    .nav-toggle { display: inline-grid !important; }
    .nav-tools { margin-left: auto; }
    .js .site-nav nav {
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        margin: 0;
        padding: 0.4rem 1rem 1.1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        display: none;
        background: var(--nav-solid);
        border-bottom: 1px solid var(--edge);
    }
    .js .site-nav.is-open nav { display: flex; }
    .js .site-nav nav a { padding: 0.95rem 0.4rem; font-size: 1.05rem; border-bottom: 1px solid rgba(0, 245, 255, 0.08); animation: none; }
    .js .site-nav nav a::before,
    .js .site-nav nav a::after { left: 0.4rem; right: 0.4rem; }
    .nav-indicator { display: none; }
    .site-nav nav { flex-wrap: wrap; }
}

/* the hero circuit decoration keeps its original cut-off */
@media (max-width: 860px) {
    .hero-circuit { display: none; }
}

/* comfortable tap targets on phones, tablets and touch screens */
@media (max-width: 1080px), (pointer: coarse) {
    .nav-tools button { min-width: 44px; height: 44px; }
}

@media (max-width: 640px) {
    .brand span { display: none; }
    .site-nav nav a { padding: 0.5rem 0.55rem; font-size: 0.9rem; }
    .hub-grid { grid-template-columns: 1fr; }
    .container { padding: 2.6rem 1.1rem; }
    .hud .tr, .hud .bl, .hud .br { display: none; }
    .playlist { grid-template-columns: 1fr; }
    .playlist .artist { font-size: 0.84rem; }
    .btn { padding: 0.85rem 1.35rem; }
    .h1-pre { letter-spacing: 0.34em; text-indent: 0.34em; }
}

/* ---------------------------------------------------------------------
   12 · "Daylight" theme (the ☀️ / 🌙 toggle — same behaviour as before)
   --------------------------------------------------------------------- */
:root.light-mode {
    --bg: #E9F4F8;
    --text: #0A2430;
    --text-strong: #031A24;
    --text-muted: #3A5D6D;
    --accent: #006F82;
    --accent-rgb: 0, 122, 142;
    --edge: rgba(0, 110, 130, 0.34);
    --edge-hot: rgba(0, 130, 150, 0.9);
    --panel: rgba(255, 255, 255, 0.93);
    --panel-2: rgba(240, 249, 252, 0.95);
    --nav-bg: rgba(238, 248, 251, 0.82);
    --nav-solid: rgba(240, 249, 252, 0.99);
    --btn-ink: #04303C;
    --btn-fill: rgba(255, 255, 255, 0.94);
    --grid-line: rgba(0, 120, 140, 0.1);
    --halo: #E9F4F8;
    --cr: 0, 140, 160;
    --ct: 0, 110, 130;
    --fx-cyan:   0, 150, 175;
    --fx-blue:   20, 110, 200;
    --fx-ice:    60, 170, 200;
    --fx-orange: 220, 90, 0;
    --fx-purple: 120, 50, 200;
    --fx-blend:  source-over;
    color-scheme: light;
}
.light-mode [data-accent="cyan"]   { --cr: 0, 140, 160;  --ct: 0, 110, 130; }
.light-mode [data-accent="orange"] { --cr: 230, 100, 0;  --ct: 176, 66, 0; }
.light-mode [data-accent="purple"] { --cr: 120, 50, 200; --ct: 96, 40, 176; }
.light-mode [data-accent="ice"]    { --cr: 20, 130, 190; --ct: 0, 96, 140; }
.light-mode [data-accent="blue"]   { --cr: 20, 110, 200; --ct: 10, 80, 170; }

:root.light-mode { scrollbar-color: rgba(0, 120, 140, 0.5) #E9F4F8; }
.light-mode body::before {
    background:
        radial-gradient(1100px 620px at 50% -8%, rgba(0, 150, 200, 0.16), transparent 62%),
        radial-gradient(800px 560px at 92% 108%, rgba(138, 43, 226, 0.08), transparent 62%),
        radial-gradient(800px 560px at 6% 104%, rgba(255, 106, 0, 0.07), transparent 62%),
        linear-gradient(180deg, #F2FAFC, #E3F0F5 60%);
}
.light-mode .site-nav nav a:hover,
.light-mode .site-nav nav a[aria-current="true"] { color: #031A24; }
.light-mode .brand { color: #031A24; }
.light-mode .nav-tools button { color: #04516A; }
.light-mode .eyebrow, .light-mode .h1-pre, .light-mode .hud span,
.light-mode .container[data-tag]::before { color: #0B6A80; opacity: 1; }
.light-mode .glow {
    background-image: linear-gradient(100deg, #0A7FA0 0%, #00A3B8 32%, #031A24 50%, #00A3B8 68%, #1060C0 100%);
    background-size: 260% 100%;
    filter: drop-shadow(0 0 10px rgba(0, 140, 170, 0.2));
}
.light-mode .hub-thumb,
.light-mode .sub-thumb { background-color: #031020; }
.light-mode .hub-thumb .tech,
.light-mode .sub-thumb .tech { color: rgba(var(--cr), 1); filter: brightness(1.7); }
.light-mode .hero-circuit { --circ-trace: rgba(0, 120, 140, 0.28); --circ-node: #008AA6; --circ-pulse: #0090B0; --circ-glow: #00A3C8; }
.light-mode .card .fm { color: #006E82; text-shadow: none; }
.light-mode .playlist li { background: linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(240, 249, 252, 0.85)); border-color: rgba(0, 120, 140, 0.18); border-left-color: rgba(0, 130, 150, 0.7); }
.light-mode .playlist li::before { color: #007A8E; }
.light-mode .playlist li:hover { background: linear-gradient(90deg, rgba(0, 160, 190, 0.16), rgba(255, 255, 255, 0.92)); }
.light-mode .badge { color: #9A3E00; background: rgba(255, 106, 0, 0.12); }
.light-mode .btn-ghost { color: #04516A; }
.light-mode .btn:hover, .light-mode .btn:focus-visible { color: #021820; }
.light-mode .light-string { background: #E3F0F5; }
.light-mode footer { background: linear-gradient(180deg, transparent, rgba(215, 235, 242, 0.95) 45%); }
.light-mode .rail::after, .light-mode .site-nav::after { filter: saturate(0.7) brightness(0.8); }

/* ---------------------------------------------------------------------
   13 · FX off / reduced motion
   Everything is fully visible and readable with motion removed.
   --------------------------------------------------------------------- */
html[data-fx="off"] *,
html[data-fx="off"] *::before,
html[data-fx="off"] *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
}
html[data-fx="off"] .js .reveal:not(.is-in) { opacity: 1; translate: none; }
html[data-fx="off"] .panel { --rx: 0deg !important; --ry: 0deg !important; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        transition-delay: 0s !important;
    }
    .js .reveal:not(.is-in) { opacity: 1; translate: none; }
    .panel { --rx: 0deg !important; --ry: 0deg !important; }
}
