/* KalibrOS marketing site — tokens and voice from kalibros-brand.md (metrc-buffer repo). */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/fonts/archivo-2axis.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/plex-mono-500.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  --graphite: #17191c;
  --bone: #eceae6;
  --gauge: #9aa1ab;
  --signal: #ff7a1a;
  --advisory: #d9a441;
  --reconciled: #4fbf8b;

  /* The Desk's own HAIRLINE token: 1px of gauge at half strength (src/features/ui/tokens.ts).
     Used for every visible rule. --hairline stays a quieter variant for dividers inside a
     already-bordered box, where a full-strength rule would be one line too many. */
  --rule: color-mix(in srgb, var(--gauge) 50%, transparent);
  --hairline: color-mix(in srgb, var(--gauge) 28%, transparent);

  --section-y: clamp(72px, 9vw, 128px);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--graphite);
  -webkit-tap-highlight-color: transparent;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--graphite);
  color: var(--bone);
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  overscroll-behavior-y: none;
  touch-action: manipulation;
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
}

main {
  overflow-x: clip;
}

a {
  color: inherit;
}

::selection {
  background: var(--bone);
  color: var(--graphite);
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(24px, 4vw, 40px);
}

h1, h2 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* ---- wordmark + dial ---- */

.wordmark {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.wordmark .kalibr {
  font-weight: 250;
  font-stretch: 112%;
}

.wordmark .os {
  font-weight: 800;
  color: var(--signal);
}

.dial {
  width: 28px;
  height: 28px;
  flex: none;
}

.dial.dial--lg {
  width: 56px;
  height: 56px;
}

/* The one motion the brand allows, per src/features/ui/tokens.ts DIAL_SETTLE: 400ms,
   cubic-bezier(0.2,0,0,1), needle settles to true zero — never triggered by scroll, never
   looping. The header dial stays static; only the hero readout's large dial plays it, after
   the readout's own conditions have ticked in (see .tick below). */
.dial .needle {
  transform-origin: 16px 16px;
}

.dial--lg .needle {
  animation: dial-settle 400ms cubic-bezier(0.2, 0, 0, 1) 600ms both;
}

@keyframes dial-settle {
  from { transform: rotate(-32deg); }
  to { transform: rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .dial--lg .needle {
    animation: none;
  }
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--graphite);
  border-bottom: 1px solid var(--rule);
  padding-top: var(--safe-t);
}

.site-header .bar {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 0.9rem;
  color: var(--gauge);
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--bone);
}

.btn-small {
  min-height: 36px;
  padding: 0 16px;
  font-size: 0.875rem;
}

@media (max-width: 719px) {
  .site-nav {
    display: none;
  }
  .site-header .btn-small {
    margin-left: auto;
  }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 26px;
  border-radius: 2px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  width: fit-content;
}

.btn-primary {
  background: var(--signal);
  color: var(--graphite);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #ff8c3d;
}

.btn-primary:active {
  background: #d4600a;
}

.text-link {
  color: var(--bone);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--rule);
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

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

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

.hero {
  padding: clamp(56px, 8vw, 112px) 0 var(--section-y);
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero {
    grid-template-columns: 7fr 5fr;
    gap: 64px;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 6px 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gauge);
  margin: 0 0 1.5em;
  width: fit-content;
}

.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--reconciled);
  flex: none;
}

h1 {
  font-size: clamp(2.25rem, 3.2vw + 1rem, 4rem);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.015em;
  line-height: 1.04;
  margin: 0 0 24px;
  max-width: 15ch;
}

.lede {
  font-size: 1.125rem;
  color: var(--gauge);
  max-width: 46ch;
  margin: 0 0 32px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.cta-note {
  font-size: 0.875rem;
  color: var(--gauge);
  margin: 14px 0 0;
}

/* ---- the release-gate readout ---- */

.gate {
  border: 1px solid var(--rule);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8125rem;
}

.gate-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
  color: var(--gauge);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.6875rem;
}

.gate-title {
  padding: 16px 20px 12px;
  font-family: "Archivo", sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

.gate dl {
  margin: 0;
}

.gate-row {
  display: grid;
  grid-template-columns: 1fr auto 20px;
  gap: 12px;
  align-items: center;
  padding: 10px 20px;
  border-top: 1px solid var(--hairline);
}

.gate-row dt {
  color: var(--gauge);
}

.gate-row dd {
  margin: 0;
  text-align: right;
}

.gate-row .tick {
  width: 12px;
  height: 12px;
  opacity: 0;
  animation: tick-in 120ms linear forwards;
}

.gate-row:nth-of-type(1) .tick { animation-delay: 150ms; }
.gate-row:nth-of-type(2) .tick { animation-delay: 220ms; }
.gate-row:nth-of-type(3) .tick { animation-delay: 290ms; }
.gate-row:nth-of-type(4) .tick { animation-delay: 360ms; }
.gate-row:nth-of-type(5) .tick { animation-delay: 430ms; }
.gate-row:nth-of-type(6) .tick { animation-delay: 500ms; }

@keyframes tick-in {
  to { opacity: 1; }
}

.gate-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-top: 1px solid var(--rule);
}

.gate-foot strong {
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--reconciled);
  display: block;
}

.gate-foot span {
  color: var(--gauge);
}

@media (prefers-reduced-motion: reduce) {
  .gate-row .tick {
    animation: none;
    opacity: 1;
  }
}

/* ---- product plate (large screenshot right under the hero) ---- */

.plate {
  border: 1px solid var(--rule);
  margin: 0 0 var(--section-y);
}

.plate img {
  display: block;
  width: 100%;
  height: auto;
}

.plate figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--gauge);
}

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

section {
  padding: var(--section-y) 0;
  border-top: 1px solid var(--rule);
}

.section-head {
  margin-bottom: clamp(32px, 4vw, 56px);
}

.kicker {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gauge);
  margin: 0 0 16px;
}

h2 {
  font-size: clamp(1.625rem, 1.6vw + 1.1rem, 2.5rem);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  line-height: 1.12;
  margin: 0 0 16px;
  max-width: 24ch;
}

.section-lede {
  color: var(--gauge);
  max-width: 60ch;
  margin: 0;
  font-size: 1.05rem;
}

/* ---- editions ---- */

.editions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

@media (min-width: 1024px) {
  .editions {
    grid-template-columns: 1fr 1fr;
  }
  .edition--live {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    column-gap: 56px;
  }
}

.edition {
  background: var(--graphite);
  padding: clamp(24px, 3vw, 40px);
  display: flex;
  flex-direction: column;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 3px 11px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gauge);
  width: fit-content;
  margin: 0 0 1.1em;
}

.status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--reconciled);
}

.edition h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

.edition--live h3 {
  font-size: 1.75rem;
  font-stretch: 112%;
}

.edition p {
  color: var(--gauge);
  font-size: 0.95rem;
  margin: 0 0 1.4em;
  flex: 1;
}

.edition .tagline {
  color: var(--bone);
  font-size: 0.85rem;
  margin: 0 0 1.1em;
  font-style: normal;
}

.edition-link {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: var(--rule);
  width: fit-content;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.edition-link:hover,
.edition-link:focus-visible {
  color: var(--signal);
  text-decoration-color: var(--signal);
}

/* the live edition's scope list */
.scope {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8125rem;
  align-self: start;
}

.scope li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--hairline);
  color: var(--gauge);
}

.scope li:last-child {
  border-bottom: 1px solid var(--hairline);
}

.scope li b {
  color: var(--bone);
  font-weight: 400;
}

/* ---- surfaces (hardware ecosystem) ---- */

.surfaces-section {
  background: var(--bone);
  color: var(--graphite);
}

.surfaces-section .kicker,
.surfaces-section .section-lede,
.surfaces-section .spec,
.surfaces-section .surface p {
  color: #60666f;
}

.surfaces {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: color-mix(in srgb, #60666f 45%, transparent);
  border: 1px solid color-mix(in srgb, #60666f 45%, transparent);
}

@media (min-width: 1024px) {
  .surfaces {
    grid-template-columns: 1fr 1fr;
  }
  .surface--desk {
    grid-column: 1 / -1;
  }
}

.surface {
  background: var(--bone);
  padding: clamp(24px, 3vw, 40px);
}

.surface h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

.surface p {
  font-size: 0.95rem;
  margin: 0;
}

.spec {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.stage {
  height: 420px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 20px;
}

@media (min-width: 480px) {
  .stage {
    height: 520px;
  }
}

@media (max-width: 719px) {
  .stage {
    height: auto;
  }
}

.stage .device-frame {
  margin: 0;
}

.surface--desk .device-frame {
  margin-bottom: 20px;
  border-color: color-mix(in srgb, #60666f 45%, transparent);
}

.device-frame {
  border: 1px solid var(--rule);
  overflow: hidden;
  background: var(--graphite);
}

.device-frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* Pocket's frame reads as a literal phone, not a panel — the one place this page rounds a
   corner further than a button, because a phone genuinely has rounded corners. */
.device-frame--phone {
  max-width: 220px;
  border-width: 7px;
  border-radius: 26px;
}

.device-frame--phone img {
  border-radius: 19px;
}

/* Floor's frame reads as a case, not a consumer phone: thicker, barely rounded. */
.device-frame--rugged {
  max-width: 240px;
  border-width: 10px;
  border-radius: 8px;
}

/* ---- about / credibility ---- */

.about p {
  max-width: 60ch;
  color: var(--gauge);
  font-size: 1.05rem;
  margin: 0 0 1.1em;
}

.founder {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  max-width: 60ch;
}

.founder b {
  display: block;
}

.founder span {
  color: var(--gauge);
  font-size: 0.9rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, auto));
  justify-content: start;
  gap: 40px;
  margin-top: 32px;
}

.facts div {
  font-family: "IBM Plex Mono", monospace;
}

.facts b {
  display: block;
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--bone);
}

.facts span {
  font-size: 0.75rem;
  color: var(--gauge);
}

/* ---- closing CTA band ---- */

.close h2 {
  max-width: 20ch;
}

.close p {
  color: var(--gauge);
  max-width: 52ch;
  margin: 0 0 32px;
  font-size: 1.05rem;
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 56px 0 calc(32px + var(--safe-b));
  color: var(--gauge);
  font-size: 0.875rem;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 720px) {
  .foot-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.foot-grid h4 {
  font: 500 0.72rem "IBM Plex Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gauge);
  margin: 0 0 12px;
}

.foot-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.foot-grid li a {
  color: var(--bone);
  text-decoration: none;
  display: inline-flex;
  min-height: 32px;
  align-items: center;
}

.foot-grid li a:hover,
.foot-grid li a:focus-visible {
  color: var(--signal);
}

.foot-about {
  max-width: 34ch;
  margin: 16px 0 0;
}

.foot-location {
  margin: 12px 0 0;
}

.cert {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

/* ---- legal pages (privacy / terms) ---- */

.legal {
  padding: calc(48px + var(--safe-t)) 0 64px;
  max-width: 720px;
}

.legal h1 {
  font-size: clamp(1.75rem, 3vw + 1rem, 2.5rem);
  max-width: none;
}

.legal > a.text-link {
  margin-bottom: 1.5em;
}

.legal .updated {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--gauge);
  margin: 0 0 2em;
}

.legal h2 {
  font-size: 1.15rem;
  max-width: none;
  margin-top: 1.6em;
}

.legal p,
.legal li {
  color: var(--gauge);
  font-size: 0.98rem;
  max-width: 65ch;
}

.legal strong {
  color: var(--bone);
}

.legal a {
  color: var(--bone);
  text-decoration-color: var(--rule);
}

/* ---- 404 ---- */

.notfound {
  min-height: calc(100dvh - 61px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
}

.notfound .dial {
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
}

.notfound .dial .needle {
  transform: rotate(-32deg);
}

.notfound h1 {
  max-width: none;
  font-size: clamp(1.5rem, 2vw + 1rem, 2rem);
}

.notfound p {
  color: var(--gauge);
  max-width: 46ch;
}
