/* Hearth. Tokens and components ported from docs/prototype.html. */
:root {
  --ground: #FAF4EA;
  --card: #FFFCF6;
  --rule: #E7DBC7;
  --rule-2: #E0D3BD;
  --ember: #AE5227;
  --muted: #6E6156;
  --muted-2: #786B5C;
  --mid: #4C4136;
  --ink: #211A13;
  --display: Literata, Georgia, "Times New Roman", serif;
  --body: Karla, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, a { font-family: var(--body); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
form.inline { display: contents; }

.app { max-width: 480px; min-height: 100dvh; margin: 0 auto; position: relative; }
.pad { padding-left: 24px; padding-right: 24px; }
.top { padding-top: calc(var(--safe-t) + 40px); }
.screen.with-nav { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 24px); }

/* ---- type ---- */
.display { font-family: var(--display); font-size: 54px; line-height: 1; font-weight: 400; margin: 26px 0 0; }
.lede { font-family: var(--display); font-size: 19px; line-height: 1.4; color: #8C4E26; margin: 16px 0 0; }
.q { font-family: var(--display); font-size: 29px; line-height: 1.2; font-weight: 400; margin: 22px 0 0; text-wrap: balance; }
.title { font-family: var(--display); font-size: 25px; line-height: 1.25; font-weight: 400; margin: 22px 0 0; }
.sub { font-size: 15px; line-height: 1.55; color: var(--muted); margin: 9px 0 0; text-wrap: pretty; }
.caption { font-size: 13px; color: var(--muted-2); margin: 10px 2px 0; line-height: 1.5; }
.notice { font-size: 14px; color: var(--ember); line-height: 1.5; margin: 10px 0 0; }
.eyebrow { font-size: 10.5px; letter-spacing: 0.15em; text-transform: uppercase; font-weight: 600; color: var(--ember); }
.eyebrow.soft { color: var(--muted-2); }
.horizon-label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; }
.ember { color: var(--ember); }

/* ---- flows (welcome, setup) ---- */
.flow { min-height: 100dvh; display: flex; flex-direction: column; }
.flow.dawn { background: linear-gradient(180deg, #F0D2B6 0%, var(--ground) 58%); }
.flow .body { flex: 1 1 auto; padding-top: 22px; }
.centered { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 34px; }
.centered .sub { margin-top: 24px; max-width: 30ch; }
.placeholder { min-height: calc(100dvh - var(--nav-h) - 60px); }
.placeholder .sub { margin-top: 10px; }
.placeholder form { margin-top: 26px; }
.actions { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; padding-bottom: calc(var(--safe-b) + 28px); }
.row-actions { flex-direction: row; }
.grow { flex: 1 1 auto; display: flex; }
.grow > * { flex: 1 1 auto; }

.steps { display: flex; gap: 6px; }
.steps span { flex: 1 1 0; height: 4px; border-radius: 999px; background: var(--rule); }
.steps span.on { background: var(--ember); }

.gate { width: 100%; max-width: 320px; margin-top: 30px; display: flex; flex-direction: column; gap: 12px; }
.gate .sub { margin: 0; }
.field {
  height: 52px; border-radius: 16px; border: 1px solid var(--rule-2); background: var(--card);
  padding: 0 18px; font-size: 18px; letter-spacing: 0.12em; text-align: center; color: var(--ink);
}
.field[aria-invalid=true] { border-color: var(--ember); }

/* ---- buttons ---- */
.btn-primary, .btn-quiet, .btn-outline, .btn-add, .btn-no, .cta-yes, .cta-no {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  border-radius: 999px; cursor: pointer; font-weight: 600;
}
.btn-primary { height: 54px; border: 0; background: var(--ember); color: #fff; font-size: 16.5px; width: 100%; }
.btn-primary:disabled { opacity: 0.45; cursor: default; }
.btn-ink { background: var(--ink); color: var(--ground); }
.btn-quiet { height: 52px; padding: 0 24px; border: 1px solid var(--rule-2); background: transparent; color: var(--mid); font-size: 16px; font-weight: 500; }
.btn-outline { height: 48px; width: 100%; border: 1px solid var(--ember); background: transparent; color: var(--ember); font-size: 15px; margin-top: 6px; }
.btn-text { display: inline-flex; align-self: center; align-items: center; min-height: 44px; padding: 0 16px; color: var(--muted-2); font-size: 14.5px; font-weight: 500; text-decoration: none; }
.btn-add, .cta-yes { height: 46px; padding: 0 18px; border: 0; background: var(--ember); color: #fff; font-size: 15px; }
.btn-no, .cta-no { height: 46px; padding: 0 16px; border: 1px solid var(--rule-2); background: transparent; color: var(--mid); font-size: 15px; font-weight: 500; }
.row { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; }

/* ---- setup 1: chips ---- */
.chips { display: flex; flex-wrap: wrap; gap: 9px; align-content: flex-start; }
.chip {
  position: relative; display: inline-flex; align-items: center; height: 48px; padding: 0 20px;
  border-radius: 999px; font-size: 15px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--rule-2); color: var(--mid); user-select: none;
}
.chip input, .opt input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--ground); font-weight: 600; }
.chip:has(input:focus-visible), .opt:has(input:focus-visible) { outline: 2px solid var(--ember); outline-offset: 2px; }

/* ---- setup 2: pace ---- */
.options { display: flex; flex-direction: column; gap: 12px; }
.opt {
  position: relative; display: flex; align-items: flex-start; gap: 14px; border-radius: 18px; cursor: pointer;
  border: 1px solid var(--rule-2); padding: 18px;
}
.opt:has(input:checked) { border: 1.5px solid var(--ember); background: var(--card); padding: 17.5px; }
.opt .radio { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 999px; margin-top: 2px; border: 1.5px solid #C6B49B; }
.opt:has(input:checked) .radio { border: 6.5px solid var(--ember); background: var(--card); }
.opt .t { font-family: var(--display); font-size: 20px; line-height: 1.2; color: var(--ink); display: block; }
.opt .d { font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 6px; display: block; }

/* ---- setup 3: finds ---- */
.finds { display: flex; flex-direction: column; gap: 11px; }
.find { background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 16px 18px; }
.find.added { border-color: #E4C6A8; }
.find.skipped { opacity: 0.55; }
.find h2 { font-family: var(--display); font-size: 19px; line-height: 1.25; font-weight: 400; margin: 8px 0 0; }
.find p { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 6px 0 0; }
.resolved { font-size: 13.5px; font-weight: 600; margin-top: 13px; color: var(--muted-2); }
.resolved.ember { color: var(--ember); }

/* ---- the sundial ---- */
.sky-region { position: relative; height: calc(250px + var(--safe-t)); margin-top: 0; overflow: hidden; }
.sky-region > * { translate: 0 var(--safe-t); }
.sky { position: absolute; left: 0; right: 0; top: calc(-1 * var(--safe-t)); height: calc(196px + var(--safe-t)); }
.arc { position: absolute; left: 0; top: 0; width: 100%; height: 250px; overflow: visible; }
.arc path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.arc-faint { stroke: rgba(var(--stroke), 0.2); stroke-width: 1.5; }
.arc-traced { stroke: rgba(var(--stroke), 0.5); stroke-width: 1.75; }
.horizon { stroke: rgba(var(--stroke), 0.28); stroke-width: 1; }
.star { position: absolute; width: 2.4px; height: 2.4px; border-radius: 999px; background: #F4EDE0; opacity: 0.85; }

.traveller { position: absolute; width: 24px; height: 24px; border-radius: 999px; pointer-events: none; }
.traveller::before {
  content: ""; position: absolute; inset: -15px; border-radius: 999px;
  background: color-mix(in srgb, var(--sun) 20%, transparent);
}
.traveller.sun { background: var(--sun); }
.traveller.moon::after {
  content: ""; position: absolute; inset: 1px; border-radius: 999px;
  box-shadow: inset 7px -5px 0 0 var(--sun);
  transform: rotate(-20deg);
}
.traveller.moon::before { background: color-mix(in srgb, var(--sun) 12%, transparent); }

.dateline { position: absolute; left: 24px; top: 52px; color: var(--ink); } /* --ink here is the sky's, so it flips at night */
.dateline .weekday { font-family: var(--display); font-size: 27px; line-height: 1.1; }
.dateline .monthday { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; margin-top: 4px; opacity: 0.72; }

.dot-hit {
  position: absolute; width: 44px; height: 44px; padding: 0; margin: 0; border: 0; background: transparent;
  border-radius: 999px; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.dot { display: block; border-radius: 999px; transition: box-shadow 200ms ease; }
.dot-hit.future .dot { width: 12px; height: 12px; background: var(--dot); }
.dot-hit.past .dot { width: 9px; height: 9px; background: rgba(var(--stroke), 0.3); }
.dot-hit.suggested .dot { width: 14px; height: 14px; border: 1.75px dashed rgba(var(--stroke), 0.75); background: transparent; }
.dot-hit.selected .dot { box-shadow: 0 0 0 6px rgba(var(--stroke), 0.12); }

.sky-region .clock { position: absolute; left: 24px; top: 210px; }
.sky-region .sunset { position: absolute; right: 24px; top: 209px; font-size: 12px; color: var(--muted-2); }

/* ---- under the arc ---- */
.screen .body { padding-top: 16px; }
.daycard {
  background: var(--card); border: 1px solid var(--rule); border-radius: 20px; padding: 22px 20px;
  box-shadow: 0 1px 2px rgba(33, 26, 19, 0.04), 0 14px 30px -20px rgba(87, 58, 36, 0.38);
}
.daycard.offered { border-color: #E4D3B8; }
.daycard .t { font-family: var(--display); font-size: 24px; line-height: 1.2; font-weight: 400; margin: 9px 0 0; }
.daycard .d { font-size: 15px; line-height: 1.5; color: var(--muted); margin: 9px 0 0; }

.rest { display: flex; flex-direction: column; margin-top: 24px; }
.rest .horizon-label { margin-bottom: 8px; }
.restrow {
  display: flex; align-items: baseline; gap: 12px; width: 100%; min-height: 48px;
  border: 0; border-top: 1px solid var(--rule); background: transparent;
  padding: 14px 2px; cursor: pointer; text-align: left;
}
.restrow .w { flex: 0 0 104px; font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; font-weight: 600; color: var(--muted-2); }
.restrow.offered .w { color: var(--ember); }
.restrow .n { flex: 1 1 auto; font-size: 15px; line-height: 1.35; color: var(--mid); }
.restrow.offered .n { color: var(--ink); }
.restrow .mk { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 999px; background: var(--rule-2); align-self: center; }
.restrow.offered .mk { background: transparent; border: 1.5px dashed var(--ember); }

.further { margin-top: 26px; display: flex; flex-direction: column; gap: 9px; }
.look { display: flex; gap: 8px; }
.look button {
  flex: 1 1 0; height: 44px; border-radius: 999px; border: 1px solid var(--rule-2);
  background: transparent; color: var(--mid); font-size: 14px; font-weight: 600; opacity: 0.55;
}

/* ---- pursuits ---- */
.ribbon {
  width: 100%; min-height: 54px; padding: 10px 16px; background: #F4EAD9; border: 1px solid #E9DDC8;
  border-radius: 16px; display: flex; align-items: center; gap: 12px; text-decoration: none;
}
.ribbon-text { flex: 1 1 auto; font-size: 14px; color: var(--mid); line-height: 1.35; }
.pursuits { display: flex; flex-direction: column; gap: 11px; }
.pursuit { background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 16px 18px; }
.pursuit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pursuit h2 { font-family: var(--display); font-size: 20px; line-height: 1.2; font-weight: 400; margin: 0; }
.cadence { flex: 0 0 auto; font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; font-weight: 600; color: var(--muted-2); }
.pursuit-next { display: flex; align-items: baseline; gap: 9px; margin-top: 10px; font-size: 15px; line-height: 1.35; }
.pursuit-context { font-size: 13.5px; line-height: 1.45; color: var(--muted); margin: 6px 0 0; }

/* ---- tab bar ---- */
.nav {
  position: fixed; left: 50%; translate: -50% 0; bottom: 0; width: 100%; max-width: 480px;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  border-top: 1px solid #EBE0CE; background: rgba(250, 244, 234, 0.96);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: stretch; z-index: 10;
}
.nav a {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted-2); text-decoration: none;
}
.nav a.on { color: var(--ember); }
.nav .l { font-size: 11.5px; letter-spacing: 0.02em; font-weight: 500; }
.nav a.on .l { font-weight: 600; }

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