/* ==========================================================================
   Color Rush (컬러 러시) — Shared Stylesheet
   Single hand-written stylesheet. No build step, no framework.
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand surfaces */
  --color-bg: #12131a;
  --color-bg-elevated: #16171f;
  --color-surface: #1c1e28;
  --color-surface-2: #23253150;
  --color-border: #2c2e3a;
  --color-text: #f1f2f6;
  --color-text-muted: #9a9cb0;
  --color-text-faint: #8b8da3; /* AA on --color-bg and --color-surface */

  /* Game colors */
  --color-red: #ff4757;
  --color-blue: #3d9bff;
  --color-green: #2ed573;
  --color-yellow: #ffc048;
  --color-purple: #a55eea;
  --color-orange: #ff7f50;

  /* Semantic aliases */
  --color-accent: var(--color-blue);
  --color-success: var(--color-green);
  --color-danger: var(--color-red);
  --focus-ring: 0 0 0 3px #12131a, 0 0 0 5px var(--color-yellow);

  /* Typography */
  --font-kr: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  --font-en: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, system-ui, sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.9375rem; /* 15px: smallest readable secondary text */
  --text-base: 1.0625rem; /* 17px body */
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 2.75rem;
  --text-5xl: 3.5rem;

  /* Spacing (4px grid) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 999px;

  /* Elevation (dark-theme: soft glow, not drop shadow) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);
  --shadow-glow-blue: 0 0 40px rgba(61, 155, 255, 0.25);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-base: 250ms var(--ease-out);

  --container-max: 1180px;
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-kr);
  font-size: var(--text-base);
  line-height: 1.6;
  word-break: keep-all; /* Korean: wrap between words, not inside them */
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[lang="en"],
:lang(en) {
  font-family: var(--font-en);
}

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

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

ul,
ol {
  padding-left: 1.2em;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

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

/* ---------- Accessibility: focus ---------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  background: var(--color-yellow);
  color: #12131a;
  font-weight: 700;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

section {
  scroll-margin-top: 84px;
}

.section {
  padding-block: var(--space-24);
}

.section--tight {
  padding-block: var(--space-16);
}

.eyebrow {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-blue);
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
}

.section-lede {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  max-width: 640px;
}

.section-head {
  margin-bottom: var(--space-12);
}

.section-head--center {
  text-align: center;
  margin-inline: auto;
}

.section-head--center .section-lede {
  margin-inline: auto;
}

/* ---------- Site header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 19, 26, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 0.02em;
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-mark span:nth-child(1) { color: var(--color-red); }
.brand-mark span:nth-child(2) { color: var(--color-orange); }
.brand-mark span:nth-child(3) { color: var(--color-yellow); }
.brand-mark span:nth-child(4) { color: var(--color-green); }
.brand-mark span:nth-child(5) { color: var(--color-blue); }
.brand-mark span:nth-child(6) { color: var(--color-purple); }
.brand-mark span:nth-child(7) { color: var(--color-red); }
.brand-mark span:nth-child(8) { color: var(--color-orange); }
.brand-mark span:nth-child(9) { color: var(--color-blue); }

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.site-nav__links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.site-nav__links a:hover {
  color: var(--color-text);
}

.site-nav__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-blue);
  color: #0a1420;
  font-weight: 700;
  font-size: var(--text-sm);
  min-height: 44px;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.site-nav__cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow-blue);
}

@media (max-width: 720px) {
  .site-nav__links {
    display: none;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--text-base);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  border: 1px solid transparent;
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-blue), var(--color-purple));
  color: #ffffff;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-blue);
}

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

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

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--space-16) var(--space-20);
  position: relative;
  overflow: clip;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 560px;
  background: radial-gradient(closest-side, rgba(61, 155, 255, 0.22), transparent 70%),
    radial-gradient(closest-side, rgba(165, 94, 234, 0.18), transparent 70%) 60% 0;
  pointer-events: none;
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-16);
  align-items: center;
}

.hero__wordmark {
  display: inline-flex;
  flex-wrap: wrap;
  font-size: clamp(2.6rem, 6vw, var(--text-5xl));
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: var(--space-6);
}

.hero__tagline {
  font-size: clamp(1.1rem, 2.2vw, var(--text-2xl));
  color: var(--color-text-muted);
  max-width: 46ch;
  margin-bottom: var(--space-8);
  font-weight: 500;
}

.hero__tagline strong {
  color: var(--color-text);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}

.hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-green);
  display: inline-block;
}

@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero__wordmark,
  .hero__meta,
  .hero__actions {
    justify-content: center;
  }
  .hero__tagline {
    margin-inline: auto;
  }
}

/* ---------- Phone mockup (pure CSS, no images) ---------- */
.phone-mockup {
  display: flex;
  justify-content: center;
  perspective: 1200px;
}

.phone-frame {
  width: 260px;
  aspect-ratio: 9 / 19.5;
  background: linear-gradient(160deg, #23242f, #14151d);
  border-radius: 42px;
  padding: 14px;
  box-shadow: var(--shadow-lg), 0 0 0 2px #2c2e3a;
  transform: rotate(-3deg);
  transition: transform var(--transition-base);
}

.phone-frame:hover {
  transform: rotate(0deg);
}

.phone-notch {
  position: absolute;
  width: 90px;
  height: 18px;
  background: #0d0e13;
  border-radius: var(--radius-full);
  left: 50%;
  translate: -50% 0;
  margin-top: 4px;
  z-index: 2;
}

.phone-screen {
  position: relative;
  height: 100%;
  width: 100%;
  background: linear-gradient(180deg, #181a24, #101119);
  border-radius: 30px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 30px 16px 20px;
}

.game-topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--color-text-faint);
}

.game-score {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-text);
}

.game-timer-track {
  margin-top: 10px;
  height: 5px;
  border-radius: var(--radius-full);
  background: #2a2c38;
  overflow: hidden;
}

.game-timer-bar {
  height: 100%;
  width: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-green), var(--color-yellow), var(--color-red));
  transform-origin: left;
  animation: timer-shrink 3.6s linear infinite;
}

@keyframes timer-shrink {
  0% { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}

.game-word-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}

.game-word {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.game-word-hint {
  font-size: 10px;
  color: var(--color-text-faint);
  letter-spacing: 0.04em;
}

.game-controls {
  display: flex;
  justify-content: center;
  gap: 22px;
  padding-bottom: 6px;
}

.game-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}

.game-btn--no {
  background: rgba(255, 71, 87, 0.16);
  color: var(--color-red);
  border: 1.5px solid rgba(255, 71, 87, 0.5);
}

.game-btn--yes {
  background: rgba(46, 213, 115, 0.16);
  color: var(--color-green);
  border: 1.5px solid rgba(46, 213, 115, 0.5);
}

/* ---------- Features ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: transform var(--transition-base), border-color var(--transition-base);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-blue);
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.feature-card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.feature-card__body {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* icon tint variants */
.icon-tint--red { background: rgba(255, 71, 87, 0.14); color: var(--color-red); }
.icon-tint--blue { background: rgba(61, 155, 255, 0.14); color: var(--color-blue); }
.icon-tint--green { background: rgba(46, 213, 115, 0.14); color: var(--color-green); }
.icon-tint--purple { background: rgba(165, 94, 234, 0.14); color: var(--color-purple); }
.icon-tint--orange { background: rgba(255, 127, 80, 0.14); color: var(--color-orange); }
.icon-tint--yellow { background: rgba(255, 192, 72, 0.14); color: var(--color-yellow); }

/* ---------- How to play (steps) ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  counter-reset: step;
}

.step-card {
  position: relative;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}

.step-card__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: 800;
  margin-bottom: var(--space-5);
  background: linear-gradient(135deg, var(--color-blue), var(--color-purple));
  color: #fff;
}

.step-card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.step-card__body {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

@media (max-width: 860px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

/* ---------- Download section ---------- */
.download {
  text-align: center;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: var(--space-16) var(--space-8);
}

.download__badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.store-badge {
  display: inline-flex;
  text-align: left;
  align-items: center;
  gap: var(--space-3);
  background: #101119;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-6);
  min-width: 200px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.store-badge__status {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.store-badge__text {
  text-align: left;
}

.store-badge__small {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-faint);
}

.store-badge__big {
  display: block;
  font-size: var(--text-base);
  font-weight: 700;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-12);
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  transition: color var(--transition-fast);
}

.site-footer__links a:hover {
  color: var(--color-text);
}

.site-footer__note {
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  line-height: 1.7;
}

/* ==========================================================================
   Legal / content pages (privacy, terms, support)
   ========================================================================== */

.legal-page {
  padding-block: var(--space-16) var(--space-24);
}

.legal-header {
  margin-bottom: var(--space-12);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border);
}

.legal-header h1 {
  font-size: var(--text-3xl);
  font-weight: 800;
  margin-bottom: var(--space-2);
}

.legal-header__meta {
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}

.lang-block {
  margin-bottom: var(--space-16);
}

.lang-block__tag {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: rgba(61, 155, 255, 0.14);
  color: var(--color-blue);
  margin-bottom: var(--space-6);
}

.lang-block--en .lang-block__tag {
  background: rgba(165, 94, 234, 0.14);
  color: var(--color-purple);
}

.legal-content h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-top: var(--space-10);
  margin-bottom: var(--space-3);
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p,
.legal-content li {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  margin-bottom: var(--space-3);
}

.legal-content strong {
  color: var(--color-text);
}

.legal-content a {
  color: var(--color-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-content ul {
  margin-bottom: var(--space-5);
}

.callout {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-yellow);
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-5);
  margin-block: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.toc {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin-bottom: var(--space-10);
}

.toc__title {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}

.toc ol {
  columns: 2;
  gap: var(--space-8);
  font-size: var(--text-sm);
  padding-left: 1.1em;
}

.toc a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  color: var(--color-text-muted);
}

.toc a:hover {
  color: var(--color-blue);
}

@media (max-width: 640px) {
  .toc ol {
    columns: 1;
  }
}

/* ---------- FAQ accordion (support.html) ---------- */
.faq-list {
  border-top: 1px solid var(--color-border);
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-2);
  text-align: left;
  font-size: var(--text-lg);
  font-weight: 700;
}

.faq-question:hover {
  color: var(--color-blue);
}

.faq-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  transition: transform var(--transition-base);
}

.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--transition-base);
}

.faq-answer__inner {
  padding: 0 var(--space-2) var(--space-6);
  color: var(--color-text-muted);
}

.contact-card {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  justify-content: space-between;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-block: var(--space-10);
}

.contact-card__label {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  margin-bottom: var(--space-1);
}

.contact-card__value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-blue);
}

/* ---------- 404 page ---------- */
.error-page {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-block: var(--space-24);
}

.error-page__code {
  font-size: clamp(4rem, 14vw, 8rem);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--color-red), var(--color-blue), var(--color-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: var(--space-6);
}

.error-page__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.error-page__body {
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  max-width: 44ch;
}

/* ---------- Responsive scale-down ---------- */
@media (max-width: 640px) {
  .section {
    padding-block: var(--space-16);
  }
  .section--tight {
    padding-block: var(--space-12);
  }
  .container {
    padding-inline: var(--space-4);
  }
  .contact-card {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
}

@media (min-width: 1440px) {
  .container {
    padding-inline: var(--space-8);
  }
}
