:root {
  --primary: #0052ff;
  --primary-active: #003ecc;
  --ink: #0a0b0d;
  --body: #5b616e;
  --muted: #7c828a;
  --hairline: #dee1e6;
  --hairline-soft: #eef0f3;
  --canvas: #ffffff;
  --surface-soft: #f7f7f7;
  --surface-strong: #eef0f3;
  --surface-dark: #0a0b0d;
  --surface-dark-elevated: #16181c;
  --on-primary: #ffffff;
  --on-dark: #ffffff;
  --on-dark-soft: #a8acb3;
  --semantic-up: #05b169;
  --warning: #f4b000;
  --radius-card: 24px;
  --radius-input: 12px;
  --radius-pill: 999px;
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 20;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  padding: 10px 16px;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--hairline-soft);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1200px, calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
}

.nav-links {
  gap: 24px;
  color: var(--body);
  font-size: 14px;
  font-weight: 600;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  gap: 48px;
  align-items: center;
  width: min(1200px, calc(100% - 40px));
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  padding: 72px 0 48px;
}

.hero-copy {
  max-width: 560px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 24px;
  font-size: clamp(44px, 7vw, 80px);
  font-weight: 400;
  line-height: 1;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 400;
  line-height: 1.08;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.hero-description,
.section-copy p {
  color: var(--body);
  font-size: 18px;
}

.generator-panel {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--canvas);
  padding: 32px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.panel-header,
.selector-header,
.button-row,
.insight-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-header {
  margin-bottom: 24px;
}

.panel-header h2 {
  margin-bottom: 0;
  font-size: 32px;
}

.ghost-button,
.primary-button,
.secondary-button {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 700;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.ghost-button {
  background: var(--surface-strong);
  color: var(--ink);
  padding: 10px 16px;
}

.primary-button {
  flex: 1 1 220px;
  background: var(--primary);
  color: var(--on-primary);
  padding: 16px 28px;
}

.secondary-button {
  flex: 1 1 260px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 16px 24px;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--primary-active);
}

.ghost-button:hover,
.secondary-button:hover,
.ghost-button:focus-visible,
.secondary-button:focus-visible {
  background: #dfe4ec;
}

.ghost-button:active,
.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.result-card {
  margin-bottom: 24px;
  border-radius: var(--radius-card);
  background: var(--surface-dark);
  color: var(--on-dark);
  padding: 28px;
}

.result-label {
  margin-bottom: 18px;
  color: var(--on-dark-soft);
  font-size: 13px;
  font-weight: 700;
}

.result-balls,
.number-grid {
  display: grid;
  gap: 10px;
}

.result-balls {
  grid-template-columns: repeat(6, minmax(44px, 1fr));
  min-height: 56px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.ball,
.number-button {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.ball {
  background: var(--canvas);
  color: var(--ink);
  font-size: 20px;
}

.ball.tier-1,
.number-button.tier-1.is-selected {
  background: #f4b000;
  color: #0a0b0d;
}

.ball.tier-2,
.number-button.tier-2.is-selected {
  background: #0052ff;
  color: #ffffff;
}

.ball.tier-3,
.number-button.tier-3.is-selected {
  background: #cf202f;
  color: #ffffff;
}

.ball.tier-4,
.number-button.tier-4.is-selected {
  background: #5b616e;
  color: #ffffff;
}

.ball.tier-5,
.number-button.tier-5.is-selected {
  background: #05b169;
  color: #ffffff;
}

.result-note {
  margin: 0;
  color: var(--on-dark-soft);
  font-size: 14px;
}

.button-row {
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.selector-header {
  margin-bottom: 16px;
}

.selector-header h3,
.selector-header .panel-kicker {
  margin-bottom: 0;
}

.selected-count {
  margin: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  padding: 6px 12px;
  color: var(--body);
  font-size: 13px;
  font-weight: 700;
}

.number-grid {
  grid-template-columns: repeat(9, 1fr);
  margin-bottom: 24px;
}

.number-button {
  border: 1px solid var(--hairline);
  background: var(--canvas);
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.number-button:hover,
.number-button:focus-visible {
  border-color: var(--primary);
}

.number-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.number-button.is-selected {
  border-color: transparent;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.insight-grid > div {
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  background: var(--surface-soft);
  padding: 16px;
}

.insight-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.insight-grid strong {
  font-size: 15px;
}

.content-band,
.seo-band,
.faq-band {
  padding: 96px 0;
}

.content-band,
.faq-band {
  background: var(--surface-soft);
}

.content-band > *,
.seo-band > *,
.faq-band > * {
  width: min(1200px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

.section-copy {
  max-width: 760px;
  margin-bottom: 40px;
}

.method-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.method-list article {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--canvas);
  padding: 32px;
}

.method-list span {
  display: inline-grid;
  width: 32px;
  height: 32px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.method-list p,
.faq-list p {
  margin-bottom: 0;
  color: var(--body);
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--canvas);
  padding: 20px 24px;
}

.faq-list summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.faq-list p {
  padding-top: 14px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  border-top: 1px solid var(--hairline-soft);
  padding: 32px 0;
  color: var(--muted);
  font-size: 13px;
}

.site-footer p {
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy {
    max-width: 720px;
  }

  .method-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav {
    width: min(100% - 28px, 1200px);
  }

  .nav-links {
    display: none;
  }

  .hero,
  .content-band > *,
  .seo-band > *,
  .faq-band > *,
  .site-footer {
    width: min(100% - 28px, 1200px);
  }

  .hero {
    padding-top: 48px;
  }

  h1 {
    font-size: 44px;
  }

  .hero-description,
  .section-copy p {
    font-size: 16px;
  }

  .generator-panel {
    padding: 20px;
  }

  .panel-header {
    align-items: flex-start;
  }

  .panel-header h2 {
    font-size: 26px;
  }

  .result-card {
    padding: 20px;
  }

  .result-balls {
    grid-template-columns: repeat(3, 1fr);
  }

  .number-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .insight-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
  }
}

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