/* ==========================================================================
   erichunsicker.com — Base + shared components · v3 ("Owner" direction, 2026-11-10)
   Reset, base type, and every piece of chrome shared across all pages
   (header/nav, buttons, eyebrows, section rhythm, stats band, email band,
   footer, placeholders). Page-unique layout stays in each page's <style>.
   No raw hex/px here — everything pulls from tokens.css.
   ========================================================================== */

/* ---------- reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: var(--leading-body);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- accessibility: visible keyboard focus (only on keyboard nav) ---------- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}
/* on the dark panels, use a light ring so it stays visible */
.email :focus-visible, .stats :focus-visible, .bagcta :focus-visible {
  outline-color: var(--color-accent-green);
}

/* ---------- skip link (visible only when focused) ---------- */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-weight: var(--weight-semibold);
  transition: top .15s;
}
.skip-link:focus { top: var(--space-4); }

/* ---------- layout helpers ---------- */
.wrap {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}
.read {
  max-width: var(--container-read);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* ---------- type ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-tight);
}
.eyebrow {
  font-size: var(--text-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  font-weight: var(--weight-medium);
  color: var(--eyebrow-color);
}
/* two-tone headline: soft first half, solid second (wrap the first half in .s) */
.two .s { color: rgba(44, 44, 44, .55); }
.on-ink .two .s, .two.on-ink .s { color: rgba(255, 255, 255, .55); }
/* text link with an arrow */
.more { font-weight: var(--weight-semibold); color: var(--color-text); white-space: nowrap; }
.more::after { content: " \2192"; }
.more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  letter-spacing: -0.01em;
  white-space: nowrap;
  font-weight: var(--btn-weight);
  font-size: .95rem;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: var(--btn-radius);
  border: 1.5px solid transparent;
  transition: .2s;
  cursor: pointer;
}
.btn-primary { background: var(--btn-bg); color: var(--btn-text); box-shadow: var(--shadow-glow); }
.btn-primary:hover { background: var(--btn-bg-hover); }
.btn-light { background: var(--white); color: var(--color-text); }
.btn-light:hover { background: #f3f3f3; }
.btn-ghost { background: var(--btn2-bg); border-color: var(--btn2-border); color: var(--btn2-text); }
.btn-ghost:hover { border-color: var(--color-text-muted); }
.btn-sm { font-size: .85rem; padding: 10px 16px; border-radius: 12px; }

/* ---------- header / nav ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: blur(13px);
  backdrop-filter: blur(13px);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  font-size: 1.125rem;
  letter-spacing: -0.03em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand::before {
  content: "EH";
  width: 20px; height: 20px;
  border-radius: 6px;
  background: var(--ink-1000);
  color: #fff;
  display: grid; place-items: center;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0;
}
.brand span { display: none; }
nav.links { display: flex; gap: 26px; }
nav.links a {
  font-size: .875rem;
  font-weight: var(--weight-medium);
  color: var(--color-text);
  transition: .15s;
}
nav.links a:hover { text-decoration: underline; text-underline-offset: 4px; }
nav.links a.active { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.nav-cta { display: flex; align-items: center; gap: var(--space-4); }
.nav-sub { display: none; }  /* mobile-only Subscribe inside the menu */

/* hamburger (mobile only) */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  position: relative;
  transition: .2s;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after  { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { top: 0; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  nav.links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-2) var(--container-pad) var(--space-4);
    box-shadow: var(--shadow-md);
    display: none;
  }
  nav.links.open { display: flex; }
  nav.links a { padding: var(--space-3) 0; font-size: 1.05rem; border-bottom: 1px solid var(--color-hairline); }
  nav.links a:last-child { border-bottom: none; }
  .nav-cta .btn { display: none; }
  .brand { font-size: 1.05rem; }  /* subscribe lives in the open menu instead */
  .nav-sub { display: block; font-weight: var(--weight-semibold); }
  nav.links a:hover, nav.links a.active { text-decoration: none; }
}

/* ---------- partner strip ---------- */
.partners { border-bottom: 1px solid var(--color-border); background: var(--color-bg); }
.partners .wrap {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  height: 84px;
  flex-wrap: wrap;
  justify-content: center;
}
.partners .lab {
  font-size: var(--text-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  color: var(--color-text-muted);
  font-weight: var(--weight-semibold);
  margin-right: var(--space-2);
}
.plogo {
  font-family: var(--font-heading);
  font-weight: var(--weight-medium);
  font-size: 1.05rem;
  color: var(--gray-400);
  letter-spacing: .02em;
  transition: .2s;
}
.plogo:hover { color: var(--color-text); }
@media (max-width: 860px) {
  .partners .wrap { gap: var(--space-5); height: auto; padding-top: var(--space-5); padding-bottom: var(--space-5); }
}

/* ---------- section rhythm + heading block ---------- */
section.block { padding: var(--section-y) 0; }
@media (max-width: 760px) { section.block { padding: var(--section-y-mobile) 0; } }
.sec-head { max-width: 660px; margin-bottom: var(--space-8); }
.sec-head h2 { font-size: var(--text-h2); line-height: 1; margin: var(--space-3) 0 var(--space-4); }
.sec-head p { color: var(--color-text-muted); font-size: var(--text-lead); }

/* ---------- stats / proof band (card ink) ---------- */
.stats { background: var(--color-surface-dark); color: var(--color-text-on-dark); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.stats .wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  padding: var(--space-9) var(--container-pad);
}
.stat { text-align: center; }
.stat .n {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: var(--weight-heading);
  letter-spacing: -0.04em;
  line-height: 1;
}
.stat .n em { font-style: normal; color: var(--color-accent-green); }
.stat .l {
  margin-top: var(--space-3);
  font-size: var(--text-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  color: var(--on-dark-label);
}
@media (max-width: 760px) { .stats .wrap { grid-template-columns: repeat(2, 1fr); gap: var(--space-7) var(--space-5); } }

/* ---------- email band (dark, rounded) ---------- */
.email {
  background: var(--color-surface-dark);
  color: var(--color-text-on-dark);
  border-radius: var(--radius-lg);
  padding: clamp(48px, 7vw, 88px) clamp(20px, 5vw, 64px);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.email::before {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(203, 184, 164, .26), transparent 68%);
  top: -180px;
  right: -120px;
}
.email h2 { color: var(--color-text-on-dark); font-size: var(--text-h2); line-height: 1; position: relative; }
.email .eyebrow { color: var(--color-accent-green); }
.email p { color: var(--color-text-on-dark-muted); max-width: 46ch; margin: var(--space-4) auto var(--space-6); position: relative; }
.email form {
  display: flex;
  gap: 6px;
  max-width: 460px;
  margin: 0 auto;
  position: relative;
  background: #26231f;
  border: 1px solid var(--on-ink-line);
  border-radius: 16px;
  padding: 6px;
}
.email form:focus-within { border-color: rgba(255,255,255,.5); }
.email form .btn-primary { background: var(--white); color: var(--color-text); }
.email form .btn-primary:hover { background: #f3f3f3; }
@media (max-width: 480px) { .email form { flex-direction: column; } .email input { text-align: center; } }
.email input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--color-text-on-dark);
  font-size: var(--text-body); /* 16px — prevents iOS zoom-on-focus */
}
.email input::placeholder { color: var(--on-dark-placeholder); }
.email .form-msg {
  position: relative;
  margin: var(--space-4) auto 0;
  font-size: var(--text-small);
  color: var(--color-success-on-dark);
  min-height: 1.2em;
}
.email .form-msg.error { color: var(--color-error-on-dark); }

/* ---------- light capture form (email box + button in one white card) ---------- */
.capture {
  display: flex; gap: 6px; max-width: 440px; margin: 0 auto;
  background: var(--white); border-radius: 16px; padding: 6px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 10px 30px rgba(60,45,30,.10), 0 2px 6px rgba(0,0,0,.05);
}
.capture:focus-within { box-shadow: 0 0 0 2px var(--ink-800), 0 10px 30px rgba(60,45,30,.14); }
.capture input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 14px; font: inherit; font-size: 1rem; outline: none; color: var(--color-text); }
.capture input::placeholder { color: var(--ink-400); }
.capture .btn { padding: 12px 16px; border-radius: 11px; }
.form-msg { margin: var(--space-4) auto 0; font-size: var(--text-small); color: var(--success); min-height: 1.2em; text-align: center; }
.form-msg.error { color: var(--danger); }
@media (max-width: 480px) { .capture { flex-direction: column; padding: 8px; } .capture input { text-align: center; padding: 12px 10px; } }

/* ---------- footer ---------- */
footer { padding: var(--space-9) 0 var(--space-6); background: var(--cream); border-top: 1px solid var(--color-border); font-size: .875rem; }
.foot-grid { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-6); flex-wrap: wrap; }
.foot-brand { font-family: var(--font-heading); font-weight: var(--weight-semibold); font-size: 1.125rem; letter-spacing: -0.03em; }
.foot-brand span { display: none; }
.socials { display: flex; gap: var(--space-3); margin-top: var(--space-4); }
.socials a {
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  background: var(--white);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  transition: .18s;
}
.socials a:hover { border-color: var(--ink-800); color: var(--ink-800); }
.foot-links { display: flex; gap: var(--space-7); flex-wrap: wrap; }
.foot-col h4 {
  font-family: var(--font-body);
  font-size: .875rem;
  letter-spacing: -0.005em;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  font-weight: var(--weight-semibold);
}
.foot-col a { display: block; font-size: .875rem; color: var(--color-text-muted); margin-bottom: var(--space-2); }
.foot-col a:hover { color: var(--color-text); }
.copy { margin-top: var(--space-7); padding-top: var(--space-4); border-top: 1px solid var(--color-border); font-size: .8rem; color: var(--color-text-muted); }

/* ---------- image placeholders (preview scaffolding — real photos replace) ---------- */
.ph > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.ph {
  position: relative;
  background: linear-gradient(135deg, var(--ph-from), var(--ph-mid) 60%, var(--ph-to));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ph-text);
  overflow: hidden;
}
.ph::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(0, 0, 0, .025) 0 12px, transparent 12px 24px);
}
.ph .cap { position: relative; z-index: 1; font-size: var(--text-small); font-weight: var(--weight-medium); max-width: 82%; opacity: .85; }

/* ---------- poster treatment: photo slots as editorial panels ---------- */
.ph.poster {
  background: linear-gradient(150deg, var(--poster-from), var(--poster-mid) 55%, var(--poster-to));
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
}
.ph.poster::after { content: none; }
.poster-big {
  position: relative; z-index: 1;
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  letter-spacing: var(--tracking-tight);
  font-size: clamp(1.9rem, 5vw, 3.4rem);
  line-height: 1.08;
  color: var(--poster-text);
  max-width: 14ch;
}
.poster-small {
  position: relative; z-index: 1;
  font-size: var(--text-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  font-weight: var(--weight-medium);
  color: var(--poster-muted);
}
.course .poster-big { font-size: clamp(1.5rem, 2.6vw, 2rem); }

/* ---------- visually-hidden (labels for screen readers) ---------- */
.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;
}

/* ---------- honeypot (bot trap — off-screen, never shown to humans) ---------- */
.hp {
  position: absolute !important;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---------- anchor offset so #email etc. clear the sticky 72px header ---------- */
[id] { scroll-margin-top: 80px; }

/* ---------- respect reduced-motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .btn:hover, .card:hover, .ep:hover, .btn-primary:hover { transform: none; }
}
