/* ============================================================
   BE Science Olympiad — design system

   Palette, type and glass treatment carried over from the 2025-26
   site. Bishop England green (#009A44) with white as the accent —
   green and white are the school's colours, not gold.
   ============================================================ */

:root {
  /* surfaces — deep forest greens */
  --bg-deepest: #0a1f12;
  --bg-deep:    #0f2b18;
  --bg-nav:     rgba(5, 13, 8, 0.85);

  /* school colours */
  --be-green:        #009A44;
  --be-green-bright: #00c853;
  --be-green-dark:   #006b2d;
  --green-dim:       rgba(0, 169, 68, 0.2);
  --green-accent:    #00a944;

  /* glass */
  --glass:        rgba(0, 100, 40, 0.3);
  --glass-hover:  rgba(14, 80, 40, 0.5);
  --glass-border: rgba(255, 255, 255, 0.1);
  --border:       rgba(255, 255, 255, 0.15);
  --border-hover: rgba(255, 255, 255, 0.35);
  --border-focus: rgba(0, 154, 68, 0.8);
  --bg-input:     rgba(8, 35, 18, 0.85);

  /* text — white on green, no gold anywhere */
  --text:       #ffffff;
  --text-muted: rgba(255, 255, 255, 0.6);
  --text-dim:   rgba(255, 255, 255, 0.3);
  --text-faint: rgba(255, 255, 255, 0.18);

  --red-accent: #e74c3c;
  --red-dim:    rgba(231, 76, 60, 0.15);
  --cyan:       #22d3ee;
  --amber:      #fbbf24;

  --shadow:       0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-green: 0 0 20px rgba(0, 154, 68, 0.15);

  --radius:    12px;
  --radius-lg: 16px;
  --nav-h:     60px;
  --maxw:      1140px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg-deepest);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--be-green-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--green-dim); color: var(--text); }

/* Ambient green wash so scrolling reads as one continuous space. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(0, 169, 68, 0.18), transparent 65%),
    radial-gradient(ellipse 70% 50% at 88% 12%, rgba(0, 200, 83, 0.08), transparent 60%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-deepest) 60%);
}

/* ── layout ───────────────────────────────────────────────── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

section { padding: 72px 0; }
.section-sm { padding: 48px 0; }

/* ── type ─────────────────────────────────────────────────── */
h1, h2, h3, h4 { letter-spacing: -0.025em; line-height: 1.15; font-weight: 700; }

h1 { font-size: clamp(2.1rem, 5.5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--be-green-bright);
  margin-bottom: 14px;
}

.lede { color: var(--text-muted); font-size: 1.05rem; max-width: 60ch; }
.muted { color: var(--text-dim); }
.mono { font-variant-numeric: tabular-nums; }

/* ── top nav ──────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.nav .wrap { display: flex; align-items: center; gap: 28px; width: 100%; }

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }

/* The Battling Bishops mascot, self-hosted rather than hotlinked. */
.brand-mark {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text { line-height: 1.25; }
.brand-name { font-size: 14.5px; font-weight: 700; letter-spacing: -0.015em; }
.brand-sub {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.nav-links { display: flex; gap: 3px; margin-left: auto; align-items: center; }

.nav-links a {
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav-links a.active { color: var(--be-green-bright); background: var(--green-dim); }

/* Mobile: bottom tab bar. It lives outside the header because the header's
   backdrop-filter would otherwise be the containing block for a fixed child. */
.tabbar { display: none; }

@media (max-width: 880px) {
  .nav-links { display: none; }

  .tabbar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 200;
    justify-content: space-around;
    gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
  }
  .tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 2px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-dim);
    transition: color var(--transition), background var(--transition);
  }
  .tabbar a.active { color: var(--be-green-bright); background: var(--green-dim); }
  .tabbar-icon { font-size: 17px; line-height: 1; }

  body { padding-bottom: 72px; }
}

/* ── buttons ──────────────────────────────────────────────── */
.btn {
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.7rem 1.25rem;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  line-height: 1;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--be-green), var(--be-green-bright));
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(0, 154, 68, 0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 154, 68, 0.42);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red-accent);
  border-color: rgba(231, 76, 60, 0.3);
}
.btn-danger:hover:not(:disabled) { background: rgba(231, 76, 60, 0.28); }

.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* Legacy alias so any older markup keeps the school colours. */
.btn-gold {
  background: linear-gradient(135deg, var(--be-green), var(--be-green-bright));
  color: #fff; font-weight: 600;
  box-shadow: 0 2px 12px rgba(0, 154, 68, 0.3);
}
.btn-gold:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 154, 68, 0.42);
}

/* ── cards ────────────────────────────────────────────────── */
.card {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: border-color var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

.card-hd {
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-bd { padding: 20px; }

.card-lift:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}
.card-lift { transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition); }

/* ── chips / badges ───────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid;
  white-space: nowrap;
}

.chip-study { background: rgba(34, 211, 238, 0.12); color: var(--cyan);            border-color: rgba(34, 211, 238, 0.28); }
.chip-lab   { background: var(--green-dim);          color: var(--be-green-bright); border-color: rgba(0, 200, 83, 0.32); }
.chip-build { background: rgba(251, 191, 36, 0.12);  color: var(--amber);           border-color: rgba(251, 191, 36, 0.28); }
.chip-tbd   { background: rgba(255, 255, 255, 0.07); color: var(--text-muted);      border-color: var(--glass-border); }
.chip-live  { background: var(--red-dim);            color: var(--red-accent);      border-color: rgba(231, 76, 60, 0.32); }
.chip-soon  { background: rgba(255, 255, 255, 0.1);  color: #ffffff;                border-color: var(--border); }

/* ── forms ────────────────────────────────────────────────── */
label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 7px;
}

input[type=text], input[type=email], input[type=date], input[type=time],
input[type=number], input[type=url], select, textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color var(--transition), background var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 154, 68, 0.14);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { resize: vertical; min-height: 80px; }

.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── grids ────────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

@media (max-width: 880px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  section { padding: 48px 0; }
  .wrap { padding: 0 18px; }
}

/* ── stat tiles ───────────────────────────────────────────── */
.stat { padding: 20px; }
.stat-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px;
}
.stat-value { font-size: 27px; font-weight: 700; line-height: 1; letter-spacing: -0.02em;
              font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.v-gold, .v-green { color: var(--be-green-bright); }
.v-cyan { color: var(--cyan); }
.v-purple { color: #fff; }

/* ── motion ───────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.5s var(--ease) both; }

.stagger > * { animation: fadeUp 0.45s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 0.04s; }
.stagger > *:nth-child(2) { animation-delay: 0.08s; }
.stagger > *:nth-child(3) { animation-delay: 0.12s; }
.stagger > *:nth-child(4) { animation-delay: 0.16s; }
.stagger > *:nth-child(5) { animation-delay: 0.20s; }
.stagger > *:nth-child(6) { animation-delay: 0.24s; }

/* ── utilities ────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; }
.gap-sm { gap: 8px; } .gap-md { gap: 16px; } .gap-lg { gap: 26px; }
.mt-sm { margin-top: 10px; } .mt-md { margin-top: 20px; } .mt-lg { margin-top: 34px; }
.mb-md { margin-bottom: 20px; } .mb-lg { margin-bottom: 34px; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.wrap-narrow { max-width: 460px; margin: 0 auto; }

.divider { height: 1px; background: var(--glass-border); border: 0; margin: 26px 0; }

.empty { padding: 44px 20px; text-align: center; color: var(--text-dim); font-size: 14px; }
.empty-icon { font-size: 30px; margin-bottom: 12px; opacity: 0.5; }

/* ── toast ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(80px);
  z-index: 500;
  padding: 12px 20px;
  border-radius: 10px;
  background: #0f2b18;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  transition: transform 0.28s var(--ease), opacity 0.28s var(--ease);
  max-width: calc(100vw - 40px);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.err { border-color: rgba(231, 76, 60, 0.5); color: #ffb4ab; }
.toast.ok  { border-color: rgba(0, 200, 83, 0.5); color: #7ef0a8; }

@media (max-width: 880px) { .toast { bottom: 84px; } }

/* ── footer ───────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--glass-border);
  padding: 30px 0;
  margin-top: 40px;
  color: var(--text-faint);
  font-size: 12px;
}
.footer .wrap { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
