/* ---------------------------------------------------------------------------
   MOURI Tech Hackathon — enrollment page
   Plain CSS, no build step, no framework. Palette mirrors the MOURI Tech
   brand tokens used on the marketing microsite (deep ink ground, ember
   accent as primary action colour — "the look the brand is known for").
--------------------------------------------------------------------------- */

:root {
  --ink-900: oklch(0.16 0.038 256);
  --ink-800: oklch(0.225 0.043 256);
  --ink-700: oklch(0.29 0.045 256);
  --ink-600: oklch(0.36 0.045 256);

  --ember: oklch(0.71 0.174 47);
  --ember-strong: oklch(0.66 0.186 41);
  --signal: oklch(0.76 0.121 218);
  --blue: oklch(0.62 0.14 264);

  --fg: oklch(0.97 0.006 256);
  --fg-muted: oklch(0.78 0.024 256);
  --fg-faint: oklch(0.62 0.03 256);

  --border: oklch(1 0 0 / 12%);
  --border-strong: oklch(1 0 0 / 22%);
  --card-bg: oklch(0.225 0.043 256 / 0.7);

  --danger: oklch(0.72 0.19 25);
  --danger-bg: oklch(0.72 0.19 25 / 0.12);
  --success: oklch(0.76 0.15 155);
  --success-bg: oklch(0.76 0.15 155 / 0.12);

  --radius: 0.85rem;
  --radius-sm: 0.55rem;
  --shadow-card: 0 1px 2px oklch(0 0 0 / 30%), 0 12px 30px -14px oklch(0 0 0 / 55%);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--ink-900);
  color: var(--fg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg {
  max-width: 100%;
  display: block;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.wrap-narrow {
  max-width: 720px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ember);
  color: var(--ink-900);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* Focus visibility — applied everywhere, never removed */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: oklch(0.16 0.038 256 / 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  gap: 1rem;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
  flex-wrap: wrap;
}

.wordmark-mouri { color: var(--fg); }
.wordmark-tech { color: var(--ember); }
.wordmark-suffix {
  font-weight: 500;
  color: var(--fg-faint);
  font-size: 0.9rem;
  border-left: 1px solid var(--border-strong);
  padding-left: 0.5rem;
  margin-left: 0.1rem;
}

.header-cta {
  white-space: nowrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
  font-family: inherit;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ember);
  color: var(--ink-900);
}

.btn-primary:hover {
  background: var(--ember-strong);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--fg);
}

.btn-ghost:hover {
  border-color: var(--ember);
  color: var(--ember);
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--fg-muted);
  padding: 0.65rem 0.25rem;
}

.btn-link:hover {
  color: var(--signal);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* Hero */
.hero {
  padding: 5rem 0 4.5rem;
  background:
    radial-gradient(circle at 15% 0%, oklch(0.71 0.174 47 / 0.16), transparent 55%),
    radial-gradient(circle at 85% 20%, oklch(0.76 0.121 218 / 0.14), transparent 50%),
    var(--ink-900);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 780px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--signal);
  margin: 0 0 1.1rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--fg-muted);
  max-width: 620px;
  margin: 0 0 2.25rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Sections */
.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: var(--ink-800);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.15rem);
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
}

.section-sub {
  color: var(--fg-muted);
  max-width: 620px;
  font-size: 1.02rem;
  margin: 0 0 2.5rem;
}

/* Feature cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}

.feature-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.65rem;
  background: oklch(0.71 0.174 47 / 0.15);
  color: var(--ember);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.feature-icon svg {
  width: 1.4rem;
  height: 1.4rem;
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.feature-card p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.96rem;
}

/* Track cards */
.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}

.track-card {
  background: var(--ink-900);
  border: 1px solid var(--border);
  border-left: 3px solid var(--signal);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
}

.track-kicker {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--signal);
}

.track-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.track-card p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.94rem;
}

/* Form */
.section-form {
  background: var(--ink-900);
}

#enroll-form {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.field {
  margin-bottom: 1.6rem;
}

.field:last-of-type {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.94rem;
  margin-bottom: 0.4rem;
}

.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  background: var(--ink-800);
  border: 1px solid var(--border-strong);
  color: var(--fg);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  font-size: 0.98rem;
  font-family: inherit;
  transition: border-color 0.12s ease;
}

.field textarea {
  resize: vertical;
  min-height: 3rem;
}

#description {
  min-height: 9rem;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--fg-faint);
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23c9cedb' stroke-width='2'%3E%3Cpath d='M5 8l5 5 5-5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

.field select:invalid {
  color: var(--fg-faint);
}

.field-hint {
  margin: 0.4rem 0 0;
  font-size: 0.84rem;
  color: var(--fg-faint);
}

.char-count {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  color: var(--fg-faint);
}

.char-count.is-met {
  color: var(--success);
}

.char-count.is-short {
  color: var(--fg-faint);
}

/* Invalid field state */
.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
}

.field-error {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--danger);
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.error-summary {
  background: var(--danger-bg);
  border: 1px solid oklch(0.72 0.19 25 / 0.4);
  color: var(--fg);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  font-size: 0.92rem;
  margin: 0 0 1.5rem;
}

.form-actions {
  margin-top: 2rem;
}

.form-fineprint {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  color: var(--fg-faint);
  text-align: center;
}

/* Result states */
.result-state {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.result-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.result-icon svg {
  width: 1.75rem;
  height: 1.75rem;
}

.result-icon-success {
  background: var(--success-bg);
  color: var(--success);
}

.result-icon-error {
  background: var(--danger-bg);
  color: var(--danger);
}

.result-state h3 {
  margin: 0 0 0.6rem;
  font-size: 1.35rem;
}

.result-state p {
  color: var(--fg-muted);
  max-width: 440px;
  margin: 0 auto 1.5rem;
}

.hidden {
  display: none !important;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--fg-faint);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 640px) {
  .hero {
    padding: 3.5rem 0 3rem;
  }

  .section {
    padding: 3rem 0;
  }

  #enroll-form,
  .result-state {
    padding: 1.5rem 1.25rem;
  }

  .header-row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .header-cta {
    padding: 0.55rem 0.9rem;
    font-size: 0.85rem;
  }
}


/* The MouRio mark replaces the typed wordmark. Height-constrained and
   width:auto so the SVG's own aspect ratio survives every viewport. */
.wordmark-logo { height: 30px; width: auto; display: block; }
@media (max-width: 640px) { .wordmark-logo { height: 24px; } }


/* ── Live entry counts (hero card) ────────────────────────────────────────
   Sized to still look deliberate at three digits: the numerals are fluid and
   tabular, so 2 -> 30 -> 100 changes the card's presence without reflowing the
   labels or making the digits jitter as they count up. */
/* MUST come with the display rule below: an author-level `display` overrides the
   browser's own `[hidden] { display: none }`, so without this the card is visible
   from first paint — showing the markup's placeholders until data arrives, which
   is precisely the "0 teams" impression the hidden state exists to prevent. */
.live-card[hidden] { display: none; }
.live-card {
  display: inline-block; margin-top: 2rem; padding: 1.25rem 1.75rem 1.35rem;
  border-radius: 16px;
  border: 1px solid var(--border-strong, rgba(255,255,255,.14));
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.015));
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 10px 30px rgba(0,0,0,.28);
}
.live-card-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .85rem; }
.live-card-label {
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-faint); font-weight: 600;
}
.live-stats { display: flex; align-items: center; gap: 1.6rem; }
.live-stat { display: flex; align-items: baseline; gap: .5rem; }
.live-n {
  font-size: clamp(2.1rem, 5.2vw, 3rem); font-weight: 800; line-height: 1;
  letter-spacing: -0.03em; color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.live-k { font-size: .95rem; color: var(--fg-muted); font-weight: 500; }
.live-div {
  width: 1px; align-self: stretch; margin: .15rem 0;
  background: var(--border-strong, rgba(255,255,255,.14));
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: oklch(.72 .17 150); box-shadow: 0 0 0 0 oklch(.72 .17 150 / .55);
  animation: live-pulse 2.4s ease-out infinite;
}
@keyframes live-pulse {
  70% { box-shadow: 0 0 0 7px oklch(.72 .17 150 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(.72 .17 150 / 0); }
}
/* Respect a reader who asked the OS for less motion: no pulse, and the count-up
   in app.js is skipped for the same preference. */
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
@media (max-width: 480px) {
  .live-card { display: block; }
  .live-stats { gap: 1.1rem; }
}
