/* Project page for "Fooled by a Lookalike" (ICBTA 2026).
   Layout: one reading column (~900px) of numbered sections; hex addresses in mono are the page's signature motif. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #14171c;
  --ink-2: #4a505a;
  --muted: #6f757e;
  --line: #e2e5ea;
  --axis: #c4c9d1;
  --accent: #2a5bd7;
  --match-bg: #dbe6fb;
  --match-ink: #1d3f99;
  --diff-bg: #fde2d8;
  --diff-ink: #a8361a;
  --cA: #2a78d6;
  --cB: #eb6834;
  --cC: #1baf7a;
  --t0: #8a93a0;
  --t1: #eb6834;
  --good: #0f7a3a;
  --bad: #b8361f;
  --h0: #f1f3f6; --h1: #fde3d6; --h2: #f9c2a6; --h3: #f29a74; --h4: #e1704a; --h5: #c24f2c; --h6: #8f3519;
  --hink-light: #14171c; --hink-dark: #ffffff;
  --font-body: "IBM Plex Sans", "IBM Plex Sans KR", "IBM Plex Sans JP", "Apple SD Gothic Neo", "Hiragino Sans", "Malgun Gothic", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
/* Light theme by default; the dark palette applies only when data-theme="dark" is set on <html>. */
:root[data-theme="dark"] {
    --bg: #111317; --surface: #1a1d22; --ink: #eef0f3; --ink-2: #b9bec6; --muted: #8b919a; --line: #2b2f36; --axis: #3c424b;
    --accent: #7ea2f2; --match-bg: #1f3260; --match-ink: #c4d6ff; --diff-bg: #5a2416; --diff-ink: #ffb8a1;
    --cA: #3987e5; --cB: #d95926; --cC: #199e70; --t0: #7d8590; --t1: #e8743f; --good: #4cc27c; --bad: #ff8a6b;
    --h0: #22262c; --h1: #3b2a24; --h2: #5a3221; --h3: #7f3d22; --h4: #a84b25; --h5: #d0612f; --h6: #f08a5a;
    color-scheme: dark;
}
/* Korean and Japanese pages: keep each script on its own font so shared Han characters are not drawn with the other language's glyphs. */
:root:lang(ko) { --font-body: "IBM Plex Sans", "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif; }
:root:lang(ja) { --font-body: "IBM Plex Sans", "IBM Plex Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", system-ui, sans-serif; }
:root:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }
:root:lang(ja) :is(h1, h2, h3, .title-tr) { word-break: auto-phrase; }
/* Monospace labels that carry Korean or Japanese words: Plex Mono's wide spaces look broken next to Hangul and kana. */
:root:is(:lang(ko), :lang(ja)) :is(.sec-num, .svg-tag) { font-family: var(--font-body); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.65; }
a { color: var(--accent); }
.wrap { max-width: 920px; margin: 0 auto; padding-block: 28px 72px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 56px; }
.topbar { display: flex; justify-content: flex-end; align-items: center; font-size: 14px; }
/* language menu: a <details> dropdown, so it works without JavaScript */
.lang { position: relative; }
.lang summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); user-select: none; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.lang[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.lang summary:hover, .lang[open] summary { border-color: var(--accent); }
.lang ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 140px; margin: 0; padding: 6px; list-style: none; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(20, 23, 28, 0.10); }
.lang ul a { display: block; padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.lang ul a:hover, .lang ul a:focus-visible { background: var(--bg); }
.lang ul a[aria-current="page"] { color: var(--accent); font-weight: 600; }
h1 { font-size: clamp(27px, 4.4vw, 38px); line-height: 1.22; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 24px; line-height: 1.3; margin: 0; text-wrap: balance; }
h3 { font-size: 17px; margin: 0; }
p { margin: 0; max-width: 70ch; }
ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; max-width: 70ch; }
.eyebrow { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.authors { font-size: 16px; color: var(--ink-2); }
.lede { color: var(--ink-2); font-size: 17px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.btn:hover { border-color: var(--accent); }
.btn[aria-disabled="true"] { color: var(--muted); cursor: default; }
.btn[aria-disabled="true"]:hover { border-color: var(--line); }
section { display: grid; gap: 18px; min-width: 0; }
.sec-head { display: grid; gap: 8px; }
.sec-num { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.note { font-size: 13px; color: var(--muted); }
.mono { font-family: var(--font-mono); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; min-width: 0; }
.abstract { display: grid; gap: 10px; }
.abstract p { color: var(--ink-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.addr-compare { display: grid; gap: 10px; }
.addr-row { display: grid; grid-template-columns: 8.5em 1fr; gap: 12px; align-items: baseline; min-width: 0; }
.addr-row .lab { font-size: 13px; color: var(--ink-2); }
.addr { font-family: var(--font-mono); font-size: clamp(11px, 2.05vw, 15.5px); letter-spacing: 0.02em; word-break: break-all; }
.addr .m { background: var(--match-bg); color: var(--match-ink); border-radius: 2px; }
.addr .d { background: var(--diff-bg); color: var(--diff-ink); border-radius: 2px; font-weight: 600; }
.addr .x { color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 4px; align-content: start; }
.stat .v { font-size: clamp(20px, 5.6vw, 28px); font-weight: 700; line-height: 1.15; }
.stat .v.bad { color: var(--bad); }
.stat .v.good { color: var(--good); }
.stat .k { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.diagram { overflow-x: auto; }
.diagram svg { display: block; min-width: 640px; width: 100%; height: auto; }
.svg-box { fill: var(--surface); stroke: var(--axis); stroke-width: 1.2; }
.svg-box.hi { stroke: var(--accent); stroke-width: 1.6; }
.svg-t { fill: var(--ink); font-family: var(--font-body); font-size: 13px; }
.svg-t2 { fill: var(--ink-2); font-family: var(--font-body); font-size: 11.5px; }
.svg-arrow { stroke: var(--muted); stroke-width: 1.4; fill: none; }
.svg-head { fill: var(--muted); }
.svg-tag { font-family: var(--font-mono); font-size: 11px; font-weight: 600; }

.cond-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cond { border-top: 3px solid var(--line); padding-top: 10px; display: grid; gap: 4px; align-content: start; }
.cond.a { border-color: var(--cA); } .cond.b { border-color: var(--cB); } .cond.c { border-color: var(--cC); }
.cond .ttl { font-weight: 700; }
.cond p { font-size: 14px; color: var(--ink-2); }
@media (max-width: 640px) { .cond-grid { grid-template-columns: 1fr; } }

.levels { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.levels th, .levels td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.levels th { font-size: 12px; color: var(--muted); font-weight: 500; }
.levels td.addr { font-size: 13px; }
.scroll { overflow-x: auto; }

.chart svg { display: block; width: 100%; height: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.grid-l { stroke: var(--line); stroke-width: 1; }
.base-l { stroke: var(--axis); stroke-width: 1; }
.ax-t { fill: var(--muted); font-family: var(--font-body); font-size: 12px; }
.ax-t2 { fill: var(--ink-2); font-family: var(--font-body); font-size: 12px; }
.ax-g { fill: var(--accent); font-family: var(--font-body); font-size: 12px; }
.lbl { fill: var(--ink-2); font-family: var(--font-body); font-size: 12px; }
.lbl-b { fill: var(--ink); font-family: var(--font-body); font-size: 12.5px; font-weight: 500; }
.lineA { stroke: var(--cA); } .lineB { stroke: var(--cB); } .lineC { stroke: var(--cC); }
.dotA { fill: var(--cA); } .dotB { fill: var(--cB); } .dotC { fill: var(--cC); }
.dot-t0 { fill: var(--t0); } .dot-t1 { fill: var(--t1); }
.ring { stroke: var(--surface); stroke-width: 2; }
.conn { stroke: var(--axis); stroke-width: 2.5; stroke-linecap: round; }
.pt { fill: var(--accent); }
.bar { fill: var(--h4); }
.tip-target { cursor: default; }

.heat { border-collapse: separate; border-spacing: 3px; font-size: 13px; width: 100%; min-width: 580px; }
.heat th { font-weight: 500; color: var(--muted); font-size: 12px; padding: 4px 6px; text-align: center; }
.heat th.rowh { text-align: left; color: var(--ink); font-size: 13px; white-space: nowrap; }
.heat td { text-align: center; padding: 8px 4px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.heat td.tot { font-weight: 700; }
.heat tr.tier th { text-align: left; color: var(--accent); font-size: 12px; padding-top: 10px; }
.h0 { background: var(--h0); color: var(--hink-light); } .h1 { background: var(--h1); color: var(--hink-light); } .h2 { background: var(--h2); color: var(--hink-light); }
.h3 { background: var(--h3); color: var(--hink-light); } .h4 { background: var(--h4); color: var(--hink-dark); } .h5 { background: var(--h5); color: var(--hink-dark); } .h6 { background: var(--h6); color: var(--hink-dark); }
:root[data-theme="dark"] .heat td { color: var(--ink); }
.ramp { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.ramp span.c { width: 22px; height: 12px; border-radius: 2px; display: inline-block; }

.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.ex { display: grid; gap: 10px; align-content: start; }
.ex .who { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.verdict { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.verdict.bad { background: var(--diff-bg); color: var(--diff-ink); }
.verdict.good { background: color-mix(in oklab, var(--good) 18%, var(--surface)); color: var(--good); }
blockquote { margin: 0; padding: 10px 12px; border-left: 3px solid var(--line); font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; color: var(--ink-2); background: var(--bg); border-radius: 0 6px 6px 0; }
.ex .gloss { font-size: 14px; }
/* Korean and Japanese pages: translated title under the English one, and a translation under each verbatim English quote. */
.title-tr { font-size: 18px; color: var(--ink-2); margin: 0; }
blockquote .tr { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-family: var(--font-body); font-size: 13px; color: var(--ink-2); }

.mt { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 780px; }
.mt th, .mt td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mt th { color: var(--muted); font-weight: 500; font-size: 12px; vertical-align: bottom; }
.mt th:first-child, .mt td:first-child { text-align: left; }
.mt td.name { font-weight: 500; }
.mt tr.tier td { color: var(--accent); font-size: 12px; text-align: left; padding-top: 14px; border-bottom: none; }
.hl-bad { color: var(--bad); font-weight: 700; }
.hl-good { color: var(--good); font-weight: 700; }

pre.code { margin: 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; color: var(--ink); }
.cite-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.copy { font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }

#tip { position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.45; padding: 7px 10px; border-radius: 6px; max-width: 280px; opacity: 0; transition: opacity .08s; }
#tip.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #tip { transition: none; } }
footer { font-size: 13px; color: var(--muted); display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 18px; }
