/* Celcius — site styles. No framework. Six core colours carry the design; the rest are
   derived tints of them or semantic colours used only inside the finding record. */

@font-face {
  font-family: "Celcius Display";
  src: url("/assets/fonts/display.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Celcius Mono";
  src: url("/assets/fonts/mono.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Core palette */
  --abyss: #0B1218;      /* page base */
  --hull: #0E171E;       /* raised surface */
  --rule: #1F2E3A;       /* hairlines */
  --frost: #E4EDF2;      /* primary text */
  --haze: #B7C6D1;       /* secondary text */
  --signal: #5BE0F0;     /* the only accent */

  /* Derived tints of the core */
  --hull-hit: #122530;   /* highlighted readout row */
  --grid-line: #15222C;
  --panel-line: #22313D;
  --rule-strong: #2B3D4A;
  --underline: #3A5566;
  --field-line: #526B7D; /* ≥3:1 against field and form backgrounds */
  --field-hover: #5E788B;
  --mist: #8FA3B2;       /* tertiary text */
  --dim: #7A909F;        /* readout keys */
  --signal-soft: #9DEFF8;

  /* Semantic — finding record and form errors only */
  --amber: #F2B45C;
  --err: #F29C9C;
  --ok: #7EE0B0;

  /* Type */
  --font-sans: "Celcius Display", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Celcius Mono", ui-monospace, monospace;

  /* Layout */
  --gutter: 24px;
  --pad-x: clamp(20px, 6.6vw, 96px);
  --section-y: clamp(72px, 9.5vw, 136px);
  --max: 1440px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--abyss);
  color: var(--frost);
  font-family: var(--font-sans);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--abyss);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-stretch: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, ol, figure, pre { margin: 0; }
img, svg { display: block; }

a { color: var(--signal); text-underline-offset: 4px; }
a:hover { color: var(--signal-soft); }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 1px;
}

.accent { color: var(--signal); }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--pad-x);
}

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 10;
  padding: 12px 16px;
  background: var(--signal);
  color: var(--abyss);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 16px; color: var(--abyss); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 2px;
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--line { border: 1px solid var(--signal); color: var(--signal); background: transparent; }
.btn--line:hover { background: var(--signal); color: var(--abyss); }
.btn--solid {
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  background: var(--signal);
  color: var(--abyss);
  font-size: 1.0625rem;
  font-weight: 600;
}
.btn--solid:hover { background: var(--signal-soft); color: var(--abyss); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

.link-quiet {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--frost);
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-underline-offset: 6px;
}
.link-quiet:hover { color: var(--frost); text-decoration-color: var(--signal); }

/* Masthead */
.masthead { border-bottom: 1px solid var(--rule); }
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 80px;
}
.wordmark {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--frost);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 600;
  font-stretch: 118%;
  letter-spacing: -0.01em;
}
.wordmark:hover { color: var(--frost); }
.wordmark__mark { color: var(--signal); }
.nav { display: flex; align-items: center; gap: 36px; font-size: .9375rem; }
.nav__link { display: inline-flex; align-items: center; min-height: 44px; color: var(--haze); text-decoration: none; }
.nav__link:hover { color: var(--frost); }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}
.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 56px;
  padding-block: clamp(64px, 8.3vw, 120px) clamp(72px, 8.9vw, 128px);
}
.hero__copy {
  grid-column: span 7;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 24px;
}
.hero__title {
  font-size: clamp(2.75rem, 5.3vw, 4.75rem);
  line-height: 1.02;
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero__lede {
  max-width: 32em;
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--haze);
}
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; padding-top: 8px; }

/* Readout (hero motif) */
.readout {
  grid-column: 8 / span 5;
  align-self: center;
  background: var(--hull);
  border: 1px solid var(--panel-line);
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: .8125rem;
  line-height: 1.3;
}
.readout__head, .readout__foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  color: var(--mist);
  font-size: .75rem;
}
.readout__head { border-bottom: 1px solid var(--rule); }
.readout__foot { border-top: 1px solid var(--rule); align-items: center; }
.readout__body { position: relative; overflow: hidden; padding: 8px 0 12px; }
.readout__rows { display: flex; flex-direction: column; }
.readout__row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  padding: 11px 20px;
}
.readout__row dt { color: var(--dim); }
.readout__row dd { color: var(--frost); display: flex; flex-direction: column; gap: 8px; }
.readout__row--hit { background: var(--hull-hit); box-shadow: inset 2px 0 0 var(--signal); }
.readout__path { color: var(--haze); word-break: break-word; }
.readout__scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--signal);
  box-shadow: 0 0 18px 2px rgba(91, 224, 240, .45);
  opacity: 0;
  pointer-events: none;
}
.signal { display: inline-flex; align-items: center; gap: 8px; color: var(--signal); }
.signal__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }

/* The single orchestrated load moment: grid settles, one scan pass, rows resolve, status lands. */
@media (prefers-reduced-motion: no-preference) {
  .hero__grid { animation: settle 1.6s ease-out both; }
  .readout__scan { animation: scan 2.4s cubic-bezier(.4, 0, .2, 1) .3s 1 both; }
  .readout__row, .readout__foot { animation: resolve .35s ease-out both; }
  .readout__row:nth-child(1) { animation-delay: .5s; }
  .readout__row:nth-child(2) { animation-delay: .8s; }
  .readout__row:nth-child(3) { animation-delay: 1.1s; }
  .readout__row:nth-child(4) { animation-delay: 1.4s; }
  .readout__row:nth-child(5) { animation-delay: 1.7s; }
  .readout__row:nth-child(6) { animation-delay: 2s; }
  .readout__foot { animation-delay: 2.5s; }
}
@keyframes settle { from { opacity: 0; } to { opacity: 1; } }
@keyframes scan {
  0% { top: 0; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { top: calc(100% - 2px); opacity: 0; }
}
@keyframes resolve { from { opacity: 0; } to { opacity: 1; } }

/* Sections */
.section { padding-block: var(--section-y); border-bottom: 1px solid var(--rule); }
.section--hull { background: var(--hull); }
.section__intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 20px;
  margin-bottom: 72px;
}
.section__title {
  grid-column: span 6;
  max-width: 16ch;
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.08;
  font-weight: 550;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.section__lede {
  grid-column: 7 / span 6;
  align-self: end;
  max-width: 31em;
  font-size: clamp(1.0625rem, 1.3vw, 1.1875rem);
  line-height: 1.6;
  color: var(--haze);
}

/* Services spec sheet */
.spec {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  border-top: 1px solid var(--rule-strong);
}
.spec + .spec { margin-top: 72px; }
.spec__group {
  grid-column: span 3;
  padding-top: 28px;
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: .875rem;
  font-weight: 500;
  color: var(--signal);
}
.spec__list { grid-column: 4 / span 9; }
.spec__item {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 8px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}
.spec__item:last-child { border-bottom: 0; }
.spec__item dt { grid-column: span 3; font-size: 1.1875rem; line-height: 1.35; font-weight: 600; font-stretch: 106%; }
.spec__item dd { grid-column: 4 / span 6; max-width: 31em; color: var(--haze); }

/* Engagement sequence */
.steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: var(--gutter);
  border-top: 1px solid var(--rule-strong);
}
.steps__item { display: flex; flex-direction: column; gap: 14px; padding-top: 28px; }
.steps__item:first-child { margin-top: -1px; border-top: 2px solid var(--signal); padding-top: 27px; }
.steps__n { font-family: var(--font-mono); font-stretch: 87.5%; font-size: .8125rem; color: var(--signal); }
.steps__name { font-size: 1.375rem; line-height: 1.2; font-weight: 600; font-stretch: 110%; }
.steps__item p { max-width: 31em; font-size: 1rem; color: var(--haze); }

/* Why Celcius */
.why {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 64px;
}
.why__copy { grid-column: span 5; display: flex; flex-direction: column; gap: 48px; }
.why__copy .section__title { max-width: 14ch; }
.why__item { display: flex; flex-direction: column; gap: 10px; padding: 24px 0; border-top: 1px solid var(--rule-strong); }
.why__item:last-child { border-bottom: 1px solid var(--rule-strong); }
.why__item h3 { font-size: 1.25rem; line-height: 1.3; font-weight: 600; font-stretch: 106%; }
.why__item p { max-width: 31em; color: var(--haze); }

.record {
  grid-column: 7 / span 6;
  align-self: start;
  background: var(--hull);
  border: 1px solid var(--panel-line);
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: .8125rem;
  line-height: 1.7;
}
.record__head, .record__line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--rule);
}
.record__line:last-child { border-bottom: 0; }
.record__sev { padding: 2px 10px; border: 1px solid var(--amber); color: var(--amber); font-size: .75rem; }
.record__block { display: flex; flex-direction: column; gap: 12px; padding: 24px; border-bottom: 1px solid var(--rule); }
.record__label { color: var(--mist); }
.record__steps { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.record__diff {
  padding: 16px;
  background: var(--abyss);
  border: 1px solid var(--rule);
  font-family: inherit;
  font-size: .75rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}
.record__diff del { color: var(--err); text-decoration: none; }
.record__diff ins { color: var(--ok); text-decoration: none; }

/* Request form */
.section#request { border-bottom: 0; }
.request {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 48px;
}
.request__copy { grid-column: span 5; display: flex; flex-direction: column; gap: 24px; }
.request__copy .section__lede { grid-column: auto; }
.request__title {
  font-size: clamp(2.25rem, 3.9vw, 3.5rem);
  line-height: 1.04;
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.025em;
}
.request__note { font-size: .9375rem; color: var(--mist); }

.form {
  grid-column: 7 / span 6;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: clamp(24px, 2.8vw, 40px);
  border: 1px solid var(--panel-line);
  background: var(--abyss);
}
.field { display: flex; flex-direction: column; gap: 10px; }
.field__label { font-size: .9375rem; font-weight: 500; }
.field__input {
  min-height: 52px;
  padding: 0 16px;
  background: var(--hull);
  border: 1px solid var(--field-line);
  border-radius: 2px;
  color: var(--frost);
  font: inherit;
  font-size: 1.0625rem;
}
.field__input:hover { border-color: var(--field-hover); }
.field__input:focus-visible { outline: 2px solid transparent; outline-offset: 0; border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal); }
.field__input[aria-invalid="true"] { border-color: var(--err); }
.field__error { font-size: .875rem; line-height: 1.5; color: var(--err); }
.field__error[hidden] { display: none; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.cf-turnstile { min-height: 65px; }
.form__notice { font-size: .9375rem; color: var(--haze); }
.form__status { font-size: .9375rem; line-height: 1.5; color: var(--haze); }
.form__status:empty { display: none; }
.form__status[data-tone="error"] { color: var(--err); }

.form-done { display: flex; flex-direction: column; gap: 12px; }
.form-done h3 { font-size: 1.375rem; font-weight: 600; font-stretch: 110%; }
.form-done p { color: var(--haze); }

/* Result pages (no-JS form outcomes, 404) */
.result { padding-block: var(--section-y); min-height: 60vh; }
.result__inner { max-width: 31em; display: flex; flex-direction: column; gap: 20px; }
.result__title { font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.08; font-weight: 600; font-stretch: 112%; letter-spacing: -0.02em; }
.result__inner p { color: var(--haze); }

/* Footer */
.footer { border-top: 1px solid var(--rule); color: var(--mist); font-size: .9375rem; }
.footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding-block: 36px; }

/* Tablet */
@media (max-width: 1100px) {
  .hero__copy, .readout { grid-column: 1 / -1; }
  .readout { max-width: 560px; }
  .section__title, .section__lede { grid-column: 1 / -1; }
  .spec__group { grid-column: 1 / -1; padding-top: 24px; }
  .spec__list { grid-column: 1 / -1; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 40px; }
  .steps__item:first-child { margin-top: 0; }
  .why__copy, .record, .request__copy, .form { grid-column: 1 / -1; }
  .record, .form { max-width: 640px; }
}

/* Phone */
@media (max-width: 720px) {
  :root { --pad-x: 20px; }
  body { font-size: 1rem; }
  .hero__title { font-stretch: 108%; letter-spacing: -0.02em; }
  .section__title { font-stretch: 108%; letter-spacing: -0.015em; }
  .request__title { font-stretch: 108%; letter-spacing: -0.02em; }
  .hero__actions .btn--solid { min-height: 52px; font-size: 1rem; }
  .readout { font-size: .75rem; }
  .masthead__inner { min-height: 64px; }
  .nav { gap: 16px; }
  .nav__link { display: none; }
  .btn--line { padding: 0 14px; font-size: .875rem; }
  .hero__grid { background-size: 40px 40px; }
  .hero__inner { padding-block: 56px 64px; row-gap: 40px; }
  .hero__copy { gap: 24px; padding-top: 0; }
  .hero__actions .btn--solid { width: 100%; }
  .readout__row { grid-template-columns: 76px 1fr; padding: 10px 16px; }
  .readout__head, .readout__foot { padding: 12px 16px; }
  .readout__sub { display: none; }
  .section__intro { margin-bottom: 48px; }
  .spec + .spec { margin-top: 48px; }
  .spec__item { padding: 22px 0; }
  .spec__item dt, .spec__item dd { grid-column: 1 / -1; }
  .steps {
    grid-template-columns: 1fr;
    row-gap: 0;
    border-top: 0;
    border-left: 1px solid var(--rule-strong);
  }
  .steps__item {
    display: grid;
    grid-template-columns: 36px 1fr;
    column-gap: 0;
    row-gap: 6px;
    padding: 16px 0 16px 16px;
  }
  .steps__item:first-child { margin-left: -1px; padding-top: 16px; border-top: 0; border-left: 2px solid var(--signal); }
  .steps__n { padding-top: 6px; grid-row: span 2; }
  .record__head, .record__line, .record__block { padding-inline: 16px; }
  .form { padding: 24px 20px; gap: 22px; }
  .footer__inner { flex-direction: column; padding-block: 28px; }
  .footer { font-size: .875rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

@media (forced-colors: active) {
  .field__input:focus-visible { outline: 2px solid Highlight; }
  .btn--solid, .btn--line { border: 1px solid ButtonText; }
  .readout__row--hit { outline: 1px solid CanvasText; }
}
