/* Longsleeve shared base. Rules byte-identical across all pages live here,
   so the masthead, footer, newsletter, design tokens and reset change in ONE place.
   Loaded before each page's inline <style>, so page-specific rules still override. */

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/sourceserif4.woff2") format("woff2");
}

:root {
  --paper: #f1ecdf;
  --paper-deep: #e8e1cf;
  --ink: #1a1612;
  --ink-soft: #4a3f33;
  --ink-mute: #6a5b46;
  --accent: #1f3d1a;
  --accent-soft: #2c5527;
  --caution: #8a2a1a;
  --hairline: rgba(26,22,18,0.18);
  --hairline-dark: rgba(26,22,18,0.32);
  --serif: "Iowan Old Style", "Hoefler Text", Charter, Baskerville, Georgia, serif;
  --display: "Source Serif 4", "Times New Roman", Times, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --max: 66rem;
  --col: 38rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4.75rem; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.55;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.085  0 0 0 0 0.07  0 0 0 0.05 0'/></filter><rect width='240' height='240' filter='url(%23g)'/></svg>");
}

a { color: inherit; text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 0.04em; text-decoration-color: rgba(26,22,18,0.35); }

a:hover { text-decoration-color: var(--ink); }

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

.skip {
  position: absolute; left: 0.5rem; top: -3.5rem;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; border-radius: 3px;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none; z-index: 200;
}

.skip:focus { top: 0.5rem; }

:focus { outline: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
/* Visible keyboard focus on the purchase controls (radio inputs are visually hidden) */
.opt:has(input:focus-visible),
.pack:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Flip the focus ring to paper-tone where it sits on dark or forest-green surfaces */
.closing :focus-visible,
.pull-overlay :focus-visible { outline-color: var(--paper); }

/* Canonical display tracking. Pages may override size/line-height, not this. */
h1, h2 { letter-spacing: -0.02em; }

p { margin: 0 0 1.05rem; text-wrap: pretty; }

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

.mast {
  position: sticky; top: 0; z-index: 100;
  background: rgba(241,236,223,0.92);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--hairline);
}

.mast-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex; align-items: center; gap: 1.6rem;
}

.brand .dot { color: var(--accent); }
.brand-logo { height: 1.7rem; width: auto; display: block; }

.mast-nav a { text-decoration: none; color: var(--ink-soft); }

.pill:hover { background: var(--accent); }

.burger {
  display: none; background: none; border: 0; padding: 0.45rem; cursor: pointer; line-height: 0;
}

.burger span { display: block; width: 22px; height: 1.5px; background: var(--ink); margin: 5px 0; transition: transform 0.25s, opacity 0.2s; }

body.nav-open { overflow: hidden; }

body.nav-open .burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }

body.nav-open .burger span:nth-child(2) { opacity: 0; }

body.nav-open .burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.drawer {
  position: fixed; inset: 0; z-index: 99;
  background: var(--paper);
  display: none; flex-direction: column;
  padding: 5.5rem 2rem 2.5rem;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}

.drawer a {
  font-size: clamp(1.8rem, 6vw, 2.5rem); letter-spacing: -0.022em;
  text-decoration: none; padding: 0.85rem 0;
  border-bottom: 1px solid var(--hairline);
}

body.nav-open .drawer { display: flex; }

@media (max-width: 780px) {
  /* .mast .mast-nav (2 classes) beats each page's inline `.mast-nav` base rule
     regardless of source order, since the inline rule loads after this file. */
  .mast .mast-nav { display: none; }
  .burger { display: block; padding: 0.7rem; }
  /* The buy pill stays. Sticky "Get a tube" is reachable everywhere, including phones. */
  .mast .pill { padding: 0.72rem 1.05rem; font-size: 0.92rem; }
}

.folio span:nth-child(2) { text-align: center; }

.folio span:last-child { text-align: right; }

@media (max-width: 640px) { .folio span:nth-child(2) { display: none; } }

.colo-inner { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 2rem; }

@media (max-width: 780px) { .colo-inner { grid-template-columns: 1fr; } }

.colophon a { color: var(--ink-soft); }

/* ---- founder signature: draws itself on scroll (founder-track.js adds .sig-prep, then .signed) ---- */
.sig-ink { display: block; }
.sig-ink img {
  display: block; width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(105deg, #000 44%, rgba(0,0,0,0) 56%);
  mask-image: linear-gradient(105deg, #000 44%, rgba(0,0,0,0) 56%);
  -webkit-mask-size: 250% 100%; mask-size: 250% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 0% 0; mask-position: 0% 0;
}
.sig-ink.sig-prep img { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
.sig-ink.sig-prep.signed img {
  -webkit-mask-position: 0% 0; mask-position: 0% 0;
  transition: -webkit-mask-position 1.15s cubic-bezier(0.65, 0.05, 0.36, 1) 0.2s;
  transition: mask-position 1.15s cubic-bezier(0.65, 0.05, 0.36, 1) 0.2s;
}
@media (prefers-reduced-motion: reduce) {
  .sig-ink img, .sig-ink.sig-prep img, .sig-ink.sig-prep.signed img {
    -webkit-mask-image: none; mask-image: none; transition: none;
  }
}

/* ---- masthead pill: never wrap (was breaking to two lines at phone widths) ---- */
.pill { white-space: nowrap; }
@media (max-width: 480px) {
  .pill { padding: 0.45rem 0.7rem; letter-spacing: 0.08em; font-size: 0.62rem; }
  .mast-inner { gap: 0.6rem; padding-left: 1.1rem; padding-right: 1.1rem; }
  .mast-nav { display: none; }
}

/* ---- footer: avoid single-word orphan lines ---- */
.colophon .colo-inner > div { text-wrap: pretty; }


/* ---- smart masthead: hides on scroll-down, returns on scroll-up (phones only) ---- */
.mast { transition: transform 0.28s ease; }
@media (max-width: 899px) {
  .mast.mast-hidden { transform: translateY(-100%); }
}

/* ---- waitlist form status (assets/waitlist.js) ---- */
.form-status { margin: 0.6rem 0 0; font-size: 0.95rem; line-height: 1.5; }
.form-status:empty { display: none; margin: 0; }
.form-status.is-ok { font-family: var(--serif); font-style: italic; color: var(--accent); }
.form-status.is-err { color: #8a2b1d; }
.form-status.is-err a { color: inherit; }
