:root {
  --ink: #12211a;
  --muted: #647069;
  --paper: #f6f4ed;
  --panel: #fffef9;
  --line: #d9ddd5;
  --green: #0d694c;
  --green-dark: #084a37;
  --green-soft: #dceade;
  --yellow: #efb629;
  --coral: #e66f51;
  --shadow: 0 20px 55px rgba(33, 54, 43, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 8%, rgba(239, 182, 41, 0.16), transparent 27rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; }

.site-header {
  width: min(1180px, calc(100% - 40px));
  height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(18, 33, 26, 0.12);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; text-decoration: none; letter-spacing: -0.02em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: white; background: var(--green); font-size: 12px; letter-spacing: -0.04em; }
nav { display: flex; gap: 30px; }
nav a { color: var(--muted); font-size: 14px; text-decoration: none; transition: color .2s; }
nav a:hover { color: var(--green); }

main { overflow: hidden; }
.hero {
  width: min(1180px, calc(100% - 40px));
  min-height: 560px;
  margin: 0 auto;
  padding: 78px 0 84px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 80px;
  align-items: center;
}
.eyebrow { margin: 0 0 16px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2 { font-family: Georgia, "Noto Serif SC", serif; font-weight: 500; letter-spacing: -.045em; }
h1 { margin: 0; max-width: 730px; font-size: clamp(52px, 7vw, 86px); line-height: .99; }
.hero-intro { max-width: 650px; margin: 30px 0 36px; color: #56625b; font-size: 18px; line-height: 1.8; }
.hero-intro strong { color: var(--ink); }
.primary-button { display: inline-flex; align-items: center; gap: 18px; padding: 14px 20px; color: white; background: var(--green); border-radius: 999px; font-size: 14px; font-weight: 700; text-decoration: none; box-shadow: 0 10px 28px rgba(13, 105, 76, .18); transition: transform .2s, background .2s; }
.primary-button:hover { transform: translateY(-2px); background: var(--green-dark); }

.hero-card { position: relative; padding: 28px; color: white; background: var(--green); border-radius: 28px; box-shadow: var(--shadow); overflow: hidden; }
.hero-card::after { content: ""; position: absolute; right: -56px; bottom: -64px; width: 210px; height: 210px; border: 42px solid rgba(255,255,255,.08); border-radius: 50%; }
.card-kicker { margin: 0 0 40px; color: #a9d4c3; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.hero-card-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.hero-card-title span { max-width: 110px; color: #d9ede4; font-family: Georgia, serif; font-size: 24px; line-height: 1; }
.hero-card-title strong { font-family: Georgia, serif; font-size: 50px; font-weight: 400; letter-spacing: -.05em; }
.hero-card-rule { height: 1px; margin: 26px 0; background: rgba(255,255,255,.22); }
.hero-card dl { position: relative; z-index: 1; margin: 0; }
.hero-card dl div { display: flex; justify-content: space-between; padding: 9px 0; }
.hero-card dt { color: #bcd9cc; font-size: 13px; }
.hero-card dd { margin: 0; font-size: 15px; font-weight: 800; }
.hero-card-note { position: relative; z-index: 1; margin: 25px 0 0; color: #a9d4c3; font-size: 11px; }

.index-section { padding: 86px max(20px, calc((100% - 1180px) / 2)) 110px; background: var(--panel); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 50px; margin-bottom: 38px; }
.section-heading h2, .method-section h2 { margin: 0; font-size: clamp(38px, 5vw, 58px); line-height: 1.05; }
.section-heading > p { max-width: 360px; margin: 0 0 6px; color: var(--muted); line-height: 1.7; }
.toolbar { display: grid; grid-template-columns: minmax(300px, 1fr) auto auto; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 10px 35px rgba(33, 54, 43, .04); }
.search-box { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #fafbf8; }
.search-box > span { color: var(--green); font-size: 24px; line-height: 1; transform: rotate(-15deg); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }
.search-box input::placeholder { color: #98a19b; }
kbd { padding: 3px 7px; color: #8a948d; border: 1px solid #dce0da; border-radius: 5px; background: white; font-family: inherit; font-size: 10px; white-space: nowrap; }
.filter-group { display: flex; gap: 6px; }
.filter-chip { padding: 9px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.filter-chip:hover, .filter-chip.is-active { color: var(--green-dark); background: var(--green-soft); }
.high-match-toggle { display: flex; align-items: center; gap: 9px; padding: 0 6px; font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.high-match-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { width: 34px; height: 20px; padding: 3px; border-radius: 999px; background: #cdd3ce; transition: background .2s; }
.toggle-track span { display: block; width: 14px; height: 14px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.16); transition: transform .2s; }
.high-match-toggle input:checked + .toggle-track { background: var(--green); }
.high-match-toggle input:checked + .toggle-track span { transform: translateX(14px); }

.results-meta { min-height: 45px; padding: 16px 2px 10px; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.results-meta button, .empty-state button { padding: 0; border: 0; color: var(--green); background: transparent; font-weight: 700; cursor: pointer; }
.table-shell { border-top: 2px solid var(--ink); }
.table-head, .unit-row { display: grid; grid-template-columns: minmax(180px, .75fr) minmax(290px, 1.2fr) minmax(320px, 1.35fr); column-gap: 28px; }
.table-head { padding: 14px 18px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.unit-row { padding: 27px 18px; border-bottom: 1px solid var(--line); animation: reveal .28s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } }
.unit-id { margin-bottom: 9px; color: var(--green); font-size: 11px; font-weight: 900; letter-spacing: .13em; }
.unit-topic { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: 24px; font-weight: 500; line-height: 1.15; letter-spacing: -.025em; }
.best-match { padding-left: 18px; border-left: 3px solid var(--yellow); }
.match-link { display: inline; font-size: 16px; font-weight: 750; line-height: 1.5; text-decoration-color: transparent; text-underline-offset: 3px; transition: color .2s, text-decoration-color .2s; }
.match-link:hover { color: var(--green); text-decoration-color: currentColor; }
.external-arrow { margin-left: 4px; color: var(--green); font-size: .8em; }
.rating-line { display: flex; align-items: center; gap: 9px; margin-top: 7px; }
.stars { color: var(--yellow); font-size: 13px; letter-spacing: .07em; }
.stars i { color: #dfe2dd; font-style: normal; }
.rating-label { color: var(--muted); font-size: 11px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.article-meta span { padding: 4px 7px; color: #65541b; background: #f7edc7; border-radius: 5px; font-size: 10px; font-weight: 750; }
.article-note { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.pending-match { display: grid; gap: 7px; padding: 16px; border: 1px dashed #d49f91; border-radius: 12px; background: #fff5f1; }
.pending-match strong { color: #a64935; font-family: Georgia, "Noto Serif SC", serif; font-size: 18px; }
.pending-match span { color: #84665e; font-size: 11px; }
.keywords { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 13px; }
.keyword { padding: 4px 7px; border-radius: 5px; color: #426355; background: #edf4ee; font-size: 10px; font-weight: 700; }
.more-matches { display: grid; gap: 16px; }
.secondary-match { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.secondary-match + .secondary-match { padding-top: 15px; border-top: 1px dashed #d9ddd5; }
.secondary-match .match-link { font-size: 14px; font-weight: 650; }
.secondary-match .stars { white-space: nowrap; }
.empty-state { padding: 80px 20px; text-align: center; border-bottom: 1px solid var(--line); }
.empty-state > span { font-family: Georgia, serif; font-size: 28px; }
.empty-state p { color: var(--muted); }
.empty-state button { margin-top: 8px; }

.method-section { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 105px 0 110px; }
.method-section > div:first-child { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: end; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 58px; }
.method-grid article { min-height: 220px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.48); }
.method-grid article > span { color: var(--coral); font-family: Georgia, serif; font-size: 32px; }
.method-grid h3 { margin: 44px 0 10px; font-size: 17px; }
.method-grid p, .rating-legend p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.rating-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; padding: 26px; color: white; background: var(--green-dark); border-radius: var(--radius); }
.rating-legend > div { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; align-items: center; }
.rating-legend .stars { grid-row: 1 / 3; font-size: 11px; }
.rating-legend strong { font-size: 13px; }
.rating-legend p { color: #bcd2c8; }

footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 40px; display: flex; justify-content: space-between; gap: 30px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }
footer p { margin: 0; }
footer a { color: var(--green); font-weight: 700; text-decoration: none; }

:focus-visible { outline: 3px solid rgba(239, 182, 41, .6); outline-offset: 3px; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr .75fr; gap: 35px; }
  .toolbar { grid-template-columns: 1fr auto; }
  .filter-group { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; }
  .table-head, .unit-row { grid-template-columns: minmax(160px, .7fr) minmax(240px, 1fr) minmax(260px, 1fr); gap: 18px; }
}

@media (max-width: 720px) {
  .site-header { height: 66px; }
  nav { display: none; }
  .hero { min-height: auto; padding: 55px 0 70px; grid-template-columns: 1fr; }
  h1 { font-size: clamp(48px, 14vw, 66px); }
  .hero-intro { font-size: 16px; }
  .hero-card { max-width: 430px; }
  .index-section { padding-top: 70px; padding-bottom: 80px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 18px; }
  .toolbar { grid-template-columns: 1fr; }
  .high-match-toggle { padding: 6px; }
  .filter-group { grid-column: auto; grid-row: auto; margin: 0 -2px; }
  kbd { display: none; }
  .table-head { display: none; }
  .table-shell { border-top: 0; }
  .unit-list { display: grid; gap: 14px; }
  .unit-row { grid-template-columns: 1fr; gap: 22px; padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 8px 28px rgba(33, 54, 43, .04); }
  .unit-topic { font-size: 25px; }
  .best-match { padding: 15px 0 0; border-left: 0; border-top: 3px solid var(--yellow); }
  .more-matches { padding-top: 2px; }
  .method-section > div:first-child { grid-template-columns: 1fr; }
  .method-grid, .rating-legend { grid-template-columns: 1fr; }
  .method-grid article { min-height: 190px; }
  footer { display: block; }
  footer a { display: inline-block; margin-top: 12px; }
}

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