/* Lastlid site styles. Plain CSS, no build step — every page links this file.
   Palette sampled from the app's own screens; see sites/README.md. */

:root {
  --bg: #000000;
  --surface: #212226;
  --surface-2: #2b2c30;
  --border: #2e2f34;
  --text: #f4f5f7;
  --muted: #a9acb1;
  --accent: #68d1c0;
  --accent-ink: #10312c;
  /* form fields need a 3:1 edge of their own; the card border is decorative */
  --field-border: #6a6b71;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.65 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(104, 209, 192, 0.25); }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 720px; }

a { color: var(--accent); }

/* ---------- header ---------- */

header { padding: 28px 0; }
.mark { font-weight: 700; letter-spacing: 0.18em; font-size: 0.82rem; color: var(--accent); text-decoration: none; }
.crumb { color: var(--muted); font-size: 0.82rem; letter-spacing: 0.06em; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }

/* ---------- type ---------- */

h1 { font-size: clamp(1.9rem, 5.2vw, 2.7rem); line-height: 1.14; letter-spacing: -0.025em; margin: 24px 0 16px; }
h2 { font-size: 1.45rem; letter-spacing: -0.01em; margin: 0 0 16px; }
h3 { font-size: 1.05rem; margin: 26px 0 6px; }
p { margin: 0 0 14px; }
.lead { font-size: 1.12rem; color: var(--muted); margin: 0 0 8px; max-width: 46ch; }
.muted { color: var(--muted); }

section { padding: 44px 0; border-top: 1px solid var(--border); margin-top: 44px; }

/* ---------- calls to action ---------- */

.cta {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  font-weight: 600; text-decoration: none; padding: 14px 26px; border-radius: 999px;
}
.cta:hover { filter: brightness(1.08); }
.cta-note { color: var(--muted); font-size: 0.92rem; margin: 14px 0 0; }

/* ---------- home page ---------- */

.hero { padding: 40px 0 8px; }
.hero .lead { font-size: 1.2rem; margin: 0 0 28px; max-width: 42ch; }

/* align-items must not be the flex default (stretch), or the shots are pulled
   to the strip's height and lose their aspect ratio. */
.shots { display: flex; align-items: flex-start; gap: 16px; overflow-x: auto; padding: 48px 0 8px; scrollbar-width: thin; }
/* height:auto is required — without it the height="768" attribute wins and the
   shots render stretched. The attributes stay so the box is reserved before load. */
.shots img { width: 216px; height: auto; flex: 0 0 auto; border-radius: 18px; border: 1px solid var(--border); }

.steps { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.step b { display: block; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* ---------- tables ---------- */

table { width: 100%; border-collapse: collapse; margin: 8px 0 4px; font-size: 0.97rem; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }
td.free { color: var(--accent); }
tr.quit td { color: var(--accent); font-weight: 600; }
td .when { display: block; color: var(--muted); font-size: 0.84rem; }

/* ---------- details / faq ---------- */

details { border-bottom: 1px solid var(--border); padding: 16px 0; }
details summary { cursor: pointer; font-weight: 600; }
details p { color: var(--muted); margin: 12px 0 0; }

/* ---------- calculator ---------- */

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; margin-top: 28px; }
.fields { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.field label { display: block; font-size: 0.86rem; color: var(--muted); margin-bottom: 7px; }
.field input, .field select {
  width: 100%; font: inherit; font-size: 1rem;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--field-border); border-radius: 10px;
  padding: 11px 12px;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field .hint { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }
.optional-head { margin: 22px 0 0; font-size: 0.86rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 18px; }

.privacy-line { font-size: 0.92rem; color: var(--muted); margin: 0 0 8px; }
.privacy-line b { color: var(--text); font-weight: 600; }

.summary { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 28px 0 0; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.stat .n { font-size: 1.7rem; font-weight: 700; line-height: 1.15; display: block; }
.stat .k { font-size: 0.84rem; color: var(--muted); }
.stat.key .n { color: var(--accent); }

.chart { margin: 28px 0 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .step-line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .step-fill { fill: var(--accent); opacity: 0.1; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; }
.chart .zero-dot { fill: var(--accent); }

/* ---------- articles ---------- */

.article-meta { color: var(--muted); font-size: 0.88rem; margin: 0 0 28px; }
.article-meta time { color: var(--muted); }

article h2 { margin-top: 44px; }
article h2:first-of-type { margin-top: 32px; }
article ul, article ol { padding-left: 0; margin: 0 0 16px; }
article li { margin: 0 0 10px; padding-left: 22px; list-style: none; position: relative; }
article ul > li::before {
  content: ""; position: absolute; left: 4px; top: 0.72em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
article ol { counter-reset: step; }
article ol > li { counter-increment: step; }
article ol > li::before {
  content: counter(step); position: absolute; left: 0; top: 0.12em;
  color: var(--accent); font-size: 0.85rem; font-weight: 500; font-variant-numeric: tabular-nums;
}

/* the one-line answer a reader (or an assistant) can lift out of the page */
.answer {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 2px solid var(--accent); border-radius: 0 14px 14px 0;
  padding: 20px 22px; margin: 0 0 32px;
}
.answer p { margin: 0; }
.answer p + p { margin-top: 10px; }

.timeline { list-style: none; padding: 0; margin: 0; }
/* the timeline is a ul inside an article, so opt it out of the bullet rule above */
.timeline li { border-bottom: 1px solid var(--border); padding: 18px 0; }
.timeline li::before { content: none; }
.timeline li:last-child { border-bottom: 0; }
.timeline .when-label { display: block; color: var(--accent); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.timeline b { display: block; margin-bottom: 4px; }
.timeline span { color: var(--muted); }

.callout {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 22px; margin: 28px 0;
}
.callout p:last-child { margin-bottom: 0; }

.related { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 20px; }
.related a {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px;
}
.related a:hover { border-color: var(--accent); }
.related b { display: block; margin-bottom: 4px; }
.related span { color: var(--muted); font-size: 0.92rem; }

.with-shot { display: grid; grid-template-columns: 1fr auto; gap: 34px; align-items: start; margin-top: 8px; }
.with-shot img { width: 200px; height: auto; border-radius: 18px; border: 1px solid var(--border); }
.with-shot .shot-caption { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 10px; max-width: 200px; }
@media (max-width: 680px) {
  .with-shot { grid-template-columns: 1fr; gap: 24px; }
  .with-shot img { width: 176px; }
}

/* ---------- craving timer ---------- */

.timer-stage { display: grid; place-items: center; margin: 32px 0 8px; }
.timer-stage svg { width: min(320px, 78vw); height: auto; display: block; grid-area: 1/1; }
.timer-face { grid-area: 1/1; text-align: center; pointer-events: none; }

.ring-track { fill: none; stroke: var(--border); stroke-width: 6; }
.ring-progress {
  fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 50% 50%;
}
.breath { fill: var(--accent); opacity: 0.16; }
.breath-edge { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0.6; }

#phase { display: block; font-size: 1.15rem; font-weight: 600; margin-bottom: 4px; }
#remaining { display: block; font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
#hint { display: block; color: var(--muted); font-size: 0.86rem; margin-top: 6px; min-height: 1.2em; }

.timer-controls { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }
.btn {
  font: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer;
  padding: 13px 26px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
}
.btn:hover { filter: brightness(1.08); }
.btn.quiet { background: transparent; color: var(--text); border-color: var(--field-border); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.reasons { margin-top: 32px; }
.reasons label { display: block; font-size: 0.86rem; color: var(--muted); margin-bottom: 7px; }
.reasons textarea {
  width: 100%; min-height: 84px; resize: vertical;
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--field-border);
  border-radius: 10px; padding: 11px 12px;
}
.reasons textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.reason-echo { color: var(--text); font-size: 1rem; margin-top: 10px; min-height: 1.4em; }

.done-note { text-align: center; color: var(--muted); margin-top: 4px; }

@media (prefers-reduced-motion: reduce) {
  .breath, .ring-progress { transition: none !important; }
}

.sources { list-style: none; padding: 0; margin: 0; }
.sources li { margin: 0 0 16px; padding-left: 0; position: static; }
.sources li::before { content: none; }
.sources b { display: block; font-weight: 500; }
.sources .what { display: block; color: var(--muted); font-size: 0.92rem; margin-top: 3px; }
.checked-on { color: var(--faint); font-size: 0.85rem; margin-top: 20px; }

/* ---------- footer ---------- */

footer { border-top: 1px solid var(--border); margin-top: 44px; padding: 28px 0 48px; color: var(--muted); font-size: 0.9rem; }
footer a { margin-right: 18px; }
.disclaimer { font-size: 0.88rem; color: var(--muted); }

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