/* SPIDER STAMINA — site styles */

:root {
  --bg: #0e0f11;
  --surface: #16181b;
  --surface-2: #1e2125;
  --text: #ebecee;
  --muted: #9ba1a8;
  --line: #2b2f35;
  --accent: #ff5a36;
  --accent-soft: rgba(255, 90, 54, .14);
  --accent-ink: #120805;
  --blue: #5b9dff;
  --head-font: "Barlow Condensed", "Arial Narrow", sans-serif;
  --head-transform: uppercase;
  --head-weight: 700;
  --head-spacing: .01em;
  --body-font: "Inter", system-ui, sans-serif;
  --radius: 10px;
  --hero-bg: radial-gradient(1200px 500px at 85% -10%, rgba(255, 90, 54, .22), transparent 60%),
             linear-gradient(180deg, #121417, #0e0f11);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.7 var(--body-font);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-underline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--head-font);
  text-transform: var(--head-transform);
  font-weight: var(--head-weight);
  letter-spacing: var(--head-spacing);
  line-height: 1.1;
  margin: 0 0 .5em;
}
h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin-top: 2.2em; }
h3 { font-size: 1.3rem; margin-top: 1.8em; }
h3 { color: var(--accent); letter-spacing: .04em; }

p { margin: 0 0 1.1em; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }

.wordmark {
  font: 800 1.45rem/1 "Barlow Condensed", "Arial Narrow", sans-serif;
  letter-spacing: .02em; text-decoration: none; color: var(--text); white-space: nowrap;
}
.wordmark span { color: var(--accent); }

.nav { margin-left: auto; display: flex; gap: 2px; font: 500 .9rem/1 "Inter", system-ui, sans-serif; }
.nav a {
  color: var(--muted); text-decoration: none; padding: 9px 11px; border-radius: 6px; white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); }

@media (max-width: 960px) {
  .site-header .wrap { flex-wrap: wrap; gap: 0; padding-top: 10px; }
  .nav {
    margin: 0 -16px; padding: 6px 16px 8px; width: calc(100% + 32px);
    overflow-x: auto; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
}

/* ---------- Hero ---------- */
.hero { background: var(--hero-bg); border-bottom: 1px solid var(--line); }
.hero .wrap { padding: clamp(56px, 9vw, 110px) 0 clamp(44px, 6vw, 72px); }
.eyebrow {
  font: 600 .8rem/1 "Inter", system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2.8rem, 8vw, 5.6rem); max-width: 14ch; margin-bottom: .3em; }
.hero .lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); max-width: 58ch; }
.byline { font: 500 .9rem "Inter", system-ui, sans-serif; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 .95rem/1 "Inter", system-ui, sans-serif; text-decoration: none;
  padding: 14px 22px; border-radius: var(--radius); border: 1px solid var(--line); color: var(--text);
  background: var(--surface); cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 48px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stat { background: var(--surface); padding: 18px 20px; }
.stat b { display: block; font: 700 2rem/1 var(--head-font); color: var(--text); }
.stat b { font-size: 2.4rem; }
.stat small { font: 500 .8rem "Inter", system-ui, sans-serif; color: var(--muted); }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Article layout ---------- */
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding: 48px 0 80px; }
.toc { position: sticky; top: 96px; align-self: start; font: 500 .88rem/1.4 "Inter", system-ui, sans-serif; }
.toc p { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.toc a { display: block; color: var(--muted); text-decoration: none; padding: 6px 0 6px 12px; border-left: 2px solid var(--line); }
.toc a:hover, .toc a.active { color: var(--text); border-left-color: var(--accent); }
.content { max-width: 72ch; }
.content > h2:first-child { margin-top: 0; }
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 32px; }
  .toc { display: none; }
}

.callout {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.4em 0;
}
.callout p:last-child { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.4em; padding: 0; list-style: none; }
.chips li {
  font: 500 .85rem/1 "Inter", system-ui, sans-serif; padding: 9px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 1.4em 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font: 400 .92rem/1.4 "Inter", system-ui, sans-serif; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th { font-weight: 600; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.rm-table th:first-child, .rm-table td:first-child { color: var(--muted); font-weight: 600; }

.bar { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.bar i { display: block; height: 8px; border-radius: 4px; background: var(--accent); }
.bar span { font-variant-numeric: tabular-nums; min-width: 3ch; }
tr.phase-strength td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.phase-endurance td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
tr.phase-endurance .bar i { background: var(--blue); }

.legend { display: flex; gap: 20px; font: 500 .82rem "Inter", system-ui, sans-serif; color: var(--muted); margin-top: -.6em; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 7px; background: var(--accent); vertical-align: -1px; }
.legend span.e::before { background: var(--blue); }

pre.formula {
  font: 400 .88rem/1.7 ui-monospace, "SFMono-Regular", Consolas, monospace;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; overflow-x: auto; white-space: pre;
}

/* ---------- Tabs ---------- */
.tabs [role="tablist"] { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs [role="tab"] {
  font: 600 .9rem/1 "Inter", system-ui, sans-serif; padding: 11px 16px; cursor: pointer;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius);
}
.tabs [role="tab"][aria-selected="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; font: 400 .85rem/1.4 "Inter", system-ui, sans-serif; min-height: 118px; }
.day b { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.day ol { margin: 0; padding-left: 18px; }
.day.rest { background: transparent; color: var(--muted); border-style: dashed; }
@media (max-width: 760px) {
  .week { grid-template-columns: minmax(0, 1fr); }
  .day { min-height: 0; display: grid; grid-template-columns: 64px 1fr; align-items: start; }
  .day b { margin: 2px 0 0; }
}

/* ---------- CTA band ---------- */
.cta-band {
  margin-top: 3em; padding: 28px; border-radius: calc(var(--radius) + 4px);
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
}
.cta-band h3 { margin: 0 0 4px; color: var(--text) !important; }
.cta-band p { margin: 0; color: var(--muted); }

/* ---------- Calculator ---------- */
.page-head { padding: 48px 0 8px; }
.page-head h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: .2em; }
.page-head p { color: var(--muted); max-width: 62ch; }

.calc { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 24px; padding: 24px 0 24px; align-items: start; }
@media (max-width: 900px) { .calc { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: 24px; }
.card h2 { font-size: 1.35rem; margin: 0 0 18px; }

.field { margin-bottom: 16px; font-family: "Inter", system-ui, sans-serif; }
.field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 5px; line-height: 1.4; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }

input[type="text"], input[type="number"], select {
  width: 100%; font: 500 1rem "Inter", system-ui, sans-serif; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px;
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="number"] { -moz-appearance: textfield; }

.onerm {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px; margin: 4px 0 18px; border-radius: var(--radius); background: var(--accent-soft);
  font-family: "Inter", system-ui, sans-serif;
}
.onerm span { font-size: .82rem; font-weight: 600; }
.onerm output { font: 700 2rem/1 var(--head-font); color: var(--accent); font-variant-numeric: tabular-nums; }

.summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 18px; font-family: "Inter", system-ui, sans-serif; }
.summary div { background: var(--surface-2); border-radius: var(--radius); padding: 14px 16px; }
.summary small { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.summary output { font: 700 1.7rem/1.2 var(--head-font); font-variant-numeric: tabular-nums; }

.sets td { font-size: 1rem; }
.sets .load { font: 700 1.25rem/1 var(--head-font); font-variant-numeric: tabular-nums; }
.sets tr.done td { opacity: .45; }
.sets tr.done .load { text-decoration: line-through; }
.sets input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.empty { color: var(--muted); font: 400 .9rem "Inter", system-ui, sans-serif; padding: 8px 0 0; }

.chart { width: 100%; height: auto; display: block; }
.chart text { font: 500 12px "Inter", system-ui, sans-serif; fill: var(--muted); }
.chart .lbl { font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 90px; font: 400 .85rem "Inter", system-ui, sans-serif; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer a { color: var(--muted); }

/* ---------- Print (calculator sheet) ---------- */
@media print {
  .site-header, .site-footer, .no-print, .toc { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .card, .table-wrap { border-color: #999; background: #fff; }
  .calc { grid-template-columns: 1fr; }
}

/* ---------- Content pages ---------- */
.page-head .byline { margin-top: -.4em; }
.prose { max-width: 72ch; padding-bottom: 72px; }
.prose > h2:first-child { margin-top: 1em; }
h4 { font: 600 1.05rem/1.3 "Inter", system-ui, sans-serif; margin: 1.6em 0 .5em; }

/* Variant cards */
.variants { display: grid; gap: 20px; padding: 24px 0 72px; }
.variant { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; scroll-margin-top: 88px; }
.variant.featured { border-color: var(--accent); }
.variant h2 { margin: 0 0 14px; }
.variant .tag { font: 600 .72rem/1 "Inter", system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); padding: 5px 8px; border-radius: 4px; vertical-align: middle; margin-left: 8px; }
.variant .table-wrap { margin: 0; }
.variant td, .variant th { padding: 7px 12px; }
.variant p { font-size: .98rem; }
@media (max-width: 820px) { .variant { grid-template-columns: minmax(0, 1fr); } }

.meters { display: grid; gap: 7px; margin: 0 0 18px; font: 500 .8rem/1 "Inter", system-ui, sans-serif; }
.meter { display: grid; grid-template-columns: 108px 1fr; align-items: center; gap: 10px; color: var(--muted); }
.meter span { display: block; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; }
.m-str i { background: var(--accent); }
.m-se i { background: #ff9f43; }
.m-fh i { background: var(--blue); }
.m-eh i { background: #a78bfa; }

.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; font: 500 .82rem/1 "Inter", system-ui, sans-serif; }
.facts li { background: var(--surface-2); border-radius: 6px; padding: 8px 10px; }
.facts b { color: var(--text); }

.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.jump a { font: 500 .85rem/1 "Inter", system-ui, sans-serif; color: var(--text); text-decoration: none; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; }
.jump a:hover { border-color: var(--accent); }

/* Figures */
figure { margin: 1.6em 0; }
figure img { display: block; border-radius: var(--radius); background: #fff; }
figcaption { font: 400 .82rem "Inter", system-ui, sans-serif; color: var(--muted); margin-top: 8px; }
.photo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 1.6em 0; }
.photo-row a { display: block; }
.photo-row img { width: 100%; aspect-ratio: 200 / 141; object-fit: cover; border-radius: var(--radius); }
@media (max-width: 640px) { .photo-row { grid-template-columns: 1fr 1fr; } }

.profile { display: flex; gap: 20px; align-items: center; }
.profile img { width: 88px; height: 88px; object-fit: cover; object-position: top; border-radius: 50%; border: 2px solid var(--accent); flex: none; }

/* Plan cards (programs) */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 1.4em 0; }
.plans .card { padding: 20px; }
.plans h3 { margin: 0 0 12px; font-size: 1.15rem; }
.steps { list-style: none; margin: 0; padding: 0; font: 400 .92rem/1.4 "Inter", system-ui, sans-serif; }
.steps li { display: grid; grid-template-columns: 92px 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps small { color: var(--muted); }

/* Quotes */
.quotes { display: grid; gap: 14px; margin: 1.4em 0; }
.quotes blockquote, .quotes p, .quotes div { margin: 0; }
blockquote { margin: 1.2em 0; padding: 16px 20px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
blockquote p:last-child { margin: 0; }
cite { display: block; font: 600 .82rem "Inter", system-ui, sans-serif; font-style: normal; color: var(--muted); margin-top: 8px; }

/* Glossary */
dl.glossary { display: grid; grid-template-columns: 220px 1fr; gap: 0; margin: 1.4em 0; border-top: 1px solid var(--line); }
dl.glossary dt, dl.glossary dd { padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; }
dl.glossary dt { font-weight: 600; padding-right: 16px; }
dl.glossary dd { color: var(--muted); }
@media (max-width: 640px) { dl.glossary { grid-template-columns: 1fr; } dl.glossary dt { border-bottom: 0; padding-bottom: 0; } }

td.benefit { font-weight: 600; vertical-align: middle; border-left: 1px solid var(--line); }
td.b-str { color: var(--accent); } td.b-se { color: #ff9f43; } td.b-hyp { color: var(--blue); } td.b-end { color: #a78bfa; }

/* Videos */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; padding: 24px 0 72px; }
.video { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); overflow: hidden; }
.video .frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video .frame iframe, .video .frame button { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .frame button { padding: 0; cursor: pointer; background: #000 center / cover no-repeat; }
.video .frame button::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%23120805'/%3E%3C/svg%3E") center / 30px no-repeat;
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
}
.video h2 { font-size: 1.2rem; margin: 0; padding: 14px 18px; }

/* Links */
.link-group { margin: 1.4em 0 2.4em; }
.link-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.link-list li + li { border-top: 1px solid var(--line); }
.link-list a { display: flex; justify-content: space-between; gap: 16px; padding: 14px 18px; color: var(--text); text-decoration: none; font: 500 .95rem/1.4 "Inter", system-ui, sans-serif; }
.link-list a:hover { background: var(--surface-2); }
.link-list small { display: block; color: var(--muted); font-weight: 400; }
.link-list a::after { content: "↗"; color: var(--accent); }

/* Athletic calculator result */
.big-result { font: 700 3.4rem/1 var(--head-font); color: var(--accent); margin: 6px 0 4px; }
.status { font: 400 .9rem "Inter", system-ui, sans-serif; color: var(--muted); min-height: 1.4em; }
.status.error { color: #ff7b72; }
tr.hl td { color: var(--accent); font-weight: 600; }

/* Carried-over quote blocks (abc.php) */
.quote-box { display: flow-root; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: 18px 22px 4px; margin: 1.2em 0; }
.quote-box img { float: right; max-width: 40%; height: auto; margin: 4px 0 12px 18px; border-radius: var(--radius); }
.txt-small { font: 500 .85rem/1.5 "Inter", system-ui, sans-serif; color: var(--muted); }
@media (max-width: 560px) { .quote-box img { float: none; max-width: 100%; margin: 0 0 12px; } }

/* Phones: never let content push the page wider than the screen */
.layout > *, .calc > *, .variant > *, .card { min-width: 0; }
@media (max-width: 560px) {
  .card { padding: 18px; }
  .summary { grid-template-columns: minmax(0, 1fr); }
  .summary[style] { grid-template-columns: minmax(0, 1fr) !important; }
  .profile { gap: 14px; }
  .profile img { width: 64px; height: 64px; }
}