/* Coffrack website. Colours, radii and type mirror the app's design tokens
   (docs/design/tokens.json in the app repository); keep them in sync. */

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/InterVariable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --surface-0: #08090a;
  --surface-1: #0e0f11;
  --surface-2: #141517;
  --surface-3: #1a1b1e;
  --surface-4: #212226;
  --border-hairline: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);

  --text-primary: #f2f1ee;
  --text-secondary: #a3a29e;
  --text-tertiary: #7c7b77;
  --text-on-accent: #14100b;

  --accent: #d98e4a;
  --accent-hover: #e39b57;
  --accent-text: #e8a063;
  --accent-glow: rgba(217, 142, 74, 0.35);
  --accent-wash: rgba(217, 142, 74, 0.1);
  --info: #6fa8dc;
  --info-wash: rgba(111, 168, 220, 0.12);
  --success: #58b77a;

  --fresh-resting: #6fa8dc;
  --fresh-peak: #58b77a;
  --fresh-fading: #d9a54a;
  --fresh-stale: #8a8985;
  --fresh-on-resting: #8fbde6;
  --fresh-on-peak: #7ccb98;
  --fresh-on-fading: #e4b96a;
  --fresh-on-stale: #a3a29e;
  --fresh-wash-resting: rgba(111, 168, 220, 0.14);
  --fresh-wash-peak: rgba(88, 183, 122, 0.14);
  --fresh-wash-fading: rgba(217, 165, 74, 0.14);
  --fresh-wash-stale: rgba(138, 137, 133, 0.14);

  --radius-control: 8px;
  --radius-card: 14px;
  --radius-sheet: 22px;

  --page: 1120px;
  --gutter: 24px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

a {
  color: var(--accent-text);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

img,
svg {
  display: block;
}

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--surface-3);
  padding: 8px 12px;
  border-radius: var(--radius-control);
}

/* ─── Header ─────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(8, 9, 10, 0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-hairline);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--text-primary);
}

.brand img {
  width: 30px;
  height: 30px;
}

.nav {
  display: flex;
  gap: 24px;
  font-size: 14px;
}

.nav a {
  color: var(--text-secondary);
}

.nav a:hover {
  color: var(--text-primary);
}

/* ─── Type ───────────────────────────────────────────────────────────────── */

.overline {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 12px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  font-size: clamp(40px, 7vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.lede {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--text-secondary);
  max-width: 34em;
  text-wrap: pretty;
}

.muted {
  color: var(--text-secondary);
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 96px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -120px 0 auto;
  height: 720px;
  pointer-events: none;
  background:
    radial-gradient(55% 55% at 28% 18%, rgba(217, 142, 74, 0.22), transparent 70%),
    radial-gradient(35% 40% at 85% 45%, rgba(111, 168, 220, 0.09), transparent 70%);
}

.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.hero .lede {
  margin: 22px 0 32px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.platform {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.platform svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

/* ─── Phone mock ─────────────────────────────────────────────────────────── */

.phone {
  justify-self: center;
  width: 100%;
  max-width: 330px;
  aspect-ratio: 390 / 800;
  border-radius: 44px;
  padding: 12px;
  background: linear-gradient(160deg, #2a2b2f, #121315 60%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 40px 80px rgba(0, 0, 0, 0.6),
    0 0 120px rgba(217, 142, 74, 0.12);
}

.screen {
  position: relative;
  height: 100%;
  border-radius: 34px;
  overflow: hidden;
  background: var(--surface-0);
  padding: 44px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 260px;
  background: radial-gradient(80% 70% at 30% 0%, rgba(217, 142, 74, 0.2), transparent 70%);
  pointer-events: none;
}

.screen > * {
  position: relative;
}

.notch {
  position: absolute;
  top: 12px;
  left: 50%;
  translate: -50% 0;
  width: 96px;
  height: 26px;
  border-radius: 999px;
  background: #000;
}

.screen .date {
  color: var(--text-secondary);
  font-size: 12px;
}

.screen .hello {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: -6px;
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  padding: 14px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.strong {
  font-weight: 600;
}

.small {
  font-size: 12px;
  color: var(--text-secondary);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.chip.peak {
  background: var(--fresh-wash-peak);
  color: var(--fresh-on-peak);
}

.chip.resting {
  background: var(--fresh-wash-resting);
  color: var(--fresh-on-resting);
}

.chip.fading {
  background: var(--fresh-wash-fading);
  color: var(--fresh-on-fading);
}

.chip.stale {
  background: var(--fresh-wash-stale);
  color: var(--fresh-on-stale);
}

.chip.stock {
  background: rgba(88, 183, 122, 0.14);
  color: var(--fresh-on-peak);
}

.track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 10px;
}

.track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.bag {
  width: 38px;
  height: 46px;
  border-radius: 8px 8px 10px 10px;
  background: linear-gradient(180deg, #9a6b3f, #5e3b22);
  flex: none;
  position: relative;
}

.bag::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 14px;
  height: 14px;
  border-radius: 3px;
  background: rgba(242, 241, 238, 0.85);
}

.timer {
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.steps {
  display: flex;
  gap: 4px;
  margin-top: 12px;
}

.steps span {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.steps span.done {
  background: var(--accent);
}

.steps span.now {
  background: linear-gradient(90deg, var(--accent) 55%, rgba(255, 255, 255, 0.08) 55%);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--text-on-accent);
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 0 24px var(--accent-glow);
}

.tabbar {
  margin-top: auto;
  display: flex;
  justify-content: space-around;
  padding: 10px 0 2px;
  border-top: 1px solid var(--border-hairline);
  font-size: 10px;
  color: var(--text-tertiary);
}

.tabbar span.on {
  color: var(--accent-text);
}

/* ─── Sections ───────────────────────────────────────────────────────────── */

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

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.section-head .lede {
  margin-top: 16px;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.pillar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sheet);
  padding: 28px;
}

.pillar p {
  margin: 8px 0 0;
  color: var(--text-secondary);
}

.pillar .demo {
  margin-top: auto;
  font-size: 13px;
}

.icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-wash);
  color: var(--accent-text);
}

.icon svg {
  width: 20px;
  height: 20px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tile {
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.tile b {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
}

.list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  background: var(--surface-2);
}

.list > div {
  padding: 10px 14px;
}

.list > div + div {
  border-top: 1px solid var(--border-hairline);
}

.price {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Freshness strip */

.stages {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 2.2fr 2.6fr minmax(130px, 1.3fr);
  gap: 6px;
}

.stage {
  border-radius: var(--radius-card);
  padding: 18px 16px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border-hairline);
}

.stage .days {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.stage.resting {
  background: var(--fresh-wash-resting);
}

.stage.peak {
  background: var(--fresh-wash-peak);
}

.stage.fading {
  background: var(--fresh-wash-fading);
}

.stage.stale {
  background: var(--fresh-wash-stale);
}

.stage .name {
  font-weight: 600;
  font-size: 17px;
}

.stage.resting .name {
  color: var(--fresh-on-resting);
}

.stage.peak .name {
  color: var(--fresh-on-peak);
}

.stage.fading .name {
  color: var(--fresh-on-fading);
}

.stage.stale .name {
  color: var(--fresh-on-stale);
}

.stage-note {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-tertiary);
}

/* Split feature rows */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.feature {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sheet);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feature p {
  margin: 8px 0 0;
  color: var(--text-secondary);
}

.bubbles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  margin-top: auto;
}

.bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.45;
}

.bubble.me {
  align-self: flex-end;
  background: var(--accent-wash);
  border: 1px solid rgba(217, 142, 74, 0.25);
  border-bottom-right-radius: 6px;
}

.bubble.it {
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-bottom-left-radius: 6px;
  color: var(--text-secondary);
}

.bubble.it b {
  color: var(--text-primary);
  font-weight: 600;
}

/* Principles */

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.principles h3 {
  margin: 16px 0 8px;
}

.principles p {
  margin: 0;
  color: var(--text-secondary);
}

/* CTA */

.cta {
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(45% 70% at 50% 100%, rgba(217, 142, 74, 0.16), transparent 70%);
  pointer-events: none;
}

.cta .wrap {
  position: relative;
}

.cta img {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
}

.cta .lede {
  margin: 16px auto 32px;
}

.cta .platforms {
  justify-content: center;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border-hairline);
  padding: 32px 0 48px;
  font-size: 14px;
  color: var(--text-tertiary);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.site-footer a {
  color: var(--text-secondary);
}

.site-footer a:hover {
  color: var(--text-primary);
}

/* ─── Legal pages ────────────────────────────────────────────────────────── */

.doc {
  max-width: 720px;
  padding-top: 72px;
  padding-bottom: 96px;
}

.doc h1 {
  font-size: clamp(34px, 5vw, 48px);
}

.doc .updated {
  color: var(--text-tertiary);
  font-size: 14px;
  margin: 12px 0 40px;
}

.doc h2 {
  font-size: 22px;
  letter-spacing: -0.015em;
  margin: 44px 0 12px;
}

.doc p,
.doc li {
  color: var(--text-secondary);
}

.doc strong {
  color: var(--text-primary);
  font-weight: 600;
}

.doc ul {
  padding-left: 20px;
}

.doc li + li {
  margin-top: 6px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 16px 0;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--border-hairline);
}

.doc th {
  color: var(--text-primary);
  font-weight: 600;
}

.doc td {
  color: var(--text-secondary);
}

.table-scroll {
  overflow-x: auto;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .pillars,
  .split {
    grid-template-columns: 1fr;
  }

  .principles {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }

  .nav a.hide-sm {
    display: none;
  }

  .hero {
    padding: 56px 0 72px;
  }

  section {
    padding: 72px 0;
  }

  .pillar,
  .feature {
    padding: 22px;
  }

  .stages {
    grid-template-columns: 1fr 1fr;
  }

  .tiles {
    grid-template-columns: repeat(2, 1fr);
  }
}

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