/*
  TactiCall
  World: a night match seen from the dugout. Floodlit turf, chalk lines, a tactics board.
  One accent (telestrator yellow) for the primary action, the current match minute and the top rating.
  The tilted pitch is the only loud element; everything around it stays quiet.
*/

:root {
  /* Neutral ramp, tinted toward turf at night */
  --night-deep: #070d09;
  --night: #0a120d;
  --dugout: #101a14;
  --raised: #18241c;
  --chalk: #f1f3ea;
  --chalk-2: #a9b3a6;
  --chalk-3: #808c80;
  --hairline: rgba(241, 243, 234, 0.1);
  --hairline-strong: rgba(241, 243, 234, 0.18);

  /* Light band: the paper side of a tactics board */
  --paper: #eceee4;
  --paper-raised: #f8f9f3;
  --ink: #101a14;
  --ink-2: #445046;
  --ink-hairline: rgba(16, 26, 20, 0.14);

  --flare: #ffd23f;
  --flare-hover: #ffe07a;
  --flare-ink: #1a1503;
  --turf-a: #14502a;
  --turf-b: #115024;

  --tilt: 50deg;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1200px;
  --topbar-h: 64px;

  --font-display: "Barlow Condensed", "Do Hyeon", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", "Menlo", monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--night);
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  color: var(--chalk);
  background: var(--night);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.625;
  font-synthesis: none;
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--flare);
  color: var(--flare-ink);
}

:focus-visible {
  outline: 2px solid var(--flare);
  outline-offset: 3px;
}

.band-paper :focus-visible {
  outline-color: var(--ink);
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

/* ───────── Type roles ───────── */

.display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

:lang(ko) .display {
  line-height: 1.14;
  letter-spacing: 0;
}

.section-title {
  font-size: clamp(36px, 4.6vw, 60px);
}

.lede {
  max-width: 34em;
  font-size: 18px;
  line-height: 1.6;
  color: var(--chalk-2);
}

.band-paper .lede {
  color: var(--ink-2);
}

/* ───────── Buttons ───────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition:
    background-color 0.16s var(--ease),
    border-color 0.16s var(--ease),
    transform 0.16s var(--ease);
}

.button:active {
  transform: scale(0.98);
}

.button.primary {
  background: var(--flare);
  color: var(--flare-ink);
}

.button.primary:hover:not(:disabled) {
  background: var(--flare-hover);
}

.button.secondary {
  background: rgba(10, 18, 13, 0.6);
  border-color: var(--hairline-strong);
  color: var(--chalk);
}

.button.secondary:hover {
  background: var(--raised);
}

.button.compact {
  min-height: 36px;
  padding: 0 16px;
  font-size: 14px;
}

.button.full {
  width: 100%;
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.text-link {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--hairline-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  transition: text-decoration-color 0.16s var(--ease);
}

.text-link:hover {
  text-decoration-color: var(--flare);
}

.band-paper .text-link {
  text-decoration-color: var(--ink-hairline);
}

.band-paper .text-link:hover {
  text-decoration-color: var(--ink);
}

/* ───────── Top bar ───────── */

.topbar {
  position: fixed;
  z-index: 30;
  inset: 0 0 auto;
  height: var(--topbar-h);
  border-bottom: 1px solid transparent;
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.topbar.is-solid {
  background: var(--night);
  border-bottom-color: var(--hairline);
}

.topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}

.brand svg {
  width: 24px;
  height: 24px;
  color: var(--flare);
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a,
.lang-link {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--chalk-2);
  transition:
    color 0.16s var(--ease),
    background-color 0.16s var(--ease);
}

.site-nav a:hover,
.lang-link:hover,
.site-nav a[aria-current="page"] {
  color: var(--chalk);
}

.site-nav a:hover,
.lang-link:hover {
  background: rgba(241, 243, 234, 0.06);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

/* ───────── Hero ───────── */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: max(100svh, 640px);
  padding: calc(var(--topbar-h) + 64px) 0 96px;
  overflow: hidden;
  background: var(--night-deep);
}

.hero-video,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-video {
  object-fit: cover;
}

/* Neutral scrim: keeps the headline corner calm and lets the footage melt into the page. */
.hero-shade {
  background:
    linear-gradient(180deg, rgba(7, 13, 9, 0.72) 0%, rgba(7, 13, 9, 0.16) 28%, rgba(7, 13, 9, 0.5) 62%, var(--night) 100%),
    linear-gradient(90deg, rgba(7, 13, 9, 0.78) 0%, rgba(7, 13, 9, 0.32) 48%, rgba(7, 13, 9, 0) 76%);
}

.hero-copy {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 24px;
}

.hero-title {
  max-width: 9.5em;
  font-size: clamp(48px, 7.4vw, 104px);
}

:lang(en) .hero-title {
  max-width: 12em;
}

.hero-copy .lede {
  color: var(--chalk);
  font-size: clamp(17px, 1.5vw, 20px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * {
    animation: rise 0.5s var(--ease) both;
  }

  .hero-copy > :nth-child(2) {
    animation-delay: 60ms;
  }

  .hero-copy > :nth-child(3) {
    animation-delay: 120ms;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* ───────── Sections ───────── */

.section {
  padding: 96px 0;
}

.band-dugout {
  background: var(--dugout);
}

.band-paper {
  background: var(--paper);
  color: var(--ink);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px 80px;
  align-items: start;
}

.split.is-centered {
  align-items: center;
}

.split-intro {
  display: grid;
  justify-items: start;
  gap: 20px;
}

.split-intro .button,
.split-intro .text-link {
  margin-top: 12px;
}

/* ───────── How it works: sticky pitch, scrolling steps ───────── */

.stage-head {
  margin-bottom: 64px;
}

.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 80px;
  align-items: start;
}

.stage-pitch {
  position: sticky;
  top: calc(var(--topbar-h) + 32px);
  display: grid;
  gap: 16px;
  /* Player layers are pitch-sized and translated, so their boxes reach past the pitch. */
  overflow-x: clip;
}

/* Match clock: the steps are minutes of one match, so the rail is a real sequence. */
.clock {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--hairline);
}

.clock button {
  position: relative;
  min-width: 64px;
  padding: 8px 12px 12px;
  border: 0;
  background: none;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--chalk-3);
  text-align: left;
  transition: color 0.16s var(--ease);
}

.clock button::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: var(--flare);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.clock button:hover {
  color: var(--chalk);
}

.clock button[aria-current="step"] {
  color: var(--flare);
}

.clock button[aria-current="step"]::after {
  transform: scaleX(1);
}

.pitch-3d {
  perspective: 1300px;
  perspective-origin: 50% 0%;
}

.deck-pitch {
  position: relative;
  width: 100%;
  /* The tilt leaves the top of the box empty; pull the pitch up into it. */
  margin-top: -16%;
  aspect-ratio: 140 / 90;
  transform-style: preserve-3d;
  transform: rotateX(var(--tilt));
  transform-origin: 50% 100%;
  color: rgba(241, 243, 234, 0.85);
}

.grass {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, var(--turf-a) 0 7.14%, var(--turf-b) 7.14% 14.28%);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
}

.deck-pitch svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Each spot is a pitch-sized layer, so a percentage translate maps to pitch coordinates
   and a formation change animates on transform only. */
.pitch-spot {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: translate(calc(var(--x) * 1%), calc(var(--y) * 1%));
  transition: transform 0.7s var(--ease);
  transition-delay: calc(var(--i, 0) * 24ms);
  pointer-events: none;
}

.pitch-dot,
.pitch-ball {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  transform: translate(-50%, -100%) rotateX(calc(-1 * var(--tilt)));
  transform-origin: 50% 100%;
}

.pitch-dot {
  display: grid;
  place-items: center;
  width: clamp(24px, 2.8vw, 36px);
  aspect-ratio: 1;
  background: var(--chalk);
  color: var(--night);
  font-family: var(--font-display);
  font-size: clamp(14px, 1.5vw, 20px);
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.4);
}

.pitch-dot.gk {
  background: var(--flare);
}

.pitch-ball {
  width: clamp(12px, 1.4vw, 16px);
  aspect-ratio: 1;
  background: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

/* The manager's call, or what it compiled to */
.call-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--dugout);
  overflow: hidden;
}

.call-kind {
  align-self: stretch;
  display: grid;
  place-items: center;
  padding: 0 16px;
  border-right: 1px solid var(--hairline);
  font-size: 13px;
  font-weight: 500;
  color: var(--chalk-2);
  white-space: nowrap;
}

.call-bar code {
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.45;
  color: var(--chalk);
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 62svh;
  padding: 8px 0 64px;
  transition: opacity 0.3s var(--ease);
}

.step:last-child {
  min-height: 0;
  padding-bottom: 8px;
}

.steps.is-tracking .step:not(.is-active) {
  opacity: 0.4;
}

.step-minute {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--chalk-3);
}

.step.is-active .step-minute {
  color: var(--flare);
}

.step h3 {
  font-size: clamp(32px, 3.4vw, 44px);
}

.step p {
  max-width: 30em;
  color: var(--chalk-2);
}

.data-rows {
  display: grid;
  margin: 8px 0 0;
  border-top: 1px solid var(--hairline);
}

.data-rows div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  min-height: 44px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 20px;
}

.data-rows dt {
  color: var(--chalk-3);
}

.data-rows dd {
  margin: 0;
  color: var(--chalk);
  text-align: right;
}

.meter-grid {
  display: grid;
  gap: 16px;
  margin: 8px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}

.meter {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  line-height: 20px;
  color: var(--chalk-2);
}

.meter dt,
.meter dd {
  margin: 0;
}

.meter .track {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--raised);
  overflow: hidden;
}

.meter .track i {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: 2px;
  background: var(--chalk);
}

.meter .value {
  text-align: right;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--chalk);
}

/* ───────── Ranking table ───────── */

.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.rank-table caption {
  padding-bottom: 12px;
  text-align: left;
  font-size: 14px;
  color: var(--chalk-3);
}

.rank-table th {
  padding: 0 16px 12px;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  color: var(--chalk-3);
  text-align: left;
  white-space: nowrap;
}

.rank-table td {
  height: 72px;
  padding: 12px 16px;
  border-top: 1px solid var(--hairline);
  vertical-align: middle;
}

.rank-table tbody tr:last-child td {
  border-bottom: 1px solid var(--hairline);
}

.rank-table th:first-child,
.rank-table td:first-child {
  width: 56px;
  padding-left: 0;
}

.rank-table th:last-child,
.rank-table td:last-child {
  padding-right: 0;
  text-align: right;
}

.rank-table .rank,
.rank-table .rating {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
}

.rank-table .rank {
  color: var(--chalk-3);
}

.rank-table tbody tr:first-child .rank,
.rank-table tbody tr:first-child .rating {
  color: var(--flare);
}

.who {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.who strong {
  font-size: 17px;
  font-weight: 500;
  line-height: 24px;
}

.who span {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--chalk-3);
}

.who .kind {
  color: var(--chalk-2);
}

.rank-table .plain {
  font-size: 15px;
  color: var(--chalk-2);
  white-space: nowrap;
}

/* ───────── FAQ ───────── */

.faq-list {
  border-top: 1px solid var(--ink-hairline);
}

.faq-list details {
  border-bottom: 1px solid var(--ink-hairline);
}

.faq-list summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 16px 0;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary svg {
  width: 20px;
  height: 20px;
  color: var(--ink-2);
  transition: transform 0.2s var(--ease);
}

.faq-list details[open] summary svg {
  transform: rotate(180deg);
}

.faq-list details p {
  max-width: 38em;
  padding: 0 36px 24px 0;
  color: var(--ink-2);
}

.contact-row {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--ink-hairline);
  font-size: 15px;
  color: var(--ink-2);
}

.contact-row a {
  justify-self: start;
  color: var(--ink);
}

/* ───────── Waitlist ───────── */

.waitlist-form {
  display: grid;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--dugout);
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--chalk-2);
}

.field small {
  font-size: 14px;
  font-weight: 400;
  color: var(--chalk-3);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: var(--night);
  color: var(--chalk);
  line-height: 22px;
  transition:
    border-color 0.16s var(--ease),
    background-color 0.16s var(--ease);
}

.field select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23a9b3a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.field select option {
  background: var(--dugout);
  color: var(--chalk);
}

.field textarea {
  resize: vertical;
}

.field input::placeholder {
  color: var(--chalk-3);
}

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

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--flare);
  outline-offset: 1px;
  border-color: transparent;
}

.honeypot {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  min-height: 24px;
  font-size: 15px;
  line-height: 24px;
  color: var(--chalk);
}

.form-status:empty {
  display: none;
}

/* ───────── Footer ───────── */

.site-footer {
  padding: 48px 0;
  border-top: 1px solid var(--hairline);
  background: var(--night-deep);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 48px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 15px;
  color: var(--chalk-2);
}

.footer-links a {
  transition: color 0.16s var(--ease);
}

.footer-links a:hover {
  color: var(--chalk);
}

/* ───────── Leaderboard page ───────── */

.page-head {
  padding: calc(var(--topbar-h) + 80px) 0 48px;
}

.page-head .wrap {
  display: grid;
  gap: 20px;
}

.page-head h1 {
  font-size: clamp(48px, 7vw, 88px);
}

.board {
  padding: 0 0 96px;
}

.board-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 32px;
}

/* ───────── Responsive ───────── */

@media (max-width: 960px) {
  .section {
    padding: 72px 0;
  }

  .split {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .stage-head {
    margin-bottom: 32px;
  }

  .stage-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* The pitch stays pinned under the top bar while the steps scroll beneath it. */
  .stage-pitch {
    top: var(--topbar-h);
    z-index: 2;
    gap: 12px;
    margin-inline: calc(-1 * var(--gutter));
    padding: 8px var(--gutter) 16px;
    border-bottom: 1px solid var(--hairline);
    background: var(--night);
  }

  .step {
    min-height: 0;
    padding: 24px 0 48px;
  }
}

@media (max-width: 720px) {
  :root {
    --tilt: 56deg;
  }

  .topbar-inner {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .site-nav {
    display: none;
  }

  .hero {
    padding-bottom: 64px;
  }

  .hero-shade {
    background:
      linear-gradient(180deg, rgba(7, 13, 9, 0.72) 0%, rgba(7, 13, 9, 0.24) 26%, rgba(7, 13, 9, 0.72) 58%, var(--night) 100%);
  }

  .deck-pitch {
    margin-top: -18%;
  }

  .clock button {
    min-width: 56px;
    padding: 4px 8px 8px;
    font-size: 20px;
  }

  /* Two lines reserved, so the pinned block keeps its height as the line changes. */
  .call-bar {
    min-height: 64px;
  }

  .call-kind {
    padding: 0 12px;
  }

  .call-bar code {
    padding: 12px;
    font-size: 12px;
    line-height: 20px;
  }

  .faq-list summary {
    font-size: 17px;
  }

  .waitlist-form {
    padding: 20px;
  }

  /* Leaderboard page: fold formation and record under the name. */
  .rank-table .optional {
    display: none;
  }

  .rank-table th,
  .rank-table td {
    padding-inline: 8px;
  }

  .rank-table th:first-child,
  .rank-table td:first-child {
    width: 40px;
  }

  .board-actions .button {
    width: 100%;
  }
}

@media (min-width: 721px) {
  .who .mobile-only {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .hero-video {
    display: none;
  }

  .hero {
    background: var(--night-deep) url("assets/hero-poster.jpg") center / cover no-repeat;
  }
}
