:root {
  color-scheme: light;
  --bg: #f3efe6;
  --bg-accent: #dfe7f4;
  --ink: #1d2a2a;
  --muted: #5c6a6b;
  --accent: #d65b2f;
  --accent-dark: #b44924;
  --card: #ffffff;
  --card-border: rgba(255, 255, 255, 0.9);
  --line: rgba(29, 42, 42, 0.12);
  --shadow: 0 20px 45px rgba(28, 31, 33, 0.12);
  --radius: 18px;
  --nav-bg: rgba(255, 255, 255, 0.6);
  --nav-active-bg: #ffffff;
  --input-bg: #fffaf5;
  --input-disabled-bg: #f2f2f2;
  --team-card-bg: #fbfbfb;
  --ghost-bg: rgba(29, 42, 42, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 20%, #fff4e4 0%, transparent 40%),
    radial-gradient(circle at 80% 10%, #e0f0ff 0%, transparent 45%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-accent) 100%);
  min-height: 100vh;
}

h1,
h2,
h3 {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  margin: 0 0 0.5rem;
  letter-spacing: 0.5px;
}

p {
  margin: 0 0 1rem;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  padding: 1.5rem 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #000;
  background: linear-gradient(135deg, var(--accent), #f09d5c);
  box-shadow: 0 8px 18px rgba(214, 91, 47, 0.35);
}

.brand-title {
  font-weight: 700;
  margin: 0;
  color: #000;
}

.brand-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-link {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--nav-bg);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  transition: transform 0.2s ease, background 0.2s ease;
}

.theme-toggle {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--nav-active-bg);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 6px 14px rgba(29, 42, 42, 0.12);
}

.nav-link.is-active {
  background: var(--nav-active-bg);
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(29, 42, 42, 0.12);
}

.page {
  padding: 0.5rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--card-border);
  animation: rise 0.6s ease both;
}

.hero {
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(214, 91, 47, 0.2) 0%, transparent 70%);
  top: -40px;
  right: -30px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
}

.hero-stats {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.form-card {
  animation-delay: 0.05s;
}

.info-card {
  animation-delay: 0.12s;
}

.registration-form {
  display: grid;
  gap: 1rem;
}

.field-group {
  display: grid;
  gap: 0.5rem;
}

label {
  font-weight: 600;
}

input[type="text"] {
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 1rem;
  background: var(--input-bg);
  color: var(--ink);
}

input[type="text"]:disabled {
  background: var(--input-disabled-bg);
  color: var(--muted);
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
}

fieldset {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

legend {
  padding: 0 0.4rem;
  font-weight: 600;
  color: var(--muted);
}

.radio,
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 500;
}

.checkbox input {
  margin-top: 0.2rem;
}

.check-group {
  gap: 0.75rem;
}

button {
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 999px;
  padding: 0.85rem 1.4rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 20px rgba(214, 91, 47, 0.35);
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(214, 91, 47, 0.4);
}

.ghost {
  background: var(--ghost-bg);
  color: var(--ink);
}

.form-message {
  min-height: 1.2rem;
  font-weight: 600;
}

.form-message.is-error {
  color: #c13b24;
}

.form-message.is-success {
  color: #1f6b4f;
}

.admin-row {
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
}

.admin-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

body:not(.is-admin) .admin-only {
  display: none;
}

.info-grid {
  display: grid;
  gap: 1rem;
}

.mono {
  font-family: "Courier New", Courier, monospace;
  margin-bottom: 0.25rem;
}

.overview-card {
  animation-delay: 0.05s;
}

.review-card {
  animation-delay: 0.12s;
}

.overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.overview-meta {
  display: flex;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
}

.team-list {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
}

.team-card {
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 1rem;
  background: var(--team-card-bg);
}

.team-card h3 {
  margin-bottom: 0.35rem;
}

.team-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.tag {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(214, 91, 47, 0.15);
  color: var(--accent-dark);
  font-weight: 600;
}

.team-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.team-input {
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 0.95rem;
  background: var(--input-bg);
  color: var(--ink);
  min-width: 180px;
  flex: 1 1 180px;
}

.site-footer {
  padding: 2rem 1.25rem 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 860px) {
  .site-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .page {
    max-width: 960px;
    margin: 0 auto;
  }

  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.is-dark {
  --bg: #101418;
  --bg-accent: #1c2530;
  --ink: #f3efe6;
  --muted: #b3bbc0;
  --accent: #f08a4b;
  --accent-dark: #cf6b2f;
  --card: #1a2126;
  --card-border: rgba(255, 255, 255, 0.08);
  --line: rgba(243, 239, 230, 0.14);
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.5);
  --nav-bg: rgba(15, 20, 24, 0.7);
  --nav-active-bg: #1f2730;
  --input-bg: #1f2730;
  --input-disabled-bg: #2b333b;
  --team-card-bg: #182127;
  --ghost-bg: rgba(243, 239, 230, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
