/*
 * Fight Your Shadow website — "Corner Gym" (docs/conventions/design.md).
 * One stylesheet for every page: the app's colour tokens, its three fonts
 * (self-hosted below), and the shared pieces.
 * Dark only, square corners, the only red is the glove red.
 */
/* The app's own fonts, self-hosted as Latin woff2 subsets (public/fonts,
   made from assets/fonts; licences OFL-*.txt beside them). No Google Fonts
   request: it blocked the first paint by ~0.7 s on a phone (2026-11-25). */
@font-face { font-family: 'Alfa Slab One'; font-weight: 400; font-display: swap; src: url('/fonts/AlfaSlabOne-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Oswald'; font-weight: 400; font-display: swap; src: url('/fonts/Oswald-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Oswald'; font-weight: 600; font-display: swap; src: url('/fonts/Oswald-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Libre Franklin'; font-weight: 400; font-display: swap; src: url('/fonts/LibreFranklin-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Libre Franklin'; font-weight: 600; font-display: swap; src: url('/fonts/LibreFranklin-SemiBold.woff2') format('woff2'); }

:root {
  --ink: #0A0A0A;
  --surface: #141312;
  --surface-raised: #1E1D1B;
  --line: #3A3836;
  --shadow: #272726;
  --red: #BC2B23;
  --red-pressed: #A8251E; /* hover/pressed fill of a red button */
  --red-text: #DD5B51;   /* small red text and icons on ink/surface */
  --cream: #F2E6CB;
  --cream-muted: #A39C8C;

  --font-display: 'Alfa Slab One', Georgia, serif;
  --font-label: 'Oswald', 'Arial Narrow', Arial, Helvetica, sans-serif;
  --font-body: 'Libre Franklin', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

  --rope: linear-gradient(var(--red) 0 3px, var(--cream) 3px 6px, var(--shadow) 6px 9px);
  color-scheme: dark;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ink); }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  background: var(--ink);
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}
img { max-width: 100%; }

/* ---------- Type ---------- */
/* Alfa Slab One has one weight: never bold it. */
h1, h2, .slab {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.1;
  color: var(--cream);
}
h1 { font-size: 30px; }
h2 { font-size: 22px; }
strong, b { font-weight: 600; }

.label {
  font-family: var(--font-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
}

/* ★ ACADEMY ★ — above a title. */
.eyebrow {
  display: block;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--red-text);
}
.eyebrow::before { content: "\2605\00a0\00a0"; content: "\2605\00a0\00a0" / ""; }
.eyebrow::after { content: "\00a0\00a0\2605"; content: "\00a0\00a0\2605" / ""; }

a {
  color: var(--cream);
  text-decoration: underline;
  text-decoration-color: var(--red-text);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { color: var(--red-text); }
:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }

/* ---------- Ring-rope stripe ---------- */
.rope { height: 9px; background: var(--rope); }
/* At the very top of a page (works on centred flex bodies too). */
.rope-top { position: relative; }
.rope-top::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 9px;
  background: var(--rope);
}

/* ---------- Page shell for the small pages ---------- */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 32px;
}
.card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 32px 24px;
}
.app-logo {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 16px;
}
.muted { color: var(--cream-muted); }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 14px 28px;
  border: 0;
  border-radius: 0;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  color: var(--cream);
  background: transparent;
  cursor: pointer;
}
.btn:hover { color: var(--cream); }
.btn-block { display: flex; width: 100%; }
/* Primary: red fill, the double rule 3px outside (leave 5px around it). */
.btn-primary {
  background: var(--red);
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
.btn-primary:hover { background: var(--red-pressed); }
.btn-primary:focus-visible { outline-color: var(--cream); }
.btn-primary:disabled {
  background: var(--shadow);
  outline-color: var(--shadow);
  color: var(--cream-muted);
  cursor: not-allowed;
}
/* Secondary: transparent, 2px cream border. */
.btn-secondary { border: 2px solid var(--cream); }
.btn-secondary:hover { background: var(--surface-raised); }
.btn-secondary:disabled { border-color: var(--shadow); color: var(--cream-muted); cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; text-align: left; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cream);
}
.form-group input {
  width: 100%;
  padding: 13px 14px;
  font: 16px/1.4 var(--font-body);
  color: var(--cream);
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.form-group input::placeholder { color: var(--cream-muted); opacity: 1; }
.form-group input:focus { outline: none; border-color: var(--cream); box-shadow: inset 0 0 0 1px var(--cream); }

/* ---------- Notices: words + an icon, never colour alone ---------- */
.notice {
  position: relative;
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
  color: var(--cream);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-left: 4px solid var(--cream-muted);
  padding: 12px 14px 12px 44px;
}
.notice::before {
  position: absolute;
  left: 14px;
  top: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 13px/1 var(--font-label);
}
.notice-error { border-left-color: var(--red-text); }
.notice-error::before { content: "!"; content: "!" / ""; color: var(--ink); background: var(--red-text); }
.notice-success { border-left-color: var(--cream); }
.notice-success::before { content: "\2713"; content: "\2713" / ""; color: var(--ink); background: var(--cream); }

/* ---------- Icon disc: cream disc, red ring, ink icon ---------- */
.icon-disc {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 0 auto 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  border: 3px solid var(--red);
}
.icon-disc svg { width: 40px; height: 40px; stroke: var(--ink); stroke-width: 2.5; fill: none; }
.icon-disc.is-error { background: var(--surface-raised); border-color: var(--red-text); }
.icon-disc.is-error svg { stroke: var(--red-text); }

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--shadow);
  border-top-color: var(--cream);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 3s; }
}
