/* FSIM.IT: the shared style sheet. Tokens first, then the frame of every page,
   then the parts of the home page, the lists and the search. */

:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --subtle: #EFF6FF;
  --sunken: #F1F5F9;
  --text: #0F172A;
  --muted: #475569;
  --heading: #0B2545;
  --navy: #0B2545;
  --navy-deep: #071A33;
  --sky: #0284C7;
  --link: #0369A1;
  --amber: #D97706;
  --amber-bright: #F59E0B;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -12px rgba(15, 23, 42, .18);
  --shadow-lift: 0 2px 4px rgba(15, 23, 42, .06), 0 18px 40px -16px rgba(11, 37, 69, .32);
  --radius: 14px;
  --radius-sm: 9px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --header-h: 62px;
  color-scheme: light;
}

html[data-theme='dark'] {
  --bg: #0B1120;
  --surface: #111827;
  --subtle: #1E293B;
  --sunken: #0F172A;
  --text: #F1F5F9;
  --muted: #94A3B8;
  --heading: #F8FAFC;
  --sky: #38BDF8;
  --link: #38BDF8;
  --amber: #F59E0B;
  --border: #1F2937;
  --border-strong: #334155;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .7);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .5), 0 20px 44px -18px rgba(56, 189, 248, .22);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg: #0B1120;
    --surface: #111827;
    --subtle: #1E293B;
    --sunken: #0F172A;
    --text: #F1F5F9;
    --muted: #94A3B8;
    --heading: #F8FAFC;
    --sky: #38BDF8;
    --link: #38BDF8;
    --amber: #F59E0B;
    --border: #1F2937;
    --border-strong: #334155;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 18px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img, svg { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.18; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 800; text-wrap: balance; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
button, input, select { font: inherit; color: inherit; }
kbd { font: 600 .72rem var(--mono); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--surface); color: var(--muted); }
:focus-visible { outline: 3px solid var(--amber-bright); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(2, 132, 199, .25); }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 22px; }
.container-narrow { max-width: 820px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--mono); }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.18em; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 700; transition: top .15s; }
.skip-link:focus { top: 12px; }
.eyebrow { font: 700 .74rem/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--sky); margin: 0 0 .7em; }
html[data-theme='light'] .eyebrow { color: var(--link); }

/* Buttons and chips */
.btn { display: inline-flex; align-items: center; gap: .55em; padding: .72em 1.15em; border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: .98rem; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background-color .15s, border-color .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn .icon { transition: transform .15s; }
.btn:hover .icon { transform: translateX(3px); }
.btn-primary { background: var(--sky); color: #fff; box-shadow: 0 8px 22px -10px rgba(2, 132, 199, .9); }
html[data-theme='dark'] .btn-primary { color: #04121F; }
.btn-amber { background: var(--amber-bright); color: #1C1203; }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--heading); }
.btn-ghost:hover { border-color: var(--sky); color: var(--link); }
.btn-glass { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); color: #fff; backdrop-filter: blur(6px); }
.btn-glass:hover { background: rgba(255, 255, 255, .18); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--heading); cursor: pointer; transition: border-color .15s, color .15s; }
.icon-btn:hover { border-color: var(--sky); color: var(--link); }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; display: inline-flex; align-items: center; gap: .4em; text-decoration: underline; text-underline-offset: 3px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: .5em; padding: .42em .9em; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: .9rem; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.chip:hover { border-color: var(--sky); }
.chip[disabled] { opacity: .45; cursor: not-allowed; }
.chip.is-active, .chip[aria-pressed='true'] { background: var(--navy); border-color: var(--navy); color: #fff; }
html[data-theme='dark'] .chip.is-active, html[data-theme='dark'] .chip[aria-pressed='true'] { background: var(--sky); border-color: var(--sky); color: #04121F; }
.chip-count { font: 600 .74rem var(--mono); opacity: .75; }

.level-badge { display: inline-flex; align-items: center; gap: .4em; padding: .2em .7em; border-radius: 999px; border: 1px solid; font: 700 .72rem/1.5 var(--font); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.level-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.level-badge[data-level='novizio'] { background: #DCFCE7; color: #166534; border-color: #86EFAC; }
.level-badge[data-level='appassionato'] { background: #DBEAFE; color: #1E40AF; border-color: #93C5FD; }
.level-badge[data-level='esperto'] { background: #F3E8FF; color: #6B21A8; border-color: #D8B4FE; }
html[data-theme='dark'] .level-badge[data-level='novizio'] { background: rgba(34, 197, 94, .13); color: #86EFAC; border-color: rgba(134, 239, 172, .4); }
html[data-theme='dark'] .level-badge[data-level='appassionato'] { background: rgba(59, 130, 246, .16); color: #93C5FD; border-color: rgba(147, 197, 253, .4); }
html[data-theme='dark'] .level-badge[data-level='esperto'] { background: rgba(168, 85, 247, .16); color: #D8B4FE; border-color: rgba(216, 180, 254, .4); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--heading); min-width: 0; }
.brand-mark { flex: none; filter: drop-shadow(0 2px 5px rgba(11, 37, 69, .25)); }
html[data-theme='dark'] .brand-mark circle[fill='none'] { stroke: #E2E8F0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-name { font-weight: 900; font-size: 1.32rem; letter-spacing: -.035em; }
.brand-name span { color: var(--sky); }
.brand-claim { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-link { font-weight: 600; font-size: .93rem; color: var(--heading); text-decoration: none; padding: .5em .7em; border-radius: 8px; }
.header-link:hover { color: var(--link); background: var(--subtle); }
.search-trigger { display: inline-flex; align-items: center; gap: .6em; height: 40px; padding: 0 .7em 0 .85em; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted); text-decoration: none; font-size: .92rem; min-width: 220px; cursor: pointer; transition: border-color .15s; }
.search-trigger:hover { border-color: var(--sky); }
.search-trigger span { flex: 1; }
.icon-moon, html[data-theme='dark'] .icon-sun { display: none; }
html[data-theme='dark'] .icon-moon { display: block; }
.nav-toggle { display: none; }
.nav-toggle .icon-close, .nav-toggle[aria-expanded='true'] .icon-menu { display: none; }
.nav-toggle[aria-expanded='true'] .icon-close { display: block; }
.section-nav { border-top: 1px solid var(--border); }
.section-nav-inner { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding-top: 5px; padding-bottom: 5px; }
.section-nav-inner::-webkit-scrollbar { display: none; }
.section-nav a { flex: none; padding: .42em .78em; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .87rem; transition: color .15s, background-color .15s; }
.section-nav a:hover { color: var(--heading); background: var(--subtle); }
.section-nav a[aria-current='page'] { color: var(--link); background: var(--subtle); }

/* Hero */
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--navy-deep); color: #E2E8F0; }
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.hero-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7, 26, 51, .97) 0%, rgba(7, 26, 51, .9) 34%, rgba(7, 26, 51, .45) 66%, rgba(7, 26, 51, .28) 100%), linear-gradient(180deg, rgba(7, 26, 51, .2) 55%, rgba(7, 26, 51, .85) 100%); }
.hud { position: absolute; top: 3%; right: 1.5%; width: 46%; height: 84%; z-index: 1; color: #7DD3FC; opacity: .82; pointer-events: none; mix-blend-mode: screen; }
.hud-lines { fill: none; stroke: currentColor; stroke-width: 1.300; stroke-linecap: round; stroke-linejoin: round; }
.hud text { fill: currentColor; stroke: none; font: 600 10.5px var(--mono); letter-spacing: .04em; }
.hud .hud-big { font-size: 16px; }
.hud .hud-horizon { stroke-width: 1.800; }
.hud .hud-amber { stroke: #FBBF24; stroke-width: 2.400; }
.hud .hud-amber-fill { fill: #FBBF24; stroke: none; }
.hud-attitude { transform-origin: 300px 200px; animation: hud-roll 16s ease-in-out infinite; }
.hud-heading { animation: hud-heading 150s linear infinite; }
.hud-fpv { animation: hud-fpv 11s ease-in-out infinite; }
@keyframes hud-roll { 0%, 100% { transform: rotate(-2.600deg) translateY(5px); } 50% { transform: rotate(3.200deg) translateY(-12px); } }
@keyframes hud-heading { from { transform: translateX(180px); } to { transform: translateX(-900px); } }
@keyframes hud-fpv { 0%, 100% { transform: translate(-4px, 3px); } 50% { transform: translate(5px, -4px); } }
.hero-inner { position: relative; z-index: 2; padding-top: clamp(56px, 9vw, 112px); padding-bottom: clamp(44px, 7vw, 84px); }
.hero-kicker { display: inline-flex; align-items: center; gap: .6em; font: 600 .78rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #BAE6FD; border: 1px solid rgba(186, 230, 253, .3); border-radius: 999px; padding: .4em .95em; background: rgba(8, 47, 73, .5); margin-bottom: 1.4em; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); animation: pulse 2.400s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.hero h1 { color: #fff; font-size: clamp(2.3rem, 6.2vw, 4.4rem); font-weight: 900; letter-spacing: -.04em; line-height: 1.02; max-width: 13.5em; margin-bottom: .45em; }
.hero h1 .hl { background: linear-gradient(92deg, #38BDF8, #7DD3FC 45%, #FBBF24); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: clamp(1.02rem, 1.7vw, 1.22rem); max-width: 31em; color: #CBD5E1; margin-bottom: 1.6em; }
.hero-search { display: flex; align-items: center; gap: 10px; max-width: 560px; background: rgba(255, 255, 255, .97); border-radius: 13px; padding: 6px 6px 6px 16px; color: #475569; box-shadow: 0 18px 44px -18px rgba(0, 0, 0, .7); }
.hero-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: #0F172A; font-size: 1.02rem; padding: .55em 0; outline: none; }
.hero-search input::placeholder { color: #64748B; }
.hero-search:focus-within { outline: 3px solid var(--amber-bright); outline-offset: 2px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.300em; }
.hero-stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 14px 44px; margin: clamp(34px, 5vw, 60px) 0 0; padding-top: 22px; border-top: 1px solid rgba(148, 163, 184, .28); }
.hero-stats div { display: flex; flex-direction: column-reverse; }
.hero-stats dt { font: 600 .7rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #94A3B8; }
.hero-stats dd { margin: 0; font: 800 clamp(1.5rem, 3vw, 2.1rem)/1.1 var(--mono); color: #fff; letter-spacing: -.03em; }

/* Bands */
.band { padding: clamp(48px, 7vw, 88px) 0; }
.band-tight { padding: clamp(28px, 4vw, 44px) 0 clamp(48px, 7vw, 80px); }
.band-alt, .band-route { background: var(--surface); border-block: 1px solid var(--border); }
.band-head { max-width: 46em; margin-bottom: clamp(24px, 3.5vw, 40px); }
.band-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.band-head p:last-child { color: var(--muted); font-size: 1.06rem; margin: 0; }
.band-foot { margin: 28px 0 0; }

.level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.level-card { display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s, border-color .18s; }
.level-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; }
.level-card[data-level='novizio']::before { background: #22C55E; }
.level-card[data-level='appassionato']::before { background: #3B82F6; }
.level-card[data-level='esperto']::before { background: #A855F7; }
.level-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--border-strong); }
.level-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.level-card-n { font: 700 .82rem var(--mono); color: var(--muted); }
.level-card-text { font-size: 1.04rem; flex: 1; }
.level-card-cta { display: inline-flex; align-items: center; gap: .5em; font-weight: 700; color: var(--link); }
.level-card:hover .level-card-cta .icon { transform: translateX(4px); }
.level-card-cta .icon { transition: transform .15s; }

/* The route of the first steps */
.route { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); position: relative; counter-reset: wpt; }
.route::before { content: ''; position: absolute; left: 7%; right: 7%; top: 10px; height: 2px; background: repeating-linear-gradient(90deg, var(--sky) 0 10px, transparent 10px 18px); background-size: 18px 2px; animation: route-flow 1.400s linear infinite; opacity: .8; }
@keyframes route-flow { to { background-position: 18px 0; } }
.wpt a { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 0 8px 12px; text-decoration: none; color: var(--text); border-radius: 12px; position: relative; }
.wpt-mark { width: 20px; height: 20px; transform: rotate(45deg); border: 2.500px solid var(--sky); background: var(--surface); border-radius: 4px; margin-bottom: 14px; transition: background-color .15s, transform .15s; }
.wpt:first-child .wpt-mark, .wpt:last-child .wpt-mark { border-color: var(--amber-bright); border-radius: 50%; }
.wpt a:hover .wpt-mark { background: var(--sky); transform: rotate(45deg) scale(1.180); }
.wpt-code { font: 700 .72rem var(--mono); letter-spacing: .08em; color: var(--sky); }
html[data-theme='light'] .wpt-code { color: var(--link); }
.wpt-label { font-weight: 700; line-height: 1.25; color: var(--heading); }
.wpt a:hover .wpt-label { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.wpt-time { font: 500 .76rem var(--mono); color: var(--muted); }

/* Sections */
.section-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.section-card { display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'icon code' 'name name' 'text text' 'n n'; gap: 10px 12px; align-content: start; padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s; }
.section-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--sky); }
.section-card-icon { grid-area: icon; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; background: var(--subtle); color: var(--link); }
.section-card-icon .icon { width: 24px; height: 24px; }
.section-card-code { grid-area: code; justify-self: end; align-self: start; font: 700 .7rem var(--mono); letter-spacing: .12em; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; }
.section-card-name { grid-area: name; font-weight: 800; font-size: 1.06rem; line-height: 1.22; color: var(--heading); letter-spacing: -.015em; }
.section-card-text { grid-area: text; font-size: .88rem; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.section-card-n { grid-area: n; display: inline-flex; align-items: center; gap: .5em; font: 700 .8rem var(--mono); color: var(--link); margin-top: 4px; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; transition: transform .18s, box-shadow .18s, border-color .18s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--border-strong); }
.card[hidden] { display: none; }
.card-media { display: block; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #0B2545, #0E3A66); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.card:hover .card-media img { transform: scale(1.045); }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 18px; flex: 1; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin: 0; }
.card-section { font: 600 .74rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-decoration: none; position: relative; z-index: 2; }
.card-section:hover { color: var(--link); }
.card-title { font-size: 1.12rem; line-height: 1.28; margin: 0; letter-spacing: -.015em; font-weight: 750; }
.card-title a { color: var(--heading); text-decoration: none; }
.card-title a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.card:hover .card-title a { color: var(--link); }
.card-desc { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin: auto 0 0; padding-top: 8px; display: flex; align-items: center; gap: .45em; font: 500 .78rem var(--mono); color: var(--muted); }

/* Filters */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 24px; }
.filter-count { margin: 0 0 0 auto; font: 500 .86rem var(--mono); color: var(--muted); }
.filter-count strong { color: var(--heading); }
.select select { appearance: none; padding: .5em 2.2em .5em .9em; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.500' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .7em center / 1em; font-weight: 600; font-size: .9rem; cursor: pointer; max-width: 100%; }
.filter-text { display: inline-flex; align-items: center; gap: .5em; padding: 0 .9em; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); }
.filter-text input { border: 0; background: transparent; outline: none; padding: .5em 0; width: 12em; max-width: 40vw; font-size: .9rem; }
.filter-text:focus-within { border-color: var(--sky); }
.filter-empty { padding: 34px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.filter-more { display: flex; justify-content: center; margin-top: 28px; }
.no-js .filter-bar, .no-js .filter-more { display: none; }
.soon-box { margin-top: 40px; border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 4px 22px; background: var(--surface); }
.soon-box summary { cursor: pointer; font-weight: 700; padding: 14px 0; color: var(--heading); display: flex; align-items: center; gap: .6em; }
.soon-box ul { list-style: none; padding: 0 0 12px; margin: 0; display: grid; gap: 8px; }
.soon-box li { display: flex; align-items: baseline; gap: 12px; color: var(--muted); font-size: .95rem; }
.soon-box .level-badge { flex: none; }

/* Page heads */
.page-head { padding: clamp(26px, 4vw, 48px) 0 clamp(22px, 3vw, 34px); background: var(--surface); border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.page-head::after { content: ''; position: absolute; right: -80px; top: -120px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid var(--border); box-shadow: 0 0 0 60px color-mix(in srgb, var(--subtle) 55%, transparent), 0 0 0 61px var(--border), 0 0 0 130px color-mix(in srgb, var(--subtle) 30%, transparent), 0 0 0 131px var(--border); pointer-events: none; opacity: .7; }
.page-head > .container { position: relative; z-index: 1; }
.page-head h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); font-weight: 900; letter-spacing: -.035em; margin: 0; }
.page-head-row { display: flex; align-items: center; gap: 18px; margin: 6px 0 14px; }
.page-head-row .eyebrow { margin-bottom: .35em; }
.page-head-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: var(--navy); color: #7DD3FC; flex: none; box-shadow: var(--shadow); }
.page-head-icon .icon { width: 32px; height: 32px; }
.page-lead { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--muted); max-width: 48em; margin: .8em 0 0; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .5em; font-size: .86rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--link); text-decoration: underline; }
.page-search { margin-top: 18px; border: 1px solid var(--border-strong); box-shadow: var(--shadow); background: var(--bg); }
.page-search input { color: var(--text); }
.page-404 { padding-block: clamp(60px, 12vw, 140px); }

.band-about { background: var(--navy-deep); color: #CBD5E1; }
.band-about h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.band-about .eyebrow { color: #7DD3FC; }
.band-about .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.about-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.about-points li { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid rgba(148, 163, 184, .22); border-radius: 12px; background: rgba(15, 39, 71, .6); }
.about-points .icon { color: #FBBF24; width: 22px; height: 22px; margin-top: 2px; }
.about-points strong { color: #fff; }

/* Prose of the plain pages */
.prose { font-size: 1.08rem; line-height: 1.75; }
.prose h2 { font-size: 1.5rem; margin-top: 2em; }
.prose h3 { font-size: 1.18rem; margin-top: 1.6em; }
.prose li { margin-bottom: .4em; }

/* Footer */
.site-footer { background: var(--navy-deep); color: #94A3B8; padding: 54px 0 26px; font-size: .93rem; }
.site-footer a { color: #CBD5E1; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .brand { color: #fff; }
.site-footer .brand-mark circle[fill='none'] { stroke: #E2E8F0; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 2fr 1fr; gap: 40px; }
.footer-brand p { margin: 12px 0 0; max-width: 22em; }
.footer-byline { color: #64748B; }
.footer-title { font: 700 .72rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #7DD3FC; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-sections { grid-template-columns: 1fr 1fr; column-gap: 24px; }
.footer-legal { margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(148, 163, 184, .2); font-size: .82rem; color: #64748B; }
.footer-legal p { margin: 0 0 .5em; max-width: 70em; }
.footer-legal strong { color: #CBD5E1; }

/* Search */
.search-dialog { width: min(720px, calc(100vw - 24px)); max-height: min(78vh, 720px); margin: 9vh auto auto; padding: 0; border: 1px solid var(--border-strong); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .7); overflow: hidden; }
.search-dialog[open] { display: flex; flex-direction: column; animation: pop .16s ease-out; }
.search-dialog::backdrop { background: rgba(7, 26, 51, .62); backdrop-filter: blur(5px); }
@keyframes pop { from { opacity: 0; transform: translateY(-10px) scale(.985); } }
.search-form { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--border); color: var(--muted); }
.search-form input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 1.12rem; padding: .5em 0; color: var(--text); }
.search-filters { display: flex; gap: 8px; padding: 12px 18px 0; flex-wrap: wrap; }
.search-filters .chip { font-size: .8rem; padding: .3em .8em; }
.search-results { overflow-y: auto; padding: 10px; display: grid; gap: 4px; align-content: start; flex: 1; }
.search-result { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; padding: 9px; border-radius: 11px; text-decoration: none; color: var(--text); border: 1px solid transparent; }
.search-result:hover, .search-result.is-active { background: var(--subtle); border-color: var(--border); }
.search-result img { width: 96px; height: 54px; object-fit: cover; border-radius: 7px; background: var(--navy); }
.search-result-title { font-weight: 700; line-height: 1.3; color: var(--heading); display: block; }
.search-result-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 5px; font: 500 .74rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.search-result-meta .level-badge { font-size: .62rem; padding: .1em .6em; }
.search-result-desc { display: block; margin-top: 5px; font-size: .9rem; color: var(--muted); line-height: 1.45; }
.search-results mark { background: color-mix(in srgb, var(--amber-bright) 38%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 26px 16px; color: var(--muted); text-align: center; }
.search-suggest { padding: 8px 8px 14px; }
.search-suggest p { font: 700 .72rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 6px 0 10px; }
.search-hint { margin: 0; padding: 10px 18px; border-top: 1px solid var(--border); font-size: .78rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.search-results-page { padding: 0; gap: 10px; overflow: visible; }
.search-results-page .search-result { grid-template-columns: 176px 1fr; background: var(--surface); border-color: var(--border); padding: 12px; }
.search-results-page .search-result img { width: 176px; height: 99px; }

/* Lightbox for the diagrams */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(4, 12, 26, .94); color: #E2E8F0; }
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; font-size: .9rem; }
.lightbox-bar p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-scroll { flex: 1; overflow: auto; display: grid; place-items: center; padding: 0 18px 22px; }
.lightbox-scroll img { width: min(1500px, 100%); min-width: 880px; height: auto; border-radius: 12px; }
.lightbox .icon-btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }

.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 60; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--heading); box-shadow: var(--shadow-lift); cursor: pointer; display: grid; place-items: center; }
.to-top[hidden] { display: none; }
.to-top:hover { color: var(--link); border-color: var(--sky); }

/* Smaller screens */
@media (max-width: 1100px) {
  .section-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .route { grid-template-columns: 1fr; gap: 2px; padding-left: 4px; }
  .route::before { left: 13px; right: auto; top: 22px; bottom: 34px; width: 2px; height: auto; background: repeating-linear-gradient(180deg, var(--sky) 0 10px, transparent 10px 18px); animation: none; }
  .wpt a { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: 'mark code time' 'mark label time'; column-gap: 12px; row-gap: 2px; align-items: center; text-align: left; padding: 10px 6px 10px 0; }
  .wpt-mark { grid-area: mark; margin: 0 0 0 4px; }
  .wpt-code { grid-area: code; }
  .wpt-label { grid-area: label; }
  .wpt-time { grid-area: time; }
}
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .level-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .header-link { display: none; }
  .search-trigger { min-width: 0; width: 40px; padding: 0; justify-content: center; color: var(--heading); }
  .search-trigger span, .search-trigger kbd { display: none; }
  .nav-toggle { display: inline-grid; }
  .section-nav { display: none; border-top: 1px solid var(--border); background: var(--surface); max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
  .section-nav.is-open, .no-js .section-nav { display: block; }
  .section-nav-inner { flex-direction: column; gap: 0; padding-block: 8px 14px; }
  .section-nav a { padding: .8em .6em; font-size: 1rem; border-bottom: 1px solid var(--border); border-radius: 0; }
  .hud { width: 100%; right: 0; top: 0; height: 100%; opacity: .3; }
  .hero-media::after { background: linear-gradient(180deg, rgba(7, 26, 51, .9) 0%, rgba(7, 26, 51, .8) 55%, rgba(7, 26, 51, .94) 100%); }
  .hero-stats { grid-template-columns: repeat(2, auto); }
  .page-head::after { display: none; }
}
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .section-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .section-card { padding: 15px; }
  .section-card-text { display: none; }
  .brand-claim { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .filter-count { margin-left: 0; width: 100%; }
  .hero-search .btn { padding-inline: .9em; }
  .search-result { grid-template-columns: 72px 1fr; }
  .search-result img { width: 72px; height: 41px; }
  .search-results-page .search-result { grid-template-columns: 1fr; }
  .search-results-page .search-result img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .search-hint { display: none; }
  .page-head-icon { width: 52px; height: 52px; border-radius: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .site-header, .site-footer, .to-top, .search-dialog, .filter-bar, .hero-search, .hero-cta { display: none !important; }
  body { background: #fff; color: #000; }
}
