:root {
  --paper: #f1f4ee;
  --paper-deep: #e3e9df;
  --ink: #1c2433;
  --ink-soft: #4a5466;
  --night: #26315c;
  --night-deep: #1a2246;
  --yolk: #e9b949;
  --lavender: #b8b3e3;
  --leaf: #4f7149;
  --line: #c9d2c4;
  --serif: Georgia, "PT Serif", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 38rem;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
}

img, svg { max-width: 100%; display: block; }

a { color: var(--leaf); text-underline-offset: 0.18em; }
a:hover { color: var(--night); }

:focus-visible {
  outline: 3px solid var(--night);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.25rem, 5.2vw, 3.75rem); max-width: 16ch; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; line-height: 1.3; }

p { margin: 0 0 1em; max-width: var(--measure); }

.wrap { width: min(70rem, 100% - 2.5rem); margin-inline: auto; }

/* Header */
.site-header { padding: 1.4rem 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--serif); font-size: 1.35rem; color: var(--ink); text-decoration: none;
}
.brand svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.98rem; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--yolk); }

/* Hero */
.hero { padding: 3.5rem 0 2rem; }
.hero .lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 34rem; }

/* Day timeline: the signature element */
.day {
  margin: 3rem 0 1rem;
  background: var(--paper-deep);
  border-radius: 14px;
  padding: 1.5rem 1.5rem 1.25rem;
}
.day-title { font-family: var(--serif); font-size: 1.15rem; margin: 0 0 1rem; }
.day-bar {
  position: relative;
  height: 64px;
  border-radius: 10px;
  background: linear-gradient(90deg, #fbfcf8 0%, #fbfcf8 58%, #d8d6ee 66.6%, var(--night) 70%, var(--night) 100%);
  overflow: hidden;
}
.seg { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; }
.seg.meal { background: var(--yolk); top: 10px; bottom: auto; height: 22px; border-radius: 6px; font-size: 0; }
.seg.meal::after { content: attr(data-label); position: absolute; top: 27px; left: 50%; transform: translateX(-50%); font-size: 0.8rem; color: var(--ink); white-space: nowrap; }
.seg.sleep { color: #e9e8fa; font-family: var(--serif); font-size: 1rem; }
.seg.coffee { width: 0; border-left: 2px dashed var(--ink-soft); top: 6px; bottom: 6px; }
.now {
  position: absolute; top: -4px; bottom: -4px; width: 2px; background: #c0392b;
  display: none;
}
.now.show { display: block; }
.ticks { position: relative; height: 1.4rem; margin-top: 0.35rem; font-size: 0.8rem; color: var(--ink-soft); }
.ticks span { position: absolute; transform: translateX(-50%); }
.ticks span:first-child { transform: none; }
.ticks span:last-child { transform: translateX(-100%); }
.legend { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 0.45rem 2rem; font-size: 0.95rem; }
.legend b { font-weight: 600; margin-right: 0.5rem; }
.now-note { font-size: 0.9rem; color: var(--ink-soft); margin: 0.8rem 0 0; min-height: 1.4em; }

/* Sections */
section { padding: 3.5rem 0; }
.band-night { background: var(--night); color: #eef0f8; }
.band-night a { color: var(--yolk); }
.band-night .muted { color: #c3c8de; }

.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 2rem 2.5rem; margin-top: 2rem; }
.principles h3 { margin-bottom: 0.4rem; }
.principles p { font-size: 0.98rem; }
.principles .icon { width: 36px; height: 36px; margin-bottom: 0.8rem; }

.weeks { list-style: none; counter-reset: wk; padding: 0; margin: 2rem 0 0; display: grid; gap: 0; }
.weeks li { counter-increment: wk; display: grid; grid-template-columns: 7rem 1fr; gap: 1.5rem; padding: 1.4rem 0; border-top: 1px solid var(--line); }
.weeks li:last-child { border-bottom: 1px solid var(--line); }
.weeks li::before { content: "Неделя " counter(wk); font-family: var(--serif); font-size: 1.1rem; color: var(--leaf); }
.weeks h3 { margin-bottom: 0.3rem; }
.weeks p { margin: 0; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.75rem; display: flex; flex-direction: column; }
.plan.featured { border: 2px solid var(--night); }
.plan .price { font-family: var(--serif); font-size: 2.2rem; margin: 0.2rem 0 1rem; }
.plan ul { padding-left: 1.1rem; margin: 0 0 1.5rem; }
.plan li { margin-bottom: 0.35rem; }
.plan .btn { margin-top: auto; align-self: flex-start; }

.btn {
  display: inline-block; background: var(--night); color: #fff; text-decoration: none;
  padding: 0.8rem 1.3rem; border-radius: 999px; font-weight: 500;
}
.btn:hover { background: var(--night-deep); color: #fff; }
.btn.light { background: var(--yolk); color: var(--ink); }
.btn.light:hover { background: #dca935; color: var(--ink); }

.faq details { border-top: 1px solid var(--line); padding: 1rem 0; max-width: 46rem; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-family: var(--serif); font-size: 1.15rem; }
.faq details p { margin: 0.7rem 0 0; }

.posts { list-style: none; padding: 0; margin: 2rem 0 0; }
.posts li { padding: 1.3rem 0; border-top: 1px solid var(--line); }
.posts li:last-child { border-bottom: 1px solid var(--line); }
.posts a.title { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); text-decoration: none; }
.posts a.title:hover { text-decoration: underline; text-decoration-color: var(--yolk); }
.posts p { margin: 0.35rem 0 0; color: var(--ink-soft); }
.posts time { font-size: 0.9rem; color: var(--ink-soft); }

/* Article */
.article { padding: 2.5rem 0 4rem; }
.article header p { color: var(--ink-soft); }
.article .body { max-width: 40rem; }
.article .body p, .article .body li { font-family: var(--serif); font-size: 1.12rem; line-height: 1.7; }
.article .body h2 { margin-top: 1.6em; font-size: 1.5rem; }
.article .body ul { padding-left: 1.2rem; }
.note { background: var(--paper-deep); border-radius: 10px; padding: 1rem 1.2rem; font-size: 0.95rem; max-width: 40rem; }

/* Footer */
.site-footer { background: var(--night-deep); color: #c3c8de; padding: 2.5rem 0; font-size: 0.92rem; }
.site-footer a { color: #fff; }
.site-footer .wrap { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.site-footer p { margin: 0 0 0.5rem; }

@media (max-width: 640px) {
  .hero { padding-top: 2rem; }
  .day { padding: 1.1rem; }
  .seg.meal::after { content: none; }
  .ticks .minor { display: none; }
  .seg.sleep { font-size: 0.85rem; }
  .weeks li { grid-template-columns: 1fr; gap: 0.3rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .day-bar .seg.sleep { animation: dusk 1.6s ease-out both; }
  @keyframes dusk { from { opacity: 0; } to { opacity: 1; } }
}

.article h1 { max-width: 24ch; font-size: clamp(2rem, 4vw, 3rem); }
