/*
 * Dayspine — site styles.
 *
 * The design language is the app's, locked 2026-07-28: white canvas, orange as
 * the brand, Outfit for words and JetBrains Mono for anything with digits.
 *
 * The one structural idea: the page is built on the spine. A single vertical
 * rail runs from the first section to the last, and every block of content hangs
 * off it as an event with a time. The product's claim is that six trackers
 * belong on one timeline; a page built as a grid of feature cards would argue
 * the opposite.
 */

:root {
  --canvas: #ffffff;
  --surface: #fbf9f7;
  --raised: #f2eeea;
  --line: #e9e3dd;

  --text: #171310;
  --muted: #736b64;
  --faint: #a79e96;

  --brand: #f26a11;
  --brand-deep: #b24a05; /* orange TEXT on white — the brand orange is unreadable at body size */
  --brand-tint: #fef0e6;
  --on-brand: #ffffff;

  /* Module accents. Every one is darker than a dark-theme equivalent would be:
     a colour that pops on near-black disappears on white. Only nutrition is
     allowed to be loud, because it is the brand. */
  --nutrition: #f26a11;
  --training: #2f5d8c;
  --cardio: #a63636;
  --fasting: #6b4e9e;
  --recovery: #1f7358;
  --mindset: #8a5a2b;

  --rail-x: 104px; /* where the spine sits on desktop */

  --step--1: clamp(0.78rem, 0.76rem + 0.1vw, 0.84rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.6rem, 1.35rem + 1.2vw, 2.2rem);
  --step-3: clamp(2.4rem, 1.8rem + 3vw, 4.4rem);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* --- the spine ---------------------------------------------------------- */

.spine {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 0 0;
}

/* The rail itself. One continuous line for the whole page — it is the product. */
.spine::before {
  content: '';
  position: absolute;
  left: var(--rail-x);
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

/* The marker that tracks the viewport. Scrolling the page walks the day. */
#now-marker {
  position: fixed;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 5;
}

#now-marker .inner {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
}

#now-marker .dot {
  position: absolute;
  left: calc(var(--rail-x) - 5px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--canvas), 0 0 0 6px var(--brand-tint);
}

/*
 * The label lives in the time gutter, right-aligned with every other timestamp,
 * rather than to the right of the rail. Two reasons: it read as an annotation
 * stuck on top of the body copy when it sat on the content side, and "now" is a
 * time — it belongs in the column where the times are.
 */
#now-marker .label {
  position: absolute;
  left: 0;
  width: calc(var(--rail-x) - 22px);
  text-align: right;
  transform: translateY(-50%);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--brand-deep);
}

/* --- an event on the rail ----------------------------------------------- */

.event {
  position: relative;
  padding: 0 0 0 var(--rail-x);
  margin: 0 0 clamp(64px, 9vw, 132px);
}

.event > .body {
  padding-left: 40px;
  max-width: 640px;
}

.event .time {
  position: absolute;
  left: 0;
  top: 2px;
  width: calc(var(--rail-x) - 22px);
  text-align: right;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--step--1);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

/* The node where an event meets the rail. Colour carries the module. */
.event .node {
  position: absolute;
  left: calc(var(--rail-x) - 4px);
  top: 9px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 4px var(--canvas);
}

.event[data-module='nutrition'] .node { background: var(--nutrition); }
.event[data-module='training'] .node { background: var(--training); }
.event[data-module='cardio'] .node { background: var(--cardio); }
.event[data-module='fasting'] .node { background: var(--fasting); }
.event[data-module='recovery'] .node { background: var(--recovery); }
.event[data-module='mindset'] .node { background: var(--mindset); }

/* A hollow node marks a section that is commentary rather than a logged event. */
.event[data-kind='aside'] .node {
  background: var(--canvas);
  border: 2px solid var(--line);
}

.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 12px;
}

h1,
h2,
h3 {
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 16px;
}

h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); letter-spacing: -0.015em; }

p {
  margin: 0 0 16px;
  color: var(--muted);
  max-width: 58ch;
}

p strong {
  color: var(--text);
  font-weight: 600;
}

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

.masthead {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 28px;
}

.wordmark {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.wordmark .accent { color: var(--brand-deep); }

.tagline {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.hero h1 { margin-bottom: 20px; }

.hero .lede {
  font-size: var(--step-1);
  color: var(--text);
  font-weight: 400;
  max-width: 30ch;
}

/* The one orange surface on the whole page. */
.offer {
  background: var(--brand);
  color: var(--on-brand);
  border-radius: 18px;
  padding: clamp(22px, 3vw, 34px);
  margin: 28px 0 0;
  max-width: 460px;
}

.offer p { color: rgba(255, 255, 255, 0.9); margin-bottom: 0; }
.offer .stack {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--step-2);
  font-weight: 500;
  display: block;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

/* --- waitlist form ------------------------------------------------------ */

.signup {
  display: flex;
  gap: 10px;
  margin: 26px 0 10px;
  max-width: 460px;
  flex-wrap: wrap;
}

.signup input {
  flex: 1 1 220px;
  min-width: 0;
  font: inherit;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--text);
}

.signup input::placeholder { color: var(--faint); }

.signup input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-color: transparent;
}

.signup button {
  font: inherit;
  font-weight: 600;
  padding: 13px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: var(--canvas);
  cursor: pointer;
  transition: background 0.15s ease;
}

.signup button:hover { background: var(--brand-deep); }
.signup button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.signup button[disabled] { opacity: 0.55; cursor: default; }

.form-note {
  font-size: var(--step--1);
  color: var(--faint);
  margin: 0;
  min-height: 1.4em;
}

.form-note[data-state='ok'] { color: var(--recovery); }
.form-note[data-state='error'] { color: var(--cardio); }

/* --- the stack comparison ----------------------------------------------- */

.ledger {
  border-top: 1px solid var(--line);
  margin: 22px 0 0;
  max-width: 460px;
}

.ledger li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--step--1);
  color: var(--muted);
}

.ledger {
  list-style: none;
  padding: 0;
}

.ledger li span:last-child {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--faint);
  white-space: nowrap;
}

.ledger li.total {
  color: var(--text);
  font-weight: 600;
  border-bottom: 0;
}

.ledger li.total span:last-child { color: var(--text); }

/* --- module list -------------------------------------------------------- */

.modules {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  max-width: 560px;
}

.modules li {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 14px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.modules li::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 8px;
  background: var(--swatch, var(--text));
}

.modules b {
  font-weight: 600;
  color: var(--text);
}

.modules span {
  color: var(--muted);
  font-size: var(--step--1);
  display: block;
}

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

footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 34px 0 64px var(--rail-x);
}

footer .body { padding-left: 40px; }

footer p,
footer address {
  font-size: var(--step--1);
  color: var(--faint);
  font-style: normal;
  max-width: 52ch;
}

footer nav {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  font-size: var(--step--1);
}

/* --- prose pages (privacy, support) ------------------------------------- */

.prose {
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}

.prose h1 { font-size: var(--step-2); margin-bottom: 8px; }
.prose h2 {
  font-size: var(--step-1);
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.prose p,
.prose li { color: var(--muted); }
.prose li { margin-bottom: 8px; }
.prose .updated {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--step--1);
  color: var(--faint);
  margin-bottom: 36px;
}
.prose .back {
  display: inline-block;
  margin-bottom: 28px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- motion ------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.seen {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .reveal.seen {
    opacity: 1;
    transform: none;
    transition: none;
  }
  #now-marker { display: none; }
}

/* --- small screens ------------------------------------------------------ */

@media (max-width: 720px) {
  :root { --rail-x: 62px; }

  .spine { padding-right: 18px; }
  .event { margin-bottom: 56px; }
  .event > .body { padding-left: 22px; }
  .event .time {
    width: calc(var(--rail-x) - 16px);
    font-size: 0.7rem;
  }
  footer { padding-left: var(--rail-x); }
  footer .body { padding-left: 22px; }
  .signup { flex-direction: column; }
  .signup button { width: 100%; }
}
