/* ============================================================
   CryoShell Exosuits — industrial thermal-instrument aesthetic
   Thermal duality: cold steel-blue (cryo) vs ember amber (thermal)
   ============================================================ */

:root {
  /* graphite base — tinted dark, never pure black */
  --bg:        #0c0f13;
  --bg-2:      #11161c;
  --surface:   #161d25;
  --surface-2: #1c2530;
  --line:      #2a343f;
  --line-soft: #20282f;

  --ink:       #e7edf1;
  --ink-soft:  #aeb9c2;
  --ink-mute:  #6c7984;

  /* CRYO mode (default) — glacial steel */
  --accent:    #6fb4cf;   /* ice steel */
  --accent-2:  #9fd4e0;   /* frost */
  --accent-ink:#0a1418;
  --glow:      rgba(111,180,207,0.16);

  --maxw: 1240px;
  --ease: cubic-bezier(.22,.68,.32,1);

  --f-disp: "Archivo Expanded","Archivo",sans-serif;
  --f-body: "Spline Sans",system-ui,sans-serif;
  --f-mono: "IBM Plex Mono",ui-monospace,monospace;
}

/* THERMAL mode — ember warmth */
html[data-mode="thermal"] {
  --accent:    #d98a4f;   /* ember */
  --accent-2:  #e8a86a;   /* amber */
  --accent-ink:#1a0f06;
  --glow:      rgba(217,138,79,0.18);
  --bg:        #100c0a;
  --bg-2:      #181210;
  --surface:   #211711;
  --surface-2: #2a1d14;
  --line:      #3a2a1f;
  --line-soft: #2c2018;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .6s var(--ease), color .6s var(--ease);
}

/* ---------- atmospheric layers ---------- */
.atmosphere {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(70% 55% at 78% 8%, var(--glow), transparent 60%),
    radial-gradient(60% 50% at 8% 92%, var(--glow), transparent 65%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  transition: background .6s var(--ease);
}
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, .nav, .foot { position: relative; z-index: 2; }

/* ---------- typography primitives ---------- */
h1, h2, h3, h4 { font-family: var(--f-disp); font-weight: 800; line-height: .98; letter-spacing: -.01em; }

.kicker {
  font-family: var(--f-mono);
  font-size: .72rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--ink-mute); display: inline-flex; align-items: center; gap: .65em;
}
.kicker .dot { width: 7px; height: 7px; background: var(--accent); border-radius: 1px; box-shadow: 0 0 12px var(--accent); }

.sec-head { max-width: var(--maxw); margin: 0 auto 3.2rem; padding: 0 clamp(20px,5vw,56px); }
.sec-head h2 { font-size: clamp(2.1rem, 5.2vw, 4rem); margin-top: 1.1rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--f-mono); font-size: .82rem; letter-spacing: .04em;
  text-decoration: none; padding: .85em 1.4em; border-radius: 2px;
  transition: transform .2s var(--ease), background .25s, border-color .25s, color .25s;
  border: 1px solid transparent; cursor: pointer;
}
.btn-solid { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-solid:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px var(--accent); }
.btn-ghost { color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-2); transform: translateY(-2px); }
.btn-ghost svg { transition: transform .25s var(--ease); }
.btn-ghost:hover svg { transform: translateX(4px); }
.btn-block { width: 100%; justify-content: center; padding: 1.05em; font-size: .9rem; }

/* ============================================================ NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding: .9rem clamp(20px,5vw,56px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line-soft);
  transition: background .4s, border-color .4s;
}
.nav.scrolled { background: color-mix(in srgb, var(--bg) 90%, transparent); }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-mark { color: var(--accent); display: grid; place-items: center; }
.brand-word { font-family: var(--f-disp); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.brand-word sup { font-size: .5em; color: var(--accent); top: -.9em; }

.nav-links { display: flex; gap: 1.8rem; }
.nav-links a {
  font-family: var(--f-mono); font-size: .78rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft); text-decoration: none;
  position: relative; transition: color .2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0;
  background: var(--accent); transition: width .25s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.nav-right { display: flex; align-items: center; gap: 1rem; }

/* thermal toggle */
.thermal-toggle {
  display: inline-flex; align-items: center; gap: .55rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 30px;
  padding: .3rem .55rem; cursor: pointer; font-family: var(--f-mono);
}
.tt-track { width: 34px; height: 18px; background: var(--bg-2); border-radius: 30px; position: relative; border: 1px solid var(--line); }
.tt-thumb { position: absolute; top: 1px; left: 1px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); transition: transform .3s var(--ease), background .3s; box-shadow: 0 0 8px var(--glow); }
html[data-mode="thermal"] .tt-thumb { transform: translateX(16px); }
.tt-label { font-size: .62rem; letter-spacing: .12em; color: var(--ink-mute); transition: color .3s; }
.tt-label[data-cryo] { color: var(--ink); }
html[data-mode="thermal"] .tt-label[data-cryo] { color: var(--ink-mute); }
html[data-mode="thermal"] .tt-label[data-thermal] { color: var(--ink); }

/* ============================================================ HERO */
.hero { max-width: var(--maxw); margin: 0 auto; padding: clamp(2.5rem,6vw,5rem) clamp(20px,5vw,56px) 0; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem,5vw,4rem); align-items: center; }

.hero-copy h1 {
  font-size: clamp(2.8rem, 7.5vw, 6.2rem); margin: 1.4rem 0 1.6rem;
  letter-spacing: -.02em;
}
.hero-copy h1 .flux {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  transition: background .6s;
}
.lede { font-size: clamp(1.05rem,1.6vw,1.25rem); color: var(--ink-soft); max-width: 40ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin: 2.2rem 0 2.6rem; }

.hero-stats { display: flex; gap: clamp(1.2rem,3vw,2.6rem); border-top: 1px solid var(--line-soft); padding-top: 1.5rem; }
.hero-stats dt { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: .4rem; }
.hero-stats dd { font-family: var(--f-disp); font-weight: 800; font-size: clamp(1.4rem,3vw,2rem); }
.hero-stats dd span { font-size: .55em; color: var(--accent); margin-left: .15em; font-family: var(--f-mono); }

/* hero visual */
.hero-visual { position: relative; aspect-ratio: 3/4.2; }
.suit-frame {
  position: relative; height: 100%; width: 100%;
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
  background:
    linear-gradient(180deg, var(--surface), var(--bg-2));
}
.suit-frame::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 34px 34px; opacity: .35;
  mask-image: radial-gradient(70% 70% at 50% 45%, #000, transparent 80%);
}
.suit { position: relative; height: 100%; width: 100%; display: block; padding: 8% 0; }
.thermal-band { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .5; transition: background .6s; }
.band-a { width: 60%; height: 40%; top: -8%; right: -10%; background: var(--accent); }
.band-b { width: 55%; height: 38%; bottom: -8%; left: -10%; background: var(--accent-2); opacity: .35; }

.hud { position: absolute; font-family: var(--f-mono); display: flex; flex-direction: column; gap: 2px; padding: .5rem .65rem; background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--line); border-radius: 3px; backdrop-filter: blur(4px); }
.hud-k { font-size: .56rem; letter-spacing: .18em; color: var(--ink-mute); }
.hud-v { font-size: 1rem; font-weight: 600; color: var(--accent-2); }
.hud-1 { top: 9%; left: 6%; }
.hud-2 { top: 40%; right: 5%; }
.hud-3 { bottom: 10%; left: 7%; }

.scanline { position: absolute; left: 0; right: 0; height: 2px; top: 0; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .5; animation: scan 5.5s var(--ease) infinite; }
@keyframes scan { 0%{top:5%} 50%{top:92%} 100%{top:5%} }

/* ticker */
.ticker { margin-top: clamp(3rem,6vw,5rem); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); overflow: hidden; padding: .9rem 0; }
.ticker-row { display: inline-flex; gap: 1.4rem; white-space: nowrap; font-family: var(--f-mono); font-size: .76rem; letter-spacing: .14em; color: var(--ink-mute); animation: marquee 34s linear infinite; }
.ticker .sep { color: var(--accent); }
@keyframes marquee { from{transform:translateX(0)} to{transform:translateX(-50%)} }

/* ============================================================ THESIS */
.thesis { max-width: 1000px; margin: clamp(4rem,9vw,7rem) auto; padding: 0 clamp(20px,5vw,56px); }
.thesis p { font-family: var(--f-disp); font-weight: 600; font-size: clamp(1.5rem,3.6vw,2.6rem); line-height: 1.2; letter-spacing: -.01em; }
.thesis em { color: var(--accent-2); font-style: normal; }
.lead-cap { float: left; font-size: 2.6em; line-height: .72; padding: .04em .12em 0 0; color: var(--accent); font-weight: 900; }

/* ============================================================ SYSTEMS / BENTO */
.systems { max-width: var(--maxw); margin: 0 auto clamp(4rem,9vw,7rem); padding: 0 clamp(20px,5vw,56px); }
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.cell {
  background: var(--surface); border: 1px solid var(--line); border-radius: 5px;
  padding: 1.7rem 1.6rem 1.5rem; position: relative; overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s, background .3s;
}
.cell::after { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 70% at 100% 0%, var(--glow), transparent 60%); opacity: 0; transition: opacity .3s; }
.cell:hover { transform: translateY(-4px); border-color: var(--accent); }
.cell:hover::after { opacity: 1; }
.cell-no { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .2em; color: var(--ink-mute); }
.cell-ico { color: var(--accent); margin: 1rem 0 .9rem; }
.cell h3 { font-size: 1.32rem; margin-bottom: .55rem; }
.cell p { color: var(--ink-soft); font-size: .96rem; }
.cell-meta { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.2rem; }
.cell-meta span { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .1em; color: var(--accent-2); border: 1px solid var(--line); padding: .3em .6em; border-radius: 2px; }

/* asymmetric spans */
.cell-climate { grid-column: span 3; }
.cell-seal    { grid-column: span 3; }
.cell-comms   { grid-column: span 2; }
.cell-bio     { grid-column: span 2; }
.cell-mod     { grid-column: span 2; }

/* ============================================================ FIELD */
.field { max-width: var(--maxw); margin: 0 auto clamp(4rem,9vw,7rem); padding: 0 clamp(20px,5vw,56px); }
.field-list { list-style: none; border-top: 1px solid var(--line); }
.field-row {
  display: grid; grid-template-columns: 80px 1fr 1.1fr auto; gap: 1.5rem;
  align-items: baseline; padding: 1.8rem 0; border-bottom: 1px solid var(--line);
  transition: padding .3s var(--ease), background .3s;
}
.field-row:hover { padding-left: 1.2rem; background: linear-gradient(90deg, var(--surface), transparent 70%); }
.field-idx { font-family: var(--f-mono); color: var(--accent); font-size: .82rem; letter-spacing: .14em; }
.field-row h3 { font-size: clamp(1.3rem,2.6vw,1.9rem); }
.field-row p { color: var(--ink-soft); font-size: .96rem; }
.field-temp { font-family: var(--f-mono); font-size: .76rem; color: var(--ink-mute); white-space: nowrap; justify-self: end; }

/* ============================================================ CHASSIS */
.chassis { max-width: var(--maxw); margin: 0 auto clamp(4rem,9vw,7rem); padding: 0 clamp(20px,5vw,56px); }
.chassis-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem,5vw,4rem); align-items: start; }
.chassis-copy h2 { font-size: clamp(2rem,4.6vw,3.4rem); margin: 1.1rem 0 1.3rem; }
.chassis-copy > p { color: var(--ink-soft); max-width: 46ch; }

.model-tabs { display: flex; gap: .5rem; margin: 2rem 0 1.4rem; flex-wrap: wrap; }
.model-tab {
  font-family: var(--f-mono); font-size: .78rem; letter-spacing: .05em;
  background: transparent; color: var(--ink-soft); border: 1px solid var(--line);
  padding: .6em 1em; border-radius: 2px; cursor: pointer; transition: all .2s;
}
.model-tab:hover { color: var(--ink); border-color: var(--ink-mute); }
.model-tab.is-active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.model-panel { animation: fade .35s var(--ease); }
.model-tag { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); margin-bottom: .6rem; }
.model-panel > p:not(.model-tag) { color: var(--ink-soft); }
.model-specs { list-style: none; display: flex; gap: 2rem; margin-top: 1.3rem; }
.model-specs li { display: flex; flex-direction: column; }
.model-specs span { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); }
.model-specs b { font-family: var(--f-disp); font-size: 1.5rem; }
@keyframes fade { from{opacity:0; transform: translateY(6px)} to{opacity:1; transform:none} }

/* chassis live card */
.chassis-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1.6rem; position: sticky; top: 90px; }
.card-top { display: flex; align-items: center; gap: .6rem; font-family: var(--f-mono); font-size: .68rem; letter-spacing: .16em; color: var(--ink-mute); padding-bottom: 1.1rem; border-bottom: 1px solid var(--line-soft); }
.card-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 var(--glow)} 70%{box-shadow:0 0 0 9px transparent} 100%{box-shadow:0 0 0 0 transparent} }
.card-rows { padding: 1.1rem 0; }
.card-row { display: flex; justify-content: space-between; align-items: center; padding: .55rem 0; font-size: .92rem; color: var(--ink-soft); }
.card-row b { font-family: var(--f-mono); color: var(--ink); font-weight: 500; }
.card-row b.ok { color: var(--accent-2); }
.card-bar { height: 6px; background: var(--bg-2); border-radius: 30px; overflow: hidden; border: 1px solid var(--line-soft); }
.card-bar-fill { height: 100%; width: 78.4%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation: breathe 4s var(--ease) infinite; }
@keyframes breathe { 0%,100%{width:76%} 50%{width:81%} }
.card-foot { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .08em; color: var(--ink-mute); margin-top: 1rem; }

/* ============================================================ SPEC */
.spec { max-width: var(--maxw); margin: 0 auto clamp(4rem,9vw,7rem); padding: 0 clamp(20px,5vw,56px); }
.spec-table { border-top: 1px solid var(--accent); }
.spec-line { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1rem .2rem; border-bottom: 1px solid var(--line-soft); transition: background .25s, padding-left .25s; }
.spec-line:hover { background: var(--surface); padding-left: 1rem; }
.spec-line span { color: var(--ink-soft); font-size: .98rem; }
.spec-line b { font-family: var(--f-mono); font-size: 1rem; letter-spacing: .02em; color: var(--ink); }

.quote { margin-top: clamp(3rem,6vw,4.5rem); max-width: 720px; }
.quote blockquote { font-family: var(--f-disp); font-weight: 600; font-size: clamp(1.4rem,3vw,2.1rem); line-height: 1.22; letter-spacing: -.01em; }
.quote figcaption { font-family: var(--f-mono); font-size: .82rem; color: var(--accent-2); margin-top: 1.1rem; }

/* ============================================================ REQUEST */
.request { padding: clamp(4rem,9vw,7rem) clamp(20px,5vw,56px); border-top: 1px solid var(--line-soft); background: linear-gradient(180deg, transparent, var(--bg-2)); }
.request-inner { max-width: 880px; margin: 0 auto; }
.request h2 { font-size: clamp(2.4rem,6vw,4.6rem); }
.request > .request-inner > p { color: var(--ink-soft); max-width: 44ch; margin: 1.2rem 0 2.6rem; font-size: 1.1rem; }

.req-form { display: grid; gap: 1.1rem; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.req-field { display: flex; flex-direction: column; gap: .5rem; }
.req-field span { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); }
.req-field input, .req-field select, .req-field textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 3px;
  color: var(--ink); font-family: var(--f-body); font-size: 1rem; padding: .85em 1em;
  transition: border-color .2s, box-shadow .2s; width: 100%;
}
.req-field textarea { resize: vertical; }
.req-field input:focus, .req-field select:focus, .req-field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow);
}
.req-field input::placeholder, .req-field textarea::placeholder { color: var(--ink-mute); }
.hp { position: absolute; left: -9999px; }

/* ============================================================ FOOTER */
.foot { border-top: 1px solid var(--line); padding: clamp(3rem,6vw,4.5rem) clamp(20px,5vw,56px) 2rem; }
.foot-grid { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.foot-brand p { color: var(--ink-soft); margin-top: .9rem; max-width: 30ch; font-size: .95rem; }
.foot-col h4 { font-family: var(--f-mono); font-weight: 500; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 1rem; }
.foot-col a { display: block; color: var(--ink-soft); text-decoration: none; font-size: .92rem; padding: .3rem 0; transition: color .2s; }
.foot-col a:hover { color: var(--accent-2); }
.foot-base { max-width: var(--maxw); margin: 2.5rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .1em; color: var(--ink-mute); }
.foot-stat { color: var(--accent-2); }

/* ============================================================ REVEAL */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"]{transition-delay:.08s}
.reveal[data-delay="2"]{transition-delay:.16s}
.reveal[data-delay="3"]{transition-delay:.24s}
.reveal[data-delay="4"]{transition-delay:.32s}

/* ============================================================ RESPONSIVE */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 360px; margin: 0 auto; }
  .chassis-grid { grid-template-columns: 1fr; }
  .chassis-card { position: static; }
  .cell-climate, .cell-seal { grid-column: span 6; }
  .cell-comms, .cell-bio, .cell-mod { grid-column: span 3; }
  .field-row { grid-template-columns: 50px 1fr; }
  .field-row p { grid-column: 2; }
  .field-temp { grid-column: 2; justify-self: start; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .bento { gap: 12px; }
  .cell-climate, .cell-seal, .cell-comms, .cell-bio, .cell-mod { grid-column: span 6; }
  .field-pair { grid-template-columns: 1fr; }
  .model-specs { gap: 1.4rem; }
  .foot-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; gap: 1.2rem 2rem; }
  .tt-label[data-thermal], .tt-label[data-cryo] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
