:root {
  --navy: #08111c;
  --navy-2: #122033;
  --ink: #172033;
  --muted: #5d6b7c;
  --paper: #f4efe6;
  --paper-2: #fbf7f1;
  --line: rgba(23, 32, 51, 0.14);
  --gold: #e4c98a;
  --gold-deep: #b88a3d;
  --cyan: #00afca;
  --danger: #8c2f2f;
  --serif: "Cormorant Garamond", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: Manrope, "Segoe UI", sans-serif;
  --measure: 72rem;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}
img, svg { display: block; }
a { color: inherit; }
button, input { font: inherit; }
::selection { background: var(--gold); color: var(--navy); }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--gold);
  color: var(--navy);
  padding: 0.5rem 0.8rem;
  z-index: 20;
}
.skip:focus { top: 0.5rem; }

.wrap {
  width: min(var(--measure), calc(100% - 2.5rem));
  margin-inline: auto;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.hp {
  position: absolute;
  left: -10000px;
  height: 0;
  overflow: hidden;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(8, 17, 28, 0.94);
  color: #f6f1e7;
  backdrop-filter: blur(14px);
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.6rem;
}
.flag-rule {
  height: 4px;
  background:
    linear-gradient(#e4c98a, #e4c98a) 0 0 / 100% 3px no-repeat,
    var(--cyan);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}
.mark { width: 36px; height: 36px; flex: none; }
.brand-text { display: grid; line-height: 1.15; }
.brand-text strong { font-size: 0.92rem; font-weight: 700; }
.brand-text em { font-style: normal; color: var(--gold); font-size: 0.78rem; letter-spacing: 0.02em; }
.nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; justify-content: flex-end; }
.nav a, .text-button {
  color: #f6f1e7;
  text-decoration: none;
  font-size: 0.92rem;
}
.nav a:hover, .text-button:hover { color: var(--gold); }
.languages { display: flex; align-items: center; gap: 0.15rem; }
.languages form { margin: 0; }
.languages button {
  background: none;
  border: 0;
  padding: 0.2rem 0.4rem;
  color: rgba(246, 241, 231, 0.72);
  cursor: pointer;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}
.languages button[aria-current="true"] { color: var(--gold); font-weight: 700; }
.languages-on-light { margin-bottom: 1rem; }
.languages-on-light button { color: var(--muted); }
.languages-on-light button[aria-current="true"] { color: var(--navy); }
.text-button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.hero {
  background:
    radial-gradient(circle at 88% 0%, rgba(0, 175, 202, 0.18), transparent 26%),
    linear-gradient(rgba(228, 201, 138, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(228, 201, 138, 0.05) 1px, transparent 1px),
    var(--navy);
  background-size: auto, 32px 32px, 32px 32px, auto;
  color: #f6f1e7;
  padding: 4.5rem 0 4rem;
}
.hero-grid, .submit-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 3rem;
  align-items: end;
}
.submit-grid { align-items: start; grid-template-columns: 0.85fr 1.15fr; }
.kicker {
  margin: 0 0 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.kicker-dark { color: var(--gold-deep); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; }
h1 { margin: 0; font-size: clamp(2.7rem, 5.4vw, 4.7rem); line-height: 0.92; }
h2 { margin: 0; font-size: clamp(2.1rem, 4vw, 3.3rem); line-height: 0.98; }
h3 { margin: 0.4rem 0 0.6rem; font-size: 1.85rem; line-height: 1.05; }
.lede, .submit-copy p { max-width: 40rem; color: rgba(246, 241, 231, 0.86); font-size: 1.05rem; }
.organizer {
  margin: 1.1rem 0 0;
  max-width: 40rem;
  color: var(--gold);
  font-size: 1.15rem;
}
.submit-copy p { color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}
.button:hover { background: #f0d9a4; }
.button:disabled { opacity: 0.6; cursor: wait; }
.button-ghost { background: transparent; color: var(--gold); }
.button-ghost:hover { background: rgba(228, 201, 138, 0.08); }
.button-wide { width: 100%; }

.final-card {
  border: 1px solid rgba(228, 201, 138, 0.45);
  padding: 1.4rem 1.4rem 0.6rem;
  background: rgba(8, 17, 28, 0.45);
}
.final-date {
  margin: 0;
  font-family: var(--serif);
  font-size: 2.6rem;
  line-height: 1;
}
.final-place { margin: 0.35rem 0 1rem; color: rgba(246, 241, 231, 0.78); }
.prizes { list-style: none; margin: 0; padding: 0; }
.prizes li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(228, 201, 138, 0.28);
}
.prizes span { color: var(--gold); letter-spacing: 0.08em; }
.prizes b { font-weight: 600; }

.directions { padding: 4.5rem 0 1rem; }
.section-head { max-width: 40rem; margin-bottom: 1.8rem; }
.track-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.track {
  min-height: 16rem;
  padding: 1.3rem 1.2rem 1.4rem;
  background: var(--paper-2);
  border-top: 3px solid var(--gold-deep);
}
.track-index {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--gold-deep);
}
.track p { margin: 0; color: var(--muted); }

.submit { padding: 3rem 0 4.5rem; }
.submit-copy h2, .panel h1 { color: var(--navy); }
.steps { margin: 1.5rem 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step;
  padding: 0.7rem 0 0.7rem 2.4rem;
  position: relative;
  border-top: 1px solid var(--line);
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  color: var(--gold-deep);
  font-size: 0.82rem;
  font-weight: 700;
}

.card, .login-card {
  background: white;
  border: 1px solid var(--line);
  padding: 1.4rem;
}
fieldset { border: 0; margin: 0 0 1rem; padding: 0; }
legend { font-weight: 700; margin-bottom: 0.7rem; }
.choices { display: grid; gap: 0.55rem; }
.choice { position: relative; display: block; }
.choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.choice span {
  display: block;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.choice small {
  display: block;
  color: var(--gold-deep);
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}
.choice:has(input:checked) span {
  border-color: var(--gold-deep);
  background: #fff8ea;
}
.choice:has(input:focus-visible) span { outline: 2px solid var(--cyan); outline-offset: 2px; }

.field { margin-bottom: 1rem; }
.field label, legend { font-weight: 700; }
.field input[type="email"], .field input[type="text"], .field input[type="password"], .search input {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.8rem 0.85rem;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}
.field input:focus-visible, .search input:focus-visible, .button:focus-visible, .nav a:focus-visible, .text-button:focus-visible, .languages button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.drop {
  position: relative;
  margin-top: 0.45rem;
  padding: 1rem;
  border: 1px dashed rgba(23, 32, 51, 0.35);
  background: var(--paper-2);
}
.drop.is-over { border-color: var(--gold-deep); background: #fff8ea; }
.drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-button {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-weight: 700;
  color: var(--navy);
}
.file-name, .muted { color: var(--muted); }
.field-error, .form-error { color: var(--danger); }
.form-error {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  background: #f8ecec;
}
.messages { margin-bottom: 1rem; }
.message {
  margin: 0;
  padding: 0.85rem 1rem;
  background: #143d45;
  color: #f6f1e7;
  border-left: 4px solid var(--gold);
}

.site-footer {
  background: var(--navy);
  color: rgba(246, 241, 231, 0.82);
  padding: 2rem 0;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
}
.footer-title { margin: 0 0 0.35rem; color: #f6f1e7; max-width: 36rem; }
.site-footer a { color: var(--gold); }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(circle at 80% 0%, rgba(0, 175, 202, 0.16), transparent 24%),
    var(--navy);
}
.login-card { width: min(28rem, 100%); }
.login-card h1 { font-size: 2.6rem; margin: 1.2rem 0 0.4rem; }
.login-lead { margin-top: 0; color: var(--muted); }
.brand-dark { color: var(--navy); text-decoration: none; }

.panel { padding: 2.5rem 0 4rem; }
.panel-note { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.4rem 0; }
.pill {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  background: white;
  text-decoration: none;
  color: var(--ink);
}
.pill span { color: var(--muted); }
.pill.is-active { border-color: var(--navy); background: var(--navy); color: #f6f1e7; }
.pill.is-active span { color: var(--gold); }
.search { display: flex; gap: 0.6rem; margin-bottom: 1rem; }
.search input { margin-top: 0; }
.result-count { color: var(--muted); }
.sheet { width: 100%; border-collapse: collapse; background: white; }
.sheet th, .sheet td {
  padding: 0.9rem 0.8rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.sheet th {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.sheet a { color: #0d5f73; }
.empty { padding: 2rem 0; color: var(--muted); }
.pager { display: flex; gap: 0.4rem; margin-top: 1rem; }
.pager a, .pager span {
  min-width: 2.2rem;
  padding: 0.35rem 0.55rem;
  text-align: center;
  border: 1px solid var(--line);
  background: white;
  text-decoration: none;
}
.pager span { background: var(--navy); color: white; }

@media (max-width: 900px) {
  .hero-grid, .submit-grid, .track-grid, .footer-grid, .search { grid-template-columns: 1fr; display: grid; }
  .footer-grid, .search, .bar { display: flex; flex-wrap: wrap; }
  .hero { padding-top: 3rem; }
  h1 { font-size: 2.5rem; }
  .sheet thead { display: none; }
  .sheet tr { display: grid; gap: 0.35rem; padding: 0.8rem 0; }
  .sheet td { display: block; border: 0; padding: 0; }
  .sheet td::before {
    content: attr(data-label);
    display: block;
    margin-top: 0.45rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
