/* ==========================================================================
   The Fasting Carnivore — thefastingcarnivore.com
   Hand-authored, no framework. Shared by index.html, app.html and /journal.

   Every text colour below is checked against its background:
   --muted 7.87:1 · --accent 10.49:1 · ink-on-accent-solid 7.95:1
   (the previous build used slate-500 at 4.24:1, which failed AA)
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #020617;
  --surface: #0b1220;
  --surface-2: #0f172a;
  --border: #1e293b;
  --border-lit: #2b3a52;

  --text: #e2e8f0;
  --text-strong: #f8fafc;
  --muted: #94a3b8;

  --accent: #34d399;        /* text + icons on dark — 10.49:1 */
  --accent-solid: #10b981;  /* button fills, with dark ink on top — 7.95:1 */
  --amber: #fbbf24;
  --rose: #fca5a5;

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shell: 1120px;
  --pad: clamp(20px, 5vw, 40px);
  --radius: 14px;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
  scroll-padding-top: 88px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; z-index: 60;
  background: var(--accent-solid); color: #04140d;
  padding: 12px 18px; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 14px; left: 14px; }

.shell { max-width: var(--shell); margin-inline: auto; padding-inline: var(--pad); }

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

h1, h2, h3, h4 { color: var(--text-strong); line-height: 1.12; letter-spacing: -0.025em; }
h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(27px, 4vw, 40px); font-weight: 800; }
h3 { font-size: clamp(19px, 2.2vw, 23px); font-weight: 700; letter-spacing: -0.015em; }
h4 { font-size: 16px; font-weight: 700; }

p { margin-bottom: 1.05em; }
p:last-child { margin-bottom: 0; }

.kicker {
  display: block; margin-bottom: 14px;
  color: var(--accent); font-size: 12px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.lede { max-width: 62ch; color: var(--text); font-size: clamp(18px, 2.1vw, 21px); line-height: 1.6; }
.muted { color: var(--muted); }
.prose { max-width: 68ch; color: var(--muted); }
.prose strong { color: var(--text); font-weight: 650; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.small { font-size: 14.5px; line-height: 1.6; }

/* ---------- nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.86);
  backdrop-filter: blur(12px);
}
.nav-in {
  display: flex; align-items: center; gap: 16px;
  max-width: var(--shell); margin-inline: auto;
  padding: 12px var(--pad); min-height: 64px;
}
.logo { display: flex; align-items: center; gap: 10px; margin-right: auto;
        min-height: 44px; padding-right: 6px;
        color: var(--text-strong); font-weight: 700; letter-spacing: -0.02em; }
.logo svg { flex: none; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 12px; border-radius: 9px;
  color: var(--muted); font-size: 15px; font-weight: 550;
  transition: color .18s, background .18s;
}
.nav-links a:hover { color: var(--text-strong); background: var(--surface-2); }
.nav-cta {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 18px; border-radius: 999px;
  background: var(--accent-solid); color: #04140d;
  font-size: 15px; font-weight: 700;
  transition: filter .18s, transform .18s;
}
.nav-cta:hover { filter: brightness(1.08); }
@media (max-width: 760px) {
  .nav-links { display: none; }
}

/* ---------- layout blocks ---------- */

section { scroll-margin-top: 84px; }
.band { padding: clamp(56px, 8vw, 104px) 0; }
.band + .band { border-top: 1px solid var(--border); }
.band-tint { background:
  radial-gradient(1000px 420px at 12% 0%, rgba(16,185,129,.07), transparent 62%),
  var(--bg); }

.head { max-width: 62ch; margin-bottom: clamp(28px, 4vw, 44px); }
.head p { color: var(--muted); }

.split {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 64px); align-items: start;
}
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* ---------- hero ---------- */

.hero { padding: clamp(48px, 8vw, 92px) 0 clamp(44px, 6vw, 76px); }
.hero .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tag {
  border: 1px solid var(--border-lit); border-radius: 999px;
  padding: 5px 13px; color: var(--muted);
  font-size: 12.5px; font-weight: 600; letter-spacing: .01em;
}
.hero h1 { margin-bottom: 20px; max-width: 17ch; }
.hero .lede { margin-bottom: 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 50px; padding: 0 24px; border-radius: 999px;
  border: 1px solid transparent;
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: filter .18s, background .18s, border-color .18s;
}
.btn-primary { background: var(--accent-solid); color: #04140d; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { border-color: var(--border-lit); background: transparent; color: var(--text-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .55; cursor: progress; }

/* ---------- cards ---------- */

.cards { display: grid; gap: 16px; }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .cards-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .cards-3, .cards-2 { grid-template-columns: 1fr; } }

.card {
  min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 24px;
}
.card h3 { margin-bottom: 9px; }
.card p { color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.card .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; margin-bottom: 14px; border-radius: 9px;
  background: rgba(16,185,129,.13); color: var(--accent);
  font-family: var(--mono); font-size: 13px; font-weight: 700;
}

/* ---------- fact rows ---------- */

.rows { border-top: 1px solid var(--border); }
.row {
  display: grid; grid-template-columns: 190px minmax(0, 1fr);
  gap: 8px 32px; padding: 22px 0; border-bottom: 1px solid var(--border);
}
.row dt { color: var(--text-strong); font-weight: 700; }
.row dd { color: var(--muted); }
@media (max-width: 700px) { .row { grid-template-columns: 1fr; } }

/* ---------- callouts ---------- */

.note {
  border: 1px solid var(--border-lit); border-left: 3px solid var(--accent);
  border-radius: 10px; background: var(--surface);
  padding: 20px 22px; color: var(--muted); font-size: 15.5px; line-height: 1.65;
}
.note.warn { border-left-color: var(--amber); }
.note.stop { border-left-color: var(--rose); }
.note h3, .note h4 { margin-bottom: 8px; color: var(--text-strong); }
.note ul { margin: 8px 0 0; padding-left: 20px; }
.note li { margin-bottom: 6px; }

.evidence {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-lit); border-radius: 999px;
  padding: 3px 11px; margin-bottom: 12px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.evidence::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ev-good { color: var(--accent); }
.ev-mixed { color: var(--amber); }
.ev-mine { color: #a5b4fc; }

/* ---------- app teaser ---------- */

.appcard {
  border: 1px solid var(--border-lit); border-radius: 18px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  padding: clamp(22px, 3vw, 30px);
}
.ring { display: grid; place-items: center; margin: 0 auto 18px;
        width: 168px; height: 168px; border-radius: 50%;
        background: conic-gradient(var(--accent) 0 78%, #1e293b 78% 100%); }
.ring-in { display: grid; place-items: center; width: 138px; height: 138px;
           border-radius: 50%; background: var(--surface-2); text-align: center; }
.ring-time { font-family: var(--mono); font-size: 27px; font-weight: 700; color: var(--accent); }
.ring-sub { color: var(--muted); font-size: 12.5px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.stat { border: 1px solid var(--border); border-radius: 11px; background: var(--bg);
        padding: 12px 10px; text-align: center; }
.stat b { display: block; font-size: 17px; color: var(--text-strong); }
.stat span { color: var(--muted); font-size: 12px; }

.checks { list-style: none; margin-top: 6px; }
.checks li { position: relative; padding-left: 28px; margin-bottom: 11px;
             color: var(--muted); font-size: 15.5px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .45em;
  width: 15px; height: 8px; border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}

/* ---------- signup ---------- */

.signup {
  border: 1px solid var(--border-lit); border-radius: 18px;
  background: var(--surface); padding: clamp(24px, 4vw, 40px);
}
.signup-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.signup-form input[type=email] {
  flex: 1 1 260px; min-height: 50px; min-width: 0;
  border: 1px solid var(--border-lit); border-radius: 999px;
  background: var(--bg); padding: 0 20px; font-size: 16px;
}
.signup-form input::placeholder { color: #64748b; }
.signup-form input:focus { border-color: var(--accent); }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden;
      clip-path: inset(50%); white-space: nowrap; }
.form-status { width: 100%; min-height: 1.4em; margin-top: 12px; font-size: 14.5px; }
.form-status.ok { color: var(--accent); }
.form-status.err { color: var(--rose); }
.form-status a { color: var(--accent); text-decoration: underline; }

/* ---------- disclaimer + footer ---------- */

.disclaimer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: clamp(34px, 5vw, 52px) 0;
}
.disclaimer .prose { color: var(--muted); font-size: 15px; }

.foot { border-top: 1px solid var(--border); padding: 36px 0 44px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: center;
           justify-content: space-between; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px;
                padding: 0 10px; color: var(--muted); font-size: 14.5px; }
.foot-links a:hover { color: var(--accent); }
.foot-note { color: var(--muted); font-size: 14px; }

/* ---------- journal ---------- */

.post-list { list-style: none; border-top: 1px solid var(--border); }
.post-list li { border-bottom: 1px solid var(--border); }
.post-list a { display: grid; grid-template-columns: 130px minmax(0,1fr);
               gap: 6px 28px; padding: 24px 0; transition: padding .2s; }
.post-list a:hover { padding-left: 10px; }
.post-list time { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.post-list h3 { margin-bottom: 6px; }
.post-list p { color: var(--muted); font-size: 15.5px; }
@media (max-width: 700px) { .post-list a { grid-template-columns: 1fr; } }

.article { max-width: 68ch; }
.article h2 { margin: 44px 0 14px; font-size: clamp(23px, 3vw, 30px); }
.article h3 { margin: 30px 0 10px; }
.article p, .article li { color: var(--muted); }
.article ul, .article ol { margin: 0 0 1.05em; padding-left: 22px; }
.article li { margin-bottom: 8px; }
.article a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article .note { margin: 26px 0; }
.byline { color: var(--muted); font-size: 14.5px; margin-bottom: 30px; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
