/* ============================================================
   Sub-Etha Press — subethapress.com
   Shared production stylesheet. Mobile-first, fluid, no build step.
   ============================================================ */

:root {
  --bg:          #0F1D16;
  --surface:     #16271D;
  --border:      #2C4A38;
  --accent-dark: #1E3428;
  --text:        #F4F7F1;
  --muted:       #A6B8AB;
  --dim:         #869A8D;  /* lightened from comp #6E8377 to clear WCAG AA (4.5:1) for small secondary text */
  --gold:        #C6A15A;
  --gold-hover:  #D9B872;

  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans:  'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --gutter: 24px;
  --maxw-wide:  880px;  /* hero, showcase, footer */
  --maxw-prose: var(--measure);  /* landing text sections   */
  --maxw-legal: 720px;  /* legal documents         */

  /* type + spacing scale (#3 tokenization) */
  --tracking-caps: 0.2em;
  --text-body: 15px;
  --text-sm:   13px;
  --measure:   500px;   /* reading-column line-length cap (~66ch, matches the book-card blurb measure) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
}

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

/* The hidden attribute must always win, even over class display rules
   (state panels use display:flex; without this they'd render while hidden) */
[hidden] { display: none !important; }

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

html, body { margin: 0; padding: 0; background: var(--bg); }

body {
  font-family: var(--sans);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--gold); color: var(--bg); }

img { max-width: 100%; display: block; }

a {
  color: var(--gold);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Page shell ---------- */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--gutter);
}

main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wide  { width: 100%; max-width: var(--maxw-wide);  }
.prose { width: 100%; max-width: var(--maxw-prose); }
.legal { width: 100%; max-width: var(--maxw-legal); }

.rule { width: 56px; height: 1px; background: var(--border); border: 0; }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--dim);
  margin: 0;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(72px, 12vh, 128px) 0 clamp(56px, 9vh, 96px);
}
.hero__mark { opacity: 0.5; margin-bottom: 28px; }
.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: 0.005em;
  margin: 0;
}
.hero__kicker {
  font-size: clamp(11px, 1.4vw, 13px);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--dim);
  margin: var(--space-2) 0 0;
}
.hero__lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 2.6vw, 25px);
  line-height: 1.5;
  color: var(--muted);
  max-width: 560px;
  margin: 0;
  text-wrap: pretty;
}
.hero .rule { margin: 36px 0; }

/* ---------- Book showcase ---------- */
.showcase {
  width: 100%;
  max-width: var(--maxw-wide);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: clamp(28px, 5vw, 56px);
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 5vw, 56px);
  justify-content: center;
}
.showcase__cover { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; }
.book-cover {
  width: clamp(160px, 22vw, 216px);
  height: auto;              /* let aspect-ratio drive height; HTML height attr must not win */
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 24px 48px -16px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.4);
}
.showcase__info { flex: 1 1 320px; min-width: 260px; display: flex; flex-direction: column; }
.showcase__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4.2vw, 40px);
  line-height: 1.12;
  margin: 0;
}
.showcase__byline { font-size: var(--text-sm); color: var(--dim); margin: 10px 0 0; }
.showcase__byline em { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--muted); }
.showcase__desc {
  font-size: var(--text-body);
  font-weight: 300;
  line-height: 1.7;
  color: var(--muted);
  margin: var(--space-3) 0 0;
  text-wrap: pretty;
}

/* ---------- Pricing ---------- */
.pricing {
  display: flex;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin: 26px 0 0;
}
.pricing__cell { flex: 1; background: var(--surface); padding: 14px 8px; text-align: center; }
.pricing__label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--dim);
}
.pricing__value { font-family: var(--serif); font-size: 24px; color: var(--text); margin-top: var(--space-1); }

/* ---------- Buttons ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
}
button.btn { font-family: inherit; border: 0; cursor: pointer; }
.btn--primary { background: var(--gold); color: var(--bg); }
.btn--ghost { background: transparent; color: var(--gold); border: 1px solid var(--gold); font-weight: 500; }
.btn--disabled {
  background: var(--accent-dark);
  color: var(--dim);
  border: 1px solid var(--border);
  cursor: default;
  user-select: none;
}

/* ---------- Email capture (pre-launch) ---------- */
.capture { margin: 28px 0 0; }
.capture__lede {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 14px;
  text-wrap: pretty;
}
.capture__row { display: flex; flex-wrap: wrap; gap: 12px; }
.capture__io { display: flex; gap: 10px; flex: 1 1 340px; min-width: 0; }
.capture__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 0 16px;
  background: var(--accent-dark);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  border: 1px solid #547A63;  /* lighter than --border to clear WCAG 3:1 non-text contrast on --surface */
  border-radius: 4px;
}
.capture__input::placeholder { color: var(--muted); }
.capture__input:focus { border-color: var(--gold); }
.capture__input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn--submit { flex: 0 0 auto; min-width: 132px; gap: 9px; }
.btn--submit[disabled] { cursor: default; opacity: 0.85; }
.capture__spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(15, 29, 22, 0.3);
  border-top-color: #0F1D16;
  border-radius: 50%;
  animation: capture-spin 0.7s linear infinite;
}
@keyframes capture-spin { to { transform: rotate(360deg); } }
/* Turnstile container: invisible on the happy path (interaction-only). Full-width
   so a rendered challenge aligns to the input/buttons above it; a reserved
   min-height so an appearing/disappearing challenge never shifts the layout;
   top margin on the form's 8px spacing scale. Widget uses size:flexible to fill. */
.capture__turnstile {
  width: 100%;
  box-sizing: border-box;
  margin-top: var(--space-2);
  min-height: 66px;
}
.capture__error { font-size: 12.5px; color: var(--gold); margin: 10px 0 0; }

/* send-error panel — amber variant */
.capture__sendfail {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 14px 0 0;
  padding: 13px 16px;
  background: #241E1A;
  border: 1px solid #5A4632;
  border-radius: 4px;
}
.capture__sendfail p { margin: 0; font-size: 13px; line-height: 1.55; color: #C9B79E; text-wrap: pretty; }
.capture__sendfail strong { color: #E4C88F; font-weight: 600; }
.capture__sendfail em { font-family: var(--serif); font-style: italic; color: #E4C88F; }

/* success / already-subscribed confirmation */
.capture__done { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.capture__confirm {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 340px;
  min-width: 0;
  padding: 13px 18px;
  background: var(--accent-dark);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.capture__confirm p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.capture__confirm strong { color: var(--text); font-weight: 600; }

/* honeypot — visually hidden and unfocusable, but present in the DOM for bots
   (clip pattern, NOT display:none, so naive bots still see and fill it) */
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 404 ---------- */
.notfound {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(48px, 10vh, 96px) 0;
}
.notfound__inner { width: 100%; max-width: 600px; display: flex; flex-direction: column; align-items: center; }
.notfound__mark { opacity: 0.5; margin-bottom: 30px; }
.notfound__code {
  font-size: clamp(11px, 1.4vw, 13px);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--dim);
  margin: 0;
}
.notfound__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(52px, 9vw, 92px);
  line-height: 1;
  letter-spacing: 0.005em;
  margin: 22px 0 0;
}
.notfound__lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(19px, 2.6vw, 25px);
  line-height: 1.5;
  color: var(--muted);
  max-width: 520px;
  margin: 20px 0 0;
  text-wrap: pretty;
}
.notfound .rule { margin: 36px 0; }
.notfound__body {
  font-size: var(--text-body);
  font-weight: 300;
  line-height: 1.7;
  color: var(--muted);
  max-width: var(--measure);
  margin: 0;
  text-wrap: pretty;
}
.notfound__ctas { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 38px 0 0; }
.notfound__tag { font-size: var(--text-sm); color: var(--dim); margin: clamp(48px, 9vh, 88px) 0 0; line-height: 1.7; text-wrap: pretty; }

/* ---------- Landing prose sections ---------- */
.section { width: 100%; max-width: var(--maxw-prose); text-align: left; padding: clamp(64px, 10vh, 104px) 0 0; }
.section__body {
  font-size: var(--text-body);
  font-weight: 300;
  line-height: 1.7;
  color: var(--muted);
  text-align: left;
  margin: var(--space-3) 0 0;
  text-wrap: pretty;
}
.section__body + .section__body { margin-top: var(--space-2); }

.contact { padding: clamp(64px, 10vh, 104px) 0; }
.contact .rule { margin: 0 0 36px; }
.contact__body { font-size: var(--text-body); font-weight: 300; line-height: 1.7; color: var(--muted); margin: 0; }
.link-gold { color: var(--gold); text-decoration: none; border-bottom: 1px solid var(--border); }

/* ---------- Footer ---------- */
.site-footer {
  width: 100%;
  max-width: var(--maxw-wide);
  border-top: 1px solid var(--border);
  padding: 40px 0 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; }
.site-footer nav a { font-size: var(--text-sm); color: var(--muted); text-decoration: none; padding: 6px 0; }
.site-footer p { font-size: var(--text-sm); color: var(--dim); margin: 0; line-height: 1.7; text-wrap: pretty; }

/* ============================================================
   LEGAL PAGES
   ============================================================ */
.legal { padding: 40px 0 96px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
  padding: 6px 4px;
  margin-left: -4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dim);
  text-decoration: none;
}

.legal h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 52px);
  line-height: 1.1;
  margin: 48px 0 0;
}
.legal__meta { font-size: var(--text-sm); color: var(--dim); margin: 16px 0 0; }
.legal .rule { margin: 36px 0 40px; }
.legal .rule:last-of-type { margin: 56px 0 24px; }

/* Legal closing line — fine print, not body copy */
.legal__foot { font-size: var(--text-sm); color: var(--dim); }
.legal__foot a { color: var(--dim); border-bottom: 0; }

.legal h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 27px;
  color: var(--text);
  margin: 44px 0 14px;
}
.legal h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  margin: 30px 0 12px;
}
.legal p, .legal li {
  font-size: var(--text-body);
  font-weight: 300;
  line-height: 1.8;
  color: var(--muted);
}
.legal p { margin: 0 0 16px; }
.legal ul { margin: 0 0 16px; padding-left: 22px; }
.legal li { margin-bottom: 8px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal em { font-style: italic; }
.legal a { color: var(--gold); text-decoration: none; border-bottom: 1px solid var(--border); }

/* Legal data tables — dark cells with gridlines; scroll horizontally on phones */
.table-wrap { overflow-x: auto; margin: 0 0 16px; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 4px; }
.legal table { width: 100%; min-width: 480px; border-collapse: collapse; }
.legal th {
  background: var(--accent-dark);
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
}
.legal td {
  background: var(--surface);
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--muted);
  vertical-align: top;
}
.legal tbody tr + tr td { border-top: 1px solid var(--border); }
.legal th + th, .legal td + td { border-left: 1px solid var(--border); }

/* ============================================================
   SHARED DOC LAYOUT (press.html + brand-guide.html)
   ============================================================ */
/* ---------- Shared doc/press/brand-guide layout ---------- */
/* Consolidated here so press.css and brand-guide.css don't duplicate these
   byte-identical rules. Selectors that DIFFER between the two pages
   (.title-row, .section-lede, .tile-grid, .panel) intentionally stay in
   their page-specific CSS. */
.title-row__mark { opacity: 0.5; flex: 0 0 auto; }

.doc-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 60px);
  line-height: 1.02;
  letter-spacing: 0.005em;
  margin: 0;
}
.doc-kicker {
  font-size: clamp(11px, 1.4vw, 13px);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--dim);
  margin: 14px 0 0;
}
.doc-lede {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(18px, 2.4vw, 23px);
  line-height: 1.5;
  color: var(--muted);
  max-width: 620px;
  margin: 0;
  text-wrap: pretty;
}
.doc-section { width: 100%; max-width: var(--maxw-wide); padding: clamp(64px, 10vh, 104px) 0 0; }
.doc-h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.12;
  margin: 14px 0 0;
}
.tile { background: var(--surface); min-width: 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 560px) {
  :root { --gutter: 20px; }
  .showcase { padding: 24px; }
  .showcase__info { flex-basis: 100%; min-width: 0; }
  .pricing__value { font-size: 22px; }
  .btn:not(.btn--submit) { width: 100%; }                          /* full-width CTAs on phones; submit excluded (it stacks full-width via .capture__io) */
  .capture__io { flex-direction: column; align-items: stretch; }   /* stack email input + submit, each full-width */
  .cta-row { flex-direction: column; }
}

/* Hover states — guarded so they never stick on touch devices */
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--gold-hover); }
  .btn--ghost:hover { color: var(--gold-hover); border-color: var(--gold-hover); }
  .link-gold:hover { color: var(--gold-hover); border-color: var(--gold); }
  .site-footer nav a:hover { color: var(--gold); }
  .back-link:hover { color: var(--gold); }
  .legal a:hover { border-color: var(--gold); }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  a, .btn { transition: none; }
}
