/* ==========================================================================
   BASE — reset, typography, layout primitives
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html.no-motion { scroll-behavior: auto; }

body {
  background: var(--sand);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

/* ---- Headings ----
   Fraunces is a serif, so it wants far less negative tracking than the
   grotesque it replaced. SOFT rounds the terminals and WONK swaps in the
   friendlier single-storey shapes — this is the friendliness dial. */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  font-variation-settings: "SOFT" 60, "WONK" 1;
  line-height: 1.06;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h1 { font-weight: 800; }
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); letter-spacing: -0.015em; }

p { text-wrap: pretty; }

a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

::selection { background: var(--citrus); color: var(--ink); }

/* ---- Focus: always visible, never removed ---- */
:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---- Layout ---- */
.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}
.wrap--narrow { width: min(100% - 2.5rem, var(--wrap-narrow)); }

.section { padding-block: var(--sp-7); }
.section--tight { padding-block: var(--sp-6); }

.section--dark {
  background: var(--teal);
  color: var(--sand);
  position: relative;
  overflow: hidden;
}
.section--dark h2, .section--dark h3 { color: var(--white); }
.section--dark a { color: var(--citrus); }

.section--sand2 { background: var(--sand-2); }

/* ---- Eyebrow ---- */
.eyebrow {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral-dark);
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--coral);
  flex: none;
}
.section--dark .eyebrow { color: var(--citrus); }
.section--dark .eyebrow::before { background: var(--citrus); }

/* ---- Lead / muted text ---- */
.lead {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--muted);
  max-width: 58ch;
}
.section--dark .lead { color: rgba(251,243,230,.82); }

.muted { color: var(--muted); }
.mono  { font-family: var(--mono); }

/* ---- Accent word in a headline (one per headline, max) ---- */
.accent { color: var(--coral); }
.section--dark .accent { color: var(--citrus); }

/* ---- Handwritten flourish ----
   Postcard voice. Decorative only — never load-bearing information, and
   never below ~1.3rem or it stops being legible. */
.script {
  font-family: var(--script);
  font-weight: 600;
  font-size: 1.45em;
  line-height: 0.9;
  letter-spacing: 0.005em;
  color: var(--coral);
  display: inline-block;
  transform: rotate(-2.2deg);
}
.section--dark .script { color: var(--citrus); }

/* ---- Stamp ----
   The "FREE / TAKE ONE" rubber-stamp motif from the reference. Tilted,
   punched out of amber, deliberately a little imperfect. */
.stamp {
  display: inline-grid;
  place-items: center;
  text-align: center;
  gap: 1px;
  padding: 0.6rem 0.9rem;
  background: var(--citrus);
  color: var(--ink);
  border: var(--bw-2) dashed var(--line);
  border-radius: var(--r-sm);
  transform: rotate(-5deg);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.35;
}
.stamp strong {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  line-height: 1;
}

/* ---- Dashed divider — the torn-coupon rule ---- */
.rule-dashed {
  border: 0;
  border-top: var(--bw-2) dashed var(--rule-strong);
  margin-block: var(--sp-4);
}

/* ---- Section head ---- */
.sec-head { max-width: 62ch; margin-bottom: var(--sp-5); }
.sec-head--center { margin-inline: auto; text-align: center; }
.sec-head--center .eyebrow { justify-content: center; }

/* ---- Utility ---- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.visually-hidden:focus {
  position: fixed;
  top: 12px; left: 12px;
  width: auto; height: auto;
  clip: auto; clip-path: none;
  background: var(--ink);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  border-radius: var(--r-sm);
  z-index: 9999;
}

.stack > * + * { margin-top: var(--sp-3); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---- Demo notice — this is a sample publication ---- */
.demo-bar {
  background: var(--ink);
  color: var(--sand);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.5rem 1rem;
  line-height: 1.4;
}
.demo-bar strong { color: var(--citrus); font-weight: 500; }
