/* ─────────────────────────────────────────────
   autopunk · shared site stylesheet
   Loaded by every page (except /privacy) after tokens.css.
   Page-specific styles live in home.css or per-page <style>.
───────────────────────────────────────────── */

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--black);
  color: var(--off-white);
  font-family: var(--body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; display: block; }

/* ── Grain overlay ── */
body::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 9998;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  opacity: 0.05;
  contain: strict;
}

/* ── Skip link ── */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--punk-red); color: var(--black);
  padding: 0.5rem 1rem; font-weight: 700;
  z-index: 10000;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* Global focus-visible ring — applies to every page (previously only
   on home). Keyboard users need a consistent, high-contrast focus
   indicator across every navigable surface. */
*:focus-visible {
  outline: 2px solid var(--punk-red);
  outline-offset: 3px;
}
a:focus-visible { text-decoration: underline; }

/* ── BETA LAUNCH BANNER (mirrored from index.html) ── */
.beta-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 901;
  height: var(--banner-h);
  background: var(--black);
  border-bottom: 2px solid var(--punk-red);
  display: flex; align-items: center; justify-content: center;
  padding: 0 3rem;
  overflow: hidden;
  transition: height 200ms ease, opacity 200ms ease;
}
body.banner-dismissed .beta-banner { display: none; }
.beta-banner-inner {
  display: flex; align-items: center; gap: 0.85rem;
  max-width: 1200px; width: 100%;
  flex-wrap: nowrap;
  font-family: var(--body); font-size: 0.82rem; color: var(--off-white);
}
.beta-banner-star { width: 12px; height: 12px; flex-shrink: 0; }
.beta-banner-eyebrow {
  font-family: var(--mono); font-size: 0.8125rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--punk-red); font-weight: 500;
  flex-shrink: 0;
}
.beta-banner-text {
  color: var(--off-white-70);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.beta-banner-text strong { color: var(--off-white); font-weight: 700; }
.beta-banner-cta {
  font-family: var(--body); font-weight: 700; font-size: 0.82rem;
  color: var(--punk-red); white-space: nowrap;
  padding: 0.4rem 0.7rem; border: 2px solid var(--punk-red);
  transition: background 150ms ease, color 150ms ease;
  flex-shrink: 0;
}
.beta-banner-cta:hover { background: var(--punk-red); color: var(--black); }
.beta-banner-dismiss {
  position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--off-white-70);
  cursor: pointer;
}
.beta-banner-dismiss:hover { color: var(--off-white); }
.beta-banner-text-short { display: none; }
@media (max-width: 768px) {
  .beta-banner { padding: 0 0.85rem; padding-right: 3rem; }
  .beta-banner-inner { flex-wrap: nowrap; gap: 0.5rem; font-size: 0.8125rem; align-items: center; }
  .beta-banner-eyebrow, .beta-banner-star { display: none; }
  .beta-banner-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.8125rem; line-height: 1.2; }
  .beta-banner-cta { font-size: 0.8125rem; padding: 0.6rem 0.8rem; min-height: 44px; flex-shrink: 0; border-width: 1px; }
}
@media (max-width: 480px) {
  .beta-banner-text { font-size: 0.8125rem; }
  .beta-banner-text-full { display: none; }
  .beta-banner-text-short { display: inline; }
}

/* ── 4-point star motif ── */
.star-4 {
  display: inline-block;
  background: var(--off-white);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0 L14 10 L24 12 L14 14 L12 24 L10 14 L0 12 L10 10 Z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0 L14 10 L24 12 L14 14 L12 24 L10 14 L0 12 L10 10 Z'/%3E%3C/svg%3E") center/contain no-repeat;
  vertical-align: middle;
}
.star-4.red { background: var(--punk-red); }

/* ── NAV ──
   Scoped via aria-label so page-internal <nav> elements (TOCs,
   breadcrumbs) keep normal block flow. Matches home + every subpage. */
nav[aria-label="Main navigation"] {
  position: fixed; top: var(--banner-h); left: 0; right: 0; z-index: 900;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 3rem; height: 64px;
  background: rgba(10, 8, 6, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--off-white-10);
}
.nav-logo { display: flex; align-items: center; min-height: 44px; }
.nav-logo img { border-radius: 0; }
.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav-links a {
  font-size: 0.85rem; font-weight: 500; color: var(--off-white);
  transition: color 0.2s;
  height: 44px; padding: 0 0.25rem;
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.nav-links a:hover { color: var(--off-white); opacity: 0.8; }
.nav-links a[aria-current="page"] {
  color: var(--punk-red);
  border-bottom: 2px solid var(--punk-red);
}
.nav-cta {
  background: var(--punk-red); color: var(--black);
  font-family: var(--body); font-weight: 700; font-size: 0.85rem;
  padding: 0.6rem 1.1rem; border: 2px solid var(--punk-red);
  transition: box-shadow 200ms ease, transform 100ms ease;
  min-height: 44px;
  display: inline-flex; align-items: center;
}
.nav-cta:hover {
  box-shadow: 4px 4px 0 var(--off-white-10);
  transform: translate(-2px, -2px);
}
.nav-hamburger {
  display: none;
  background: none; border: none;
  color: var(--off-white); cursor: pointer;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
}
.mobile-nav {
  display: none;
  position: fixed; top: calc(var(--banner-h) + 64px); left: 0; right: 0; bottom: 0;
  background: var(--black); border-bottom: 2px solid var(--punk-red);
  flex-direction: column;
  padding: 1.5rem;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  overflow-y: auto;
  z-index: 899;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 0.85rem 0;
  font-size: 1rem; color: var(--off-white);
  border-bottom: 1px solid var(--off-white-10);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-cta {
  background: var(--punk-red); color: var(--black) !important;
  text-align: center; font-weight: 700;
  padding: 0.85rem !important; margin-top: 0.5rem;
}
@media (max-width: 768px) {
  nav[aria-label="Main navigation"] { padding: 0 1.25rem; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-hamburger { display: inline-flex; }
}

/* ── FOOTER ── */
footer {
  position: relative;
  background: var(--black);
  border-top: 2px solid var(--punk-red);
  padding: 3rem;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 1200px; margin: 0 auto;
}
.footer-left { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-logo {
  font-family: var(--disp); font-size: 1.4rem; font-weight: 400;
  text-transform: lowercase;
}
.footer-logo span { color: var(--punk-red); }
.footer-contact a {
  font-size: 0.88rem; color: var(--off-white-70);
  border-bottom: 1px solid var(--off-white-10);
}
.footer-contact a:hover { color: var(--punk-red); border-bottom-color: var(--punk-red); }
.footer-right { display: flex; justify-content: flex-end; }
.footer-links {
  list-style: none;
  display: flex; gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 0.85rem; color: var(--off-white-70);
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 44px; padding: 0.25rem 0;
}
.footer-links a:hover { color: var(--punk-red); }
.footer-bottom {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--off-white-10);
  font-size: 0.78rem; color: var(--off-white-70);
}
.footer-bottom a { border-bottom: 1px solid var(--off-white-10); }
.footer-bottom a:hover { color: var(--punk-red); border-bottom-color: var(--punk-red); }
@media (max-width: 768px) {
  footer { grid-template-columns: 1fr; padding: 2rem 1.5rem; }
  .footer-right { justify-content: flex-start; }
}

/* ── Reveal animation ──
   Opacity stays at 1 always so content is readable for OG scrapers,
   archive crawlers, and reduced-motion users. Only transform animates. */
.reveal { opacity: 1; transform: translateY(0); transition: transform 500ms ease; }
html.js-reveal .reveal { transform: translateY(12px); }
html.js-reveal .reveal.visible { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  html.js-reveal .reveal { transform: none; transition: none; }
}

/* ── Typography defaults ──
   Caprasimo is single-weight (400 only). Setting 700/800 on the display
   face forces the browser to synthesize bold, which distorts an already-
   chunky letterform. Use size and colour for hierarchy, never fake weight.
   DM Sans (body) keeps its weight variants. */
h1, h2, h3, h4 {
  font-family: var(--disp);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--off-white);
}
h1 { font-size: clamp(2.4rem, 4.5vw, 3.6rem); text-transform: lowercase; }
h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); text-transform: lowercase; }
h3 { font-size: 1.25rem; }
p { color: var(--off-white-70); max-width: 65ch; }
.accent { color: var(--punk-red); }

/* ── Page layout ── */
.page-frame {
  background: var(--punk-red);
  padding: 0.5rem;
  min-height: calc(100vh - 64px - var(--banner-h));
}
@media (max-width: 768px) { .page-frame { padding: 0.4rem; } }
main {
  background: var(--black);
  border-radius: 12px;
  padding: calc(64px + 1.5rem) 0 3rem;
  margin-top: calc(64px + var(--banner-h) + 1rem);
  position: relative;
  overflow: hidden;
}
@media (max-width: 768px) {
  main { margin-top: 0; padding-top: calc(64px + var(--banner-h) + 2rem); }
}
.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 3rem;
}
@media (max-width: 768px) {
  .container { padding: 0 1.5rem; }
}
.page-hero {
  padding: 1.5rem 0 4rem;
  border-bottom: 2px solid var(--off-white-10);
  margin-bottom: 4rem;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.8125rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--punk-red); font-weight: 500;
  margin-bottom: 1rem;
}
.eyebrow .star-4 { width: 14px; height: 14px; }
.lede {
  font-size: 1.15rem; line-height: 1.55;
  color: var(--off-white-70);
  max-width: 60ch; margin-top: 1.5rem;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--punk-red); color: var(--black);
  font-family: var(--body); font-weight: 700; font-size: 0.95rem;
  padding: 0.85rem 1.5rem;
  border: 2px solid var(--punk-red);
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 44px;
  transition: box-shadow 200ms ease, transform 100ms ease;
}
.btn-primary:hover {
  box-shadow: 4px 4px 0 var(--off-white-10);
  transform: translate(-2px, -2px);
}
.btn-primary:active {
  box-shadow: none;
  transform: translate(0, 0);
}
.btn-primary:disabled,
.btn-primary[disabled] {
  cursor: wait;
  box-shadow: none;
  transform: none;
}
.btn-ghost {
  color: var(--off-white-70);
  font-size: 0.9rem;
  padding: 0.5rem 0;
  display: inline-flex; align-items: center; gap: 0.4rem;
  border-bottom: 1px solid var(--off-white-10);
  min-height: 44px;
  transition: color 150ms ease, border-color 150ms ease;
}
.btn-ghost:hover { color: var(--off-white); border-bottom-color: var(--punk-red); }

/* ── Sections ── */
.section { padding: 3rem 0; }
.section-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.8125rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--punk-red); font-weight: 500;
  margin-bottom: 1rem;
}
.section-eyebrow .star-4 { width: 12px; height: 12px; }
.section h2 { margin-bottom: 1rem; }
.section .section-lede { color: var(--off-white-70); max-width: 60ch; margin-bottom: 2.5rem; }

/* ── Closer / final CTA ── */
.closer {
  margin-top: 5rem;
  border-top: 2px solid var(--off-white-10);
  padding: 4rem 0;
  text-align: left;
}
.closer h2 { margin-bottom: 1.25rem; }
.closer p { margin-bottom: 2rem; }
.closer-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; }
