/* ===========================================================
   Endurance Department x TC Marathon — shared design tokens
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #131210;
  --bg-raised: #1c1a17;
  --bone: #ece6d8;
  --bone-dim: #a39c8c;
  --accent: #b5502d;
  --accent-dim: #7c3a20;
  --line: #38342c;
  --danger: #a63a2f;
  --ok: #6b7a4f;

  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  --max-w: 640px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: radial-gradient(circle at 1px 1px, #fff 1px, transparent 0);
  background-size: 3px 3px;
}

a { color: inherit; }

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 22px 18px;
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.site-header img { height: 64px; width: auto; display: block; }

.site-header nav a {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--bone-dim);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.site-header nav a:hover { color: var(--bone); border-color: var(--accent); }

/* ---------- Type ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0;
  line-height: 0.95;
}

h1 { font-size: 56px; }
h2 { font-size: 30px; }
h3 { font-size: 20px; }

.subtitle {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 21px;
  color: var(--bone);
  margin-top: 8px;
}

.tagline {
  font-family: var(--font-body);
  font-weight: 600;
  font-style: italic;
  font-size: 15px;
  color: var(--accent);
  margin-top: 14px;
}

.highlight { font-weight: 800; color: var(--accent); font-style: normal; }

p { margin: 0; color: var(--bone-dim); }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: lowercase;
}

/* ---------- Sections & rules ---------- */

section { padding: 40px 0; }
.hr { border: none; border-top: 1px solid var(--line); margin: 0; }

.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Form ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--bone);
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.field .optional-tag {
  font-weight: 700;
  font-size: 11px;
  color: var(--accent);
  text-transform: lowercase;
}

input[type="text"], textarea, select {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 14px;
  border-radius: 2px;
  transition: border-color 0.15s ease;
}
input[type="text"]:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
input::placeholder, textarea::placeholder { color: #6b6459; }
textarea { resize: vertical; min-height: 70px; font-family: var(--font-body); }
select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a39c8c' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
select option { background: var(--bg-raised); color: var(--bone); }

/* ---------- Toggle button group (race picker) ---------- */

.toggle-group { display: flex; gap: 8px; }

.toggle-btn {
  flex: 1;
  padding: 13px 8px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--bone-dim);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.01em;
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.toggle-btn:hover { border-color: var(--bone-dim); color: var(--bone); }
.toggle-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bone);
}

@media (max-width: 400px) {
  .toggle-btn { font-size: 12px; padding: 12px 4px; }
}

.hint { font-size: 12px; color: var(--bone-dim); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 20px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.03em;
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.btn-solid { background: var(--accent); color: var(--bone); }
.btn-solid:hover { background: var(--accent-dim); }
.btn-solid:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-outline { background: transparent; color: var(--bone); border-color: var(--line); }
.btn-outline:hover { border-color: var(--bone-dim); }

.btn-lg {
  padding: 22px 20px;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.btn-ghost {
  background: transparent;
  color: var(--bone-dim);
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  width: auto;
  padding: 6px 0;
}

/* ---------- Status messages ---------- */

.status { font-size: 13px; padding: 10px 12px; border-left: 2px solid; display: none; }
.status.show { display: block; }
.status-ok { border-color: var(--ok); color: #c3cca9; background: rgba(107,122,79,0.1); }
.status-err { border-color: var(--danger); color: #e4a99e; background: rgba(166,58,47,0.1); }

/* ---------- Info list ---------- */

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.info-row:last-child { border-bottom: none; }
.info-row .name { font-weight: 700; color: var(--bone); font-size: 14px; }
.info-row .meta { font-size: 13px; color: var(--bone-dim); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Roster cards ---------- */

.roster-card {
  border: 1px solid var(--line);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roster-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }

.roster-name { font-family: var(--font-display); font-size: 22px; line-height: 1; }

.race-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  border: 1px solid;
  white-space: nowrap;
  margin-left: 8px;
  vertical-align: middle;
}
.race-tag-marathon { color: var(--accent); border-color: var(--accent); background: rgba(181,80,45,0.12); }
.race-tag-half { color: #a6b07d; border-color: #6b7a4f; background: rgba(107,122,79,0.14); }
.race-tag-10-mile { color: var(--bone-dim); border-color: var(--bone-dim); background: rgba(163,156,140,0.1); }
.roster-bib {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: var(--bg);
  background: var(--bone-dim);
  padding: 3px 7px;
  border-radius: 2px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.roster-ig {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}
.roster-ig:hover { text-decoration: underline; }

.roster-times {
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--bone-dim);
  font-variant-numeric: tabular-nums;
}
.roster-times b { color: var(--bone); font-weight: 600; }

.roster-standout {
  font-size: 13px;
  color: var(--bone-dim);
  font-style: italic;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 2px;
}

.roster-rank {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--accent);
  min-width: 26px;
}

footer {
  padding: 40px 22px 60px;
  text-align: center;
  font-size: 12px;
  color: #5c574c;
}

.count-badge {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--bone-dim);
}
.count-badge b { color: var(--accent); font-weight: 700; }

@media (max-width: 420px) {
  h1 { font-size: 40px; }
}
