/* First Journal - shared stylesheet
   Mobile-first. Breakpoints: 480px, 768px, 1024px.
   Tailwind (CDN) is loaded with preflight off; every structural rule below is self-contained. */

:root {
  --ink: #111111;
  --text: #1f1f1f;
  --muted: #595959;
  --rule: #9a9a9a;
  --rule-soft: #d9d6d1;
  --paper: #ffffff;
  --tint: #f3ebe1;
  --accent: #8c5a2b;
  --accent-dark: #6b4220;
  --bar: #1a1a1a;
  --serif: "Times New Roman", Times, "Liberation Serif", Georgia, serif;
  --sans: "Helvetica Neue", Arial, Helvetica, "Liberation Sans", sans-serif;
  --gutter: 16px;
}

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

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

[x-cloak] { display: none !important; }

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

body.fj {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

:where(.fj) :where(img, video, svg) { max-width: 100%; }
:where(.fj) :where(img, video) { height: auto; display: block; }
:where(.fj) :where(h1, h2, h3, p, ul, ol, figure, blockquote, dl, dd) { margin: 0; }
:where(.fj) :where(ul, ol) { padding: 0; }
:where(.fj) a { color: inherit; }
:where(.fj) button { font: inherit; color: inherit; }

.fj :focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 100;
  background: var(--ink);
  color: #fff !important;
  padding: 12px 18px;
  font: 700 15px/1 var(--sans);
  text-decoration: none;
}
.skip-link:focus { top: 10px; }

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 60;
  transition: width 0.12s linear;
}

/* ---------- Masthead ---------- */

.masthead { border-bottom: 4px double var(--ink); }

.topbar {
  background: var(--bar);
  color: #fff;
  text-align: center;
  font: 700 11px/30px var(--serif);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.mast-row {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px var(--gutter);
}

.wordmark {
  display: inline-block;
  font: 700 clamp(26px, 5.5vw, 34px)/1.1 var(--serif);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  padding: 4px 0;
}
.wordmark:hover { color: var(--accent); }

/* ---------- Page shell ---------- */

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px var(--gutter) 48px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
}

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

.story h1 {
  font: 700 clamp(28px, 4.2vw + 6px, 40px)/1.3 var(--serif);
  color: #000;
  letter-spacing: -0.005em;
  margin-bottom: 22px;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  margin-bottom: 18px;
  font-size: 15px;
  line-height: 1.4;
}

.byline-who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--accent);
  display: grid;
  place-items: center;
  font: 700 13px/1 var(--serif);
  letter-spacing: 0.02em;
}

.byline .sep {
  display: inline-block;
  margin: 0 7px;
  color: #777;
}

.readtime {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Tinted call-out (dek + pull quote) */
.story .dek,
.story .pull {
  background: var(--tint);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.42);
  padding: 14px 16px;
  font: italic 17px/1.75 var(--sans);
  color: #1a1a1a;
}
.story .dek { margin: 0 0 24px; }
.story .pull { margin: 32px 0; font-size: 18px; }

/* ---------- Figures ---------- */

.figure { margin: 28px 0; }
.figure--hero { margin-top: 0; }

.figure img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #ddd;
}

.video-frame {
  aspect-ratio: 1200 / 630;
  width: 100%;
  background: #222;
  overflow: hidden;
}
.fj .video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figure figcaption {
  margin-top: 8px;
  font: italic 14px/1.5 var(--sans);
  color: var(--muted);
}

/* ---------- Article body ---------- */

.story p {
  margin-bottom: 1.1em;
  font-size: 17px;
  line-height: 1.8;
}

.story h2 {
  font: 700 clamp(22px, 1.6vw + 16px, 27px)/1.3 var(--serif);
  color: #000;
  margin: 2.1em 0 0.7em;
  scroll-margin-top: 20px;
}

.story strong { color: #000; }

.story a.inline {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.story ul.plain {
  list-style: none;
  margin: 0 0 1.4em;
}
.story ul.plain li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 0.85em;
  line-height: 1.75;
}
.story ul.plain li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.lead-in {
  font-weight: 700;
  color: #000;
}

/* Four steps: soft tiles, two-up from 768px */
.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 26px 0 30px;
}
.steps li {
  counter-increment: step;
  position: relative;
  background: var(--tint);
  border-radius: 4px;
  padding: 18px 18px 18px 70px;
  min-height: 92px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font: 700 18px/1 var(--serif);
}
.steps strong {
  display: block;
  font: 700 19px/1.3 var(--serif);
  margin-bottom: 4px;
}
.steps span {
  display: block;
  font: 15px/1.55 var(--sans);
  color: #3d3d3d;
}

/* ---------- Calls to action ---------- */

.cta-block {
  margin: 38px 0;
  padding: 28px 0;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  text-align: center;
}
.story .cta-lead {
  font: 700 clamp(20px, 1vw + 17px, 24px)/1.3 var(--serif);
  color: #000;
  margin: 0 0 16px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  width: 100%;
  min-height: 54px;
  padding: 14px 22px;
  background: var(--accent);
  color: #fff !important;
  font: 700 18px/1.25 var(--serif);
  text-align: center;
  text-decoration: none !important;
  border-radius: 8px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
  transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}
.btn:active { transform: translateY(0); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18); }
.btn .arrow { transition: transform 0.18s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.fj .btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.btn--end {
  min-height: 60px;
  font-size: 20px;
}

/* ---------- FAQ (Alpine accordion) ---------- */

.rule-double {
  border: 0;
  border-top: 4px double var(--ink);
  margin: 44px 0 0;
  height: 0;
}

.faq { margin: 0 0 8px; border-top: 1px solid var(--rule); }
.faq-item { border-bottom: 1px solid var(--rule-soft); }
.faq-q {
  position: relative;
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 16px 44px 16px 0;
  background: none;
  border: 0;
  text-align: left;
  font: 700 18px/1.4 var(--serif);
  cursor: pointer;
  color: #000;
  transition: color 0.15s ease;
}
.faq-q:hover { color: var(--accent); }
.faq-q::after {
  content: "+";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font: 400 28px/1 var(--sans);
  color: var(--accent);
}
.faq-q[aria-expanded="true"]::after { content: "\2212"; }
.story .faq-a { padding: 0 0 18px; margin: 0; font-size: 17px; }

/* ---------- Right rail (desktop only) ---------- */

.rail { display: none; }

.rail-title {
  font: 700 22px/1.25 var(--serif);
  color: #000;
  margin-bottom: 10px;
}

.toc { list-style: none; margin: 0 0 22px; border-top: 1px solid var(--rule-soft); }
.toc li { border-bottom: 1px solid var(--rule-soft); }
.toc a {
  display: block;
  padding: 6px 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s ease, padding-left 0.15s ease;
}
.toc a:hover { color: var(--accent); padding-left: 4px; }

.rail-card {
  text-align: center;
  border-top: 1px solid var(--rule);
  padding-top: 20px;
}
.card-title {
  font: 700 22px/1.25 var(--serif);
  color: #000;
  margin-bottom: 12px;
}
.card-art {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 12px;
}
.card-text {
  font: 14px/1.5 var(--sans);
  color: var(--muted);
  margin-bottom: 14px;
}

/* ---------- Footer (publisher imprint) ---------- */

.site-foot {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px var(--gutter) 56px;
  font: 13px/1.65 var(--sans);
  color: var(--muted);
  background: none;
  border: 0;
}
.site-foot .org { margin-bottom: 6px; }
.site-foot .org p { margin: 0 0 0.6em; }
.site-foot .org strong { color: #333; }
.site-foot .legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  margin: 10px 0 14px;
}
.site-foot .legal a {
  display: inline-block;
  padding: 12px 0;
  color: #333;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-foot .legal a:hover { color: var(--accent-dark); }
.site-foot .imprint-line {
  margin: 0;
  max-width: 72ch;
  color: var(--muted);
}

/* ---------- Legal / about pages ---------- */

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px var(--gutter) 24px;
}
.doc .back {
  display: inline-block;
  padding: 10px 0;
  font: 15px/1.4 var(--sans);
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.doc h1 {
  font: 700 clamp(28px, 4vw + 8px, 38px)/1.25 var(--serif);
  color: #000;
  margin: 10px 0 10px;
}
.doc .updated {
  font: 14px/1.5 var(--sans);
  color: var(--muted);
  padding-bottom: 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.doc h2 {
  font: 700 clamp(20px, 1.4vw + 15px, 24px)/1.3 var(--serif);
  color: #000;
  margin: 1.9em 0 0.5em;
}
.doc p {
  font-size: 17px;
  line-height: 1.75;
  margin-bottom: 1em;
}
.doc ul {
  list-style: none;
  margin: 0 0 1.2em;
}
.doc ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 0.6em;
  line-height: 1.7;
}
.doc ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.doc a:not(.back) {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.doc address {
  font-style: normal;
  background: var(--tint);
  padding: 16px 18px;
  margin: 0 0 1.2em;
  line-height: 1.7;
}

/* ---------- 480px ---------- */

@media (min-width: 480px) {
  .btn { width: auto; min-width: 280px; display: inline-flex; padding-left: 34px; padding-right: 34px; }
  .rail .btn { display: flex; width: 100%; min-width: 0; }
  .story .dek { font-size: 18px; padding: 16px 20px; }
  .story .pull { padding: 18px 22px; }
}

/* ---------- 768px ---------- */

@media (min-width: 768px) {
  body.fj { font-size: 18px; }
  .topbar { font-size: 12px; }
  .mast-row { padding: 14px 30px; }
  .page { padding: 44px 30px 72px; }
  .site-foot { padding: 44px 30px 64px; }
  .story h1 { margin-bottom: 28px; line-height: 1.35; }
  .story p { font-size: 18px; }
  .byline { padding-top: 20px; margin-bottom: 22px; font-size: 16px; }
  .story .dek { font-size: 19px; margin-bottom: 30px; }
  .story .pull { font-size: 20px; }
  .figure { margin: 36px 0; }
  .story h2 { margin-top: 2.3em; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .steps li { padding: 22px 20px 20px 74px; }
  .steps li::before { left: 20px; top: 22px; }
  .cta-block { padding: 34px 0; margin: 46px 0; }
  .faq-q { font-size: 19px; }
  .story .faq-a { font-size: 18px; }
  .doc { padding-top: 44px; }
}

/* ---------- 1024px ---------- */

@media (min-width: 1024px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 335px;
    gap: 50px;
  }
  .story { padding-right: 0; }
  .rail {
    display: block;
    position: sticky;
    top: 24px;
    align-self: start;
  }
  .byline { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .btn .arrow, .progress, .toc a, .faq-q { transition: none; }
}
