/* Rhythm — public site.
   Paper and ink rather than glass: the app is glassy and violet, the site is
   the printed note that explains it. Violet marks the plan, orange marks what
   actually happened — the same grammar as the product's own materials. */

:root {
  --paper: #f6f3ec;
  --paper-deep: #ede8dc;
  --card: #fffdf8;
  --ink: #1e1b24;
  --ink-soft: #4a4553;
  --muted: #6f6878;
  --rule: #ddd6c8;
  --plan: #6a4fe0;
  --plan-wash: #ebe6fb;
  --actual: #b9531f;
  --actual-wash: #f6e4d8;
  --pencil: #8a8273;
  --shadow: 0 1px 0 rgba(30, 27, 36, 0.04), 0 18px 40px -22px rgba(52, 36, 110, 0.35);

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15131a;
    --paper-deep: #1c1a22;
    --card: #211e29;
    --ink: #eeebf3;
    --ink-soft: #c9c4d3;
    --muted: #9b94a8;
    --rule: #34303e;
    --plan: #ab95f8;
    --plan-wash: #2a2442;
    --actual: #f0906a;
    --actual-wash: #3a2620;
    --pencil: #8f8899;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 18px 40px -20px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #15131a;
  --paper-deep: #1c1a22;
  --card: #211e29;
  --ink: #eeebf3;
  --ink-soft: #c9c4d3;
  --muted: #9b94a8;
  --rule: #34303e;
  --plan: #ab95f8;
  --plan-wash: #2a2442;
  --actual: #f0906a;
  --actual-wash: #3a2620;
  --pencil: #8f8899;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 18px 40px -20px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--plan); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--plan); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--card); padding: 8px 12px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.hand {
  font-family: var(--hand);
  font-size: 1.45rem;
  line-height: 1.1;
  color: var(--pencil);
  font-weight: 500;
}

/* ─── Header ─────────────────────────────────────────────── */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 22px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand img { width: 30px; height: 30px; }
.top nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); font-size: 0.92rem; }
.top nav a { color: var(--ink-soft); text-decoration: none; }
.top nav a:hover { color: var(--ink); text-decoration: underline; }
.top nav .lang {
  font-family: var(--mono);
  font-size: 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px 10px;
}
@media (max-width: 720px) {
  .top nav .section-link { display: none; }
}

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
  padding-top: clamp(24px, 6vw, 72px);
  padding-bottom: clamp(56px, 9vw, 112px);
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3.4rem, 11vw, 7.4rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0 0 26px;
  text-wrap: balance;
}
.hero h1 em {
  font-style: italic;
  color: var(--plan);
}
.hero .lede {
  font-size: clamp(1.06rem, 1.6vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 34em;
  margin: 0 0 34px;
}
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 14px;
  padding: 11px 22px 11px 16px;
  text-decoration: none;
  line-height: 1.15;
  min-height: 54px;
  transition: transform 0.15s ease;
}
.store:hover { transform: translateY(-1px); text-decoration: none; }
.store svg { width: 24px; height: 24px; flex: none; fill: currentColor; }
.store small { display: block; font-size: 0.7rem; opacity: 0.75; letter-spacing: 0.02em; }
.store b { font-weight: 600; font-size: 1.05rem; }
.store[aria-disabled="true"] {
  background: transparent;
  color: var(--ink);
  border: 1.5px dashed var(--pencil);
  cursor: default;
}
.store[aria-disabled="true"]:hover { transform: none; }
.cta-note { font-size: 0.88rem; color: var(--muted); margin: 0; }

.hero-note {
  margin-top: 46px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  max-width: 30em;
}
.hero-note p { margin: 0; font-size: 0.93rem; color: var(--muted); }

/* ─── Demo card ──────────────────────────────────────────── */
.demo-col { position: relative; }
.demo-hint {
  position: absolute;
  top: -8px;
  left: -14px;
  transform: translateX(-100%) rotate(-4deg);
  width: 150px;
  text-align: right;
}
.demo-hint svg { width: 70px; height: 46px; margin: 2px 0 0 auto; display: block; color: var(--pencil); }
@media (max-width: 1180px) {
  .demo-hint { position: static; transform: rotate(-2deg); width: auto; text-align: left; margin: 0 0 8px 8px; }
  .demo-hint svg { display: none; }
}

.demo {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 22px 22px 18px;
  max-width: 440px;
}
.demo h2 {
  font-family: var(--sans);
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0 0 2px;
}
.demo .sub { font-size: 0.84rem; color: var(--muted); margin: 0 0 14px; }
.rating {
  border: 0;
  margin: 0;
  padding: 7px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}
.rating legend { float: left; padding: 0; font-size: 0.92rem; display: flex; align-items: center; gap: 8px; }
.rating legend i {
  width: 9px; height: 9px; border-radius: 3px; display: inline-block;
  background: var(--c);
}
.dots { display: flex; gap: 6px; }
.dots label { position: relative; }
.dots input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.dots span {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
}
.dots label:hover span { border-color: var(--c); }
.dots input:checked + span { background: var(--c); border-color: var(--c); color: #fff; font-weight: 600; }
.dots input:focus-visible + span { outline: 2px solid var(--plan); outline-offset: 2px; }
.rating[data-p="energy"] { --c: #7b61ff; }
.rating[data-p="mood"] { --c: #b07a12; }
.rating[data-p="focus"] { --c: #1f7a52; }
.rating[data-p="stress"] { --c: #2a6fd1; }

.state {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 10px;
  padding: 12px;
  background: var(--paper);
  border-radius: 16px;
}
.state img { width: 62px; height: 62px; border-radius: 50%; flex: none; }
.state .mode-eyebrow { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.state strong { display: block; font-size: 1.1rem; font-weight: 600; line-height: 1.25; }
.state .cap { font-size: 0.85rem; color: var(--ink-soft); }
.state .score { margin-left: auto; font-family: var(--mono); font-size: 0.85rem; color: var(--plan); align-self: flex-start; }

.today-head { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 2px 4px; }
.today-head b { font-size: 0.95rem; }
.today-head span { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 2px;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
  animation: settle 0.35s ease both;
}
.tasks li::before {
  content: "";
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--plan);
  flex: none;
}
.aside {
  margin-top: 6px;
  border-top: 1px dashed var(--rule);
  padding-top: 10px;
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.aside summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: baseline; }
.aside summary::-webkit-details-marker { display: none; }
.aside summary::before { content: "›"; display: inline-block; transition: transform 0.15s; color: var(--muted); }
.aside[open] summary::before { transform: rotate(90deg); }
.aside .kept { display: block; color: var(--muted); font-size: 0.8rem; margin: 2px 0 0 14px; }
.aside ul { margin: 8px 0 2px 14px; padding: 0; list-style: none; color: var(--muted); }
.aside ul li { padding: 3px 0; }
.aside ul li::before { content: "– "; }
.aside[hidden] { display: none; }
.demo-foot { font-size: 0.74rem; color: var(--muted); margin: 12px 2px 0; }

@keyframes settle { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .demo { max-width: none; }
}
@media (max-width: 400px) {
  .demo { padding: 18px 14px 14px; border-radius: 22px; }
  .dots { gap: 4px; }
  .dots span { width: 30px; height: 30px; }
}

/* ─── Sections ───────────────────────────────────────────── */
section { padding: clamp(56px, 9vw, 104px) 0; }
.band { background: var(--paper-deep); }
h2.title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.8vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  max-width: 20em;
  text-wrap: balance;
}
.prose { max-width: 38em; color: var(--ink-soft); }
.prose p { margin: 0 0 16px; }

/* Familiar situation: a Sunday list, read on Wednesday */
.situation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.note-paper {
  position: relative;
  background: var(--card);
  border-radius: 6px;
  padding: 26px 28px 30px 54px;
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
  background-image: repeating-linear-gradient(to bottom, transparent 0 33px, var(--rule) 33px 34px);
  background-position: 0 58px;
  max-width: 400px;
}
.note-paper::before {
  content: "";
  position: absolute;
  left: 36px; top: 0; bottom: 0;
  width: 1px;
  background: var(--actual);
  opacity: 0.45;
}
.note-paper .hand { color: var(--ink-soft); font-size: 1.6rem; display: block; margin-bottom: 6px; }
.note-paper ol { margin: 0; padding: 0; list-style: none; font-family: var(--hand); font-size: 1.5rem; line-height: 34px; color: var(--ink); }
.note-paper ol li.done { text-decoration: line-through; text-decoration-color: var(--plan); color: var(--muted); }
.note-paper .wed {
  position: absolute;
  right: -10px;
  bottom: -26px;
  transform: rotate(-5deg);
  background: var(--actual-wash);
  color: var(--actual);
  padding: 6px 14px;
  border-radius: 4px;
  font-family: var(--hand);
  font-size: 1.35rem;
}
@media (max-width: 820px) {
  .situation { grid-template-columns: 1fr; }
  .note-paper { transform: rotate(0.8deg); margin: 0 6px 20px; }
}

/* How it works */
.steps {
  list-style: none;
  margin: 44px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 44px);
  counter-reset: step;
}
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 18px; }
.steps li:nth-child(2) { border-top-color: var(--plan); }
.steps li:nth-child(3) { border-top-color: var(--actual); }
.steps li::before {
  content: "0" counter(step);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}
.steps h3 { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; line-height: 1.2; margin: 0 0 10px; }
.steps p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }
.steps q {
  display: block;
  margin-top: 14px;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink);
  quotes: none;
  border-left: 2px solid var(--rule);
  padding-left: 12px;
  font-size: 0.98rem;
}
@media (max-width: 820px) {
  .steps { grid-template-columns: 1fr; }
}

/* Seven kinds of day */
.days {
  list-style: none;
  margin: 40px 0 0;
  padding: 0 0 8px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
}
.days li { text-align: center; }
.days img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.days b { display: block; font-size: 0.92rem; font-weight: 600; line-height: 1.25; }
.days span { display: block; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); margin-top: 4px; }
.days li:nth-child(-n+2) span { color: var(--actual); }
.scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--hand);
  font-size: 1.3rem;
  color: var(--pencil);
  border-top: 1px solid var(--rule);
  margin-top: 18px;
  padding-top: 8px;
}
@media (max-width: 820px) {
  .days {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 112px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-right: calc(var(--gutter) * -1);
    padding-right: var(--gutter);
  }
  .days li { scroll-snap-align: start; }
}

/* What's inside */
.inside {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 6vw, 80px);
}
.inside dl { margin: 0; }
.inside .item {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  gap: 6px 26px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
}
.inside .item:last-child { border-bottom: 1px solid var(--rule); }
.inside dt { font-family: var(--serif); font-size: 1.25rem; font-weight: 500; line-height: 1.3; }
.inside dd { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }
.inside dd small { display: block; margin-top: 6px; color: var(--muted); font-size: 0.85rem; }
.inside aside { align-self: start; position: sticky; top: 32px; }
.inside aside .hand { display: block; margin-top: 24px; max-width: 16em; transform: rotate(-1.5deg); }
@media (max-width: 820px) {
  .inside { grid-template-columns: 1fr; }
  .inside aside { position: static; }
  .inside .item { grid-template-columns: 1fr; }
}

/* What it won't do */
.wont {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(24px, 5vw, 64px);
}
.wont li { padding: 16px 0 16px 34px; border-top: 1px solid var(--rule); position: relative; color: var(--ink-soft); }
.wont li::before {
  content: "";
  position: absolute;
  left: 2px; top: 27px;
  width: 16px; height: 2px;
  background: var(--actual);
  border-radius: 2px;
}
.wont b { color: var(--ink); font-weight: 600; }
@media (max-width: 720px) { .wont { grid-template-columns: 1fr; } }

/* FAQ */
.faq { max-width: 46em; margin-top: 28px; }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 40px 18px 0;
  position: relative;
  font-weight: 600;
  font-size: 1.02rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 6px; top: 14px;
  font-family: var(--mono);
  font-size: 1.3rem;
  color: var(--muted);
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 18px; color: var(--ink-soft); max-width: 40em; }

/* Closing */
.closing { text-align: center; }
.closing img { width: 72px; height: 72px; margin: 0 auto 24px; }
.closing h2.title { margin-left: auto; margin-right: auto; }
.closing p { color: var(--ink-soft); margin: 0 auto 30px; max-width: 30em; }
.closing .cta-row { justify-content: center; }

/* Footer */
footer {
  border-top: 1px solid var(--rule);
  padding: 28px 0 40px;
  font-size: 0.86rem;
  color: var(--muted);
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer a { color: var(--ink-soft); }
[data-config][hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ─── Legal pages (generated by scripts/build-legal.mjs) ─── */
.legal { padding-top: clamp(16px, 4vw, 48px); padding-bottom: clamp(56px, 8vw, 96px); }
.legal article { max-width: 46em; color: var(--ink-soft); }
.legal h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.75rem, 7vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 20px;
  text-wrap: balance;
  overflow-wrap: break-word;
}
@media (max-width: 560px) { .legal h1 { hyphens: auto; } }
.legal h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.35rem, 2.6vw, 1.6rem);
  line-height: 1.25;
  color: var(--ink);
  margin: 48px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.legal h3 { font-size: 1.02rem; font-weight: 600; color: var(--ink); margin: 28px 0 8px; }
.legal p { margin: 0 0 14px; }
.legal ul { margin: 0 0 16px; padding-left: 1.2em; }
.legal li { margin-bottom: 6px; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal code { font-family: var(--mono); font-size: 0.85em; }
.legal a { overflow-wrap: anywhere; }
.legal blockquote {
  margin: 0 0 24px;
  padding: 12px 16px;
  border-left: 3px solid var(--actual);
  background: var(--actual-wash);
  color: var(--ink);
  font-size: 0.92rem;
}
.legal blockquote p { margin: 0; }
.legal .table { overflow-x: auto; margin: 0 0 18px; }
.legal table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); }
.legal th { color: var(--ink); font-weight: 600; }
.legal td:first-child { color: var(--ink); white-space: nowrap; }
@media (max-width: 560px) { .legal td:first-child { white-space: normal; } }
mark.field {
  font-family: var(--mono);
  font-size: 0.78em;
  background: var(--actual-wash);
  color: var(--actual);
  border-radius: 3px;
  padding: 1px 5px;
}
.field-block { border: 1px dashed var(--actual); border-radius: 6px; padding: 8px 12px; }
.draft-banner {
  max-width: 46em;
  margin: 0 0 28px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--actual);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ─── 404 ─── */
.not-found { padding-top: clamp(40px, 10vw, 120px); padding-bottom: 120px; max-width: 40em; }
.not-found h1.title { font-family: var(--serif); font-weight: 500; font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 18px; }
.not-found p { color: var(--ink-soft); margin: 0 0 12px; }
.not-found .hand { margin: 28px 0 6px; transform: rotate(-1.5deg); display: inline-block; }
.not-found .links { font-size: 1.05rem; }
.not-found .ru { margin-top: 36px; font-size: 0.9rem; color: var(--muted); }
