@font-face { font-family: 'Archivo'; src: url('/fonts/Archivo.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'Martian Mono'; src: url('/fonts/MartianMono.woff2') format('woff2'); font-weight: 100 800; font-stretch: 75% 112.5%; font-display: swap; }

:root {
  --bg: #222222; --bg2: #1b1b1b; --panel: #272727; --panel2: #2e2e2e;
  --line: #3b3b3b; --line2: #555555;
  --text: #e7ece5; --muted: #adb3b7; --dim: #7c8287;
  --accent: #ff781e; --accent-2: #ff9247; --accent-ink: #1a0d04;
  --ok: #8fd18f; --bad: #e07070;
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Martian Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 720px; --gut: 20px;
  --nav: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
body.has-nav { padding-bottom: calc(var(--nav) + 12px); }
a, button, input, select, textarea, label { touch-action: manipulation; }
input, select, textarea { font-size: 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1; letter-spacing: -.01em; font-weight: 800; text-transform: uppercase; }
h1 { font-size: clamp(2.4rem, 8vw, 4.4rem); font-stretch: 108%; line-height: .92; }
h1 em { display: block; font-style: normal; color: var(--muted); font-size: .48em; font-weight: 700; margin-top: .35em; letter-spacing: 0; }
h2 { font-size: clamp(1.4rem, 3.4vw, 2rem); font-stretch: 105%; margin: 28px 0 12px; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.mono { font-family: var(--mono); font-size: .7rem; letter-spacing: .02em; text-transform: uppercase; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }

/* ticker, norwood-style */
.ticker { background: var(--accent); color: var(--accent-ink); overflow: hidden; white-space: nowrap; font-weight: 500; padding: 6px 0; border-bottom: 1px solid #000; }
.ticker-track { display: inline-flex; animation: ticker 42s linear infinite; }
.ticker-track span { padding: 0 14px; }
.ticker-track span::after { content: '/'; margin-left: 28px; opacity: .55; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* header */
.top { max-width: var(--max); margin: 0 auto; padding: 16px var(--gut) 14px; display: flex; justify-content: space-between; align-items: start; gap: 16px; border-bottom: 1px solid var(--line); }
.brand { color: var(--text); display: grid; line-height: .9; }
.brand:hover { text-decoration: none; }
.brand b { font-size: 1.45rem; font-weight: 800; font-stretch: 108%; text-transform: uppercase; letter-spacing: -.01em; }
.brand span { color: var(--accent); margin-top: 6px; }
.top .right { display: flex; gap: 14px; align-items: center; color: var(--muted); padding-top: 4px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 20px; border: 1px solid var(--line2); background: var(--panel); color: var(--text); font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 500; cursor: pointer; border-radius: 0; }
.btn:hover { text-decoration: none; border-color: var(--muted); background: var(--panel2); }
.btn.primary, .btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover, .btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.wide { width: 100%; }
.btn.ghost, .btn-ghost { background: transparent; }
.btn-outline { background: transparent; color: var(--accent); border: 1px dashed var(--accent); }
.btn-outline:hover { background: rgba(255,120,30,.12); border-style: solid; }
.btn-lg { padding: 16px 26px; font-size: .78rem; }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: .66rem; }

/* landing */
.hero { padding: 40px 0 12px; }
.kicker { color: var(--accent); display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; font-weight: 500; }
.kicker::before { content: ''; width: 28px; height: 1px; background: var(--accent); }
.lede, .lead { font-size: 1.08rem; color: var(--muted); max-width: 48ch; margin: 18px 0 0; }
.spec { list-style: none; padding: 0; margin: 26px 0 0; border-top: 1px solid var(--line); max-width: 520px; }
.spec li { display: grid; grid-template-columns: 88px 1fr; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.spec li span:first-child { color: var(--dim); }
.spec li b { font-weight: 500; color: var(--text); }
.cta-row, .actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 28px 0 14px; }
.howto { display: grid; gap: 10px; margin: 36px 0 8px; }
.howto .card b { color: var(--accent); display: block; margin-bottom: 8px; }
.howto .card h3 { margin-bottom: 8px; }
.howto .card p { margin: 0; color: var(--muted); }

.card { background: var(--panel); border: 1px solid var(--line2); padding: 18px; margin: 0 0 12px; }
.flash { background: #2a221c; border: 1px solid var(--accent); color: var(--text); padding: 12px 14px; margin: 0 0 14px; }
.flash.err { background: #2a1818; border-color: var(--bad); }
.flash.ok { border-color: var(--ok); }
.banner { background: var(--accent); color: var(--accent-ink); padding: 12px 14px; margin: 12px 0; font-weight: 700; display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner a { color: var(--accent-ink); text-decoration: underline; }

/* forms / wizard */
.field { display: grid; gap: 6px; margin: 0 0 14px; }
.field label, form > label { font-family: var(--mono); font-size: .65rem; text-transform: uppercase; color: var(--dim); letter-spacing: .04em; }
input[type=text], input[type=email], input[type=number], input[type=password], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line2); font: inherit; border-radius: 0;
}
select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path fill='%237c8287' d='M1 1.5L6 6.5 11 1.5 12 2.5 6 8.5 0 2.5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checks { display: grid; gap: 8px; }
.checks label { display: flex; gap: 10px; align-items: center; min-height: 44px; color: var(--text); font-size: 1rem; text-transform: none; font-family: var(--font); letter-spacing: 0; }
.checks input { accent-color: var(--accent); width: 18px; height: 18px; }
.days { display: grid; gap: 8px; margin-bottom: 18px; }
.day-row { display: grid; grid-template-columns: 1fr 140px; gap: 12px; align-items: center; border: 1px solid var(--line); padding: 8px 12px; background: var(--bg); min-height: 56px; }
.day-row.off { opacity: .4; }
.day-check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 1rem; text-transform: none; font-family: var(--font); letter-spacing: 0; color: var(--text); }
.day-check input { accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.sec-label { margin: 22px 0 10px; font-size: 1rem; }
.stat { display: grid; gap: 6px; margin: 0 0 12px; }
.stat > label { font-family: var(--mono); font-size: .65rem; text-transform: uppercase; color: var(--dim); letter-spacing: .04em; }
.stat-in { display: grid; grid-template-columns: 1fr auto; border: 1px solid var(--line2); background: var(--bg); }
.stat-in input { border: 0; min-height: 48px; background: transparent; }
.stat-in .addon { display: flex; align-items: center; padding: 0 12px; color: var(--dim); font-family: var(--mono); font-size: .65rem; text-transform: uppercase; border-left: 1px solid var(--line); }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { appearance: none; margin: 0; }
input[type=number] { appearance: textfield; }
.hide { display: none !important; }
.pk { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pk:last-of-type { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.pk-name { font-weight: 700; }
.gear { margin-bottom: 8px; }
.gear-group { border: 1px solid var(--line2); margin: 0 0 12px; }
.gear-h { padding: 8px 14px; background: var(--bg2); border-bottom: 1px solid var(--line); color: var(--accent); }
.gear-item { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: start; }
.gear-item:last-child { border-bottom: 0; }
.gear-item:hover { background: var(--panel2); }
.gear-item input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; }
.gear-item b { display: block; font-stretch: 90%; text-transform: uppercase; }
.gear-item .muted { display: block; font-size: .92rem; }
.ladder .rung { grid-template-columns: 1fr; }
.units { display: inline-flex; border: 1px solid var(--line2); }
.units label { padding: 10px 14px; cursor: pointer; font-family: var(--mono); font-size: .7rem; text-transform: uppercase; }
.units label:has(input:checked) { background: var(--accent); color: var(--accent-ink); }
.units input { display: none; }
.na { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.progress { display: flex; gap: 6px; margin: 8px 0 18px; }
.progress i { flex: 1; height: 4px; background: var(--line); }
.progress i.on { background: var(--accent); }

.ladder { display: grid; border: 1px solid var(--line2); margin-bottom: 24px; }
.ladder label, .ladder .rung { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); align-items: start; }
.ladder label:last-child, .ladder .rung:last-child { border-bottom: 0; }
.ladder label { cursor: pointer; }
.ladder label:hover { background: var(--panel2); }
.ladder input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; }
.ladder b { display: block; font-stretch: 90%; text-transform: uppercase; }
.ladder span span, .ladder .muted { color: var(--muted); font-size: .92rem; font-weight: 400; text-transform: none; }
.ladder label:has(input:checked) { background: #2a221c; box-shadow: inset 3px 0 0 var(--accent); }

/* WOD */
.wod-head { padding: 22px 0 10px; display: grid; gap: 6px; }
.wod-head .meta { display: flex; justify-content: space-between; gap: 10px; color: var(--dim); flex-wrap: wrap; }
.wod-block { margin: 0 0 14px; border: 1px solid var(--line2); background: var(--panel); position: relative; }
.wod-block::before, .wod-block::after { content: ''; position: absolute; width: 8px; height: 8px; border: 1px solid var(--accent); pointer-events: none; }
.wod-block::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.wod-block::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.wod-block .hb { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.wod-block .hb b { font-stretch: 90%; text-transform: uppercase; letter-spacing: .02em; }
.ex { padding: 16px 14px; border-bottom: 1px solid var(--line); }
.ex:last-child { border-bottom: 0; }
.ex-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ex .nm { font-size: 1.2rem; font-weight: 800; text-transform: uppercase; font-stretch: 100%; line-height: 1.1; }
.ex .rx { font-family: var(--mono); font-size: .75rem; color: var(--accent); letter-spacing: .02em; margin-top: 6px; }
.ex .cue { color: var(--muted); font-size: .95rem; margin: 8px 0 0; }
.recipe-kicker { color: var(--accent); margin: 12px 0 0; }
.recipe { list-style: none; padding: 0; margin: 4px 0 0; }
.recipe li { display: grid; grid-template-columns: 5.6rem 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.recipe li:last-child { border-bottom: 0; }
.recipe-dose { color: var(--accent); font-size: .72rem; }
.recipe-name { font-weight: 700; text-transform: uppercase; font-stretch: 100%; font-size: .98rem; line-height: 1.15; }
.watch { font-family: var(--mono); font-size: .65rem; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); border: 1px dashed var(--accent); padding: 4px 8px; white-space: nowrap; flex: none; }
.watch:hover { text-decoration: none; background: rgba(255,120,30,.12); border-style: solid; }

.week-grid { display: grid; gap: 10px; }
.week { border: 1px solid var(--line2); }
.week h3 { padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.week a, .week .rest { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); color: var(--text); align-items: center; }
.week a:last-child, .week .rest:last-child { border-bottom: 0; }
.week a:hover { background: var(--panel2); text-decoration: none; }
.week a.today { box-shadow: inset 3px 0 0 var(--accent); }
.week a.done { color: var(--muted); }

.bottom { position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav); background: var(--bg2); border-top: 1px solid var(--line2); display: grid; grid-template-columns: repeat(4, 1fr); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
.bottom a { color: var(--dim); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-family: var(--mono); font-size: .58rem; text-transform: uppercase; letter-spacing: .04em; }
.bottom a:hover { text-decoration: none; color: var(--text); }
.bottom a.on { color: var(--accent); }

.foot { color: var(--dim); font-size: .8rem; padding: 28px 0 20px; border-top: 1px solid var(--line); margin-top: 28px; }

@media (min-width: 800px) { body { font-size: 18px; } }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } .spec li { grid-template-columns: 1fr; gap: 2px; } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }
