@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #0f0c0b;
  --line: #2b211d;
  --text: #ece3dc;
  --dim: #9c8a80;
  --accent: #e8763f;
  --green: #7bdc6a;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --pad: clamp(20px, 4vw, 72px);
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
h1, h2, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
h1, h2 { font-weight: 800; letter-spacing: -.02em; line-height: 1; }

/* One screen: artwork and headline on top, the dock underneath. Nothing scrolls. */
.page { position: relative; height: 100vh; height: 100svh; display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; }

.bg { position: absolute; inset: 0 0 auto; height: 76%; overflow: hidden; }
.bg img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 58%; animation: drift 40s ease-in-out infinite alternate; }
.bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15,12,11,.86), rgba(15,12,11,.25) 52%, transparent), linear-gradient(0deg, var(--bg) 1%, transparent 42%); }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.09) translateX(-1.2%); } }

/* logo lockup: floats, glows, and a spark circles the planet */
.brand { --s: clamp(64px, min(28vw, 21vh), 260px); position: absolute; z-index: 2; top: clamp(10px, 2.4vh, 28px); left: calc(var(--pad) - var(--s) * .06); display: flex; align-items: center; gap: calc(var(--s) * .12); animation: brandIn 1.1s cubic-bezier(.2, .7, .2, 1) both; }
.brand__mark { position: relative; width: var(--s); aspect-ratio: 1; animation: bob 6s ease-in-out infinite; }
.brand__mark::before { content: ""; position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(closest-side, rgba(79, 227, 240, .5), rgba(232, 118, 63, .22) 55%, transparent); filter: blur(calc(var(--s) * .1)); animation: halo 4s ease-in-out infinite; }
.brand__mark img { position: relative; z-index: 1; width: 100%; height: 100%; filter: drop-shadow(0 0 calc(var(--s) * .06) rgba(79, 227, 240, .45)); }
.brand__orbit { position: absolute; inset: -4%; transform: rotate(-14deg) scaleY(.34); animation: depth 5s linear infinite; }
.brand__orbit i { position: absolute; inset: 0; animation: spin 5s linear infinite; }
.brand__orbit i::after { content: ""; position: absolute; right: 0; top: 50%; width: calc(var(--s) * .05); aspect-ratio: 1 / 2.9; margin-top: calc(var(--s) * -.07); border-radius: 50%; background: #eaffff; box-shadow: 0 0 calc(var(--s) * .08) calc(var(--s) * .02) #4fe3f0; }
.brand__name { font-size: calc(var(--s) * .4); font-weight: 800; letter-spacing: -.03em; line-height: 1; background: linear-gradient(100deg, var(--text) 40%, #4fe3f0 50%, var(--text) 60%) 100% 0 / 300% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: sheen 7s ease-in-out infinite; text-shadow: none; filter: drop-shadow(0 2px 12px rgba(0, 0, 0, .5)); }

@keyframes brandIn { from { opacity: 0; transform: translateY(-18px) scale(.92); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5%) rotate(2deg); } }
@keyframes halo { 0%, 100% { opacity: .55; transform: scale(.95); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes spin { to { transform: rotate(360deg); } }
/* front of the planet for the near half of the orbit, behind it for the far half */
@keyframes depth { 0%, 49.9% { z-index: 2; } 50%, 100% { z-index: 0; } }
@keyframes sheen { 0%, 55% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* headline */
.hero { position: relative; z-index: 1; align-self: end; padding: 0 var(--pad) clamp(14px, 3.4vh, 40px); }
.hero h1 { font-size: clamp(2.1rem, min(6.4vw, 11.5vh), 6rem); }
/* Rust to green to cyan, like the logo's planet coming alive */
.hero h1 .accent {
  color: var(--accent);
  background: linear-gradient(90deg, #e8763f 0%, #f2a541 28%, #7bdc6a 64%, #4fe3f0 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__sub { margin-top: clamp(8px, 1.6vh, 18px); font-size: clamp(1rem, min(1.7vw, 3vh), 1.4rem); color: #e2d3c9; }

/* calls to action: coming soon, alpha, Discord */
.cta { margin-top: clamp(12px, 2.4vh, 26px); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.btn { display: inline-flex; align-items: center; gap: 9px; padding: 9px 16px; border: 1px solid transparent; font: 700 clamp(.78rem, 1.7vh, .95rem) var(--sans); letter-spacing: .01em; color: #fff; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid #4fe3f0; outline-offset: 3px; }
.btn svg { width: 1.3em; height: 1.3em; fill: currentColor; }
.btn--alpha { background: var(--accent); color: #1a0f0a; }
.btn--alpha:hover { box-shadow: 0 6px 22px rgba(232, 118, 63, .45); }
.btn--alpha:disabled { opacity: .6; cursor: wait; transform: none; }
.btn--discord { background: #5865f2; }
.btn--discord:hover { box-shadow: 0 6px 22px rgba(88, 101, 242, .5); }

/* alpha access dialog */
.alpha { width: min(460px, calc(100vw - 32px)); max-height: calc(100svh - 32px); padding: 0; border: 1px solid rgba(232, 118, 63, .5); background: #16110f; color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.alpha::backdrop { background: rgba(8, 6, 5, .72); backdrop-filter: blur(4px); }
.alpha[open] { animation: rise .35s cubic-bezier(.2, .7, .2, 1); }
.alpha__form { position: relative; display: grid; gap: 14px; padding: clamp(20px, 4vh, 32px) clamp(20px, 4vw, 32px); }
.alpha h2 { font-size: 1.6rem; padding-right: 28px; }
.alpha__lede { font-size: .92rem; color: var(--dim); }
.alpha__close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border: 0; background: none; color: var(--dim); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.alpha__close:hover { color: var(--text); }
.alpha label { display: grid; gap: 6px; font-size: .78rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.alpha label small { text-transform: none; letter-spacing: 0; opacity: .7; }
.alpha input, .alpha select, .alpha textarea { width: 100%; padding: 10px 12px; border: 1px solid #3a2d27; background: #0f0c0b; color: var(--text); font: 15px/1.4 var(--sans); text-transform: none; letter-spacing: 0; }
.alpha textarea { resize: vertical; min-height: 70px; }
.alpha input:focus, .alpha select:focus, .alpha textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 118, 63, .2); }
.alpha__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alpha__submit { justify-content: center; padding: 12px 16px; margin-top: 4px; }
.alpha__status { min-height: 1.4em; font-size: .88rem; color: var(--dim); }
.alpha__status[data-kind="ok"] { color: var(--green); }
.alpha__status[data-kind="err"] { color: #ff8a7a; }

.soon { display: inline-flex; align-items: center; gap: 12px; padding: 9px 16px 9px 14px; border: 1px solid rgba(232, 118, 63, .65); background: rgba(15, 12, 11, .55); font: clamp(.72rem, 1.5vh, .86rem) var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--text); }
.soon i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.8s ease-out infinite; }
.soon span { color: var(--dim); padding-left: 12px; border-left: 1px solid #4a3a32; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(232, 118, 63, .7); } 100% { box-shadow: 0 0 0 10px rgba(232, 118, 63, 0); } }

.js .rise { display: inline-block; opacity: 0; transform: translateY(26px); animation: rise .9s cubic-bezier(.2, .7, .2, 1) forwards; }
.js p.hero__sub.rise { display: block; }
.js .cta.rise { display: flex; }
.rise--2 { animation-delay: .18s !important; }
.rise--3 { animation-delay: .5s !important; }
.rise--4 { animation-delay: .7s !important; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- dock ---------- */
.dock { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); align-items: center; gap: clamp(20px, 3vw, 60px); padding: clamp(14px, 3vh, 34px) var(--pad) clamp(16px, 3.4vh, 38px); border-top: 1px solid rgba(236, 227, 220, .08); background: linear-gradient(180deg, rgba(15,12,11,.6), var(--bg) 40%); }

/* mine / build / research / terraform */
.cycle { --n: clamp(46px, min(6vw, 10.5vh), 100px); position: relative; display: grid; grid-template-columns: repeat(4, 1fr); }
.cycle li:not(.cycle__line) { position: relative; display: grid; justify-items: center; gap: clamp(8px, 1.8vh, 18px); text-align: center; --c: #e8763f; color: #4a3f3a; animation: lit1 8s infinite; }
.cycle li:nth-child(3) { --c: #f2a541; animation-name: lit2; }
.cycle li:nth-child(4) { --c: #7bdc6a; animation-name: lit3; }
.cycle li:nth-child(5) { --c: #4fe3f0; animation-name: lit4; }
.cycle b { font-size: clamp(.82rem, min(2.1vw, 3.8vh), 2.1rem); font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.cycle__node { width: var(--n); }
.cycle__node svg { display: block; width: 100%; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; overflow: visible; }
.cycle__hex { stroke-width: 2; fill: var(--bg); }
.cycle__line { position: absolute; left: 12.5%; right: 12.5%; top: calc(var(--n) / 2 - 1px); height: 2px; background: #2a211d; }
.cycle__line i { display: block; height: 100%; background: linear-gradient(90deg, #e8763f, #f2a541 33%, #7bdc6a 66%, #4fe3f0); transform-origin: left; animation: growX 8s infinite; box-shadow: 0 0 12px rgba(242, 165, 65, .5); }

@keyframes growX { 0%, 4% { transform: scaleX(0); opacity: 1; } 64%, 90% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes lit1 { 0%, 2% { color: #4a3f3a; filter: none; } 7%, 90% { color: var(--c); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--c) 45%, transparent)); } 100% { color: #4a3f3a; filter: none; } }
@keyframes lit2 { 0%, 22% { color: #4a3f3a; filter: none; } 27%, 90% { color: var(--c); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--c) 45%, transparent)); } 100% { color: #4a3f3a; filter: none; } }
@keyframes lit3 { 0%, 42% { color: #4a3f3a; filter: none; } 47%, 90% { color: var(--c); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--c) 45%, transparent)); } 100% { color: #4a3f3a; filter: none; } }
@keyframes lit4 { 0%, 62% { color: #4a3f3a; filter: none; } 67%, 90% { color: var(--c); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--c) 45%, transparent)); } 100% { color: #4a3f3a; filter: none; } }

/* First Breath: the planet terraforms on a loop */
.breath { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: clamp(16px, 2.6vw, 40px); padding-left: clamp(20px, 3vw, 60px); border-left: 1px solid rgba(236, 227, 220, .08); }
.breath__planet { position: relative; width: clamp(110px, min(19vw, 31vh), 310px); aspect-ratio: 1; }
.breath__planet canvas { position: relative; display: block; width: 100%; height: 100%; }
.breath__glow { position: absolute; inset: -14%; border-radius: 50%; --air: 0; --life: 0; background: radial-gradient(closest-side, transparent 70%, rgba(79, 227, 240, calc(var(--air) * .4)) 78%, rgba(123, 220, 106, calc(var(--life) * .12)) 88%, transparent 100%); }
.breath h2 { font-size: clamp(1.3rem, min(2.5vw, 4.6vh), 2.5rem); }
.breath__steps { display: grid; margin-top: clamp(4px, 1vh, 10px); font-size: clamp(.95rem, min(1.4vw, 2.6vh), 1.25rem); font-weight: 700; color: var(--dim); }
.breath__steps li { grid-area: 1 / 1; opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s; }
.breath__steps li.is-on { opacity: 1; transform: none; }

.hab { margin-top: clamp(10px, 2.2vh, 22px); max-width: 340px; font-family: var(--mono); }
.hab__head { display: flex; justify-content: space-between; align-items: baseline; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding-bottom: clamp(4px, 1vh, 10px); border-bottom: 1px solid var(--line); margin-bottom: clamp(8px, 1.6vh, 14px); }
.hab__head b { font-size: clamp(1.3rem, 3.6vh, 2.1rem); line-height: 1; font-weight: 400; color: var(--accent); letter-spacing: 0; transition: color .4s; }
.hab.is-alive .hab__head b { color: var(--green); }
.hab ul { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(5px, 1.2vh, 10px) 16px; }
.hab li { display: grid; grid-template-columns: 3.1em 1fr; align-items: center; gap: 6px; font-size: .72rem; color: var(--dim); }
.hab i { height: 5px; background: #241c19; position: relative; overflow: hidden; }
.hab i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleX(var(--v, 0)); transform-origin: left; transition: background .4s; }
.hab.is-alive i::after { background: var(--green); }

/* narrow screens: dock stacks */
@media (max-width: 860px) {
  .bg { height: 60%; }
  .bg img { object-position: 70% 50%; }
  .hero h1 { font-size: clamp(2rem, min(9.4vw, 7vh), 4rem); }
  .dock { grid-template-columns: 1fr; gap: clamp(12px, 2.6vh, 26px); }
  .cycle { --n: clamp(40px, min(13vw, 8vh), 76px); }
  .cycle b { font-size: clamp(.78rem, 3.6vw, 1.3rem); }
  .breath { padding: clamp(12px, 2.6vh, 26px) 0 0; border-left: 0; border-top: 1px solid rgba(236, 227, 220, .08); }
  .breath__planet { width: clamp(96px, min(36vw, 22vh), 240px); }
}
/* very short screens: drop the gauges before anything overflows */
@media (max-height: 520px) { .hab ul { display: none; } .hero__sub { display: none; } .brand { --s: 52px; } }
@media (max-height: 380px) { .cycle b { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .js .rise { animation: none; opacity: 1; transform: none; }
  .bg img, .soon i, .cycle__line i, .brand, .brand__mark, .brand__mark::before, .brand__name { animation: none; }
  .brand__orbit { display: none; }
  .cycle li:not(.cycle__line) { animation: none; color: var(--c); }
}
