:root {
  --bg: #f8f6f1;
  --paper: #fffdfa;
  --surface: #ffffff;
  --ink: #2f2a24;
  --muted: #6e675f;
  --quiet: #9a9288;
  --line: #e5ded4;
  --line-strong: #d7cab9;
  --accent: #b94a35;
  --accent-dark: #8f3426;
  --accent-soft: #f4ddd4;
  --green: #43805f;
  --blue: #4d6f91;
  --gold: #b9852f;
  --shadow: 0 24px 70px rgba(47, 42, 36, 0.12);
  --radius: 18px;
  --font-display: "Iowan Old Style", "Songti SC", "Noto Serif SC", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #fffdfa 0%, var(--bg) 42%, #f3eee6 100%);
  color: var(--ink);
  font: 16px/1.58 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(229, 222, 212, 0);
  background: rgba(255, 253, 250, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.site-header[data-elevated="true"],
.site-header.simple {
  border-bottom-color: rgba(229, 222, 212, 0.9);
}

.brand,
.nav-links,
.header-actions,
.hero-actions,
.footer-links,
.footer-meta {
  display: flex;
  align-items: center;
}

.brand {
  gap: 11px;
  min-width: 0;
  font-size: 20px;
  font-weight: 760;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.nav-links {
  gap: 24px;
}

.nav-links a {
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
}

.nav-links a:hover {
  color: var(--ink);
}

.header-actions,
.hero-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.language-toggle,
.small-download,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 999px;
  font-weight: 760;
}

.language-toggle {
  min-width: 48px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.small-download,
.primary-action {
  border: 0;
  background: var(--ink);
  color: white;
  box-shadow: 0 14px 30px rgba(47, 42, 36, 0.14);
}

.small-download {
  padding: 0 17px;
}

.primary-action,
.secondary-action {
  min-width: 132px;
  padding: 0 18px;
}

.secondary-action {
  border: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.84);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(560px, 1fr);
  gap: clamp(34px, 5vw, 72px);
  align-items: start;
  padding: 34px clamp(18px, 4vw, 56px) 38px;
}

.hero-content {
  max-width: 680px;
  padding-top: clamp(8px, 3vh, 28px);
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--font-display);
  letter-spacing: 0;
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(52px, 6.6vw, 94px);
  line-height: 0.94;
  max-width: 760px;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1.04;
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
  letter-spacing: 0;
}

.hero-copy,
.section-head > p,
.training-context p,
.download-section p,
.legal-page p,
.footer-brand p {
  color: var(--muted);
  font-size: 18px;
}

.hero-copy {
  max-width: 620px;
  margin-bottom: 22px;
  font-size: clamp(19px, 1.7vw, 22px);
  line-height: 1.38;
}

.almanac-board {
  align-self: start;
  position: relative;
  max-height: min(560px, calc(100svh - 132px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(249, 244, 236, 0.94)),
    var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.almanac-board::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 80px;
  background: linear-gradient(180deg, rgba(255, 253, 250, 0), rgba(255, 253, 250, 0.95));
  content: "";
  pointer-events: none;
}

.board-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 10px 14px;
}

.board-kicker,
.board-head h2,
.board-head p {
  margin: 0;
}

.board-kicker,
.sample-panel small {
  color: var(--quiet);
  font: 700 11px/1.2 var(--font-mono);
  text-transform: uppercase;
}

.board-head h2 {
  margin: 7px 0;
  font-size: clamp(28px, 3vw, 42px);
}

.board-head p {
  color: var(--muted);
}

.board-head > span {
  align-self: start;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-dark);
  font: 700 11px/1 var(--font-mono);
  white-space: nowrap;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.sample-panel,
.feature-card,
.principle-list,
.legal-page section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.82);
}

.sample-panel {
  min-height: 144px;
  padding: 13px;
}

.sample-panel h3 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 14px;
}

.timeline {
  display: grid;
  gap: 7px;
}

.timeline div {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.timeline i {
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--accent), var(--gold)) left / var(--w) 100% no-repeat,
    #eee8df;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 5px;
}

.heatmap span {
  aspect-ratio: 1;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) calc(var(--v) * 17%), #efe8dd);
}

.mini-chart {
  width: 100%;
  height: 96px;
}

.chart-grid line {
  stroke: rgba(47, 42, 36, 0.09);
  stroke-width: 1;
}

.chart-fill {
  fill: rgba(185, 74, 53, 0.12);
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-width: 4;
}

.chart-line.secondary {
  stroke: var(--blue);
  opacity: 0.68;
}

.dark-panel {
  background: var(--ink);
  color: var(--paper);
}

.dark-panel h3,
.dark-panel small {
  color: var(--paper);
}

.cycle-list,
.excerpt-list,
.metric-strip {
  display: grid;
  gap: 7px;
}

.cycle-list div,
.excerpt-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
}

.cycle-list div {
  background: rgba(255, 253, 250, 0.08);
}

.cycle-list span {
  grid-column: 1 / -1;
  color: rgba(255, 253, 250, 0.68);
  font-size: 13px;
}

.excerpt-list div {
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  background: rgba(47, 42, 36, 0.04);
}

.excerpt-list span,
.excerpt-list em {
  color: var(--muted);
  font: 700 12px/1 var(--font-mono);
  font-style: normal;
}

.app-proof {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 253, 250, 0.62);
}

.small-phone {
  width: 62px;
  height: 112px;
  margin: 0 auto;
  padding: 8px;
  border: 7px solid var(--ink);
  border-radius: 24px;
  background: var(--surface);
}

.small-phone div,
.small-phone b,
.small-phone span {
  display: block;
}

.small-phone div {
  height: 100%;
  padding: 12px 8px;
  border-radius: 15px;
  background: #f3eee6;
}

.small-phone span {
  height: 6px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: #d9cec0;
}

.small-phone b {
  height: 28px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--accent-soft);
}

.app-proof p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.section,
.training-context,
.download-section {
  padding: 80px clamp(18px, 4vw, 56px);
}

.section-head,
.training-context,
.download-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 0.75fr);
  gap: clamp(26px, 4vw, 62px);
  align-items: start;
}

.section-head {
  margin-bottom: 28px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature-card {
  padding: 22px;
}

.feature-card > span {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--accent-dark);
  font: 800 12px/1 var(--font-mono);
  text-transform: uppercase;
}

.feature-card p {
  color: var(--muted);
}

.metric-strip div {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.metric-strip i {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee8df;
}

.metric-strip b {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.training-context {
  margin: 18px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0.72), rgba(243, 238, 230, 0.78)),
    var(--bg);
}

.training-context > div:first-child {
  max-width: 720px;
}

.training-context h2 {
  max-width: 720px;
  font-size: clamp(38px, 4.2vw, 68px);
}

.training-context > div:first-child > p:last-child {
  max-width: 680px;
}

.principle-list {
  display: grid;
  gap: 12px;
  align-self: center;
  padding: 0;
  border: 0;
  background: transparent;
}

.principle-list article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.78);
}

.principle-list article:last-child {
  border-bottom: 1px solid var(--line);
}

.principle-list span {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--accent-dark);
  font: 800 12px/1 var(--font-mono);
}

.principle-list h3 {
  font-size: 18px;
}

.principle-list p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
}

.download-section {
  align-items: center;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 42px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  background: #f2ece3;
}

.footer-brand {
  max-width: 620px;
}

.footer-brand p {
  margin: 8px 0 12px;
  font-size: 15px;
}

.icp {
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  justify-content: end;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-weight: 650;
}

.footer-meta {
  grid-column: 1 / -1;
  color: var(--quiet);
  font-size: 14px;
}

.legal-page {
  width: min(860px, calc(100% - 36px));
  margin: 0 auto;
  padding: 78px 0 92px;
}

.legal-page h1 {
  font-size: clamp(44px, 7vw, 82px);
}

.legal-updated {
  margin-bottom: 34px;
}

.legal-page section {
  margin-top: 16px;
  padding: 24px;
}

.legal-page section h2 {
  font-family: var(--font-body);
  font-size: 24px;
}

.legal-page ul {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 17px;
}

.legal-page li + li {
  margin-top: 10px;
}

.legal-page a {
  color: var(--accent-dark);
  font-weight: 750;
}

.support-page .hero-copy {
  max-width: 720px;
}

@media (max-width: 980px) {
  .nav-links {
    display: none;
  }

  .hero,
  .section-head,
  .training-context,
  .download-section,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 46px;
  }

  .almanac-board {
    max-height: 500px;
    overflow: hidden;
  }

  .almanac-board::after {
    content: "";
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .training-context {
    margin-left: 18px;
    margin-right: 18px;
  }

  .footer-links {
    justify-content: start;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 66px;
    padding: 12px 16px;
  }

  .brand {
    font-size: 18px;
  }

  .brand img {
    width: 36px;
    height: 36px;
  }

  .header-actions {
    gap: 7px;
  }

  .language-toggle {
    min-width: 44px;
    min-height: 40px;
  }

  .small-download {
    min-height: 40px;
    padding: 0 13px;
  }

  .hero {
    padding-left: 18px;
    padding-right: 18px;
    padding-bottom: 34px;
  }

  h1 {
    font-size: clamp(48px, 17vw, 72px);
  }

  .board-head,
  .app-proof {
    grid-template-columns: 1fr;
    display: grid;
  }

  .board-grid {
    grid-template-columns: 1fr;
  }

  .heatmap {
    grid-template-columns: repeat(9, 1fr);
  }

  .hero-actions {
    align-items: stretch;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .hero .primary-action,
  .hero .secondary-action {
    width: auto;
    min-width: calc(50% - 5px);
    padding-right: 12px;
    padding-left: 12px;
  }

  .hero .almanac-board {
    max-height: 250px;
    overflow: hidden;
  }

  .hero .almanac-board::after {
    content: "";
  }

  .hero-copy {
    font-size: 18px;
  }

  .section,
  .training-context,
  .download-section {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .legal-page {
    padding-top: 54px;
  }
}
