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

@layer reset {
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  ul { list-style: none; }
}

@layer tokens {
  :root {
    color-scheme: light;
    --bg: #f6f7f9;
    --surface: #ffffff;
    --ink: #14181f;
    --muted: #5b6573;
    --line: #e4e8 ed;
    --line: #e4e8ed;
    --brand: #1f5fff;
    --brand-soft: #eaf1ff;
    --gold: #b8860b;
    --gold-soft: #fff7e0;
    --green: #1c7d4d;
    --green-soft: #e7f6ee;
    --red: #c0392b;
    --red-soft: #fdecea;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(20,24,31,.06), 0 8px 24px rgba(20,24,31,.05);
    --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Segoe UI", Roboto, sans-serif;
  }
}

@layer base {
  body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    padding: clamp(1rem, 3vw, 3rem) 1rem;
  }
  h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.2; letter-spacing: -.02em; }
  h2 { font-size: 1.25rem; letter-spacing: -.01em; margin-bottom: .9rem; }
  h3 { font-size: 1.05rem; }
  h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .4rem; }
  p { margin-bottom: .5rem; }
  em { font-style: normal; background: var(--gold-soft); padding: 0 .25em; border-radius: 4px; }
  small { font-weight: 400; color: var(--muted); }
}

@layer components {
  .wrap { max-width: 940px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.1rem; }

  .hero {
    background: linear-gradient(135deg, #0e1730, #1f3a7a);
    color: #fff; padding: clamp(1.6rem, 4vw, 2.6rem); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .eyebrow { text-transform: uppercase; letter-spacing: .15em; font-size: .72rem; opacity: .8; margin-bottom: .5rem; }
  .hero .sub { color: #c7d3ee; font-size: .92rem; margin-top: .6rem; }
  .badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
  .badge { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); padding: .3rem .7rem; border-radius: 999px; font-size: .8rem; }
  .badge-win { background: var(--gold); border-color: var(--gold); font-weight: 700; }

  .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.1rem, 3vw, 1.8rem); box-shadow: var(--shadow); }
  .callout { border-left: 4px solid var(--brand); }
  .note { font-size: .85rem; color: var(--muted); margin-bottom: .7rem; }

  .lede { display: flex; flex-direction: column; gap: .55rem; }
  .lede li { padding-left: 1.1rem; position: relative; }
  .lede li::before { content: "▸"; position: absolute; left: 0; color: var(--brand); }

  .macro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem; }
  .macro-box { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
  .macro-box h3 { font-size: .95rem; margin-bottom: .45rem; }
  .macro-box p { font-size: .87rem; color: var(--muted); margin: 0; }
  .macro-box strong { color: var(--ink); }

  table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
  .tbl th, .tbl td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
  .tbl thead th { background: var(--bg); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
  .scroll { overflow-x: auto; }
  .inv { color: var(--muted); font-weight: 400; font-size: .8em; }

  .matrix td.total, .matrix th.total { font-weight: 700; }
  .matrix .total { background: var(--brand-soft); color: var(--brand); }
  .matrix .rk { display: inline-flex; width: 1.4rem; height: 1.4rem; align-items: center; justify-content: center; background: var(--ink); color: #fff; border-radius: 6px; font-size: .78rem; font-weight: 700; margin-right: .3rem; }
  .matrix .sec { display: block; font-size: .72rem; color: var(--muted); margin-top: .15rem; }
  .matrix tr.rank1 td { background: var(--gold-soft); }
  .matrix tr.rank1 .total { background: var(--gold); color: #fff; }
  .matrix tr.rank1 .rk { background: var(--gold); }

  .opt { border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem; margin-top: 1rem; }
  .opt:first-of-type { margin-top: 0; }
  .opt1 { border-color: var(--gold); background: linear-gradient(180deg, var(--gold-soft), #fff 60%); }
  .opt2 { border-color: #c9d6f5; }
  .opt-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
  .opt-head h3 { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
  .opt .rk { display: inline-flex; width: 1.5rem; height: 1.5rem; align-items: center; justify-content: center; background: var(--brand); color: #fff; border-radius: 7px; font-size: .8rem; font-weight: 700; }
  .opt1 .rk { background: var(--gold); }
  .opt .sec { font-size: .75rem; color: var(--muted); background: var(--bg); padding: .15rem .55rem; border-radius: 999px; }
  .opt .score { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--brand); }
  .opt1 .score { color: var(--gold); }
  .quote { font-size: .85rem; color: var(--muted); background: var(--bg); border-radius: 8px; padding: .5rem .8rem; margin: .7rem 0 .9rem; font-variant-numeric: tabular-nums; }

  .pc { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .pc ul { display: flex; flex-direction: column; gap: .35rem; }
  .pc li { font-size: .86rem; padding-left: 1rem; position: relative; }
  .pros li::before { content: "+"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
  .cons li::before { content: "−"; position: absolute; left: 0; color: var(--red); font-weight: 700; }

  .whys { margin-top: .9rem; display: flex; flex-direction: column; gap: .5rem; }
  .whys p { font-size: .86rem; padding: .6rem .8rem; border-radius: 8px; margin: 0; }
  .whys .buy { background: var(--green-soft); }
  .whys .buy strong { color: var(--green); }
  .whys .nobuy { background: var(--red-soft); }
  .whys .nobuy strong { color: var(--red); }

  .final { border-top: 4px solid var(--gold); }
  .final h3 { margin: 1.1rem 0 .5rem; }
  .pcontext { font-size: .82rem; color: var(--muted); background: var(--bg); border-radius: 8px; padding: .6rem .8rem; margin-top: .9rem; }

  .src { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); margin-bottom: .9rem; }
  .src li { padding-left: 1rem; position: relative; }
  .src li::before { content: "·"; position: absolute; left: .2rem; }
  .disclaimer { font-size: .82rem; color: var(--red); background: var(--red-soft); border-radius: 8px; padding: .7rem .9rem; }

  .foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem 0 .5rem; }
}

@layer utilities {
  @container (max-width: 520px) { .pc { grid-template-columns: 1fr; } }
}

@media (max-width: 560px) {
  .pc { grid-template-columns: 1fr; }
  .opt .score { font-size: 1.2rem; }
}
