/* XAG — homepage styles. Self-contained: no external fonts, no external requests. */

:root {
  --bg: #060b1c;
  --bg-2: #0a1230;
  --ink: #f2f6ff;
  --ink-2: rgba(242, 246, 255, 0.70);
  --ink-3: rgba(242, 246, 255, 0.54);
  --line: rgba(242, 246, 255, 0.10);
  --royal: #0a2a6b;
  --blue: #1356d6;
  --sky: #1aa3ff;
  --ice: #7fd0ff;
  --gold: #ffb000;
  --orange: #ff8a00;
  --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Inter, Roboto, Arial, sans-serif;
  --font-text: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, Roboto, Arial, sans-serif;
  --gutter: clamp(1.25rem, 6vw, 7rem);
  --max: 1320px;
  --nav-h: 76px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --sy: 0;
  --mx: 0;
  --my: 0;
  --p: 0;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}
html.motion:not(.intro-done) { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  line-height: 1.5;
  font-size: 1rem;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 2px; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: fixed; top: 0.75rem; left: 0.75rem; z-index: 200;
  padding: 0.6rem 1rem; background: var(--gold); color: #140b00; font-weight: 600;
  transform: translateY(-200%); transition: transform 0.2s;
}
.skip:focus { transform: none; }

::selection { background: rgba(255, 176, 0, 0.35); color: var(--ink); }

/* ------------------------------------------------------------------ intro overlay */
.intro {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: none;
}
html.motion:not(.intro-done) .intro { display: block; }
html.motion .intro.out { display: block; opacity: 0; transition: opacity 1s ease 0.05s; pointer-events: none; }
.intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-skip {
  position: absolute; right: var(--gutter); bottom: 1.6rem;
  background: none; border: 1px solid var(--line); color: var(--ink-2);
  font-size: 0.66rem; letter-spacing: 0.26em; text-transform: uppercase;
  padding: 0.75rem 1.2rem; cursor: pointer;
  opacity: 0; animation: fade-in 0.8s ease 1.1s forwards;
  transition: color 0.3s, border-color 0.3s;
}
.intro-skip:hover, .intro-skip:focus-visible { color: var(--ink); border-color: var(--gold); }
@keyframes fade-in { to { opacity: 1; } }

/* ------------------------------------------------------------------ top bar */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 80;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  transition: background 0.5s, box-shadow 0.5s, opacity 1s var(--ease) 0.2s, transform 1s var(--ease) 0.2s;
}
.top.scrolled {
  background: rgba(6, 11, 28, 0.66);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 1px 0 var(--line);
}
html.lite .top.scrolled { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
html.motion:not(.intro-done) .top { opacity: 0; transform: translateY(-12px); }

.brand-lockup { display: flex; align-items: center; gap: 0.9rem; }
.brand { display: inline-flex; align-items: center; }
.brand img { height: 38px; width: auto; }
.top-seal { display: inline-block; line-height: 0; color: var(--gold); }
.top-seal .seal { width: 48px; height: 48px; filter: drop-shadow(0 0 6px rgba(255, 176, 0, 0.45)); }
html.lite .top-seal .seal { filter: none; }

.nav { margin-inline: auto; }
.nav ul { display: flex; gap: 2.4rem; }
.nav a {
  display: inline-block; position: relative; padding: 0.45rem 0;
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-2); transition: color 0.3s;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: right;
  transition: transform 0.55s var(--ease);
}
.nav a:hover, .nav a:focus-visible, .nav a[aria-current] { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current]::after { transform: none; transform-origin: left; }

.menu-btn {
  display: none; align-items: center; gap: 0.7rem; margin-left: 1.4rem;
  background: none; border: 0; padding: 0.6rem 0; cursor: pointer;
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink);
}
.menu-btn-bars { display: block; width: 22px; height: 1px; background: currentColor; position: relative; }
.menu-btn-bars::before, .menu-btn-bars::after {
  content: ""; position: absolute; left: 0; width: 100%; height: 1px; background: currentColor;
}
.menu-btn-bars::before { top: -6px; }
.menu-btn-bars::after { top: 6px; width: 60%; }

/* full-screen menu (small screens) */
.menu {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg);
  display: grid; align-content: center;
  padding: var(--gutter);
  visibility: hidden; opacity: 0;
  clip-path: circle(0 at calc(100% - 3rem) 2.4rem);
  transition: clip-path 0.9s var(--ease), opacity 0.4s, visibility 0s 0.9s;
}
.menu.open {
  visibility: visible; opacity: 1;
  clip-path: circle(170% at calc(100% - 3rem) 2.4rem);
  transition: clip-path 0.9s var(--ease), opacity 0.2s, visibility 0s;
}
html:not(.motion) .menu { transition: none; clip-path: none; }
.menu ul { display: grid; gap: 0.3rem; }
.menu a {
  display: flex; gap: 1rem; align-items: baseline;
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(2rem, 9vw, 3.4rem); letter-spacing: -0.02em; line-height: 1.2;
  padding: 0.3rem 0;
}
.menu a small { font-size: 0.68rem; letter-spacing: 0.3em; color: var(--gold); min-width: 2.2em; }
.menu-close {
  position: absolute; top: calc((var(--nav-h) - 2.4rem) / 2); right: var(--gutter);
  background: none; border: 1px solid var(--line); color: var(--ink);
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; padding: 0.7rem 1.1rem; cursor: pointer;
}

/* ------------------------------------------------------------------ chapters */
.chapter {
  position: relative; isolation: isolate;
  min-height: 100vh; min-height: 100svh;
  display: grid; align-content: center;
  padding: clamp(5rem, 14vh, 10rem) var(--gutter);
  overflow: clip;
}
.wrap {
  max-width: var(--max); width: 100%; margin-inline: auto;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 1.5rem;
}
.wrap > * { grid-column: 1 / -1; min-width: 0; }
@media (min-width: 900px) {
  .wrap > .kinetic { grid-column: 1 / 11; }
  .wrap > .lede { grid-column: 4 / 10; }
  .wrap > .soon { grid-column: 4 / 10; }
}

/* one key light behind the whole page: six pre-lit positions, cross-faded by opacity only
   (compositor work, no repaints), with the vignette folded into the same layer */
.keylight { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.keylight i {
  position: absolute; inset: 0; display: block; opacity: 0;
  transition: opacity 2.2s ease;
  background-image:
    radial-gradient(closest-side, rgba(19, 86, 214, 0.36), rgba(19, 86, 214, 0)),
    radial-gradient(closest-side, rgba(255, 138, 0, 0.16), rgba(255, 138, 0, 0)),
    radial-gradient(120% 90% at 50% 45%, rgba(2, 4, 12, 0) 55%, rgba(2, 4, 12, 0.64) 100%);
  background-repeat: no-repeat;
  background-size: 120vmax 120vmax, 64vmax 64vmax, 100% 100%;
  background-position: var(--kb), var(--kg), 0 0;
}
.keylight i[data-k="home"] { --kb: 50% 22%; --kg: 78% 62%; opacity: 1; }
.keylight i[data-k="families"] { --kb: 2% 78%; --kg: 112% 12%; }
.keylight i[data-k="business-apps"] { --kb: 104% 10%; --kg: -14% 96%; }
.keylight i[data-k="developer-tools"] { --kb: 108% 86%; --kg: -8% 14%; }
.keylight i[data-k="about"] { --kb: 96% 84%; --kg: -16% -10%; }
.keylight i[data-k="contact"] { --kb: -6% -4%; --kg: 56% 58%; }
html[data-chapter] .keylight i[data-k="home"] { opacity: 0; }
html[data-chapter="home"] .keylight i[data-k="home"],
html[data-chapter="families"] .keylight i[data-k="families"],
html[data-chapter="business-apps"] .keylight i[data-k="business-apps"],
html[data-chapter="developer-tools"] .keylight i[data-k="developer-tools"],
html[data-chapter="about"] .keylight i[data-k="about"],
html[data-chapter="contact"] .keylight i[data-k="contact"] { opacity: 1; }

/* the "cut": a hairline of gold that draws itself where one chapter becomes the next */
.chapter::after {
  content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px;
  background: linear-gradient(90deg, rgba(255, 176, 0, 0.9), rgba(255, 176, 0, 0.14) 55%, transparent);
  transform: scaleX(0); transform-origin: left; transition: transform 1.4s var(--ease);
}
html:not(.motion) .chapter::after, .chapter.in::after { transform: none; }
.hero::after { display: none; }

.chapter-num {
  position: absolute; right: calc(var(--gutter) * 0.5); top: 50%; z-index: -1;
  font-family: var(--font-display); font-weight: 600; line-height: 1;
  font-size: clamp(11rem, 32vw, 30rem);
  color: transparent; -webkit-text-stroke: 1px rgba(242, 246, 255, 0.07);
  transform: translateY(-50%);
  pointer-events: none; user-select: none;
}

.chapter-mark {
  display: flex; align-items: center; gap: 1rem;
  font-size: 0.68rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 2.2rem;
}
.chapter-mark::before {
  content: ""; width: 3rem; height: 1px; background: var(--gold);
  transform-origin: left; transition: transform 1s var(--ease) 0.1s;
}
html.motion .chapter-mark::before { transform: scaleX(0); }
html.motion .in .chapter-mark::before { transform: none; }

.kinetic {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(1.9rem, 0.6rem + 7vw, 6.6rem);
  line-height: 1.02; letter-spacing: -0.022em;
  margin-bottom: 1.8rem;
}
.kinetic em { font-style: normal; font-weight: 600; color: var(--gold); }

.line { display: block; overflow: hidden; padding-block: 0.08em; margin-block: -0.08em; white-space: nowrap; }
@media (max-width: 360px) { .line { white-space: normal; } }
.line-in { display: block; }
html.motion .line-in {
  transform: translateY(112%) rotate(0.5deg); transform-origin: left top;
  transition: transform 1.2s var(--ease);
}
html.motion .line:nth-child(2) .line-in { transition-delay: 0.12s; }
html.motion .line:nth-child(3) .line-in { transition-delay: 0.24s; }
html.motion .in .line-in { transform: none; }
html.motion .kinetic { letter-spacing: 0.08em; transition: letter-spacing 1.9s var(--ease); }
html.motion .in .kinetic { letter-spacing: -0.022em; }

.lede {
  font-weight: 300; font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem);
  color: var(--ink-2); max-width: 44ch; margin-bottom: 3.5rem; line-height: 1.55;
}

html.motion .reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--d, 0.25s);
}
html.motion .in .reveal { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ hero */
.hero {
  place-items: center; text-align: center;
  gap: clamp(1.2rem, 3vh, 2.2rem);
  padding-top: calc(var(--nav-h) + 2vh);
  padding-bottom: 7.5rem;
}

.hero-visual { position: relative; width: min(78vw, 1000px, calc((100vh - 31rem) * 2.37)); min-width: min(92vw, 420px); }
.hero-logo {
  width: 100%; aspect-ratio: 1600 / 674;
  transform: translate3d(calc(var(--mx) * 10px), calc(var(--sy) * -0.22px + var(--my) * 8px), 0);
  will-change: transform;
}
html.motion .hero-visual { opacity: 1; transition: opacity 1s; }

.flare {
  position: absolute; width: 24vmin; height: 24vmin; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 190, 40, 0.62) 0, rgba(255, 138, 0, 0.22) 26%, transparent 62%);
  opacity: 0.55;
  transform: translate3d(calc(var(--mx) * -16px), calc(var(--sy) * -0.1px + var(--my) * -12px), 0);
}
.flare::after {
  content: ""; position: absolute; left: -140%; right: -140%; top: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 210, 110, 0.38) 35%, rgba(255, 230, 170, 0.5) 50%, rgba(255, 210, 110, 0.38) 65%, transparent);
  box-shadow: 0 0 8px 1px rgba(255, 176, 0, 0.22);
  transform: translateY(-50%);
}
.flare-a { left: -3%; bottom: 2%; }
.flare-b { left: 38%; top: -8%; width: 16vmin; height: 16vmin; }
html.motion .flare-a { animation: flare 9s ease-in-out infinite alternate; }
html.motion .flare-b { animation: flare 7s ease-in-out 2s infinite alternate; }
@keyframes flare { 0% { opacity: 0.42; } 50% { opacity: 0.7; } 100% { opacity: 0.5; } }
html.lite .flare { opacity: 0.35; }

.hero-title {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(2rem, 0.8rem + 4.4vw, 5rem);
  line-height: 1.04; letter-spacing: -0.022em;
}
html.motion .hero-title { letter-spacing: 0.06em; transition: letter-spacing 2s var(--ease) 0.2s; }
html.motion.intro-done .hero-title, html.motion .hero.in .hero-title { letter-spacing: -0.022em; }
html.motion .hero .line-in { transition-delay: 0.15s; }
html.motion .hero .line:nth-child(2) .line-in { transition-delay: 0.3s; }

/* a single pass of light across the title once it has landed */
html.motion .hero-title .line-in {
  background: linear-gradient(100deg, var(--ink) 0 38%, #fff3cf 46%, var(--gold) 50%, #fff3cf 54%, var(--ink) 62% 100%);
  background-size: 300% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
html.motion .hero.in .hero-title .line-in { animation: sheen 2.4s ease-in-out 1.1s 1 both; }
@keyframes sheen { from { background-position: 100% 0; } to { background-position: 0% 0; } }

.hero-sub {
  font-weight: 300; font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  color: var(--ink-2); max-width: 46ch;
}
html.motion .hero-sub { opacity: 0; transform: translateY(18px); transition: opacity 1.2s var(--ease) 0.6s, transform 1.2s var(--ease) 0.6s; }
html.motion .hero.in .hero-sub { opacity: 1; transform: none; }

.cue {
  position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%);
  width: auto; margin: 0;
  font-size: 0.62rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--ink-2);
  padding: 0.4rem 0.2rem;
}
.cue::after {
  content: ""; display: block; width: 1px; height: 42px; margin: 0.7rem auto 0;
  background: linear-gradient(var(--gold), transparent); transform-origin: top;
}
html.motion .cue { opacity: 0; transition: opacity 1.2s ease 1.4s; }
html.motion .hero.in .cue { opacity: 1; }
html.motion .cue::after { animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 45% { transform: scaleY(1); transform-origin: top; } 46% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ------------------------------------------------------------------ families */
.split {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 1px; background: var(--line); border-block: 1px solid var(--line);
}
.family {
  display: block; position: relative;
  padding: 2.6rem clamp(1.4rem, 3vw, 2.6rem); background: var(--bg);
  transition: background 0.6s var(--ease);
}
.family::before {
  content: ""; position: absolute; left: 0; top: 0; width: 2.2rem; height: 1px; background: var(--gold);
  transition: width 0.7s var(--ease);
}
.family:hover::before, .family:focus-visible::before { width: 100%; }
.family .eyebrow {
  display: block; margin-bottom: 1.1rem;
  font-size: 0.64rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold);
}
.family:hover, .family:focus-visible { background: rgba(19, 86, 214, 0.12); }
.family strong { display: block; font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; margin-bottom: 0.55rem; }
.family .desc { display: block; color: var(--ink-2); font-weight: 300; max-width: 40ch; line-height: 1.5; }
.family .go {
  display: inline-block; margin-top: 1.2rem; color: var(--gold);
  font-size: 0.68rem; letter-spacing: 0.26em; text-transform: uppercase;
  transition: transform 0.6s var(--ease);
}
.family:hover .go { transform: translateX(6px); }

/* ------------------------------------------------------------------ product cards */
/* any number of cards: columns are whatever fits, rows wrap, partial rows keep their ledger lines */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.card { background: var(--bg); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.card-static { display: none; }
.card-static:only-child { display: block; padding: 1.5rem; color: var(--ink-2); }
.card-link {
  position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 1.4rem;
  min-height: 16rem; height: 100%; padding: 1.5rem 1.5rem 1.35rem;
  transition: background 0.6s var(--ease);
}
.card-link::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 60% at 85% 0%, rgba(26, 163, 255, 0.18), transparent 70%);
  opacity: 0; transition: opacity 0.7s var(--ease);
}
.card-link:hover::before, .card-link:focus-visible::before { opacity: 1; }
.card-link:hover { background: rgba(19, 86, 214, 0.08); }
.card-head { display: flex; align-items: center; gap: 1rem; }
.chip {
  font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold);
  border: 1px solid rgba(255, 176, 0, 0.45); border-radius: 999px; padding: 0.34em 0.75em; white-space: nowrap;
}
.card-name {
  display: block; font-family: var(--font-display); font-size: 1.32rem; font-weight: 600;
  letter-spacing: -0.01em; line-height: 1.2; margin-bottom: 0.5rem;
}
.card-tag { display: block; color: var(--ink-2); font-weight: 300; line-height: 1.45; }
.card-foot { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.card-for { font-size: 0.78rem; color: var(--ink-3); line-height: 1.4; }
.card-arrow { color: var(--gold); font-size: 1.15rem; line-height: 1; transition: transform 0.6s var(--ease); }
.card-link:hover .card-arrow, .card-link:focus-visible .card-arrow { transform: translateX(6px); }

html.motion .card {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(0.2s + min(var(--i, 0) * 65ms, 0.7s));
}
html.motion .in .card { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ seal: 27 years in education (canonical mark, assets/badge-27-years.svg) */
.seal-wrap { display: inline-block; line-height: 0; color: var(--gold); }
.seal { display: block; width: 140px; height: 140px; }
.seal-hero { margin-top: 0.4rem; }
html.motion .seal-hero { opacity: 0; transform: translateY(10px); transition: opacity 1.4s ease 1.3s, transform 1.4s var(--ease) 1.3s; }
html.motion .hero.in .seal-hero { opacity: 1; transform: none; }
.seal-about { margin-top: 0.2rem; margin-bottom: 2.2rem; }
.seal-about .seal { width: 104px; height: 104px; opacity: 0.92; }
@media (min-width: 901px) {
  .seal-hero { position: absolute; left: var(--gutter); bottom: 2.2rem; margin: 0; }
  .wrap > .seal-about { grid-column: 1 / 4; grid-row: 3; align-self: start; justify-self: start; margin-bottom: 0; }
}
@media (max-width: 760px) {
  .seal { width: 116px; height: 116px; }
}

/* ------------------------------------------------------------------ photo slots (hidden until a file exists) */
.photo {
  position: relative; display: none; margin: 0; overflow: hidden;
  background: linear-gradient(160deg, #10204f 0%, #0a1434 45%, #060b1c 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent), linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent), linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
  mask-composite: intersect;
}
.photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  transform: translate3d(0, var(--py, 0px), 0) scale(1.08);
}
.photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(85% 85% at 50% 50%, rgba(6, 11, 28, 0) 45%, rgba(6, 11, 28, 0.78) 100%);
}
.photo.missing { display: none !important; }
.photo-a, .photo-c { aspect-ratio: 4 / 5; }
.photo-b { aspect-ratio: 1 / 1; }
html.motion .photo { opacity: 0; transition: opacity 1.8s ease 0.3s; }
html.motion .in .photo { opacity: 1; }
html.motion .photo img { transition: transform 0.2s linear; }
html.photos-demo .photo img { visibility: hidden; }
html.photos-demo .photo.missing { display: block !important; }
@media (max-width: 1279px) { html.photos-demo .photo-b.missing, html.photos-demo .photo-c.missing { display: none !important; } }

@media (min-width: 1280px) {
  .wrap > .photo { display: block; grid-column: 10 / -1; grid-row: 1 / 4; align-self: start; width: 100%; }
  .wrap.has-photo > .chapter-mark { grid-column: 1 / 10; }
  .wrap.has-photo > .kinetic { grid-column: 1 / 10; }
}
@media (max-width: 1279px) {
  .wrap > .photo-a { display: block; aspect-ratio: 16 / 9; max-height: 400px; margin-bottom: 2.6rem; }
  .wrap > .photo-b, .wrap > .photo-c { display: none; }
}
@media (max-width: 760px) {
  .wrap > .photo-a { aspect-ratio: 16 / 10; margin-bottom: 2rem; }
}

/* ------------------------------------------------------------------ about */
.principles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 2.6rem clamp(2rem, 4vw, 4rem); border-top: 1px solid var(--line); padding-top: 2.6rem;
}
.principle .p-idx { display: block; color: var(--gold); font-size: 0.7rem; letter-spacing: 0.3em; margin-bottom: 1.1rem; }
.principle h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; margin-bottom: 0.6rem; }
.principle p { color: var(--ink-2); font-weight: 300; max-width: 34ch; line-height: 1.55; }
.principle:nth-child(2) { --d: 0.4s; }
.principle:nth-child(3) { --d: 0.55s; }

/* ------------------------------------------------------------------ contact */
.soon {
  position: relative; max-width: 560px; margin-inline: 0; padding: 2.2rem 2.4rem;
  border: 1px solid rgba(255, 176, 0, 0.35);
  background: linear-gradient(180deg, rgba(255, 176, 0, 0.06), rgba(255, 176, 0, 0));
}
.soon::before {
  content: ""; position: absolute; top: -1px; left: -1px; width: 2.2rem; height: 2.2rem;
  border-top: 1px solid var(--gold); border-left: 1px solid var(--gold);
}
.soon-k { display: block; font-size: 0.64rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }
.soon p { color: var(--ink-2); font-weight: 300; line-height: 1.55; }

/* ------------------------------------------------------------------ footer */
.foot {
  display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; justify-content: space-between; align-items: center;
  padding: 2.4rem var(--gutter) 3.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2);
}
.foot-brand { display: flex; align-items: center; gap: 1.1rem; }
.foot-seal { display: inline-block; line-height: 0; color: var(--gold); }
.foot-seal .seal { width: 60px; height: 60px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.4rem 2rem; }
.foot a.foot-link { color: var(--ink-2); }
.foot a.foot-link:hover { color: var(--ink); }
.foot-link { color: var(--ink-3); cursor: not-allowed; }
.foot-link small { font-size: 0.56rem; letter-spacing: 0.14em; margin-left: 0.35rem; color: var(--ink-3); }

/* ------------------------------------------------------------------ status light */
.status {
  display: flex; align-items: center; gap: 0.6rem; white-space: nowrap;
  font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2);
}
.status .dot {
  width: 7px; height: 7px; border-radius: 50%; background: rgba(242, 246, 255, 0.4);
  transition: background 0.5s, box-shadow 0.5s;
}
.status.ok .dot { background: #35e07a; box-shadow: 0 0 10px rgba(53, 224, 122, 0.85); }
.status.bad .dot { background: #ff5a5a; box-shadow: 0 0 10px rgba(255, 90, 90, 0.85); }
.status.bad .status-text { color: #ff8a8a; }
@media (max-width: 1100px) {
  .status:not(.bad) .status-label, .status:not(.bad) .status-sep {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
}

/* ------------------------------------------------------------------ atmosphere */
.rail {
  position: fixed; right: 1.1rem; top: 50%; z-index: 70; width: 1px; height: 120px;
  background: var(--line); transform: translateY(-50%); pointer-events: none;
}
.rail i { position: absolute; inset: 0; background: var(--gold); transform: scaleY(var(--p)); transform-origin: top; }

/* film grain: one small tile with its own faint alpha, stepped like a projector */
.film {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: url("../assets/grain.c56ba8b5.png") repeat 0 0 / 128px 128px;
}
html.motion .film { animation: film 1.4s steps(7) infinite; }
@keyframes film {
  0% { background-position: 0 0; }
  14% { background-position: -37px 23px; }
  28% { background-position: 29px -51px; }
  42% { background-position: -61px -17px; }
  56% { background-position: 47px 41px; }
  70% { background-position: -19px 59px; }
  84% { background-position: 63px -29px; }
  100% { background-position: 0 0; }
}
html.lite .film { display: none; }

.cursor {
  position: fixed; left: 0; top: 0; z-index: 120; pointer-events: none;
  width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  border: 1px solid rgba(242, 246, 255, 0.7);
  opacity: 0;
  transition: opacity 0.4s, width 0.4s var(--ease), height 0.4s var(--ease), margin 0.4s var(--ease), border-color 0.4s;
}
html.fine .cursor.live { opacity: 1; }
.cursor.on { width: 60px; height: 60px; margin: -30px 0 0 -30px; border-color: var(--gold); }
.cursor.down { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
[data-magnet] { transition: transform 0.5s var(--ease); }

/* ------------------------------------------------------------------ 404 */
.page-404 .chapter { min-height: 100vh; padding-top: calc(var(--nav-h) + 4rem); }
.page-404 .top { opacity: 1; transform: none; }
.page-404 .chapter::after { display: none; }
.btn {
  display: inline-block; margin-top: 0.5rem; padding: 0.9rem 1.5rem; border: 1px solid var(--gold); color: var(--gold);
  font-size: 0.7rem; letter-spacing: 0.26em; text-transform: uppercase; transition: background 0.4s, color 0.4s;
}
.btn:hover, .btn:focus-visible { background: var(--gold); color: #140b00; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 900px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .status { margin-left: auto; }
}
@media (max-width: 760px) {
  :root { --nav-h: 64px; }
  .brand img { height: 28px; }
  .brand-lockup { gap: 0.6rem; }
  .top-seal .seal { width: 38px; height: 38px; }
  .hero-visual { width: 92vw; }
  .hero { gap: 1.6rem; padding-bottom: 7.5rem; min-height: 100vh; min-height: 100svh; }
  .chapter:not(.hero) { padding-block: 5.5rem; min-height: 0; }
  .chapter-num { font-size: 42vw; right: 0; top: 4rem; transform: none; }
  .kinetic { margin-bottom: 1.4rem; }
  .lede { margin-bottom: 2.4rem; }
  .card-link { min-height: 0; }
  .rail { display: none; }
  .foot { padding-bottom: 1.6rem; }
  .flare { display: none; }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .nav ul { gap: 1.5rem; }
}

/* ------------------------------------------------------------------ reduced motion: a still, complete page */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .intro, .film, .keylight, .cursor, .rail, .status, .menu, .cue { display: none !important; }
  html, body { background: #fff; color: #000; }
}

/* Public contact address (Contact chapter) */
.soon a.mail { color: var(--gold, #ffb000); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; overflow-wrap: anywhere; }
.soon a.mail:hover, .soon a.mail:focus-visible { text-decoration-thickness: 2px; }
