/*
 * SANA platform. Layout idea: one vertical journey. A single gold thread runs
 * down the page through every world band (each band draws its own segment and
 * the segments meet at the band edges). Content is left-aligned; worlds alternate
 * which side holds the scene so the thread crosses through open space.
 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--sana-paper); color: var(--sana-ink); font: 400 var(--sana-step-0)/1.6 var(--sana-text); }
img, svg { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: var(--sana-focus); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(1180px, 100%); margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.skip { position: absolute; left: 12px; top: -80px; z-index: 100; padding: 10px 16px; border-radius: var(--sana-r-s); background: var(--sana-spark); color: var(--sana-night); font-weight: 600; }
.skip:focus { top: 12px; }
h1, h2, h3 { font-family: var(--sana-display); font-weight: 600; line-height: 1.08; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
p { margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--sana-night) 94%, transparent); backdrop-filter: blur(12px); color: var(--sana-cream); border-bottom: 1px solid #ffffff14; }
.site-header::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--sana-night); }
.header-row { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--sana-display); font-weight: 600; font-size: 1.15rem; letter-spacing: .32em; color: var(--sana-cream); }
.wordmark svg { width: 15px; height: 15px; color: var(--sana-spark); }
.header-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.header-nav a { padding: 8px 12px; border-radius: var(--sana-r-pill); text-decoration: none; font-size: var(--sana-step--1); color: #d9dfe7; }
.header-nav a:hover, .header-nav a[aria-current="page"] { background: #ffffff14; color: #fff; }
.lang { display: inline-flex; padding: 3px; border-radius: var(--sana-r-pill); background: #ffffff12; }
.lang button { min-width: 38px; min-height: 32px; border: 0; border-radius: var(--sana-r-pill); background: transparent; color: #c9d2dd; font: 600 .74rem var(--sana-text); letter-spacing: .04em; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--sana-spark); color: var(--sana-night); }
.nav-links { display: flex; gap: 2px; }
@media (max-width: 760px) {
  .header-row { flex-wrap: wrap; gap: 4px 12px; padding-block: 8px 6px; }
  .header-nav { display: contents; }
  .header-nav .lang { margin-left: auto; }
  .nav-links { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; margin-inline: -8px; }
  .nav-links a { white-space: nowrap; }
  .wordmark { letter-spacing: .24em; }
}

/* ---------- Thread ---------- */
.thread-seg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: visible; }
.thread-seg path { fill: none; stroke: var(--sana-spark); stroke-width: var(--sana-thread); vector-effect: non-scaling-stroke; opacity: .9; }
.thread-seg .narrow { display: none; }
@media (max-width: 760px) { .thread-seg .wide { display: none; } .thread-seg .narrow { display: inline; } }
.spark-end { position: absolute; width: 22px; height: 22px; color: var(--sana-spark); transform: translate(-50%, -50%); z-index: 1; pointer-events: none; }
.band { position: relative; isolation: isolate; }
.band > .wrap { position: relative; z-index: 1; }

/* ---------- Hero (night) ---------- */
.hero { background: radial-gradient(ellipse 80% 60% at 70% 0%, #1f3a5a 0%, transparent 70%), var(--sana-night); color: var(--sana-cream); padding-block: clamp(56px, 9vw, 120px) clamp(72px, 10vw, 128px); overflow: hidden; }
.stars { position: absolute; inset: 0; z-index: 0; background-image:
  radial-gradient(1.2px 1.2px at 12% 22%, #fff9 50%, transparent 51%), radial-gradient(1px 1px at 28% 68%, #fff7 50%, transparent 51%),
  radial-gradient(1.4px 1.4px at 44% 14%, #fffb 50%, transparent 51%), radial-gradient(1px 1px at 63% 42%, #fff6 50%, transparent 51%),
  radial-gradient(1.6px 1.6px at 81% 18%, #ffe9a8 50%, transparent 51%), radial-gradient(1px 1px at 90% 64%, #fff8 50%, transparent 51%),
  radial-gradient(1.2px 1.2px at 7% 84%, #fff6 50%, transparent 51%), radial-gradient(1px 1px at 54% 88%, #fff5 50%, transparent 51%),
  radial-gradient(1.3px 1.3px at 72% 78%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 36% 36%, #fff5 50%, transparent 51%); }
.hero-word { font-family: var(--sana-display); font-weight: 600; font-size: clamp(3.4rem, 2rem + 9vw, 9.5rem); letter-spacing: .26em; line-height: 1; margin-left: -.04em; color: var(--sana-cream); display: flex; align-items: flex-start; gap: .1em; }
.hero-word svg { width: .2em; height: .2em; color: var(--sana-spark); margin-top: .08em; }
.hero-kicker { margin-top: 18px; font-family: var(--sana-display); font-size: var(--sana-step-2); font-weight: 500; letter-spacing: -.01em; color: #fff; }
.hero-lead { margin-top: 14px; max-width: 58ch; color: #c3ccd8; font-size: var(--sana-step-1); line-height: 1.5; }
.paths { margin-top: 36px; }
.paths h2 { font-family: var(--sana-text); font-size: var(--sana-step--1); font-weight: 600; letter-spacing: 0; color: #9fb0c3; margin-bottom: 12px; }
.paths ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.paths a { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: var(--sana-r-pill); border: 1px solid #ffffff2e; text-decoration: none; color: #fff; font-weight: 500; transition: background .2s var(--sana-ease), border-color .2s var(--sana-ease); }
.paths a:hover { background: #ffffff12; border-color: var(--sana-spark); }
.paths a .dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Worlds ---------- */
.world { padding-block: clamp(64px, 9vw, 120px); overflow: hidden; }
.world-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.world--flip .world-grid > .world-copy { order: 2; }
.world-copy { max-width: 560px; }
.world-name { font-size: var(--sana-step-3); }
.world-tag { margin-top: 10px; font-size: var(--sana-step-1); line-height: 1.4; }
.world-desc { margin-top: 16px; max-width: 54ch; }
.world-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 22px; font-size: var(--sana-step--1); }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: var(--sana-r-pill); font-weight: 600; font-size: .8rem; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status--live { background: #d9f2df; color: #1d6b41; }
.status--preparing { background: #fff1cf; color: #7a5410; }
.status--stage3, .status--planned { background: #e9e7ef; color: #4f4c63; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: var(--sana-r-pill); font-weight: 600; text-decoration: none; border: 1px solid transparent; transition: transform .2s var(--sana-ease), background .2s var(--sana-ease); }
.btn:hover { transform: translateY(-2px); }
.btn--ghost { border-color: currentColor; background: transparent; }
.scene { position: relative; aspect-ratio: 5 / 4; width: 100%; max-width: 520px; justify-self: center; border-radius: 28px; overflow: hidden; }
.scene svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.world--night { background: linear-gradient(180deg, var(--sana-night) 0%, var(--world-night-mid) 100%); color: var(--world-night-light); }
.world--night .world-tag { color: #f3d388; }
.world--night .world-desc, .world--night .world-meta { color: #c3ccd8; }
.world--night .btn--solid { background: var(--sana-spark); color: var(--sana-night); }
.world--night .btn--ghost { color: var(--world-night-light); }
.world--night .scene { background: radial-gradient(circle at 30% 30%, #2a4c72, #10213a 70%); }

.world--sea { background: linear-gradient(180deg, #0f3d4d 0%, var(--world-sea-deep) 100%); color: var(--world-sea-light); }
.world--sea .world-tag { color: #9fe4e3; }
.world--sea .world-desc, .world--sea .world-meta { color: #c4e6e6; }
.world--sea .btn--solid { background: var(--world-sea-accent); color: var(--world-sea-deep); }
.world--sea .btn--ghost { color: var(--world-sea-light); }
.world--sea .scene { background: linear-gradient(180deg, #13788a 0%, #0b4a5a 100%); }

.world--meadow { background: linear-gradient(180deg, var(--world-meadow-light) 0%, #e2efd2 100%); color: var(--world-meadow-deep); }
.world--meadow .world-tag { color: var(--world-meadow-mid); }
.world--meadow .world-desc, .world--meadow .world-meta { color: #3d5547; }
.world--meadow .btn--solid { background: var(--world-meadow-deep); color: var(--world-meadow-accent); }
.world--meadow .btn--ghost { color: var(--world-meadow-deep); }
.world--meadow .scene { background: linear-gradient(180deg, #f6fbef 0%, #d5e9be 100%); }
.world--meadow .thread-seg path { stroke: #c9962e; }

/* ---------- School life ---------- */
.life { padding-block: clamp(64px, 8vw, 104px); background: linear-gradient(180deg, #2c1820 0%, var(--world-dusk-deep) 100%); color: var(--world-dusk-light); overflow: hidden; }
.life h2 { font-size: var(--sana-step-3); }
.life-lead { margin-top: 12px; max-width: 60ch; color: #e8cfc6; }
.life-list { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.life-item { display: grid; gap: 10px; align-content: start; padding: 22px; border-radius: var(--sana-r-l); background: #ffffff0d; border: 1px solid #ffffff1c; min-width: 0; }
.life-item h3 { font-size: var(--sana-step-1); }
.life-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.life-emblem { width: 52px; height: 52px; }
.life-item[data-world="rings"] .life-emblem { color: var(--world-rings-accent); }
.life-item[data-world="dusk"] .life-emblem { color: var(--world-dusk-accent); }
.life-item[data-world="lighthouse"] .life-emblem { color: var(--world-lighthouse-accent); }
.life-item p { color: #e8cfc6; font-size: var(--sana-step--1); }
.life-item a { justify-self: start; margin-top: 4px; font-weight: 600; color: #ffd0b0; text-underline-offset: 4px; }
.life-item[data-world="rings"] { border-top: 3px solid var(--world-rings-accent); }
.life-item[data-world="dusk"] { border-top: 3px solid var(--world-dusk-accent); }
.life-item[data-world="lighthouse"] { border-top: 3px solid var(--world-lighthouse-accent); }
.life-note { margin-top: 22px; font-size: var(--sana-step--1); color: #d6b8ad; }

/* ---------- Accessibility strip ---------- */
.access { padding-block: clamp(56px, 7vw, 88px); background: var(--world-prism-light); color: var(--world-prism-deep); }
.access-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; }
.access h2 { font-size: var(--sana-step-2); }
.access p { margin-top: 10px; color: var(--sana-muted); max-width: 52ch; }
.toggles { display: flex; flex-wrap: wrap; gap: 10px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 18px; border-radius: var(--sana-r-pill); border: 1px solid #c9c6d6; background: #fff; color: var(--world-prism-deep); font: 600 .95rem var(--sana-text); cursor: pointer; }
.toggle[aria-pressed="true"] { background: var(--world-prism-deep); color: #fff; border-color: var(--world-prism-deep); }
.toggle .knob { width: 30px; height: 18px; border-radius: 99px; background: #d8d6e2; position: relative; flex-shrink: 0; }
.toggle .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .2s var(--sana-ease); }
.toggle[aria-pressed="true"] .knob { background: var(--sana-spark); }
.toggle[aria-pressed="true"] .knob::after { transform: translateX(12px); }
.access a { color: var(--sana-spark-deep); font-weight: 600; text-underline-offset: 4px; }

/* ---------- Schools teaser ---------- */
.teaser { padding-block: clamp(56px, 7vw, 88px); background: var(--sana-cream); }
.teaser-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.teaser h2 { font-size: var(--sana-step-2); color: var(--sana-night); }
.teaser p { margin-top: 12px; color: var(--sana-muted); max-width: 52ch; }
.teaser .btn--solid { background: var(--sana-night); color: var(--sana-cream); }
.org { display: grid; gap: 0; padding: 22px; border-radius: var(--sana-r-l); background: #fff; border: 1px solid var(--sana-line); }
.org-school { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--sana-r-m); border: 1.5px solid var(--sana-night); }
.org-head { font-family: var(--sana-display); font-weight: 600; color: var(--sana-night); font-size: 1.1rem; }
.org-school small { color: var(--sana-muted); font-size: .85rem; }
.org-branches { position: relative; display: grid; gap: 10px; margin-top: 14px; padding-left: 26px; }
.org-branches::before { content: ""; position: absolute; left: 10px; top: -14px; bottom: 22px; width: 1.5px; background: var(--sana-spark); }
.org-row { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 14px; border-radius: var(--sana-r-m); }
.org-row::before { content: ""; position: absolute; left: -16px; top: 50%; width: 16px; height: 1.5px; background: var(--sana-spark); }
.org-row b { font-family: var(--sana-display); font-weight: 600; }
.org-row small { margin-left: auto; font-size: .82rem; opacity: .85; }
.org-row--night { background: var(--sana-night); color: var(--sana-cream); }
.org-row--meadow { background: var(--world-meadow-light); color: var(--world-meadow-deep); }
.org-row--soon { background: #f1eee7; color: var(--sana-muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--sana-night); color: #b8c2cf; padding-block: 48px calc(48px + env(safe-area-inset-bottom, 0px)); position: relative; }
.footer-row { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: flex-start; }
.footer-row nav ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: 6px 28px; }
.footer-row nav a { color: #dfe5ec; text-decoration: none; font-size: var(--sana-step--1); }
.footer-row nav a:hover { color: var(--sana-spark); }
.footer-note { margin-top: 18px; max-width: 60ch; font-size: var(--sana-step--1); }

/* ---------- Direction page ---------- */
.dir-hero { padding-block: clamp(48px, 7vw, 96px); overflow: hidden; }
.dir-hero .crumb { display: inline-flex; gap: 6px; font-size: var(--sana-step--1); text-decoration: none; opacity: .85; }
.dir-hero .crumb:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.dir-hero h1 { margin-top: 18px; font-size: var(--sana-step-4); }
.dir-hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 40px; align-items: center; }
.dir-scene { max-width: 400px; }
.dir-emblem { justify-self: center; width: min(240px, 60%); aspect-ratio: 1; color: var(--sana-spark); opacity: .95; }
.dir--rings .dir-emblem { color: var(--world-rings-accent); } .dir--dusk .dir-emblem { color: var(--world-dusk-accent); }
.dir--lighthouse .dir-emblem { color: var(--world-lighthouse-accent); }
@media (max-width: 860px) { .dir-hero-grid { grid-template-columns: minmax(0, 1fr); } .dir-scene, .dir-emblem { display: none; } }
.dir-hero .world-tag { font-size: var(--sana-step-2); line-height: 1.25; max-width: 24ch; }
.dir-kind { margin-top: 16px; font-size: var(--sana-step--1); opacity: .85; }
.dir-body { padding-block: clamp(44px, 6vw, 80px); }
.dir-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); }
.dir-cols h2 { font-size: var(--sana-step-1); margin-bottom: 12px; }
.dir-cols p { max-width: 60ch; }
.dir-cols ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.dir-block { margin-top: 32px; }
.dir-cols > div > .dir-block:first-child { margin-top: 0; }
.notice { padding: 14px 18px; border-radius: var(--sana-r-m); background: #fff6df; color: #6b4a0f; font-size: var(--sana-step--1); margin-bottom: 28px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.split > div { padding: 18px; border-radius: var(--sana-r-m); border: 1px solid var(--sana-line); background: #fff; }
.split h3 { font-size: 1.05rem; margin-bottom: 6px; }

.dir--night .dir-hero { background: var(--sana-night); color: var(--sana-cream); } .dir--night .dir-hero .world-tag { color: #f3d388; }
.dir--sea .dir-hero { background: var(--world-sea-deep); color: var(--world-sea-light); } .dir--sea .dir-hero .world-tag { color: #9fe4e3; }
.dir--meadow .dir-hero { background: var(--world-meadow-deep); color: var(--world-meadow-light); } .dir--meadow .dir-hero .world-tag { color: var(--world-meadow-accent); }
.dir--rings .dir-hero { background: var(--world-rings-deep); color: var(--world-rings-light); } .dir--rings .dir-hero .world-tag { color: var(--world-rings-accent); }
.dir--dusk .dir-hero { background: var(--world-dusk-deep); color: var(--world-dusk-light); } .dir--dusk .dir-hero .world-tag { color: var(--world-dusk-accent); }
.dir--lighthouse .dir-hero { background: var(--world-lighthouse-deep); color: var(--world-lighthouse-light); } .dir--lighthouse .dir-hero .world-tag { color: var(--world-lighthouse-accent); }
.dir--prism .dir-hero { background: var(--world-prism-deep); color: var(--world-prism-light); } .dir--prism .dir-hero .world-tag { color: var(--sana-spark); }
.dir-hero .btn--solid { background: var(--sana-spark); color: var(--sana-night); }
.dir-hero .btn--ghost { color: inherit; }

/* ---------- Schools page ---------- */
.roles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.roles li { padding: 20px; border-radius: var(--sana-r-l); background: #fff; border: 1px solid var(--sana-line); }
.roles h3 { font-size: 1.1rem; margin-bottom: 6px; color: var(--sana-night); }
.flow { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 12px; }
.flow li { counter-increment: step; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px 16px; border-radius: var(--sana-r-m); background: var(--world-meadow-light); color: var(--world-meadow-deep); }
.flow li::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--world-meadow-deep); color: var(--world-meadow-accent); font-weight: 700; font-family: var(--sana-display); }
.section-title { font-size: var(--sana-step-2); margin-bottom: 18px; color: var(--sana-night); }
.section + .section { margin-top: 48px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .world-grid, .teaser-grid, .access-grid, .dir-cols { grid-template-columns: minmax(0, 1fr); }
  .world--flip .world-grid > .world-copy { order: 0; }
  .scene { max-width: 420px; aspect-ratio: 16 / 10; }
  .life-list { grid-template-columns: minmax(0, 1fr); }
  .roles, .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .world-copy, .life .wrap > *, .dir-body .wrap { padding-left: 14px; }
}

/* ---------- Motion: one moment — the hero thread draws in and the spark lights up ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* A top-to-bottom wipe (dash tricks break with non-scaling strokes). */
  html:not(.a-calm) .hero .thread-seg { clip-path: inset(0 0 100% 0); animation: sana-draw 1.8s .25s var(--sana-ease) forwards; }
  html:not(.a-calm) .hero .spark-end { animation: sana-spark 1s 2.1s both; }
}
@keyframes sana-draw { to { clip-path: inset(0 0 0 0); } }
@keyframes sana-spark { from { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(-60deg); } to { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); } }

/* ---------- Reading modes (Inclusive baseline) ---------- */
html.a-large { font-size: 118%; }
html.a-calm *, html.a-calm *::before, html.a-calm *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a-contrast body { background: #fff; color: #000; }
html.a-contrast .world, html.a-contrast .life, html.a-contrast .hero, html.a-contrast .dir-hero, html.a-contrast .site-header, html.a-contrast .site-footer { background: #000 !important; color: #fff !important; }
html.a-contrast .world--meadow, html.a-contrast .access, html.a-contrast .teaser { background: #fff !important; color: #000 !important; }
html.a-contrast .world-desc, html.a-contrast .world-meta, html.a-contrast .hero-lead, html.a-contrast .life-lead, html.a-contrast .life-item p, html.a-contrast .access p, html.a-contrast .teaser p { color: inherit !important; }
html.a-contrast .stars, html.a-contrast .scene { opacity: .35; }
html.a-contrast a, html.a-contrast .btn { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
