@font-face { font-family: 'Geist'; src: url('/fonts/geist-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #fbfaf8; --ink: #232327; --mute: #6f7076; --rule: #e4e3df; --tile: #f0efec; --tile-2: #e8e7e4;
  --train: 75; --rest: 255;
  --train-tint: oklch(0.93 0.07 var(--train)); --train-strong: oklch(0.56 0.13 var(--train)); --train-deep: oklch(0.34 0.08 var(--train));
  --rest-tint: oklch(0.94 0.035 var(--rest)); --rest-strong: oklch(0.52 0.12 var(--rest)); --rest-deep: oklch(0.32 0.08 var(--rest));
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #121214; --ink: #eeede9; --mute: #9a9ba1; --rule: #2b2c31; --tile: #1e1f23; --tile-2: #2a2b30;
  --train-tint: oklch(0.32 0.06 var(--train)); --train-strong: oklch(0.8 0.13 var(--train)); --train-deep: oklch(0.92 0.06 var(--train));
  --rest-tint: oklch(0.3 0.05 var(--rest)); --rest-strong: oklch(0.78 0.1 var(--rest)); --rest-deep: oklch(0.92 0.04 var(--rest));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
html, body { overflow-x: clip; }
[hidden] { display: none !important; }
body { margin: 0; position: relative; isolation: isolate; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 1.0625rem; line-height: 1.5; letter-spacing: -0.006em; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--train-strong); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 76rem; margin: 0 auto; padding: 0 var(--gutter); }
.dim { color: var(--mute); }

/* Craftform-style masthead */
.masthead { z-index: 40; background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; display: flex; position: sticky; top: 0; }
.lead { flex: none; align-items: center; gap: 0.6rem; display: flex; }
.brand { letter-spacing: -0.02em; align-items: center; gap: 0.55rem; font-size: 1.0625rem; font-weight: 500; text-decoration: none; display: inline-flex; }
.brand svg { width: 1.6rem; height: 1.6rem; color: var(--train-strong); will-change: transform; transition: rotate 0.9s var(--ease); }
.brand:hover svg { rotate: 45deg; }
.nav { align-items: center; gap: 0.15rem; display: flex; }
.nav a { color: var(--mute); border-radius: 999px; padding: 0.4rem 0.75rem; font-size: 0.9375rem; font-weight: 500; text-decoration: none; transition: color 0.2s, background-color 0.2s; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--ink); }
.nav a[aria-current='page'] { background: var(--tile); }
.tools { align-items: center; gap: 0.35rem; margin-left: 0.4rem; display: flex; }
.tool { background: var(--tile); cursor: pointer; min-width: 2.25rem; height: 2.25rem; color: var(--ink); transition: background-color 0.2s, transform 0.2s var(--ease); border: 0; border-radius: 999px; grid-auto-flow: column; place-items: center; gap: 0.4rem; padding: 0 0.6rem; font-size: 0.8125rem; font-weight: 500; display: inline-grid; text-decoration: none; }
.tool:hover { background: var(--tile-2); }
.tool:active { transform: scale(0.94); }
.tool.theme { place-items: center; padding: 0; display: grid; }
.tool.theme svg { transition: opacity 0.3s, rotate 0.5s var(--ease), scale 0.4s var(--ease); grid-area: 1 / 1; }
.tool.theme .to-light { opacity: 0; rotate: -90deg; scale: 0.5; }
:root[data-theme='dark'] .tool.theme .to-light { opacity: 1; rotate: 0deg; scale: 1; }
:root[data-theme='dark'] .tool.theme .to-dark { opacity: 0; rotate: 90deg; scale: 0.5; }
.tool.menu { display: none; }
.tool span { color: var(--mute); }
.tool.jump span { color: var(--ink); }
.tool kbd { color: var(--mute); background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--rule); border-radius: 0.32rem; min-width: 1.15rem; padding: 0.08rem 0.22rem; font-family: inherit; font-size: 0.7rem; line-height: 1; }

.palette:not(.sheet) { width: min(32rem, calc(100vw - 2rem)); margin: 14vh auto auto; padding: 0.5rem; color: var(--ink); background: var(--bg); border: 1px solid var(--rule); border-radius: 1rem; box-shadow: 0 18px 60px -18px color-mix(in srgb, var(--ink) 38%, transparent); }
.palette:not(.sheet)::backdrop { background: color-mix(in srgb, var(--ink) 22%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.palette:not(.sheet) input { width: 100%; padding: 0.75rem 0.9rem; color: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--rule); font: inherit; font-size: 1.25rem; outline: 0; }
.palette:not(.sheet) ul { margin: 0; padding: 0.35rem 0; list-style: none; }
.palette:not(.sheet) a { display: block; padding: 0.7rem 0.9rem; color: inherit; border-radius: 0.625rem; text-decoration: none; }
.palette:not(.sheet) a:hover, .palette:not(.sheet) a:focus-visible { background: var(--tile); outline: 0; }

/* Mobile menu sheet (Craftform) */
.palette.sheet { border: 0; padding: 0; margin: 0; background: transparent; max-width: none; max-height: none; }
.palette.sheet::backdrop { background: color-mix(in srgb, var(--ink) 22%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet { transform-origin: 50% 0; width: min(22rem, 100vw - 2rem); margin: 4.25rem auto auto; border-radius: 20px; background: var(--bg); box-shadow: 0 12px 40px -12px color-mix(in srgb, var(--ink) 25%, transparent); }
.sheet[open] { animation: 0.38s cubic-bezier(0.16, 1, 0.3, 1) sheet-in; }
.sheet ul { max-height: none; padding: 0.5rem; margin: 0; }
.sheet li { opacity: 0; padding: 0; animation: 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards sheet-item; display: block; }
.sheet li:first-child { animation-delay: 40ms; }
.sheet li:nth-child(2) { animation-delay: 70ms; }
.sheet li:nth-child(3) { animation-delay: 0.1s; }
.sheet li:nth-child(4) { animation-delay: 0.13s; }
.sheet li:nth-child(5) { animation-delay: 0.16s; }
.sheet li:nth-child(n+6) { animation-delay: 0.19s; }
.sheet a { letter-spacing: -0.02em; border-radius: 12px; padding: 0.8rem 0.95rem; font-size: 1.375rem; text-decoration: none; display: block; }
.sheet a[aria-current='page'] { background: var(--tile); }
.sheet .sheet-foot { border-top: 1px solid var(--rule); border-radius: 0; margin-top: 0.4rem; padding-top: 0.4rem; }
.sheet .sheet-foot a { letter-spacing: 0; color: var(--mute); font-size: 0.9375rem; }
.sheet:focus { outline: 0; }
.sheet.is-closing { animation: 0.2s cubic-bezier(0.4, 0, 1, 1) forwards sheet-out; }
.sheet.is-closing::backdrop { animation: 0.2s linear forwards sheet-clear; }
@keyframes sheet-in { 0% { opacity: 0; transform: translateY(-0.6rem) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes sheet-item { 0% { opacity: 0; transform: translateY(0.4rem); } to { opacity: 1; transform: none; } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(-0.5rem) scale(0.96); } }
@keyframes sheet-clear { to { opacity: 0; } }

@media (max-width: 40rem) {
  .nav > a { display: none; }
  .masthead { position: sticky; }
  .tool.menu { padding: 0 0.85rem 0 0.7rem; display: inline-grid; position: absolute; left: 50%; translate: -50%; }
  .tool.menu span { color: var(--ink); }
  .tools { margin-left: 0; }
  .tool.jump { display: none; }
  .brand span { display: none; }
}

/* Hero & home */
.hero { position: relative; display: grid; gap: clamp(3.5rem, 8vw, 5rem); align-items: center; padding: clamp(3rem, 8vw, 6rem) 0 clamp(4.5rem, 8vw, 6rem); }
.hero-text { display: grid; gap: clamp(1.25rem, 2.6vw, 2rem); }
.hero-logo { display: inline-flex; width: 3.125rem; height: 3.125rem; justify-self: start; border-radius: 50%; color: var(--ink); transition: color 0.6s var(--ease); text-decoration: none; }
.hero-logo svg { display: block; width: 100%; height: 100%; transition: rotate 1.1s var(--ease), scale 1.1s var(--ease); }
.hero-logo:hover, .hero-logo:focus-visible { color: var(--train-strong); }
.hero-logo:hover svg, .hero-logo:focus-visible svg { rotate: 360deg; scale: 1.08; }
.hero-mark { display: none; }
@media (min-width: 62rem) {
  .hero-mark { display: block; position: absolute; right: 0; top: 50%; width: min(21rem, 25vw); translate: 0 -50%; color: var(--train-tint); z-index: -1; animation: turn 90s linear infinite; }
  .hero-mark svg { display: block; width: 100%; height: auto; }
}
@keyframes turn { to { rotate: 360deg; } }
.hero h1 { font-size: clamp(2rem, 4.1vw, 3.25rem); font-weight: 400; letter-spacing: -0.035em; line-height: 1.03; max-width: 11em; text-wrap: balance; }
.hero h1 .train { color: var(--train-strong); }
.hero h1 .rest { color: var(--rest-strong); }
.lede { max-width: 33rem; font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.45; color: var(--mute); text-wrap: pretty; }
.lede b { color: var(--ink); font-weight: 400; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.button { display: inline-flex; align-items: center; height: 3rem; padding: 0 1.4rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 500; text-decoration: none; border: 0; cursor: pointer; transition: scale 0.2s var(--ease); }
.button:active { scale: 0.96; }
.button.is-quiet { background: var(--tile); color: var(--ink); }

.signup { display: grid; gap: 0.6rem; max-width: 30rem; }
.field { display: flex; gap: 0.4rem; padding: 0.35rem; border-radius: 999px; background: var(--tile); transition: box-shadow 0.2s; }
.field:focus-within { box-shadow: 0 0 0 2px var(--train-strong); }
.field input[type='email'], .field input[type='password'], .field input[type='text'] { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 0.9rem; height: 2.75rem; outline: 0; font-size: 1rem; width: 100%; }
.field input::placeholder { color: var(--mute); }
.field button { border: 0; border-radius: 999px; height: 2.75rem; padding: 0 1.15rem; background: var(--ink); color: var(--bg); font-weight: 500; font-size: 0.9375rem; cursor: pointer; white-space: nowrap; transition: scale 0.2s var(--ease), opacity 0.2s; }
.field button:active { scale: 0.96; }
.field button[disabled] { opacity: 0.6; cursor: default; }
.note { font-size: 0.75rem; color: var(--mute); padding-left: 1.25rem; }
.note.is-error { color: oklch(0.6 0.17 28); }
.honey { position: absolute; left: -999rem; }
.done { display: flex; align-items: center; gap: 0.7rem; padding: 0.9rem 1.25rem; border-radius: 18px; background: var(--train-tint); color: var(--train-deep); font-weight: 500; max-width: 30rem; animation: rise 0.6s var(--ease); }
.done svg { width: 1.4rem; height: 1.4rem; flex: none; color: var(--train-strong); }
@keyframes rise { from { opacity: 0; translate: 0 0.5rem; } }
@keyframes pulse { 50% { opacity: 0.35; } }

.week-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; font-size: 0.9375rem; font-weight: 500; color: var(--mute); }
.week-head span:first-child { color: var(--ink); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(0.4rem, 1vw, 0.75rem); }
.day { position: relative; display: grid; align-content: space-between; gap: 1.5rem; min-height: clamp(9.5rem, 17vw, 13.5rem); padding: clamp(0.7rem, 1.4vw, 1.1rem); border: 0; border-radius: 16px; text-align: left; cursor: pointer; background: var(--train-tint); color: var(--train-deep); transition: background-color 0.5s var(--ease), color 0.5s var(--ease), translate 0.35s var(--ease); }
.day:hover { translate: 0 -3px; }
.day:active { translate: 0 0; }
.day[aria-pressed='true'] { background: var(--rest-tint); color: var(--rest-deep); }
.day-name { display: flex; align-items: center; justify-content: space-between; font-size: 0.8125rem; font-weight: 500; }
.day-name i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--train-strong); transition: background-color 0.5s var(--ease), border-radius 0.5s var(--ease), width 0.5s var(--ease); }
.day[aria-pressed='true'] .day-name i { background: var(--rest-strong); width: 1.1rem; border-radius: 3px; }
.day-body { display: grid; }
.day-body > span { grid-area: 1 / 1; align-self: end; transition: opacity 0.35s, translate 0.5s var(--ease); }
.log b { display: block; white-space: nowrap; font-weight: 400; font-size: clamp(1.125rem, 2.1vw, 1.75rem); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.log small, .page small { display: block; margin-top: 0.4rem; font-size: 0.8125rem; line-height: 1.25; opacity: 0.75; }
.page { opacity: 0; translate: 0 0.5rem; }
.page em { display: block; font-style: normal; font-size: clamp(0.9375rem, 1.5vw, 1.125rem); line-height: 1.2; letter-spacing: -0.015em; }
.page u { display: block; height: 1px; margin-top: 0.45rem; background: currentColor; opacity: 0.25; text-decoration: none; }
.page u:last-of-type { width: 60%; }
.day[aria-pressed='true'] .log { opacity: 0; translate: 0 -0.5rem; }
.day[aria-pressed='true'] .page { opacity: 1; translate: 0 0; }

.parts { margin-top: clamp(4rem, 10vw, 8rem); border-top: 1px solid var(--rule); }
.part { display: grid; gap: 0.5rem 2rem; padding: clamp(1.5rem, 3vw, 2.25rem) 0; border-bottom: 1px solid var(--rule); }
.part h2 { font-size: clamp(1.375rem, 2.6vw, 2rem); font-weight: 400; letter-spacing: -0.028em; line-height: 1.12; text-wrap: balance; }
.part p { max-width: 36rem; color: var(--mute); font-size: 1.0625rem; }
.part .tag { font-size: 0.8125rem; font-weight: 500; color: var(--mute); }
@media (min-width: 56rem) { .part { grid-template-columns: 3rem minmax(0, 5fr) minmax(0, 6fr); align-items: baseline; } }

.close { padding: clamp(4rem, 10vw, 8rem) 0 clamp(3rem, 6vw, 5rem); display: grid; gap: 1.5rem; }
.close h2 { font-size: clamp(2rem, 5vw, 3.75rem); font-weight: 400; letter-spacing: -0.035em; line-height: 1.04; max-width: 14em; text-wrap: balance; }

/* Auth & legal */
.auth-page { padding: clamp(2.5rem, 8vw, 5rem) 0 clamp(4rem, 10vw, 6rem); max-width: 28rem; }
.auth-page h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); font-weight: 400; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 0.75rem; }
.auth-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.field-stack { display: grid; gap: 0.35rem; }
.field-stack label { font-size: 0.875rem; font-weight: 500; color: var(--mute); }
.field-stack input { border: 0; border-radius: 14px; background: var(--tile); padding: 0 1rem; height: 2.75rem; outline: 0; }
.field-stack input:focus { box-shadow: 0 0 0 2px var(--train-strong); }
.form-error { color: oklch(0.55 0.17 28); font-size: 0.9375rem; }
.form-foot { font-size: 0.9375rem; color: var(--mute); }
.form-foot a { color: var(--ink); }

.legal-page { padding: clamp(2rem, 6vw, 4rem) 0 clamp(4rem, 10vw, 6rem); max-width: 42rem; }
.legal-page h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 400; letter-spacing: -0.03em; margin-bottom: 0.5rem; }
.legal-draft { display: inline-block; margin-bottom: 1.5rem; padding: 0.35rem 0.65rem; border-radius: 8px; background: var(--train-tint); color: var(--train-deep); font-size: 0.8125rem; font-weight: 500; }
.legal-page h2 { font-size: 1.25rem; font-weight: 500; margin: 2rem 0 0.5rem; letter-spacing: -0.02em; }
.legal-page p, .legal-page li { color: var(--mute); margin: 0.5rem 0; }
.legal-page ul { list-style: disc; padding-left: 1.25rem; margin: 0.5rem 0 1rem; }
.legal-page a { color: var(--ink); }

.foot { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; justify-content: space-between; padding: 1.5rem 0 2rem; border-top: 1px solid var(--rule); font-size: 0.9375rem; color: var(--mute); font-weight: 500; }
.foot a { color: var(--ink); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

/* Beta pill + consent bar */
.beta-pill { position: fixed; z-index: 51; left: max(var(--gutter), 1rem); bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.55rem 0.35rem 0.5rem; border-radius: 999px; background: var(--tile); border: 1px solid var(--rule); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; box-shadow: 0 4px 16px -6px color-mix(in srgb, var(--ink) 15%, transparent); animation: rise 0.35s var(--ease); }
.beta-pill-dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--train-strong); animation: pulse 2.4s ease-in-out infinite; }
.beta-pill-close { border: 0; background: transparent; color: var(--mute); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0.15rem; }
.consent-bar { position: fixed; z-index: 50; right: 0; bottom: 0; left: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.65rem 1rem; padding: 0.65rem clamp(1rem, 4vw, 2rem) calc(0.65rem + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--bg) 94%, transparent); border-top: 1px solid var(--rule); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); font-size: 0.8125rem; animation: rise 0.35s var(--ease); }
.consent-bar p { margin: 0; color: var(--mute); max-width: 36rem; }
.consent-bar a { color: var(--ink); }
.consent-bar-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.consent-btn { border: 0; border-radius: 999px; height: 2rem; padding: 0 0.85rem; background: var(--ink); color: var(--bg); font-size: 0.75rem; font-weight: 500; cursor: pointer; white-space: nowrap; }
.consent-btn.quiet { background: var(--tile); color: var(--ink); }
body:not(:has(.consent-bar[hidden])) .beta-pill:not([hidden]) { bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px)); }

@media (max-width: 44rem) {
  .week { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 8.75rem; overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 0.25rem var(--gutter) 0.5rem; scroll-snap-type: x proximity; scrollbar-width: none; }
  .week::-webkit-scrollbar { display: none; }
  .day { scroll-snap-align: start; min-height: 10.5rem; }
  .field button { padding: 0 0.9rem; font-size: 0.875rem; }
  .week-head { flex-direction: column; gap: 0.1rem; }
  .consent-bar { flex-direction: column; align-items: stretch; }
  .consent-bar-actions { justify-content: stretch; }
  .consent-btn { flex: 1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .sheet[open], .sheet li { opacity: 1; animation: none; }
}

@media print { .masthead, .beta-pill, .consent-bar, .tool.menu { display: none !important; } }
