:root {
  --navy: #0f172a;
  --navy-2: #111a2e;
  --bg-soft: #f0f4f8;
  --text: #0f172a;
  --muted: #5b6b82;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
  --font-brand: "Permanent Marker", "Outfit", sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { font-family: var(--font); color: var(--text); background: #fff; line-height: 1.5; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50; height: 72px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; background: var(--navy); color: #fff;
}
.nav__logos { display: flex; gap: 10px; align-items: center; }
.nav__logos img { width: 48px; height: 48px; object-fit: contain; border-radius: 50%; }
.nav__brand {
  font-size: 1.75rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #fff; margin-left: 2px;
}
.nav__links { display: flex; gap: 24px; font-size: 12px; font-weight: 500; }
.nav__links a:hover { opacity: .75; }
.nav__links a[aria-current="page"] { border-bottom: 2px solid #fff; }
.nav__toggle { display: none; background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; }

/* Pill-style nav link (e.g. a Register button), add class="nav__cta" */
@media (min-width: 721px) {
  .nav__links .nav__cta { border: 1px solid rgba(255,255,255,.7); border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
  .nav__links .nav__cta:hover { background: #fff; color: var(--navy); opacity: 1; }
}
@media (min-width: 721px) and (max-width: 1180px) { .nav__links { gap: 14px; } }

/* Page content */
main { max-width: 960px; margin: 0 auto; padding: 40px 24px; min-height: 60vh; }
main h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 8px; }
.lead { color: var(--muted); margin: 8px 0 32px; }

/* Buttons */
.btn {
  display: inline-block; padding: 14px 32px; border-radius: 999px;
  font-size: .95rem; font-weight: 500; transition: background .2s, color .2s;
  cursor: pointer; border: 0;
}
.btn--outline { border: 1.5px solid rgba(255,255,255,.85); color: #fff; }
.btn--outline:hover { background: #fff; color: var(--navy); }
.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { background: #1e2a47; }

/* Footer */
.footer { background: var(--navy-2); color: #cbd5e1; padding: 32px 0; font-size: .78rem; text-align: center; }

/* Responsive */
@media (max-width: 720px) {
  .nav { padding: 0 16px; }
  .nav__logos { gap: 8px; }
  .nav__logos img { width: 36px; height: 36px; }
  .nav__brand { font-size: 1.1rem; letter-spacing: .02em; }
  .nav__toggle { display: block; }
  .nav__links {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--navy); padding: 8px 24px 16px;
  }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 12px 0; border-bottom: 1px solid #1f2a44; }
  .nav__links a[aria-current="page"] { border-bottom: 1px solid #1f2a44; font-weight: 700; }
}

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 80vh; display: grid; place-items: center;
  text-align: center; color: #fff; padding: 80px 24px;
  background: var(--navy) url("/assets/hero.webp") center / cover;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgba(15,23,42,.45), rgba(15,23,42,.6));
}
.hero__text { position: relative; z-index: 1; }
.hero h1 { display: flex; flex-direction: column; font-weight: 300; margin: 0; }
.hero__light { font-size: clamp(2rem, 6vw, 3.6rem); letter-spacing: .04em; }
.hero__brand {
  font-family: var(--font-brand); font-size: clamp(2.6rem, 8vw, 5rem);
  font-style: italic; letter-spacing: .02em; line-height: 1.1;
}
.hero p { margin: 18px 0 32px; font-size: 1.05rem; opacity: .9; }
.hero__btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ===== Sections ===== */
.section { padding: 72px 0; }
.section--soft { background: var(--bg-soft); }
.section h2 { font-size: 2.2rem; font-weight: 700; }
.section h3 { font-size: 1.25rem; font-weight: 600; margin: 28px 0 8px; }
.section p, .section li { max-width: 70ch; }
.section ul, .section ol { padding-left: 1.4rem; margin: 8px 0; }
.section li { margin-bottom: 6px; }

/* Page header band (inner pages) */
.pagehead { background: var(--navy); color: #fff; padding: 48px 0; }
.pagehead h1 { font-size: 2.4rem; font-weight: 700; margin: 0; }
.pagehead p { opacity: .85; margin-top: 6px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 32px; }
.card {
  background: var(--navy); color: #fff; border-radius: var(--radius);
  padding: 32px; box-shadow: 0 6px 18px rgba(15,23,42,.18);
  transition: transform .25s; display: flex; flex-direction: column; gap: 10px;
}
.card:hover { transform: translateY(-4px); }
.card h3 { font-size: 1.6rem; margin: 0; }
.card p { opacity: .9; font-size: .95rem; }
.card .btn { align-self: flex-start; margin-top: 8px; }

/* Key facts box */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin: 24px 0;
}
.fact { background: #fff; border: 1px solid #dde4ee; border-radius: var(--radius); padding: 16px 20px; }
.fact b { display: block; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.fact span { font-size: 1.1rem; font-weight: 600; }

/* Notice */
.notice { background: #fff8e6; border-left: 4px solid #e0a800; padding: 14px 18px; border-radius: 6px; margin: 20px 0; max-width: 70ch; }

/* Contest stages */
.stages { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; padding: 0; list-style: none; }
.stages li { background: var(--navy); color: #fff; border-radius: 999px; padding: 8px 18px; font-size: .9rem; }

/* Announcements */
.post { border-bottom: 1px solid #dde4ee; padding: 24px 0; }
.post h2 { font-size: 1.4rem; margin: 0 0 4px; }
.post time { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }
.post p { margin-top: 10px; white-space: pre-wrap; }

/* Winners */
.winners h2 { margin-top: 40px; }
.winners table { width: 100%; max-width: 640px; border-collapse: collapse; margin-top: 12px; }
.winners th, .winners td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #dde4ee; }
.winners th { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
}

/* ===== Forms ===== */
.form { max-width: 560px; margin-top: 24px; display: grid; gap: 18px; }
.form[hidden] { display: none; }
.field label { display: block; font-weight: 500; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--text);
  border: 1px solid #c5d0de; border-radius: 10px; background: #fff;
}
.field input:focus, .field select:focus { outline: 2px solid var(--navy); outline-offset: 1px; }
.field small { display: block; color: var(--muted); margin-top: 4px; }
.field input[readonly] { background: var(--bg-soft); color: var(--muted); cursor: not-allowed; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; } /* honeypot */

.msg { padding: 14px 18px; border-radius: 10px; max-width: 560px; margin-top: 16px; }
.msg--error { background: #fdecef; border-left: 4px solid #e11d48; }
.msg--ok { background: #e8f6ee; border-left: 4px solid #16a34a; }
.msg .btn { margin-top: 12px; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* ===== Registration layout: form left, photo right (same height) ===== */
.reg-layout {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
  gap: 48px;
  align-items: stretch;               /* both columns share the form's height */
}
.reg-layout .form { max-width: none; margin-top: 0; }
.reg-layout .msg { max-width: none; }

.reg-photo {
  position: relative;
  min-height: 320px;
  border-radius: var(--radius); overflow: hidden;
  background: var(--navy);
  box-shadow: 0 6px 18px rgba(15,23,42,.18);
}
.reg-photo img {
  position: absolute; inset: 0;       /* fill the box instead of setting its height */
  width: 100%; height: 100%; object-fit: cover;
}
.reg-photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 16px 12px; font-size: .78rem; color: #fff;
  background: linear-gradient(transparent, rgba(15,23,42,.85));
}

@media (max-width: 860px) {
  .reg-layout { grid-template-columns: 1fr; gap: 28px; }
  .reg-photo { order: -1; min-height: 0; aspect-ratio: 16 / 9; }   /* photo above the form on phones */
}

.field textarea {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--text);
  border: 1px solid #c5d0de; border-radius: 10px; background: #fff; resize: vertical;
}
.field textarea:focus { outline: 2px solid var(--navy); outline-offset: 1px; }
.btn--outline-dark { border: 1.5px solid var(--navy); color: var(--navy); background: transparent; margin-top: 12px; }
.btn--outline-dark:hover { background: var(--navy); color: #fff; }

@media (min-width: 721px) {
  .nav__links .nav__cta[aria-current="page"] {
    background: #fff; color: var(--navy); border-bottom: 1px solid #fff;
  }
}

body {
  min-height: 100vh;
  min-height: 100dvh;      /* accounts for phone browser toolbars */
  display: flex;
  flex-direction: column;
}
.footer { margin-top: auto; }   /* pushes the footer down when the page is short */

/* ===== Admin: filters and table ===== */
.filters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin: 8px 0 16px;
}
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid #dde4ee; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #e6ecf3; vertical-align: top; }
.table th {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap; background: var(--bg-soft);
}
.table tbody tr:hover { background: #f8fafc; }
.btn--small { padding: 6px 14px; font-size: .8rem; margin-top: 0; }