/* §22 — the interface is a lit object in a dark room.
   Content emits, chrome recedes. One warm accent. The season tints, never paints. */
:root {
  --bg: #0A0A0B; --surface-1: #141416; --surface-2: #1E1E21; --surface-3: #2A2A2E;
  --hairline: rgba(255,255,255,0.09);
  --text: #F5F5F7; --text-mute: #9A9AA0; --text-dim: #5E5E63;
  --accent: #DA7756; --accent-press: #C4623F; --accent-glow: rgba(218,119,86,0.14);
  --season: #C9A227; --verified: #5E9E7E; --streak-broken: #8A5A4A; --warn: #C9A227;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.5; overscroll-behavior: none;
}
#app { min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; padding: 0 20px calc(148px + env(safe-area-inset-bottom)); overflow-y: auto; }

/* ── type scale (§22): weight and size carry the hierarchy ── */
.display { font-size: 40px; line-height: 44px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.title   { font-size: 28px; line-height: 34px; font-weight: 650; letter-spacing: -0.01em; }
.heading { font-size: 22px; line-height: 28px; font-weight: 600; }
.body-lg { font-size: 18px; line-height: 26px; font-weight: 400; }
.body    { font-size: 16px; line-height: 24px; font-weight: 400; }
.label   { font-size: 13px; line-height: 18px; font-weight: 600; }
.micro   { font-size: 11px; line-height: 15px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.mute { color: var(--text-mute); } .dim { color: var(--text-dim); }
.tab-nums { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 11px; line-height: 15px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--season); }

/* screen header: generous air at the top (§22 spacing s7) */
.screen-head { padding: 48px 0 32px; }
.screen-head .title { margin-top: 6px; }
.screen-head .sub { color: var(--text-mute); font-size: 13px; font-weight: 600; margin-top: 6px; }

/* ── status strip ── */
.status-strip {
  height: 44px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; padding-top: env(safe-area-inset-top); flex: none;
}
.status-strip .altitude { color: var(--season); font-weight: 700; font-size: 13px;
  letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.sync-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--warn);
  display: inline-block; margin-right: 14px; }
.gear { color: var(--text-dim); background: none; border: none; padding: 8px; cursor: pointer; }

/* ── surfaces: elevation by lightness, never shadows ── */
.card { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 16px; }
.pool {
  /* the lit object: one focused pool of warm light */
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(218,119,86,0.10), rgba(218,119,86,0.02) 55%, transparent 75%),
    var(--surface-1);
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
}

/* ── buttons ── */
.btn-primary {
  display: block; width: 100%; height: 52px; border-radius: 999px; border: none;
  background: var(--accent); color: #FFF7F3; font-size: 13px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
  transition: transform 100ms ease-out, background 100ms ease-out;
  box-shadow: 0 0 44px rgba(218,119,86,0.22);
}
.btn-primary:active { transform: scale(0.97); background: var(--accent-press); }
.btn-secondary {
  display: block; width: 100%; height: 52px; border-radius: 999px;
  background: transparent; border: 1px solid var(--hairline); color: var(--text-mute);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: transform 100ms ease-out;
}
.btn-secondary:active { transform: scale(0.97); }
.btn-text { background: none; border: none; color: var(--text-mute); font-size: 13px;
  font-weight: 600; padding: 14px; cursor: pointer; }

/* ── inputs ── */
input[type=text], input[type=url], input[type=password], input[type=time], textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--r-sm); color: var(--text); font-size: 16px; padding: 14px;
  font-family: inherit; outline: none;
}
input:focus, textarea:focus { border-color: var(--text-dim); }
textarea { resize: none; }

/* ── tab bar ── */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; height: calc(68px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(20,20,22,0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-around; z-index: 40;
}
.tab { background: none; border: none; color: var(--text-dim); display: flex; flex-direction: column;
  align-items: center; gap: 3px; cursor: pointer; width: 64px; padding: 8px 0; }
.tab.active { color: var(--season); }
.tab .micro { display: none; }
.tab.active .micro { display: block; }
.tab svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; }
.tab-log {
  width: 58px; height: 58px; border-radius: 999px; background: var(--accent); border: none;
  display: flex; align-items: center; justify-content: center; margin-top: -20px; cursor: pointer;
  box-shadow: 0 0 0 6px var(--bg), 0 0 32px rgba(218,119,86,0.35);
}
.tab-log svg { width: 26px; height: 26px; stroke: #FFF7F3; fill: none; stroke-width: 1.5; stroke-linecap: round; }
.tab-log.active { background: var(--accent-press); }

/* ── the Log: domain rows are objects being lit, not checkboxes ── */
.domain-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 32px; }
.domain-row {
  display: flex; align-items: center; min-height: 64px; gap: 16px; padding: 10px 16px;
  background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--r-md);
  cursor: pointer; transition: background 300ms ease-out, border-color 300ms ease-out;
}
.domain-row:active { background: var(--surface-2); }
.domain-row .glyph {
  width: 40px; height: 40px; border-radius: 999px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); transition: all 300ms ease-out;
}
.domain-row .glyph svg { width: 22px; height: 22px; stroke: var(--text-dim); fill: none;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke 300ms ease-out; }
.domain-row .name { flex: 1; color: var(--text-mute); font-size: 16px; font-weight: 600;
  transition: color 300ms ease-out; }
.domain-row .sub { color: var(--text-dim); font-size: 12px; font-weight: 400; margin-top: 1px; }
.domain-row .lamp {
  width: 10px; height: 10px; border-radius: 999px; flex: none;
  background: var(--surface-3); transition: all 300ms ease-out;
}
.domain-row.on {
  background: linear-gradient(90deg, var(--accent-glow), var(--surface-1) 70%);
  border-color: rgba(218,119,86,0.35);
}
.domain-row.on .glyph { background: rgba(218,119,86,0.18); }
.domain-row.on .glyph svg { stroke: var(--accent); }
.domain-row.on .name { color: var(--text); }
.domain-row.on .lamp { background: var(--verified); box-shadow: 0 0 12px rgba(94,158,126,0.8); }
.domain-row.readonly { cursor: default; }
.domain-row.readonly:active { background: var(--surface-1); }

/* ── the timer ── */
.timer-idle { margin: 8px 0 0; padding: 28px 20px 24px; text-align: center; }
.timer-idle .coach { color: var(--text-dim); font-size: 12px; margin-top: 14px; }
.timer-running { margin: 8px 0 0; padding: 28px 16px 0; text-align: center; }
.pulse-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--accent);
  display: inline-block; margin-right: 10px; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.25 } }
.timer-running .display { font-size: 56px; line-height: 60px; margin-top: 10px;
  text-shadow: 0 0 44px rgba(218,119,86,0.35); }
.hold-zone {
  height: 120px; margin: 24px -16px 0; border-top: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  color: var(--text-mute); font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; user-select: none; -webkit-user-select: none; position: relative; overflow: hidden;
  touch-action: none;
}
.hold-zone .ring { width: 34px; height: 34px; }
.hold-zone .ring circle.track { stroke: var(--surface-3); }
.hold-zone .ring circle.fill { stroke: var(--accent); stroke-dasharray: 88; stroke-dashoffset: 88; }
.hold-zone.holding circle.fill { transition: stroke-dashoffset 800ms linear; stroke-dashoffset: 0; }
.pause-zone { height: 56px; display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; }
.session-row { display: flex; justify-content: space-between; padding: 12px 0;
  border-bottom: 1px solid var(--hairline); color: var(--text-mute); font-size: 14px; }
.session-row:last-child { border-bottom: none; }

/* ── step preview: the day's number, emitting ── */
.step-preview { text-align: center; padding: 40px 0 8px; }
.step-preview .n { font-size: 64px; line-height: 64px; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
  text-shadow: 0 0 56px rgba(218,119,86,0.30); }
.step-preview .cap { color: var(--text-dim); font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; margin-top: 8px; }
.step-preview .empty { color: var(--text-mute); font-size: 16px; }
.chip { display: inline-block; background: var(--accent-glow); color: var(--accent);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 999px; padding: 5px 12px; margin-top: 12px; }

/* ── sheets and modals ── */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10,10,11,0.6);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); z-index: 50;
  display: flex; align-items: flex-end; }
.sheet-backdrop.center { align-items: center; justify-content: center; padding: 20px; }
.sheet { width: 100%; background: var(--surface-1); border-radius: var(--r-lg) var(--r-lg) 0 0;
  border-top: 1px solid var(--hairline);
  padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
  animation: rise 300ms ease-out; }
.sheet.card-modal { border-radius: var(--r-lg); border: 1px solid var(--hairline); animation: none; }
@keyframes rise { from { transform: translateY(40%); opacity: 0.4 } to { transform: none; opacity: 1 } }
.sheet.colloquy { animation-duration: 450ms; }
.toast { position: fixed; bottom: calc(96px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--hairline);
  color: var(--text-mute); font-size: 13px; padding: 11px 20px; border-radius: 999px;
  z-index: 60; white-space: nowrap; }

.empty-line { text-align: center; color: var(--text-mute); padding: 48px 24px; font-size: 16px; line-height: 24px; }

/* ── settings ── */
.settings-group { margin-bottom: 32px; }
.settings-group > .micro { color: var(--text-dim); margin-bottom: 10px; }
.settings-row { padding: 16px 0; border-bottom: 1px solid var(--hairline); cursor: pointer; }
.settings-row:last-child { border-bottom: none; }
.settings-row .note { color: var(--text-dim); font-size: 13px; line-height: 18px; margin-top: 3px; }

/* ── onboarding ── */
.onb { display: flex; flex-direction: column; justify-content: center; flex: 1;
  padding: 0 24px 64px; gap: 18px; min-height: 100dvh;
  background: radial-gradient(90% 50% at 50% 30%, rgba(218,119,86,0.07), transparent 70%), var(--bg); }
.token-box { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: var(--r-sm);
  padding: 18px; font-family: ui-monospace, monospace; font-size: 15px; word-break: break-all; }

/* ── The Way ── */
.lectio { padding: 40px 0 28px; }
.lectio .scripture { font-size: 19px; line-height: 28px; font-style: italic; }
.lectio .application { color: var(--text-mute); font-size: 15px; line-height: 23px; margin-top: 10px; }
.lectio .citation { color: var(--season); font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 10px; }
.map-wrap { margin: 0 -20px; position: relative; }
.map-svg { width: 100%; display: block; }
.next-card { position: sticky; bottom: 8px; margin: 12px 0 0; display: flex; align-items: center; gap: 14px; }
.ring-wrap { width: 40px; height: 40px; flex: none; }
.node-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; fill: #9A9AA0; }
.node-label.current { fill: #F5F5F7; }
.avatar-token { transition: transform 700ms ease-in-out; } /* the signature 700 ms step */

/* ── Ricordanze ── */
.bar-row { padding: 16px 0; border-bottom: 1px solid var(--hairline); cursor: pointer; }
.bar-row:last-child { border-bottom: none; }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.bar-track { height: 6px; background: var(--surface-3); border-radius: 999px; margin-top: 10px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width 600ms ease-out; }
.rung { display: flex; justify-content: space-between; padding: 9px 0 9px 14px; color: var(--text-dim); font-size: 14px; }
.rung.held { color: var(--text); }
.nearest { border-color: rgba(218,119,86,0.5); }

/* ── Bottega ── */
.cat-row { display: flex; gap: 12px; overflow-x: auto; padding: 10px 0 6px; scrollbar-width: none; }
.cat-row::-webkit-scrollbar { display: none; }
.item-card { flex: none; width: 132px; background: var(--surface-1); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: 14px; cursor: pointer; }
.item-card.dimmed { opacity: 0.45; }
.item-card .price { color: var(--text-mute); font-size: 13px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.item-card .owned-mark { color: var(--verified); font-size: 12px; font-weight: 700; margin-top: 6px; }

/* ── Archive ── */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 10px; }
.cal-cell { aspect-ratio: 1; border-radius: 8px; background: var(--surface-1);
  display: flex; align-items: center; justify-content: center; font-size: 11px;
  color: var(--text-dim); cursor: pointer; font-variant-numeric: tabular-nums; }
.mile-row { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0;
  border-bottom: 1px solid var(--hairline); font-size: 14px; }
.mile-row:last-child { border-bottom: none; }

/* ── Colloquy: the one ornamented moment ── */
.colloquy-portrait { width: 96px; height: 96px; border-radius: 999px; border: 1px solid var(--hairline);
  margin: 0 auto 22px; display: flex; align-items: center; justify-content: center;
  color: var(--accent); background: var(--surface-2); }
.colloquy .scripture { font-size: 19px; line-height: 28px; font-style: italic; text-align: center; }
.colloquy .divider { height: 1px; background: var(--hairline); margin: 22px 48px; }
.colloquy .application { color: var(--text-mute); text-align: center; font-size: 15px; line-height: 23px; }

/* ── Wintering ── */
.ember-line { text-align: center; color: var(--warn); font-size: 13px; font-weight: 700;
  letter-spacing: 0.06em; padding: 10px 0; }

/* streaks: broken is muted brown, never red, never an alarm */
.streak-broken { color: var(--streak-broken); }
