/* terredefense.com — the game's Edge look: cold blue-black, ice text, 2 px corners, Tektur headings, Smooch Sans body,
   Martian Mono figures (all self-hosted, OFL) */
@font-face { font-family: 'Tektur'; font-weight: 400 900; font-stretch: 75% 100%; font-display: swap; src: url(fonts/tektur-latin.woff2) format('woff2'); }
@font-face { font-family: 'Smooch Sans'; font-weight: 100 900; font-display: swap; src: url(fonts/smooch-sans-latin.woff2) format('woff2'); }
@font-face { font-family: 'Martian Mono'; font-weight: 100 800; font-stretch: 75% 112.5%; font-display: swap; src: url(fonts/martian-mono-latin.woff2) format('woff2'); }

:root {
  color-scheme: dark;
  --void: #06080D; --fill: #0D1119; --ink: #EAF2FF; --ink-2: #A3B4CC; --ink-3: #8597B0;
  --cyan: #3CF2FF; --go: #48F5B0; --rule: rgba(140, 180, 255, 0.16);
  --title: 'Tektur', 'Avenir Next Condensed', 'Roboto Condensed', sans-serif;
  --body: 'Smooch Sans', 'Avenir Next Condensed', 'Roboto Condensed', sans-serif;
  --mono: 'Martian Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}
* { box-sizing: border-box; }
html { background: var(--void); }
body {
  margin: 0; min-height: 100vh; color: var(--ink-2); font: 600 19px/1.4 var(--body);
  background: radial-gradient(90% 40% at 85% -5%, rgba(40, 110, 255, 0.22), transparent 70%),
              radial-gradient(60% 30% at 0% 0%, rgba(0, 220, 255, 0.10), transparent 70%), var(--void);
  padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right));
}
main, header, footer { max-width: 680px; margin-inline: auto; }
.home main, .home header, .home footer { max-width: 1120px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 20px 8px; }
header a.home { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 15px/1 var(--title); letter-spacing: 0.08em; text-transform: uppercase; }
header a.home img { width: 32px; height: 32px; border-radius: 8px; }
nav { display: flex; gap: 16px; }
nav a { color: var(--ink-3); font: 600 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; }
nav a:hover, nav a:focus-visible, nav a[aria-current] { color: var(--cyan); }
h1 { margin: 28px 0 8px; color: var(--ink); font: 800 34px/1.05 var(--title); letter-spacing: 0.02em; text-transform: uppercase; text-wrap: balance; }
h2 { margin: 32px 0 6px; color: var(--ink); font: 700 13px/1.2 var(--title); letter-spacing: 0.12em; text-transform: uppercase; }
p { margin: 0 0 12px; max-width: 34em; }
a { color: var(--cyan); }
a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.meta { color: var(--ink-3); font: 500 11px/1.4 var(--mono); letter-spacing: 0.04em; }
ul.facts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
ul.facts li { padding: 10px 12px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--rule); border-radius: 2px; }
ul.facts b { display: block; color: var(--ink); font: 700 12px/1.3 var(--title); letter-spacing: 0.08em; text-transform: uppercase; }
.mail { display: inline-block; margin-top: 4px; padding: 12px 14px; color: var(--ink); background: var(--fill); box-shadow: inset 0 0 0 1px var(--cyan); border-radius: 2px; font: 600 14px/1 var(--mono); text-decoration: none; user-select: all; }

/* The landing: the title sequence full-bleed under the header, then bands of copy (hero/ draws the fight) */
.home { padding-inline: 0; --gut: max(20px, env(safe-area-inset-left), env(safe-area-inset-right)); --page: calc(1120px + 2 * var(--gut)); }
.home header { position: absolute; inset: 0 0 auto; z-index: 2; max-width: var(--page); padding: max(18px, env(safe-area-inset-top)) var(--gut) 0; }
.home main { max-width: none; }
.home footer { max-width: var(--page); padding-inline: var(--gut); }
.hero { position: relative; overflow: hidden; isolation: isolate; display: grid; min-height: min(100svh, 940px); }
.hero .stage, .hero .poster, .hero .poster img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero .poster { z-index: -3; }
.hero .poster img { object-fit: cover; }
.hero .stage { z-index: -2; }
/* The scrim keeps the copy readable over the fight: from the bottom on a phone, from the left on a desktop */
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(5, 6, 15, 0.9) 40px, rgba(5, 6, 15, 0) 120px),
              linear-gradient(to top, rgba(5, 6, 15, 0.96) 18%, rgba(5, 6, 15, 0.75) 44%, rgba(5, 6, 15, 0) 66%); }
.hero::after { content: ''; position: absolute; inset: auto 0 0; height: 80px; z-index: -1; pointer-events: none; background: linear-gradient(to top, var(--void), transparent); }
.copy { align-self: end; display: grid; gap: 14px; justify-items: start; width: 100%; max-width: var(--page); margin: 0 auto; padding: 120px var(--gut) 76px; }
.kicker { margin: 0; color: var(--cyan); font: 600 11px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; }
.hero h1 { margin: 0; font: 800 clamp(46px, 13vw, 104px)/0.9 var(--title); letter-spacing: 0.04em; text-shadow: 0 0 28px rgba(60, 242, 255, 0.35), 0 0 2px rgba(60, 242, 255, 0.6); }
.hero h1 span { display: inline-block; }
.hero h1 .w { white-space: nowrap; }
.tagline { margin: 0; color: var(--ink); font: 700 clamp(22px, 5.4vw, 32px)/1.15 var(--body); }
.lede { margin: 0; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.soon { display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--go); background: rgba(72, 245, 176, 0.08); box-shadow: inset 0 0 0 1px rgba(72, 245, 176, 0.5); border-radius: 2px; font: 600 12px/16px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.soon::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--go); box-shadow: 0 0 10px var(--go); animation: beacon 1.6s ease-in-out infinite; }
@keyframes beacon { 50% { opacity: 0.25; box-shadow: 0 0 2px var(--go); } }
/* The fight's own numbers, in the HUD's mono (only while the fight runs) */
.readout { display: none; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-3); font: 500 10px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.hero.ready .readout { display: flex; }
.readout b { color: var(--ink); font-weight: 600; }
.readout .pips { letter-spacing: 0.2em; color: #B28CFF; }
.hero-ctl { display: none; position: absolute; right: var(--gut); bottom: 16px; gap: 6px; }
.hero.ready .hero-ctl { display: flex; }
.hero-ctl button { padding: 10px 12px; color: var(--ink-3); background: rgba(13, 17, 25, 0.8); border: 0; box-shadow: inset 0 0 0 1px var(--rule); border-radius: 2px; font: 600 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
.hero-ctl button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.hero-ctl button:hover, .hero-ctl button:focus-visible { color: var(--cyan); }

/* The sequence (with scripts only): the copy is there from the first paint; the wordmark alone waits, dim, for the Nova
   (.lit), then ignites like a neon tube. Once the fight runs (.ready) it waits as long as the Nova takes; if the fight
   never starts, CSS lights it 7 s in. .shown: lit without the ignite (reduced motion, or a sequence that began late). */
.js .hero .stage { opacity: 0; transition: opacity 1.2s ease-out 0.2s; }
.js .hero.on .stage { opacity: 1; }
.js .hero:not(.lit):not(.shown) h1 .w > span { opacity: 0.16; text-shadow: none; animation: late 0s 7s forwards; }
.js .hero.ready:not(.lit):not(.shown) h1 .w > span { animation: none; }
@keyframes late { to { opacity: 1; text-shadow: inherit; } }
.js .hero.lit h1 .w > span { animation: ignite 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 45ms); }
.js .hero.lit .readout { animation: rise 600ms 700ms ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ignite {
  0% { opacity: 0; filter: blur(6px); transform: translateY(0.12em) scale(1.06); }
  18% { opacity: 1; filter: blur(0); transform: none; }
  26% { opacity: 0.2; }
  34% { opacity: 1; }
  42% { opacity: 0.45; }
  52%, 100% { opacity: 1; text-shadow: 0 0 28px rgba(60, 242, 255, 0.35), 0 0 2px rgba(60, 242, 255, 0.6); }
  60% { text-shadow: 0 0 46px rgba(60, 242, 255, 0.9), 0 0 4px #fff; }
}

.band { max-width: var(--page); margin: 0 auto; padding: 44px var(--gut) 0; }
.band h2 { margin: 0 0 14px; font-size: 15px; }
.prose p { max-width: 38em; }
.systems { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.systems li { padding: 10px 12px 10px 30px; position: relative; background: var(--fill); box-shadow: inset 0 0 0 1px var(--rule); border-radius: 2px; font-size: 17px; line-height: 1.3; }
.systems li::before { content: ''; position: absolute; left: 12px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.systems b { display: block; margin-bottom: 2px; color: var(--ink); font: 700 12px/1.3 var(--title); letter-spacing: 0.08em; text-transform: uppercase; }
/* The screenshots as phones: on a phone a row that swipes, the next one peeking; on a desktop three side by side */
.shots { display: grid; grid-auto-flow: column; grid-auto-columns: 64%; gap: 14px; overflow-x: auto; margin-inline: calc(-1 * var(--gut)); padding: 10px var(--gut) 14px; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gut); scrollbar-width: none; }
.shots::-webkit-scrollbar { display: none; }
.shots img { display: block; width: 100%; height: auto; aspect-ratio: 1320 / 2868; object-fit: cover; border-radius: 22px; background: var(--fill); box-shadow: 0 0 0 5px #000, 0 0 0 6px #2a3242, 0 20px 50px rgba(0, 0, 0, 0.5); scroll-snap-align: start; }
.pillars { display: grid; gap: 6px; }
.faq { display: grid; max-width: 44em; }
.faq h3 { margin: 18px 0 4px; color: var(--ink); font: 700 20px/1.2 var(--body); }
.faq h3:first-child { margin-top: 0; }
.faq p { margin: 0; }
@media (min-width: 900px) {
  body { font-size: 20px; }
  .hero::before { background: linear-gradient(to bottom, rgba(5, 6, 15, 0.7), rgba(5, 6, 15, 0) 96px),
                              linear-gradient(to right, rgba(5, 6, 15, 0.95) 28%, rgba(5, 6, 15, 0.78) 50%, rgba(5, 6, 15, 0) 68%); }
  .copy { align-self: center; padding-block: 120px 96px; }
  .copy > * { max-width: 560px; }
  .band { padding-top: 64px; }
  .systems { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .shots { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 32px 0; gap: 24px; max-width: 900px; }
  .shots img:nth-child(2) { transform: translateY(-28px); }
  .pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}

footer { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; padding-block: 40px 28px; border-top: 1px solid var(--rule); margin-top: 40px; }
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .js .hero h1 .w > span { opacity: 1 !important; animation: none !important; }
  .js .hero .stage { opacity: 1; transition: none; }
  .soon::before { animation: none; }
  .hero.ready .hero-ctl { display: none; }
}
