/* Avaiki Tech Academy — site design system.
   Tokens carried over from the ATAC proposal document so print and web match. */

:root {
  --ground: #F3F6F5;
  --surface: #FFFFFF;
  --sunken: #EEF5F4;
  --ink: #132A2F;
  --muted: #566B70;
  --rule: #D3DFDE;
  --rule-strong: #A9BDBD;
  --lagoon: #0E6B70;
  --lagoon-soft: #DDEDEC;
  --indigo: #3B4A94;
  --indigo-soft: #E4E7F4;
  --on-lagoon: #FFFFFF;   /* text that sits ON the lagoon fill */

  /* the night band — the screensaver's own world, identical in both themes */
  --night: #05090B;
  --night-2: #0A1318;
  --night-ink: #E8F2F1;
  --night-muted: #8FA6A9;
  --night-rule: rgba(232, 242, 241, .16);

  --display: "Rajdhani", "Chakra Petch", "JetBrains Mono", sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --pad: 28px;
  --max: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0B1A1E;
    --surface: #10242A;
    --sunken: #0E2126;
    --ink: #E2EDEB;
    --muted: #93A9AB;
    --rule: #22393F;
    --rule-strong: #3A565C;
    --lagoon: #55C2BE;
    --lagoon-soft: #12343A;
    --indigo: #A3AEF0;
    --indigo-soft: #1B2447;
    --on-lagoon: #05191B;
  }
}

:root[data-theme="dark"] {
  --ground: #0B1A1E;
  --surface: #10242A;
  --sunken: #0E2126;
  --ink: #E2EDEB;
  --muted: #93A9AB;
  --rule: #22393F;
  --rule-strong: #3A565C;
  --lagoon: #55C2BE;
  --lagoon-soft: #12343A;
  --indigo: #A3AEF0;
  --indigo-soft: #1B2447;
  --on-lagoon: #05191B;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--lagoon); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--lagoon); outline-offset: 3px; border-radius: 2px;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; text-wrap: balance; }
h1 { font-family: var(--display); font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1.04; letter-spacing: .005em; }
h2 { font-family: var(--display); font-size: clamp(1.75rem, 3.5vw, 2.5rem); line-height: 1.14; letter-spacing: .005em; }
h3 { font-family: var(--display); font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.22; letter-spacing: .01em; }
h4 { font-family: var(--body); font-size: 1.04rem; font-weight: 700; line-height: 1.35; }
p { margin: 0; }
ul { margin: 0; padding-left: 1.15rem; }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--pad); }
.measure { max-width: 64ch; }
.label {
  font-family: var(--body);
  font-size: .72rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--lagoon);
}
.mono { font-family: var(--mono); font-size: .86em; }
.num { font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; }
.gap-s { gap: .55rem; } .gap-m { gap: 1rem; } .gap-l { gap: 1.7rem; }

/* ---------------------------------------------------------- header */
.site-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.site-head .wrap {
  display: flex; align-items: center; gap: 1.2rem;
  padding-block: .75rem; min-height: 60px;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { width: 32px; height: 32px; }
.brand img { filter: invert(1); }  /* white art, inked for the light ground */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img { filter: none; } }
:root[data-theme="dark"] .brand img { filter: none; }
:root[data-theme="light"] .brand img { filter: invert(1); }
.brand b {
  font-family: var(--mono); font-size: .76rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; line-height: 1.15;
}
.brand b span { display: block; color: var(--muted); font-weight: 400; letter-spacing: .13em; }
.site-nav { display: flex; gap: 1.4rem; align-items: center; }
.site-nav a {
  font-size: .9rem; font-weight: 600; color: var(--muted); text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--lagoon); }
@media (max-width: 720px) {
  .site-nav { display: none; }
}

/* ---------------------------------------------------------- night band */
.night {
  background: var(--night);
  color: var(--night-ink);
  position: relative;
  overflow: hidden;
}
.night::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 8%, rgba(85,194,190,.10), transparent 60%),
              radial-gradient(90% 70% at 50% 100%, rgba(59,74,148,.22), transparent 65%);
}
.night .label { color: #6FD3CE; }
.night a:not(.btn) { color: #9FD9D5; }  /* buttons keep their own ink */

.hero {
  padding-block: clamp(2.2rem, 6vw, 4rem) clamp(2.6rem, 7vw, 4.6rem);
  min-height: clamp(540px, 86vh, 860px);
  display: grid; place-items: center;
}
.hero .wrap { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 1.15rem; text-align: center; }

/* The screensaver behind the hero. tte.js lays a canvas over .hero-art; hero-fx.js sizes the <pre>. */
.hero-fx {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; user-select: none; overflow: hidden;
}
.hero-art {
  margin: 0; overflow: hidden; white-space: pre; color: transparent;
  font-family: var(--mono), "DejaVu Sans Mono", "Segoe UI Symbol", "Apple Braille", monospace;
}
.hero-fx canvas { opacity: .72; }

/* a soft pool of night behind the words so they stay readable over the moving dots */
.hero .wrap::before {
  content: ""; position: absolute; z-index: -1; inset: -14% -8%;
  background: radial-gradient(closest-side, rgba(5,9,11,.72), rgba(5,9,11,.42) 58%, transparent 100%);
  pointer-events: none;
}

.hero-lede {
  font-family: var(--display); font-weight: 700; font-size: clamp(1.45rem, 3.7vw, 2.25rem);
  line-height: 1.24; max-width: 22ch; color: var(--night-ink);
}
.hero-sub { color: var(--night-muted); max-width: 52ch; font-size: 1.02rem; }

.cta-row { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .68rem 1.25rem; border-radius: 999px;
  font-size: .94rem; font-weight: 700; text-decoration: none;
  border: 1px solid transparent; transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: #55C2BE; color: #05191B; }
.btn-primary:hover { background: #6FD3CE; }
.btn-ghost { border-color: var(--night-rule); color: var(--night-ink); }
.btn-ghost:hover { background: rgba(232,242,241,.07); }
.btn-solid { background: var(--lagoon); color: var(--on-lagoon); }
.btn-solid:hover { background: color-mix(in srgb, var(--lagoon) 86%, var(--ink)); }

/* ---------------------------------------------------------- sections */
section { padding-block: clamp(2.6rem, 6vw, 4.4rem); }
.sec-head { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1.8rem; }
.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* launch strip */
.launch {
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  background: var(--sunken);
}
.launch .wrap {
  display: grid; grid-template-columns: 1fr auto; gap: 1.2rem 2.4rem;
  align-items: center; padding-block: 1.5rem;
}
@media (max-width: 760px) { .launch .wrap { grid-template-columns: 1fr; } }

/* stat row */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--rule); border-block: 1px solid var(--rule); }
.stats div { background: var(--ground); padding: 1.2rem 1rem; }
.stats b { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem,3.4vw,2.4rem); line-height: 1.1; color: var(--lagoon); }
.stats span { font-size: .84rem; color: var(--muted); }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* pathway */
.stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 860px) { .stages { grid-template-columns: 1fr; } }
.stage {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 3px; overflow: hidden; display: flex; flex-direction: column;
}
.stage-top { padding: 1.3rem 1.3rem 0; display: flex; align-items: baseline; gap: .7rem; }
.stage-n {
  font-family: var(--mono); font-size: .74rem; font-weight: 700; letter-spacing: .1em;
  color: var(--on-lagoon); background: var(--lagoon); border-radius: 999px;
  padding: .12rem .6rem;
}
.stage-gate { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-left: auto; }
.stage-body { padding: .8rem 1.3rem 1.3rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; }
.stage-body p { color: var(--muted); font-size: .97rem; }
.facts { display: flex; flex-direction: column; gap: .3rem; margin-top: auto; padding-top: .9rem; border-top: 1px solid var(--rule); }
.facts div { display: flex; justify-content: space-between; gap: 1rem; font-size: .87rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }

/* map grid */
.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 1.3rem; }
.map-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 3px;
  overflow: hidden; text-decoration: none; color: inherit;
  transition: border-color .18s ease, transform .18s ease;
}
a.map-card:hover { border-color: var(--lagoon); transform: translateY(-2px); }
.map-card figure { margin: 0; flex: 0 0 auto; aspect-ratio: 16 / 9; background: var(--night); overflow: hidden; border-radius: 3px 3px 0 0; }
.map-card figure img { width: 100%; height: 100%; object-fit: cover; }
.map-card .body { padding: 1rem 1.1rem 1.25rem; display: flex; flex-direction: column; gap: .45rem; flex: 1 1 auto; min-height: 0; }
.map-card .n { font-family: var(--mono); font-size: .72rem; font-weight: 700; letter-spacing: .12em; color: var(--lagoon); }
.map-card h4 { font-family: var(--display); font-weight: 700; font-size: 1.26rem; letter-spacing: .01em; }
.map-card .makes { font-size: .9rem; color: var(--muted); margin-top: auto; padding-top: .55rem; }
.map-card .makes b {
  display: block; font-size: .66rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); opacity: .8; margin-bottom: .1rem;
}

/* long map entries (foundations page) */
.map-long { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--rule); border-radius: 3px; overflow: hidden; background: var(--surface); }
.map-long:nth-child(even) .map-long-fig { order: 2; }
.map-long-fig { margin: 0; background: var(--night); position: relative; min-height: clamp(230px, 27vw, 360px); }
.map-long-fig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.map-long-body { padding: clamp(1.3rem, 3vw, 2.1rem); display: flex; flex-direction: column; gap: .8rem; justify-content: center; }
.map-long-head { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.map-long-head .n { font-family: var(--mono); font-size: .76rem; font-weight: 700; letter-spacing: .12em; color: var(--lagoon); }
.map-long-head .hrs { margin-left: auto; font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.map-long-body p.covers { color: var(--muted); font-size: .98rem; }
.makes-box { background: var(--lagoon-soft); border-radius: 2px; padding: .7rem .9rem; font-size: .94rem; }
.builds { font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.makes-box b { display: block; font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--lagoon); margin-bottom: .1rem; }
@media (max-width: 820px) {
  .map-long { grid-template-columns: 1fr; }
  .map-long:nth-child(even) .map-long-fig { order: 0; }
  .map-long-fig { aspect-ratio: 16/10; min-height: 0; }
}

/* split feature */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.split img { border-radius: 3px; width: 100%; aspect-ratio: 7 / 4; object-fit: cover; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 3px; padding: 1.2rem 1.25rem; display: flex; flex-direction: column; gap: .45rem; }
.card p { font-size: .95rem; color: var(--muted); }

/* options (how a school uses it) */
.opts { display: flex; flex-direction: column; }
.opt { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0 1.4rem; padding-block: 1.5rem; border-top: 1px solid var(--rule); }
.opt:last-child { border-bottom: 1px solid var(--rule); }
.opt .tag { font-family: var(--mono); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--lagoon); padding-top: .3rem; }
.opt p { color: var(--muted); font-size: .97rem; }
@media (max-width: 620px) { .opt { grid-template-columns: 1fr; gap: .5rem; } .opt .tag { padding-top: 0; } }

/* pull quote */
.pull { border-left: 3px solid var(--lagoon); padding: .1rem 0 .1rem 1.15rem; font-family: var(--display); font-weight: 700; font-size: clamp(1.2rem, 2.4vw, 1.5rem); line-height: 1.32; }

/* footer */
.site-foot { background: var(--night); color: var(--night-ink); padding-block: 2.8rem 2.2rem; }
.site-foot .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-foot h4 { font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #6FD3CE; margin-bottom: .6rem; }
.site-foot p, .site-foot li { color: var(--night-muted); font-size: .92rem; }
.site-foot ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.site-foot a { color: var(--night-ink); text-decoration: none; }
.site-foot a:hover { color: #9FD9D5; text-decoration: underline; }
.foot-brand { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.foot-brand img { width: 40px; height: 40px; }
.foot-brand b { font-family: var(--mono); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; }
.foot-base { margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid var(--night-rule); display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; font-size: .82rem; color: var(--night-muted); }
@media (max-width: 760px) { .site-foot .wrap { grid-template-columns: 1fr; } }
