/* ExtraRace 2026. Palette and hard edges come from the school's ER4 flyer:
   black, race orange, sky blue, and a checkered flag. */
:root {
  --ink: #000;
  --paper: #fff;
  --orange: #f68b1f;
  --blue: #5fb0e5;
  --stone: #dedbd6;
  --gutter: clamp(1rem, 4vw, 2rem);
  --display: 900 1em/0.95 Archivo, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font: 400 1.0625rem/1.5 Archivo, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }

/* Top bar */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem var(--gutter);
  background: var(--ink); color: var(--paper);
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 800; font-stretch: 112%; }
.top nav { display: flex; align-items: center; gap: 1rem; }
.top form { margin: 0; }

.btn {
  display: inline-block; padding: 0.7rem 1.1rem; border: 0; cursor: pointer;
  background: var(--orange); color: var(--ink);
  font: inherit; font-weight: 800; text-decoration: none;
}
.btn:hover { background: var(--paper); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.plain { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }

/* Hero: the flyer's black block, with the two ways to change the race */
.hero { padding: clamp(1.5rem, 6vw, 4rem) var(--gutter) clamp(1.5rem, 5vw, 3rem); background: var(--ink); color: var(--paper); }
.hero > * { max-width: 60rem; margin-inline: auto; }
.hero h1 { margin-block: 0 1rem; font: var(--display); font-size: clamp(2.6rem, 11vw, 7rem); font-stretch: 110%; letter-spacing: -0.03em; }
.hero h1 span { color: var(--orange); }
.pitch { margin-block: 0 1.75rem; padding-right: min(24rem, 10%); font-size: clamp(1.05rem, 2.4vw, 1.3rem); }

.power { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(0.5rem, 2vw, 1rem); }
.power a {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 0.25rem;
  min-height: clamp(7rem, 22vw, 11rem); padding: clamp(0.75rem, 3vw, 1.5rem);
  color: var(--ink); text-decoration: none;
  transition: transform 120ms ease-out;
}
.power .up { background: var(--orange); }
.power .down { background: var(--blue); }
.power strong { font: var(--display); font-size: clamp(1.5rem, 6.5vw, 3.5rem); font-stretch: 110%; letter-spacing: -0.02em; }
.power span { font-weight: 600; font-size: clamp(0.85rem, 2.6vw, 1.1rem); line-height: 1.25; }
.power a:hover, .power a:focus-visible { transform: translateY(-4px); }
.power .down:hover, .power .down:focus-visible { transform: translateY(4px); }
.power a:active { transform: translateY(0); }

.give { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; margin-block: 1.25rem 0; font-weight: 700; }

.checker {
  height: 28px;
  background: conic-gradient(var(--ink) 25%, var(--paper) 0 50%, var(--ink) 0 75%, var(--paper) 0) 0 0 / 28px 28px;
}

/* Feed: a race timeline. The time rail is the structure. */
.feed { max-width: calc(60rem + 2 * var(--gutter)); margin-inline: auto; padding: 1.5rem var(--gutter) 3rem; }
.shot { max-width: 42rem; }
.sort { display: inline-flex; margin-bottom: 1.75rem; border: 2px solid var(--ink); }
.sort a { padding: 0.55rem 1rem; font-weight: 800; text-decoration: none; }
.sort a[aria-current] { background: var(--ink); color: var(--paper); }

.post { margin-bottom: 2rem; }
.post time { display: block; margin-bottom: 0.4rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.shot img { width: 100%; background: var(--stone); }
.shot p { margin: 0.6rem 0 0; overflow-wrap: anywhere; }

/* Comments hang off the photo they belong to */
.comments { list-style: none; margin: 0.6rem 0 0; padding: 0; font-size: 0.975rem; overflow-wrap: anywhere; }
.comments:empty { display: none; }
.comments li { padding: 0.45rem 0 0.45rem 0.75rem; border-left: 4px solid var(--stone); }
.comments li + li { margin-top: 0.25rem; }
.say { display: flex; margin-top: 0.75rem; border: 2px solid var(--ink); }
.say input { flex: 1; min-width: 0; padding: 0.6rem 0.75rem; border: 0; border-radius: 0; background: none; font: inherit; font-size: 1.0625rem; }
.say button { padding: 0 1rem; border: 0; background: var(--ink); color: var(--paper); font: inherit; font-weight: 800; cursor: pointer; }

@media (min-width: 46rem) {
  .post { display: grid; grid-template-columns: 7.5rem 1fr; margin-bottom: 0; }
  .post time { padding-top: 0.1rem; text-align: right; padding-right: 1rem; }
  .shot { padding: 0 0 2.5rem 1.25rem; border-left: 2px solid var(--ink); position: relative; }
  /* a marker where each photo meets the rail */
  .shot::before { content: ""; position: absolute; left: -7px; top: 0.45rem; width: 12px; height: 12px; background: var(--orange); }
}

.more { display: block; padding: 0.9rem; border: 2px solid var(--ink); text-align: center; font-weight: 800; text-decoration: none; }
.empty { padding: 2rem 0; font-size: 1.15rem; }

/* Sign-in and posting forms */
.form { max-width: 30rem; margin-inline: auto; padding: 2rem var(--gutter) 3rem; }
.form h1 { margin-block: 0 0.75rem; font: var(--display); font-size: clamp(2rem, 7vw, 2.75rem); letter-spacing: -0.02em; }
.form form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.form label { display: grid; gap: 0.35rem; font-weight: 700; }
.form input:not([type=hidden]), .form textarea {
  width: 100%; padding: 0.75rem; border: 2px solid var(--ink); border-radius: 0;
  background: var(--paper); color: var(--ink);
  font: inherit; font-size: 1.0625rem; /* 16px+ stops iOS zooming on focus */
}
.form .code { font-size: 1.75rem; font-weight: 800; letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }
.form .btn { padding: 0.9rem 1.1rem; font-size: 1.1rem; }
.form .btn:hover { background: var(--ink); color: var(--paper); }
.form .hint { display: block; margin-top: 1.5rem; }
.error { margin: 1rem 0 0; padding: 0.75rem 1rem; border-left: 6px solid var(--orange); background: var(--stone); font-weight: 600; }

.foot { padding: 1.5rem var(--gutter); background: var(--ink); color: var(--paper); font-size: 0.95rem; }
.foot p { max-width: 60rem; margin: 0 auto; }

@media (prefers-reduced-motion: reduce) {
  .power a { transition: none; }
  .power a:hover, .power a:focus-visible { transform: none; }
}
