/* ============================================================
   kresvik.com — engineered calm
   Palette + type per Brand Pack/Kresvik Brand Guidelines (v1.0)
   Surfaces stay Basalt / Navy / white / Mist. Signal Blue is an
   accent, not a fill: ~80% neutral, 15% navy, 5% signal.
   ============================================================ */

:root {
  --basalt: #071228;
  --navy: #0A1B3D;
  --signal: #2E6BFF;
  --steam: #6FA0FF;
  --mist: #F4F7FB;
  --slate: #44506B;
  --tint: #EDF2FB;

  /* derived, dark ground */
  --body-dark: #AFBDD9;      /* body text on basalt */
  --dim-dark: #6C7A99;       /* de-emphasised on basalt */
  --hair-dark: rgba(159, 183, 226, 0.16);
  --panel-dark: rgba(159, 183, 226, 0.045);

  /* derived, light ground */
  --hair-light: #D9E1F2;

  --sans: "Sora", ui-sans-serif, system-ui, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --w: 1120px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
}

@font-face {
  font-family: "Sora";
  src: url("fonts/sora-var.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Spline Sans Mono";
  src: url("fonts/spline-sans-mono-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--basalt);
  color: var(--body-dark);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--signal); color: #fff; }

a { color: inherit; }

.wrap { max-width: var(--w); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

/* ---------------------------------------------------------- type */

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;   /* per brand guidelines */
  text-transform: uppercase;
  color: var(--steam);
}
.eyebrow .idx { color: var(--dim-dark); }

h1, h2, h3 { color: #fff; font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.3rem); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.8rem); }
h3 { font-size: 1.12rem; }

.lede { font-size: clamp(1.02rem, 1.5vw, 1.2rem); max-width: 42em; }

.mono { font-family: var(--mono); }

/* ---------------------------------------------------------- header */

.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  background: color-mix(in srgb, var(--basalt) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair-dark);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 1rem;
}

.lockup { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; color: #fff; }
.lockup .mark { width: 30px; height: 30px; display: block; }
.lockup .word { font-weight: 600; font-size: 1.22rem; letter-spacing: -0.02em; line-height: 1; }
.lockup .word b { font-weight: 600; color: var(--signal); }

.site-nav { display: flex; gap: clamp(0.9rem, 2.5vw, 2rem); flex-wrap: wrap; justify-content: flex-end; }
.site-nav a {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--body-dark); text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}
.site-nav a:hover, .site-nav a:focus-visible { color: #fff; border-bottom-color: var(--signal); }
@media (max-width: 560px) { .site-nav a:not(.keep) { display: none; } }

/* ---------------------------------------------------------- hero */

.hero {
  position: relative;
  padding: calc(64px + clamp(5rem, 12vh, 8.5rem)) 0 clamp(4rem, 9vh, 6.5rem);
  overflow: hidden;
}

/* faint engineering grid, hero only */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(159, 183, 226, 0.13) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 78%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 78%);
}

/* the geyser: pressure, then a clean vertical release */
.geyser { position: absolute; top: 120px; bottom: 0; right: clamp(8%, 16vw, 22%); width: 2px; pointer-events: none; }
.geyser::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, transparent 4%, var(--signal) 55%, var(--steam) 100%);
  transform-origin: bottom;
}
.geyser::after {              /* crown glow where the column releases */
  content: ""; position: absolute; top: -36px; left: -80px; width: 162px; height: 162px;
  background: radial-gradient(circle, rgba(111, 160, 255, 0.18), transparent 62%);
}
@media (prefers-reduced-motion: no-preference) {
  .geyser::before { animation: rise 1.4s cubic-bezier(0.16, 1, 0.3, 1) both 0.15s; }
  @keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
}
@media (max-width: 700px) { .geyser { right: 9%; } }

.hero .wrap { position: relative; }
.hero .eyebrow { margin-bottom: 1.4rem; }
.hero h1 { max-width: 11.5em; }
.hero .lede { margin-top: 1.6rem; }
.hero .cta-row { margin-top: 2.6rem; }

/* staggered load-in */
@media (prefers-reduced-motion: no-preference) {
  .hero .eyebrow, .hero h1, .hero .lede, .hero .cta-row {
    animation: settle 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .hero h1 { animation-delay: 0.08s; }
  .hero .lede { animation-delay: 0.16s; }
  .hero .cta-row { animation-delay: 0.24s; }
  @keyframes settle { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}

/* ---------------------------------------------------------- buttons */

.cta-row { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  background: var(--signal); color: #fff;
  font-family: var(--sans); font-weight: 600; font-size: 0.95rem;
  text-decoration: none;
  padding: 0.78rem 1.5rem; border-radius: 8px;
  transition: background 140ms ease, transform 140ms ease;
}
.btn:hover, .btn:focus-visible { background: #2258DB; transform: translateY(-1px); }
.btn:active { transform: none; }

.ghost-link {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.04em;
  color: var(--body-dark); text-decoration: none;
  border-bottom: 1px solid var(--hair-dark);
  padding-bottom: 2px;
  transition: color 140ms ease, border-color 140ms ease;
}
.ghost-link:hover, .ghost-link:focus-visible { color: #fff; border-bottom-color: var(--steam); }

/* ---------------------------------------------------------- telemetry strip */

.telemetry {
  border-top: 1px solid var(--hair-dark);
  border-bottom: 1px solid var(--hair-dark);
  background: var(--panel-dark);
  overflow: hidden;
  position: relative;
}
.telemetry .lane { display: flex; width: max-content; }
.telemetry ul {
  display: flex; list-style: none; align-items: center;
  padding: 0.62rem 0; white-space: nowrap;
}
.telemetry li {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 400;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--dim-dark);
  padding: 0 1.9rem;
  border-right: 1px solid var(--hair-dark);
}
.telemetry li b { color: var(--body-dark); font-weight: 500; }
.telemetry li .ok { color: var(--steam); }
@media (prefers-reduced-motion: no-preference) {
  .telemetry .lane { animation: crawl 84s linear infinite; }
  .telemetry:hover .lane { animation-play-state: paused; }
  @keyframes crawl { to { transform: translateX(-50%); } }
}

.pulse {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal); margin-right: 0.5rem; vertical-align: 1px;
}
@media (prefers-reduced-motion: no-preference) {
  .pulse { animation: beat 2.2s ease-out infinite; }
  @keyframes beat {
    0%   { box-shadow: 0 0 0 0 rgba(46, 107, 255, 0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(46, 107, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 107, 255, 0); }
  }
}

/* ---------------------------------------------------------- sections */

.section { padding: clamp(4.5rem, 10vh, 7.5rem) 0; }
.section .eyebrow { margin-bottom: 1.2rem; }
.section h2 { max-width: 17em; }
.section .lede { margin-top: 1.3rem; }

.hairline { border: 0; border-top: 1px solid var(--hair-dark); }

/* scroll reveal (JS adds .in; without JS everything stays visible) */
.js .reveal { opacity: 0; transform: translateY(16px); }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }
.js .reveal.in { opacity: 1; transform: none; transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
@media print { .js .reveal { opacity: 1; transform: none; } }

/* principles */
.principles { margin-top: 3.5rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hair-dark); border: 1px solid var(--hair-dark); }
.principles article { background: var(--basalt); padding: 1.9rem 1.7rem 2.1rem; }
.principles .num { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--signal); display: block; margin-bottom: 1.05rem; }
.principles h3 { margin-bottom: 0.65rem; }
.principles p { font-size: 0.93rem; color: var(--body-dark); }
@media (max-width: 860px) { .principles { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------- light band (devices) */

.band-light { background: var(--mist); color: var(--slate); }
.band-light h2, .band-light h3 { color: var(--navy); }
.band-light .eyebrow { color: var(--signal); }
.band-light .eyebrow .idx { color: #8CA0C6; }

.device-grid { margin-top: 3.2rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 900px) { .device-grid { grid-template-columns: 1fr; max-width: 34rem; } }

.device {
  background: #fff; border: 1px solid var(--hair-light); border-radius: 12px;
  padding: 1.6rem 1.6rem 0.6rem;
  display: flex; flex-direction: column;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.device:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -18px rgba(10, 27, 61, 0.28); }
.device figure { margin: 0.4rem 0 1.15rem; }
.device img { width: 100%; height: 168px; object-fit: contain; display: block; }
.device h3 { font-size: 1.05rem; }
.device .role { font-size: 0.88rem; margin-top: 0.45rem; line-height: 1.55; }
.device dl { margin-top: 1.15rem; }
.device dl div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.5rem 0; border-top: 1px solid var(--hair-light);
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.04em;
}
.device dt { color: #8CA0C6; text-transform: uppercase; }
.device dd { color: var(--navy); font-weight: 500; text-align: right; }
.device .per { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: #8CA0C6; padding: 0.75rem 0 0.9rem; }

/* spec strip inside light band */
.specline { margin-top: 2.8rem; border-top: 1px solid var(--hair-light); padding-top: 1.15rem; display: flex; flex-wrap: wrap; gap: 0.4rem 2.2rem; }
.specline span { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate); }
.specline b { color: var(--signal); font-weight: 500; }

/* ---------------------------------------------------------- how it works */

.flow { margin-top: 3.4rem; display: flex; align-items: stretch; gap: 0; }
.flow-node {
  flex: 1 1 0; min-width: 0;
  border: 1px solid var(--hair-dark); border-radius: 10px;
  background: var(--panel-dark);
  padding: 1.35rem 1.3rem 1.45rem;
}
.flow-node h3 { font-size: 0.98rem; }
.flow-node p { font-size: 0.85rem; color: var(--dim-dark); margin-top: 0.5rem; line-height: 1.55; }
.flow-node .tag { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--steam); display: block; margin-bottom: 0.8rem; }

.flow-link { flex: 0 0 clamp(2.2rem, 5vw, 4.5rem); position: relative; align-self: center; height: 1px; }
.flow-link::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: 0;
  border-top: 2px dashed rgba(111, 160, 255, 0.5);
}
.flow-link::after {
  content: ""; position: absolute; right: 1px; top: -3.5px;
  width: 7px; height: 7px;
  border-top: 2px solid var(--steam); border-right: 2px solid var(--steam);
  transform: rotate(45deg);
}
.flow-link .label {
  position: absolute; left: 50%; top: -1.5rem; transform: translateX(-50%);
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--dim-dark); white-space: nowrap;
}
@media (max-width: 900px) {
  .flow { flex-direction: column; }
  .flow-link { align-self: stretch; height: clamp(2.6rem, 6vh, 3.4rem); flex-basis: auto; width: 1px; margin: 0 auto; }
  .flow-link::before { left: 0; right: auto; top: 6px; bottom: 6px; border-top: 0; border-left: 2px dashed rgba(111, 160, 255, 0.5); }
  .flow-link::after { right: auto; left: -2.5px; top: auto; bottom: 1px; transform: rotate(135deg); }
  .flow-link .label { left: 1.1rem; top: 50%; transform: translateY(-50%); }
}

/* ---------------------------------------------------------- pilot */

.pilot-panel {
  margin-top: 3rem;
  border: 1px solid var(--hair-dark); border-radius: 12px;
  background: linear-gradient(140deg, rgba(46, 107, 255, 0.12), rgba(46, 107, 255, 0.02) 55%);
  padding: clamp(1.8rem, 4vw, 3rem);
  display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap;
}
.pilot-panel .cta-row { margin-top: 0; }
.pilot-panel h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); max-width: 22em; }
.pilot-panel p { margin-top: 0.7rem; max-width: 38em; font-size: 0.95rem; }

/* ---------------------------------------------------------- footer */

.site-foot { border-top: 1px solid var(--hair-dark); padding: 3rem 0 3.4rem; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }
.site-foot .lockup .mark { width: 24px; height: 24px; }
.site-foot .lockup .word { font-size: 1.05rem; }
.site-foot .cols { display: flex; gap: clamp(2rem, 6vw, 5rem); flex-wrap: wrap; }
.site-foot .col { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; line-height: 2.1; }
.site-foot .col .h { text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim-dark); display: block; margin-bottom: 0.3rem; }
.site-foot a { color: var(--body-dark); text-decoration: none; }
.site-foot a:hover { color: #fff; }
.site-foot .legal { width: 100%; margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid var(--hair-dark); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; color: var(--dim-dark); }
