/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  --step: 8px;
  --radius: 14px;
  --maxw: 1180px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

html[data-theme="light"] {
  --bg:        #FBF7EF;
  --surface:   #F4EDE0;
  --surface-2: #EFE6D6;
  --ink:       #1E1A14;
  --ink-soft:  #4A4136;
  --muted:     #7C7060;
  --rule:      #E3D8C4;
  --rule-soft: #EDE4D4;

  --camel:      #B07E3F;
  --camel-soft: #E8D6B8;
  --olive:      #56663A;
  --olive-soft: #DCE3C8;
  --olive-ink:  #FBF7EF;

  --closed:     #CDC2AE;
  --shadow: 0 1px 2px rgba(40,30,15,.04), 0 12px 32px -18px rgba(40,30,15,.22);
}

html[data-theme="dark"] {
  --bg:        #17140E;
  --surface:   #1F1B14;
  --surface-2: #262119;
  --ink:       #F3ECDD;
  --ink-soft:  #D5CAB4;
  --muted:     #9C9079;
  --rule:      #302A20;
  --rule-soft: #241F18;

  --camel:      #D3A468;
  --camel-soft: #6E5533;
  --olive:      #A8BC7E;
  --olive-soft: #3D4A2B;
  --olive-ink:  #17140E;

  --closed:     #4A4234;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 18px 40px -22px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.015em; margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px) 96px;
}

/* ── Top bar ────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 28px 0 22px;
  border-bottom: 1px solid var(--rule);
}

.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand__mark { font-family: var(--serif); font-size: 20px; letter-spacing: -.01em; }
.rule-v { width: 1px; height: 20px; background: var(--rule); }
.brand__meta {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

.theme-toggle {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft); background: transparent;
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 9px 16px; cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.theme-toggle:hover { border-color: var(--camel); color: var(--ink); }
.theme-toggle .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--camel); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero { padding-top: clamp(48px, 8vw, 92px); }

.hero__head {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .8fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: end;
}

.hero h1 {
  font-size: clamp(48px, 8.5vw, 104px);
  line-height: .94;
  letter-spacing: -.035em;
  margin: 0;
}

.hero__sub {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.25vw, 17px);
  max-width: 34ch;
}

/* ── Upgrade hint ───────────────────────────────────────────── */
.upsell {
  margin-top: clamp(32px, 5vw, 52px);
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.upsell__line { margin: 0; font-size: 14.5px; color: var(--muted); }

.linkbtn {
  font: inherit; color: var(--camel); background: none; border: 0;
  padding: 0 0 2px; margin-left: 10px; cursor: pointer;
  border-bottom: 1px solid var(--camel);
}
.linkbtn:hover { color: var(--ink); border-color: var(--ink); }

.personalize {
  margin-top: 18px; padding: 20px 22px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  max-width: 520px;
}
.personalize__note { margin: 0 0 14px; font-size: 14.5px; color: var(--ink-soft); }
.personalize__form { display: flex; gap: 10px; flex-wrap: wrap; }
.personalize__form input {
  flex: 1 1 200px; min-width: 0;
  font: inherit; font-size: 14.5px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--rule); border-radius: 10px;
  padding: 10px 13px;
}
.personalize__form input:focus-visible { outline: 2px solid var(--camel); outline-offset: 1px; }
.personalize__confirm {
  margin: 14px 0 0; font-family: var(--mono); font-size: 12.5px; color: var(--olive);
}
html[data-theme="light"] .personalize__confirm { color: #46592c; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  font: inherit; font-size: 14.5px;
  color: var(--ink); background: transparent;
  border: 1px solid var(--rule); border-radius: 10px;
  padding: 11px 18px; cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.btn:hover { border-color: var(--camel); background: var(--surface-2); }

.btn--solid {
  background: var(--olive); border-color: var(--olive); color: var(--olive-ink);
}
.btn--solid:hover { filter: brightness(1.06); background: var(--olive); border-color: var(--olive); }

:where(button, input, a):focus-visible { outline: 2px solid var(--camel); outline-offset: 2px; }

/* ── Hero cards ─────────────────────────────────────────────── */
.cards {
  margin-top: clamp(30px, 5vw, 54px);
  display: grid;
  grid-template-columns: 1.22fr 1fr 1fr;
  gap: clamp(16px, 2vw, 28px);
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(22px, 2.4vw, 30px);
  display: flex; flex-direction: column;
  min-height: 100%;
}
.card--lead {
  border-color: var(--camel);
  box-shadow: var(--shadow);
}

.card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.signal {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-soft);
}
.signal .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.signal--open .dot { background: var(--olive); }
.signal--evergreen .dot { background: var(--olive); opacity: .55; }
.signal--upcoming .dot { background: var(--camel); }

.badge {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--olive-ink); background: var(--olive);
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}

.card h3 { font-size: clamp(26px, 2.6vw, 38px); line-height: 1.02; margin: 0 0 12px; }
.card--lead h3 { font-size: clamp(32px, 3.6vw, 48px); }

.card__why { margin: 0; color: var(--ink-soft); font-size: 15px; }
.card--lead .card__why { font-size: 16.5px; }

.card__window {
  margin: 18px 0 0;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.card__window b { color: var(--ink-soft); font-weight: 400; }

.card__action { margin-top: auto; padding-top: 22px; }
.card__action .btn { width: 100%; }

/* Angles panel */
.angles {
  margin-top: 20px; padding-top: 20px;
  border-top: 1px solid var(--rule);
  display: grid; gap: 20px;
}
.angles[hidden] { display: none; }
.angles__group h4 {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 400; margin: 0 0 10px;
}
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.tags li {
  font-size: 13px; color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--rule-soft);
  border-radius: 999px; padding: 5px 11px;
}
.tags--adjacent li { background: transparent; border-style: dashed; border-color: var(--rule); color: var(--muted); }

.angles__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: angle; }
.angles__list li {
  position: relative; padding-left: 26px;
  font-size: 14px; color: var(--ink-soft); line-height: 1.5;
}
.angles__list li::before {
  counter-increment: angle; content: counter(angle);
  position: absolute; left: 0; top: 1px;
  font-family: var(--mono); font-size: 11px; color: var(--camel);
}

/* ── Timeline ───────────────────────────────────────────────── */
.timeline {
  margin-top: clamp(72px, 11vw, 132px);
  padding-top: clamp(28px, 4vw, 40px);
  border-top: 1px solid var(--rule);
}

.timeline__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: clamp(24px, 3vw, 36px);
}
.timeline h2 { font-size: clamp(20px, 2vw, 25px); line-height: 1.25; }
.timeline__meta {
  margin: 7px 0 0;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .05em; color: var(--muted);
}

.gantt {
  position: relative;
  --label-w: clamp(110px, 15vw, 168px);
}

.gantt__months {
  display: grid;
  grid-template-columns: var(--label-w) 1fr;
}
.gantt__months::before { content: ""; }
.gantt__months-inner { position: relative; height: 26px; }
.gantt__month {
  position: absolute; top: 0; transform: translateX(-1px);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}

.gantt__rows { display: grid; }

.grow {
  display: grid;
  grid-template-columns: var(--label-w) 1fr;
  align-items: center;
  min-height: 34px;
}
.grow__label {
  font-size: 14px; color: var(--ink-soft);
  padding-right: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.grow--open .grow__label { color: var(--ink); }
.grow--closed .grow__label { color: var(--muted); }

.grow__track { position: relative; height: 34px; }
.grow__bar {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 7px; min-width: 7px; border-radius: 999px;
  background: var(--camel); opacity: .55;
  transition: opacity .2s var(--ease);
}
.grow--open   .grow__bar { background: var(--camel); opacity: 1; }
.grow--evergreen .grow__bar { background: var(--olive); opacity: .85; }
.grow--closed .grow__bar { background: var(--closed); opacity: 1; }
.grow:hover .grow__bar { opacity: 1; }

.gantt__today {
  position: absolute;
  top: 26px; bottom: 0;
  width: 1px; background: var(--camel); opacity: .5;
  pointer-events: none;
}

.gantt__footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 16px;
}

.legend { list-style: none; display: flex; align-items: center; gap: 20px; margin: 0; padding: 0; flex-wrap: wrap; }
.legend li {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.chip { width: 20px; height: 6px; border-radius: 999px; display: inline-block; }
.chip--open { background: var(--camel); }
.chip--upcoming { background: var(--camel); opacity: .45; }
.chip--closed { background: var(--closed); }
.tickmark { width: 1px; height: 12px; background: var(--camel); display: inline-block; }
.legend__today { padding-left: 4px; border-left: 1px solid var(--rule); }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; color: var(--ink-soft); }
.switch input { accent-color: var(--olive); width: 15px; height: 15px; }

.foot {
  margin-top: 72px; padding-top: 22px; border-top: 1px solid var(--rule);
}
.foot p { margin: 0; font-size: 13px; color: var(--muted); }

/* ── Errors ─────────────────────────────────────────────────── */
.loadfail {
  margin: 40px 0; padding: 24px 26px;
  border: 1px solid var(--camel); border-radius: var(--radius); background: var(--surface);
}
.loadfail h3 { font-size: 22px; margin-bottom: 10px; }
.loadfail p { margin: 0 0 12px; color: var(--ink-soft); font-size: 14.5px; }
.loadfail code {
  font-family: var(--mono); font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--rule);
  border-radius: 8px; padding: 8px 12px; display: inline-block;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero__head { grid-template-columns: 1fr; align-items: start; }
  .hero__sub { margin-top: 20px; max-width: 46ch; }
  .cards { grid-template-columns: 1fr; }
  .card--lead h3 { font-size: 38px; }
}

@media (max-width: 620px) {
  .gantt { --label-w: 96px; }
  .grow__label { font-size: 13px; padding-right: 10px; }
  .gantt__month { font-size: 9px; letter-spacing: .06em; }
  .timeline__head { flex-direction: column; align-items: stretch; }
  .timeline__head .btn { align-self: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
