@layer reset, tokens, base, components, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html, body { margin: 0; }
  h1, h2, h3, h4, p, ul, ol, dl, dd, table { margin: 0; }
  ul, ol { padding: 0; list-style: none; }
  button { font: inherit; }
}

@layer tokens {
  :root {
    color-scheme: light;

    --bg: oklch(98% 0.005 250);
    --surface: oklch(100% 0 0);
    --ink: oklch(20% 0.02 250);
    --ink-2: oklch(35% 0.02 250);
    --ink-3: oklch(55% 0.02 250);
    --line: oklch(90% 0.01 250);
    --line-2: oklch(82% 0.015 250);

    --brand: oklch(58% 0.18 255);
    --brand-soft: oklch(96% 0.025 255);
    --brand-line: oklch(85% 0.06 255);

    --gold: oklch(78% 0.15 85);
    --silver: oklch(75% 0.02 250);
    --bronze: oklch(68% 0.10 50);

    --good: oklch(60% 0.13 150);
    --warn: oklch(70% 0.14 70);

    --font: ui-sans-serif, system-ui, -apple-system, "Pretendard Variable",
      "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;

    --radius: 12px;
    --radius-sm: 8px;
  }
}

@layer base {
  body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
  }

  main {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px clamp(16px, 4vw, 40px) 96px;
  }

  h1 {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
  }

  h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 14px;
  }

  h3 {
    font-size: 17px;
    font-weight: 700;
  }

  h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-2);
    margin-bottom: 6px;
  }

  p { color: var(--ink-2); }

  strong { color: var(--ink); font-weight: 700; }
  em { font-style: normal; color: var(--brand); font-weight: 600; }
}

@layer components {
  .hero {
    background: linear-gradient(135deg, oklch(96% 0.04 255), oklch(98% 0.02 270));
    border-bottom: 1px solid var(--line);
    padding: 48px clamp(16px, 4vw, 40px) 40px;
  }

  .hero > * { max-width: 980px; margin-left: auto; margin-right: auto; }

  .eyebrow {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
  }

  .lede {
    font-size: 17px;
    color: var(--ink-2);
    margin-top: 12px;
    max-width: 720px;
  }

  .meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 20px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--brand-line);
  }

  .meta dt {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
  }

  .meta dd {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
  }

  .section {
    margin-top: 56px;
    container-type: inline-size;
  }

  .section > p { max-width: 720px; }

  .question-box {
    background: var(--brand-soft);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin: 16px 0;
    font-size: 16px;
    color: var(--ink);
  }

  .cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 16px;
  }

  .card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
  }

  .card.highlight {
    border-color: var(--brand-line);
    background: linear-gradient(180deg, var(--brand-soft), var(--surface));
    box-shadow: 0 1px 0 var(--brand-line), 0 8px 24px -16px oklch(58% 0.18 255 / 0.3);
  }

  .card h3 { margin-bottom: 6px; }
  .card-sub { font-size: 14px; color: var(--ink-2); margin-bottom: 10px; }
  .examples { font-size: 12px; color: var(--ink-3); margin: 0; }

  table.data {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 14px;
    margin-top: 12px;
  }

  .table-scroll { overflow-x: auto; margin-top: 12px; }
  .table-scroll table.data { margin-top: 0; min-width: 720px; }

  table.data th,
  table.data td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
  }

  table.data thead th {
    background: oklch(97% 0.01 250);
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  table.data tbody tr:last-child td { border-bottom: 0; }

  table.data .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
  }

  table.data .hl {
    background: oklch(97% 0.04 255);
    color: var(--ink);
    font-weight: 700;
  }

  table.data .total td {
    background: oklch(96% 0.02 250);
    font-weight: 700;
    color: var(--ink);
    border-top: 2px solid var(--line-2);
  }

  table.data .rank td {
    background: oklch(98% 0.02 60);
    font-weight: 700;
    color: var(--ink);
  }

  .scores tbody td { white-space: nowrap; }

  .note {
    font-size: 13px;
    color: var(--ink-3);
    background: oklch(98% 0.02 60);
    border: 1px solid oklch(92% 0.04 70);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 14px;
  }

  .option {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 14px;
  }

  .opt-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }

  .opt-header h3 { font-size: 19px; }

  .badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: oklch(94% 0.01 250);
    color: var(--ink-2);
  }

  .badge.gold { background: oklch(92% 0.10 85); color: oklch(40% 0.10 60); }
  .badge.silver { background: oklch(92% 0.01 250); color: oklch(40% 0.01 250); }
  .badge.bronze { background: oklch(90% 0.06 50); color: oklch(40% 0.08 40); }

  .grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 16px;
  }

  @container (max-width: 600px) {
    .grid-2 { grid-template-columns: 1fr; gap: 16px; }
  }

  .option ul {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .option ul li {
    font-size: 14px;
    color: var(--ink-2);
    padding-left: 14px;
    position: relative;
  }

  .option ul li::before {
    content: "·";
    position: absolute;
    left: 4px;
    color: var(--ink-3);
    font-weight: 700;
  }

  details {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }

  details summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
  }

  details summary:hover { color: oklch(48% 0.18 255); }

  details p {
    margin-top: 8px;
    font-size: 14px;
  }

  details p + p { margin-top: 8px; }

  .recommendation {
    background: linear-gradient(135deg, oklch(96% 0.04 255), oklch(98% 0.03 270));
    border: 1px solid var(--brand-line);
    border-radius: var(--radius);
    padding: 24px;
    margin: 16px 0 28px;
  }

  .recommendation h3 {
    font-size: 18px;
    margin-bottom: 10px;
  }

  .recommendation p + p { margin-top: 10px; }

  .trends li {
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--ink-2);
  }

  ol.sources {
    list-style: decimal inside;
    padding-left: 0;
  }

  ol.sources li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 13px;
    color: var(--ink-2);
  }

  ol.sources li:last-child { border-bottom: 0; }

  footer {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 12px;
    color: var(--ink-3);
  }
}
