/* =========================================================
   가가볼 부스 — Apple-inspired design system
   Reference: DESIGN-apple.md
   Single accent (Action Blue), alternating full-bleed tiles,
   SF Pro (system) → Inter fallback, pill CTAs, one product shadow.
   ========================================================= */

:root {
  /* Brand & accent */
  --primary: #0066cc;
  --primary-focus: #0071e3;
  --primary-on-dark: #2997ff;

  /* Text */
  --ink: #1d1d1f;
  --ink-muted-80: #333333;
  --ink-muted-48: #7a7a7a;
  --on-dark: #ffffff;
  --body-muted: #cccccc;

  /* Surface */
  --canvas: #ffffff;
  --parchment: #f5f5f7;
  --pearl: #fafafc;
  --tile-dark: #272729;
  --tile-dark-2: #2a2a2c;
  --black: #000000;

  /* Hairlines */
  --divider-soft: #f0f0f0;
  --hairline: #e0e0e0;

  /* Radius */
  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 18px;
  --r-pill: 9999px;

  /* Spacing */
  --s-xs: 8px;
  --s-sm: 12px;
  --s-md: 17px;
  --s-lg: 24px;
  --s-xl: 32px;
  --s-xxl: 48px;
  --s-section: 80px;

  /* The single system shadow — product/imagery only */
  --product-shadow: rgba(0, 0, 0, 0.22) 3px 5px 30px 0;

  --font-display: "SF Pro Display", system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  --font-text: "SF Pro Text", system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;

  --nav-h: 44px;
  --subnav-h: 52px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.374px;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--primary); text-decoration: none; }
strong, b { font-weight: 600; }

/* ---------- Global nav (black, 44px) ---------- */
.global-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--black);
  color: var(--on-dark);
}
.global-nav__inner {
  max-width: 1024px;
  height: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.global-nav__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--on-dark);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
  white-space: nowrap;
}
.global-nav__dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--primary);
}
.global-nav__links {
  display: flex;
  gap: 20px;
  margin: 0; padding: 0;
  list-style: none;
  flex: 1;
}
.global-nav__links a {
  color: var(--on-dark);
  opacity: 0.82;
  font-size: 12px;
  letter-spacing: -0.12px;
  transition: opacity 0.2s;
}
.global-nav__links a:hover { opacity: 1; }
.global-nav__cta {
  background: var(--primary);
  color: var(--on-dark);
  font-size: 12px;
  font-weight: 400;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  transition: transform 0.1s;
}
.global-nav__cta:active { transform: scale(0.95); }

@media (max-width: 833px) {
  .global-nav__links { display: none; }
  .global-nav__inner { gap: 12px; }
  .global-nav__brand { flex: 1; }
}

/* ---------- Sub-nav (frosted, sticky) ---------- */
.sub-nav {
  position: sticky;
  top: var(--nav-h);
  z-index: 90;
  height: var(--subnav-h);
  background: rgba(245, 245, 247, 0.8);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.sub-nav__inner {
  max-width: 1024px;
  height: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sub-nav__title { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: 0.231px; }
.sub-nav__cta {
  background: var(--primary);
  color: var(--on-dark);
  font-size: 14px;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  transition: transform 0.1s;
}
.sub-nav__cta:active { transform: scale(0.95); }

/* ---------- Tiles (full-bleed, alternating) ---------- */
.tile {
  padding: var(--s-section) 22px;
  scroll-margin-top: calc(var(--nav-h) + var(--subnav-h));
}
.tile--white     { background: var(--canvas); color: var(--ink); }
.tile--parchment { background: var(--parchment); color: var(--ink); }
.tile--dark      { background: var(--tile-dark); color: var(--on-dark); }

.tile__stack {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.tile__stack--wide    { max-width: 980px; }
.tile__stack--reading { max-width: 720px; text-align: left; }
.tile__stack--form    { max-width: 520px; }

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 12px;
  letter-spacing: -0.2px;
}
.hero-display {
  font-family: var(--font-display);
  font-size: 84px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.5px;
  margin: 0 0 20px;
}
.display-lg {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.4px;
  margin: 0 0 16px;
}
.lead {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
  margin: 0 0 32px;
  color: var(--ink);
}
.lead--muted    { color: var(--ink-muted-80); }
.lead--on-dark  { color: var(--on-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-text);
  font-size: 17px;
  font-weight: 400;
  border: none;
  border-radius: var(--r-pill);
  padding: 12px 24px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
  min-height: 44px;
}
.btn:active { transform: scale(0.95); }
.btn:focus-visible { outline: 2px solid var(--primary-focus); outline-offset: 3px; }
.btn--primary { background: var(--primary); color: var(--on-dark); }
.btn--primary:hover { opacity: 0.92; }
.btn--ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn--ghost-dark { color: var(--primary-on-dark); border-color: var(--primary-on-dark); }
.btn--block { width: 100%; }

.cta-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Hero art (CSS-only octagon pit) ---------- */
.hero-art { margin-top: 56px; display: flex; justify-content: center; }
.hero-pit {
  width: 220px;
  height: 220px;
  background: linear-gradient(160deg, #ffffff, #e9e9ee);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(3px 5px 30px rgba(0, 0, 0, 0.22));
}
.hero-ball {
  width: 74px; height: 74px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4aa3ff, var(--primary));
  box-shadow: var(--product-shadow);
  animation: bob 3.2s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(-6px); } 50% { transform: translateY(10px); } }

/* ---------- Facts (about) ---------- */
.fact-grid {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.fact { text-align: center; }
.fact__num {
  display: block;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 600;
  color: var(--primary-on-dark);
  line-height: 1;
  margin-bottom: 10px;
}
.fact__label { font-size: 15px; color: var(--body-muted); line-height: 1.4; }
.fact__label b { color: var(--on-dark); font-weight: 600; }

/* ---------- Rule cards ---------- */
.rule-grid {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: left;
}
.card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 24px;
}
.card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-dark);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
}
.card__title { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.3px; margin: 0 0 8px; }
.card__body { font-size: 15px; line-height: 1.45; color: var(--ink-muted-80); margin: 0; }

/* ---------- Safety list ---------- */
.safety-list {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}
.safety-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 18px;
}
.safety-list li:last-child { border-bottom: none; }
.check {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary);
  position: relative;
  margin-top: 2px;
}
.check::after {
  content: "";
  position: absolute;
  left: 8px; top: 5px;
  width: 6px; height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- Terms ---------- */
.terms { margin-top: 32px; }
.terms__article { padding: 20px 0; border-bottom: 1px solid var(--divider-soft); }
.terms__article:last-child { border-bottom: none; }
.terms__article h3 { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.3px; margin: 0 0 8px; }
.terms__article p { margin: 0; font-size: 17px; line-height: 1.5; color: var(--ink-muted-80); }

/* ---------- Agree form ---------- */
.agree-card {
  margin-top: 36px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 15px; font-weight: 600; color: var(--on-dark); }
.field input[type="text"] {
  font-family: var(--font-text);
  font-size: 17px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 14px 16px;
  height: 52px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  outline: none;
  border-color: var(--primary-focus);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.25);
}
.field input[aria-invalid="true"] { border-color: #ff453a; box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.22); }
.field__error { margin: 0; font-size: 13px; color: #ff6961; min-height: 0; }
.field__error:empty { display: none; }

.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  color: var(--body-muted);
  line-height: 1.4;
  cursor: pointer;
}
.consent input { flex: none; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--primary); cursor: pointer; }
.consent a { color: var(--primary-on-dark); }

.form-status { margin: 4px 0 0; font-size: 14px; min-height: 20px; }
.form-status.is-error { color: #ff6961; }
.form-status.is-info  { color: var(--body-muted); }

/* Button spinner */
.btn__spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .btn__spinner { display: inline-block; }
.btn.is-loading .btn__label { opacity: 0.7; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Success panel ---------- */
.success-panel {
  margin-top: 36px;
  text-align: center;
  background: var(--tile-dark-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-lg);
  padding: 40px 28px;
  animation: rise 0.4s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.success-panel__mark {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.success-panel__title { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.3px; margin: 0 0 10px; color: var(--on-dark); }
.success-panel__body { font-size: 18px; color: var(--on-dark); margin: 0 0 6px; }
.success-panel__body b { color: var(--primary-on-dark); }
.success-panel__hint { font-size: 15px; color: var(--body-muted); margin: 0 0 24px; line-height: 1.45; }

/* ---------- Footer ---------- */
.footer { background: var(--parchment); padding: 56px 22px; }
.footer__inner { max-width: 720px; margin: 0 auto; text-align: center; }
.footer__brand { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--ink); margin: 0 0 12px; }
.footer__legal { font-size: 12px; color: var(--ink-muted-48); line-height: 1.5; margin: 0 0 12px; }
.footer__copy { font-size: 12px; color: var(--ink-muted-48); margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 833px) {
  .rule-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .tile { padding: 56px 20px; }
  .hero-display { font-size: 52px; }
  .display-lg { font-size: 32px; }
  .lead { font-size: 20px; }
  .rule-grid { grid-template-columns: 1fr; }
  .fact-grid { grid-template-columns: 1fr; gap: 28px; }
  .fact__num { font-size: 40px; }
}
@media (max-width: 419px) {
  .hero-display { font-size: 44px; }
  .cta-row { flex-direction: column; }
  .cta-row .btn { width: 100%; }
}
