/* Leeway — site styles.
   Tokens are the app's own design system, so the site and the app read as one
   thing. Do not introduce colours outside this block. */

:root {
  --ivory:      #F5F3EE;   /* page */
  --ink:        #17181C;   /* alarm cards, footer, primary text */
  --stone:      #5E6068;   /* secondary text */
  --dim:        #8E8F95;   /* tertiary text */
  --surface:    #FFFFFF;   /* panels */
  --hairline:   #E2DED5;   /* rules */
  --well:       #EBE8E1;   /* slider tracks */
  --coral:      #EE6A3F;   /* the one accent */
  --coral-chip: #FCE5DA;
  --coral-text: #9C3A14;   /* accent text on light */
  --calm:       #2F7D52;   /* good state */

  --measure: 64ch;
  --page: 1060px;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --ui: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 17px/1.6 var(--ui);
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Type ---------- */

h1, h2, h3, .clock, .figure {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
h1 { font-size: clamp(2.3rem, 6.2vw, 3.9rem); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.65rem, 3.6vw, 2.3rem); line-height: 1.1; letter-spacing: -0.028em; }
h3 { font-size: 1.1rem; line-height: 1.3; letter-spacing: -0.015em; }

p { margin: 0 0 1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }
a { color: var(--coral-text); text-decoration: none; border-bottom: 1px solid rgba(156, 58, 20, 0.3); }
a:hover { border-bottom-color: var(--coral-text); }

.lede { font-size: 1.16rem; color: var(--stone); }
.small { font-size: 0.87rem; color: var(--dim); }
.tabular { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2.5px solid var(--coral); outline-offset: 3px; border-radius: 4px; }

/* ---------- Masthead ---------- */

.masthead {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 243, 238, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.masthead .wrap { display: flex; align-items: center; gap: 24px; height: 62px; }
.mark {
  font-family: var(--display); font-weight: 600; font-size: 1.12rem;
  letter-spacing: -0.03em; color: var(--ink); border: 0; display: flex; align-items: center; gap: 9px;
}
.mark:hover { border: 0; }
.mark i {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--coral); display: block; flex: none;
}
.masthead nav { margin-left: auto; display: flex; gap: 22px; align-items: center; }
.masthead nav a {
  font-size: 0.93rem; color: var(--stone); border: 0; font-weight: 500;
}
.masthead nav a:hover { color: var(--ink); border: 0; }
.masthead nav a[aria-current="page"] { color: var(--ink); }
@media (max-width: 720px) {
  .masthead nav { gap: 15px; }
  .masthead nav .hide-sm { display: none; }
}

/* ---------- Sections ---------- */

section { padding: 76px 0; border-top: 1px solid var(--hairline); }
section:first-of-type { border-top: 0; }
.section-head { max-width: var(--measure); margin-bottom: 36px; }
.section-head p { margin-top: 0.7em; color: var(--stone); }

/* ---------- Hero ---------- */

.hero { padding: 64px 0 76px; }
.hero-grid { display: grid; gap: 44px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
}
.hero h1 + p { margin-top: 1.1em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 28px; }

/* ---------- The alarm card: the app's own dark hero ---------- */

.alarm-card {
  background: var(--ink); color: var(--ivory);
  border-radius: 26px; padding: 26px;
}
.alarm-card .row {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 0.95rem; font-weight: 500; color: rgba(245, 243, 238, 0.65);
}
.clock {
  font-size: clamp(3.4rem, 11vw, 4.8rem); line-height: 1;
  letter-spacing: -0.05em; font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 0.1em; margin: 14px 0 4px;
}
.clock .suffix { font-size: 0.34em; letter-spacing: 0; color: rgba(245, 243, 238, 0.6); }
.alarm-card .sub { color: rgba(245, 243, 238, 0.65); font-size: 0.95rem; margin: 0; }
.alarm-card .flag {
  margin-top: 16px; padding: 12px 14px; border-radius: 14px;
  background: rgba(238, 106, 63, 0.16);
  border: 1px solid rgba(238, 106, 63, 0.4);
  color: #FFD9C9; font-size: 0.92rem; font-weight: 500;
}

/* ---------- Controls ---------- */

.controls { margin-top: 18px; display: grid; gap: 16px; }
.control { display: grid; gap: 7px; }
.control .top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.92rem; font-weight: 500;
}
.control .top b { font-family: var(--display); font-variant-numeric: tabular-nums; font-weight: 600; }
.control .top span { color: var(--stone); }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 26px; background: transparent; margin: 0; cursor: grab;
}
input[type="range"]:active { cursor: grabbing; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px; background: var(--well);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; margin-top: -9px; border-radius: 50%;
  background: var(--ink); border: 3px solid var(--ivory);
  box-shadow: 0 0 0 1px var(--hairline);
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--well); }
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink); border: 3px solid var(--ivory);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 1rem/1 var(--ui); padding: 16px 26px; border-radius: 999px;
  border: 0; cursor: pointer; text-align: center;
}
.btn-primary { background: var(--ink); color: var(--ivory); }
.btn-primary:hover { background: #000; }
.btn-ghost {
  background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--hairline);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--stone); }
a.btn { border-bottom: 0; }

/* ---------- The subtraction stack: the page's signature device ---------- */

.ledger { background: var(--surface); border-radius: 22px; padding: 8px 20px; }
.ledger .line {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px 0; border-top: 1px solid var(--hairline);
  font-size: 0.98rem;
}
.ledger .line:first-child { border-top: 0; }
.ledger .line .v { font-variant-numeric: tabular-nums; color: var(--stone); white-space: nowrap; }
.ledger .line.total { font-weight: 600; }
.ledger .line.total .v { color: var(--coral-text); font-family: var(--display); font-size: 1.15rem; }
.ledger .line.rule { border-top-width: 2px; border-top-color: var(--ink); }

/* ---------- Panels ---------- */

.panel { background: var(--surface); border-radius: 22px; padding: 24px; }
.cols { display: grid; gap: 16px; }
@media (min-width: 760px) { .cols-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 860px) { .cols-3 { grid-template-columns: repeat(3, 1fr); } }

.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--stone); font-size: 0.99rem; margin: 0; }

/* ---------- Pricing ---------- */

.price-amount {
  font-family: var(--display); font-weight: 600; font-size: 2.2rem;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.plan { display: grid; gap: 14px; align-content: start; }
.plan.paid { background: var(--ink); color: var(--ivory); }
.plan.paid .price-amount { color: var(--ivory); }
.plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; font-size: 0.99rem; }
.plan li { padding-left: 24px; position: relative; color: var(--stone); }
.plan.paid li { color: rgba(245, 243, 238, 0.78); }
.plan li::before {
  content: ""; position: absolute; left: 4px; top: 0.52em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--calm);
}
.plan.paid li::before { background: var(--coral); }

/* ---------- Toggle (traffic demo) ---------- */

.switch { display: inline-flex; background: var(--well); border-radius: 999px; padding: 4px; gap: 4px; }
.switch button {
  border: 0; background: transparent; cursor: pointer;
  font: 600 0.92rem/1 var(--ui); color: var(--stone);
  padding: 11px 18px; border-radius: 999px;
}
.switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); }

/* ---------- Legal pages ---------- */

.doc-grid { display: grid; gap: 40px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 940px) { .doc-grid { grid-template-columns: 220px 1fr; gap: 56px; } }
.toc { position: sticky; top: 86px; font-size: 0.93rem; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a {
  color: var(--stone); border: 0; display: block; padding: 6px 10px;
  border-left: 2px solid var(--hairline); border-radius: 0 6px 6px 0;
}
.toc a:hover { color: var(--ink); background: var(--surface); border-left-color: var(--stone); }
.toc a.active { color: var(--ink); font-weight: 600; border-left-color: var(--coral); background: var(--surface); }
@media (max-width: 939px) { .toc { position: static; } }

.doc h2 { margin: 48px 0 14px; scroll-margin-top: 86px; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { margin: 28px 0 8px; }
.doc p, .doc li { color: var(--stone); }
.doc ul { padding-left: 22px; max-width: var(--measure); }
.doc li { margin-bottom: 0.5em; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc .callout {
  background: var(--coral-chip); border-radius: 18px; padding: 20px 22px; margin: 24px 0;
  max-width: var(--measure);
}
.doc .callout p { color: var(--coral-text); margin: 0; }
.doc .callout p + p { margin-top: 0.7em; }
.doc-head { padding: 56px 0 8px; }
.doc-head .small { margin-top: 10px; }

table.data { border-collapse: collapse; width: 100%; max-width: 560px; margin: 18px 0; font-size: 0.97rem; }
table.data th, table.data td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--hairline); }
table.data th { font-weight: 600; color: var(--ink); }
table.data td { color: var(--stone); }
table.data tr:last-child td { border-bottom: 0; }

/* ---------- Footer ---------- */

footer { background: var(--ink); color: rgba(245, 243, 238, 0.72); padding: 56px 0 44px; margin-top: 0; }
footer .wrap { display: grid; gap: 28px; }
@media (min-width: 760px) { footer .wrap { grid-template-columns: 1.3fr 1fr 1fr; } }
footer .mark { color: var(--ivory); }
footer a { color: rgba(245, 243, 238, 0.72); border: 0; display: block; padding: 4px 0; font-size: 0.95rem; }
footer a:hover { color: var(--ivory); border: 0; }
footer h3 { color: var(--ivory); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase;
  font-family: var(--ui); font-weight: 600; margin-bottom: 8px; }
footer .fine { font-size: 0.86rem; color: rgba(245, 243, 238, 0.45); max-width: 46ch; }
