/* =========================================================================
   FirstRep — design system
   Mobile-first, system fonts (zero network requests), accessible, fast.
   ========================================================================= */

:root {
  /* palette */
  --bg: #ffffff;
  --surface: #f5f7fa;
  --surface-2: #eef2f7;
  --ink: #141821;          /* body text on light  ~15:1 */
  --muted: #55606f;        /* secondary text      ~4.9:1 */
  --line: #e2e8f0;
  --brand: #e04a16;        /* buttons bg + accents (white bold text ~4.4:1) */
  --brand-strong: #b23610; /* links / text on light ~5.6:1 */
  --brand-tint: #fdefe9;
  --ink-bg: #141821;       /* dark sections */
  --ink-bg-2: #1c2231;
  --on-ink: #f4f6fa;
  --on-ink-muted: #aab4c2;
  --good: #1f8a4c;
  --bad: #c1352b;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 24, 33, .06), 0 8px 24px rgba(20, 24, 33, .06);
  --wrap: 1120px;
  --gap: clamp(16px, 4vw, 28px);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 6vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 4.5vw, 2.15rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.4rem); }
p { margin: 0 0 1rem; }

a { color: var(--brand-strong); text-decoration-thickness: .09em; text-underline-offset: .15em; }
a:hover { color: var(--brand); }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gap); }
.section { padding-block: clamp(40px, 8vw, 80px); }
.section--tint { background: var(--surface); }
.section--ink { background: var(--ink-bg); color: var(--on-ink); }
.section--ink h1, .section--ink h2, .section--ink h3 { color: #fff; }
.section--ink a { color: #ffb59a; }
.stack > * + * { margin-top: 1rem; }
.lead { font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: var(--muted); max-width: 60ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 800; color: var(--brand-strong); margin: 0 0 .6rem; }
.section--ink .eyebrow { color: #ff9d78; }
.center { text-align: center; }
.muted { color: var(--muted); }
.narrow { max-width: 72ch; }

/* skip link */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink-bg); color: #fff; padding: 12px 18px; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.2rem; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand img { width: 30px; height: 30px; }
.brand span b { color: var(--brand); }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); cursor: pointer; color: var(--ink);
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-links { display: none; }

.nav-menu[data-open="true"] .nav-links {
  display: flex; flex-direction: column; gap: 2px;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--bg); border-bottom: 1px solid var(--line);
  padding: 10px var(--gap) 16px; box-shadow: var(--shadow);
}
.nav-links a {
  display: block; padding: 12px 10px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.nav-links a[aria-current="page"] { color: var(--brand-strong); }
.nav-links a:hover { background: var(--surface); }
.nav-menu { position: static; }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav-links, .nav-menu[data-open="true"] .nav-links {
    display: flex; flex-direction: row; position: static; padding: 0;
    border: 0; box-shadow: none; background: none; gap: 4px; align-items: center;
  }
  .nav-links a { padding: 8px 12px; }
  .nav-links .btn { margin-left: 8px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 1rem; line-height: 1;
  padding: 14px 22px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #c73f11; color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); }
.section--ink .btn-ghost, .hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.section--ink .btn-ghost:hover, .hero .btn-ghost:hover { background: rgba(255,255,255,.1); color:#fff; }
.btn-lg { padding: 16px 28px; font-size: 1.08rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- hero ---------- */
.hero { background: linear-gradient(160deg, var(--ink-bg), var(--ink-bg-2)); color: var(--on-ink); }
.hero .wrap { display: grid; gap: clamp(24px, 5vw, 48px); align-items: center; padding-block: clamp(48px, 9vw, 88px); }
.hero h1 { color: #fff; }
.hero p { color: var(--on-ink-muted); }
.hero .badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; padding: 7px 13px; border-radius: 999px; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.14); }
@media (min-width: 860px) { .hero .wrap { grid-template-columns: 1.1fr .9fr; } }
.hero-figure img { border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.1); }

/* ---------- grid + cards ---------- */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr; }
@media (min-width: 680px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 920px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); height: 100%;
}
.card h3 { margin-bottom: .35em; }
.card--link { text-decoration: none; color: inherit; display: block; transition: transform .1s ease, box-shadow .15s ease; }
.card--link:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(20,24,33,.12); color: inherit; }
.card .icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-strong); margin-bottom: 12px; font-size: 1.3rem; }

/* A white .card placed inside a dark (section--ink) section must keep dark,
   readable text — otherwise it inherits the section's near-white color and
   headings/hints go white-on-white. */
.section--ink .card { color: var(--ink); }
.section--ink .card h1,
.section--ink .card h2,
.section--ink .card h3,
.section--ink .card h4 { color: var(--ink); }
.section--ink .card a:not(.btn) { color: var(--brand-strong); }
.section--ink .card .hint { color: var(--muted); }

/* ---------- collapsible exercise groups ---------- */
.exgroup { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); margin-bottom: 16px; overflow: hidden; box-shadow: var(--shadow); }
.exgroup > summary {
  list-style: none; cursor: pointer; padding: 20px 22px;
}
.exgroup > summary::-webkit-details-marker { display: none; }
.exgroup > summary h2 {
  margin: 0; font-weight: 800; font-size: clamp(1.15rem, 3.5vw, 1.5rem);
  letter-spacing: -.01em;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.exgroup > summary .meta { font-weight: 600; font-size: .85rem; color: var(--muted); }
.exgroup > summary .chev { transition: transform .2s ease; flex: none; color: var(--brand-strong); }
.exgroup[open] > summary .chev { transform: rotate(180deg); }
.exgroup > summary:hover { background: var(--surface); }
.exgroup-body { padding: 0 22px 22px; }

.poster-figure { margin: 0 0 22px; }
.poster-figure img { border-radius: var(--radius-sm); border: 1px solid var(--line); width: 100%; }
.poster-figure figcaption { font-size: .85rem; color: var(--muted); margin-top: 8px; }

.exercise { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; }
.exercise:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.exercise h3 { font-size: 1.2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.badge { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 4px 9px; border-radius: 999px; }
.badge-beg { background: #e7f6ec; color: #1f7a43; }
.badge-int { background: #fdefe9; color: var(--brand-strong); }
.ex-cols { display: grid; gap: 18px; margin-top: 12px; }
@media (min-width: 720px) { .ex-cols { grid-template-columns: 1.3fr 1fr; } }
.ex-meta { background: var(--surface); border-radius: var(--radius-sm); padding: 14px 16px; font-size: .95rem; }
.ex-meta dt { font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 10px; }
.ex-meta dt:first-child { margin-top: 0; }
.ex-meta dd { margin: 2px 0 0; }
.ex-steps { padding-left: 1.2em; margin: 0; }
.ex-steps li { margin-bottom: 6px; }
.mistakes { list-style: none; padding: 0; margin: 12px 0 0; }
.mistakes li { position: relative; padding-left: 26px; margin-bottom: 6px; }
.mistakes li::before { content: "✕"; position: absolute; left: 0; top: 0; color: var(--bad); font-weight: 900; }
.cue { background: var(--brand-tint); border-left: 4px solid var(--brand); padding: 12px 16px; border-radius: 8px; margin-top: 14px; font-size: .95rem; }
.cue strong { color: var(--brand-strong); }

/* ---------- tables (weekly plan) ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.plan { width: 100%; border-collapse: collapse; min-width: 560px; }
table.plan th, table.plan td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plan thead th { background: var(--ink-bg); color: #fff; font-size: .9rem; }
table.plan tbody tr:nth-child(even) { background: var(--surface); }
table.plan td strong { display: block; }
.rest-row td { background: var(--brand-tint) !important; color: var(--brand-strong); font-weight: 700; }

/* ---------- notes / callouts ---------- */
.note { border-radius: var(--radius); padding: 18px 20px; border: 1px solid var(--line); background: var(--surface); }
.note--warn { background: #fff7ed; border-color: #f4c99a; }
.note--info { background: #eef4ff; border-color: #c3d6f7; }
.note strong { display: block; margin-bottom: 4px; }
.disclosure-top { background: var(--brand-tint); border: 1px solid #f3c3b0; border-radius: var(--radius); padding: 18px 20px; margin-bottom: 28px; font-size: .96rem; }
.disclosure-top strong { color: var(--brand-strong); }

/* ---------- gear ---------- */
.gear-card { display: flex; flex-direction: column; }
.gear-card .price-note { font-size: .82rem; color: var(--muted); margin-top: auto; }
.gear-card .btn { margin-top: 14px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; max-width: 520px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: .92rem; }
.field input, .field textarea {
  font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); width: 100%;
}
.field input:focus, .field textarea:focus { outline: 3px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.field textarea { min-height: 130px; resize: vertical; }
.form .hint { font-size: .82rem; color: var(--muted); }

/* email capture inline */
.capture { display: flex; flex-wrap: wrap; gap: 10px; max-width: 480px; }
.capture input { flex: 1 1 220px; padding: 14px 16px; border-radius: 999px; border: 1px solid var(--line); font: inherit; }
.section--ink .capture input { background: rgba(255,255,255,.95); }

/* ---------- ad slots ---------- */
/* Ad slots are HIDDEN until an ad network is approved, so no empty boxes show
   at launch. When your ads are live, DELETE this one rule to reveal them. */
.ad-slot { display: none !important; }

.ad-slot {
  margin: 26px auto; max-width: 100%; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 12px, var(--surface-2) 12px, var(--surface-2) 24px);
  color: var(--muted); padding: 14px; min-height: 100px;
  display: grid; place-items: center;
}
.ad-slot .ad-label { text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; font-weight: 700; }
.ad-slot[data-size="leaderboard"] { min-height: 110px; }
.ad-slot[data-size="rectangle"] { min-height: 250px; max-width: 336px; }

/* ---------- subscription / locked plan ---------- */
.paywall { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.paywall .preview { padding: 26px; }
.paywall .locked {
  background: linear-gradient(180deg, transparent, var(--ink-bg) 55%);
  color: var(--on-ink); padding: 40px 26px 30px; text-align: center; margin-top: -60px;
  position: relative;
}
.paywall .locked h3 { color: #fff; }
.price { font-size: 2.4rem; font-weight: 900; color: #fff; }
.price small { font-size: 1rem; font-weight: 600; color: var(--on-ink-muted); }
.check-list { list-style: none; padding: 0; margin: 0 0 18px; display: inline-grid; gap: 8px; text-align: left; }
.check-list li { position: relative; padding-left: 30px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: #56d98a; font-weight: 900; }

/* ---------- featured strip ---------- */
.feat { position: relative; }
.feat img { border-radius: var(--radius); border: 1px solid var(--line); }
.feat figcaption { position: absolute; left: 12px; bottom: 12px; background: rgba(20,24,33,.82); color: #fff; padding: 7px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink-bg); color: var(--on-ink-muted); padding-block: 46px 30px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color:#fff; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-grid h2 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 900; font-size: 1.2rem; text-decoration: none; }
.footer-brand img { width: 28px; height: 28px; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.12); margin-top: 30px; padding-top: 22px; font-size: .82rem; line-height: 1.7; }
.footer-legal p { margin: 0 0 10px; }

/* ---------- copy-protection helpers ---------- */
.protect { -webkit-user-select: none; -moz-user-select: none; user-select: none; }
.protect img, .poster-figure img, .feat img, .hero-figure img {
  -webkit-user-drag: none; user-select: none; pointer-events: none;
}
/* keep interactive imgs (in links/buttons) clickable */
a img, button img { pointer-events: auto; }

/* ---------- workout thumbnail cards ---------- */
.workout-card { padding: 0; overflow: hidden; }
.workout-card img { aspect-ratio: 5 / 4; object-fit: cover; object-position: top center; width: 100%; border-bottom: 1px solid var(--line); }
.workout-card .wc-body { padding: 16px 18px; }
.workout-card .wc-body h3 { margin: 0 0 3px; font-size: 1.15rem; }
.workout-card .wc-body p { margin: 0; color: var(--muted); font-size: .92rem; }
.workout-card .wc-body .go { color: var(--brand-strong); font-weight: 700; font-size: .9rem; margin-top: 8px; display: inline-block; }

/* ---------- cookie consent banner ---------- */
.cookie-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 16px; z-index: 200; width: min(680px, calc(100% - 24px));
  background: var(--ink-bg); color: var(--on-ink);
  border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius);
  box-shadow: 0 14px 44px rgba(0, 0, 0, .45); padding: 20px 22px;
}
.cookie-banner:focus { outline: none; }
.cookie-title { display: block; color: #fff; font-weight: 800; font-size: 1.05rem; margin-bottom: 6px; }
.cookie-banner p { color: var(--on-ink-muted); font-size: .92rem; margin: 0 0 14px; }
.cookie-banner a { color: #ffb59a; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-actions .btn { flex: 1 1 auto; }
.btn-neutral { background: #2a3242; color: #fff; }
.btn-neutral:hover { background: #37425a; color: #fff; }
@media (min-width: 560px) { .cookie-actions .btn { flex: 0 0 auto; } }

/* utilities */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none; }
.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; }
