/* privyscope site. Research-paper figure meets ML notebook. System fonts only: no requests leave the page. */
:root {
  color-scheme: light;
  --paper: #f4f7fa;
  --surface: #ffffff;
  --ink: #111b2e;
  --slate: #4b586b;
  --rule: #cbd5e1;
  --grid: rgba(17, 27, 46, 0.055);
  --teal: #14808a;
  --teal-ink: #0d6670;
  --track: #e6ecf3;
  --code-bg: #eef3f8;
  --forbid: #c0392b;
  /* validated 8-hue categorical set, light steps */
  --e-per: #2a78d6; --e-phone: #eb6834; --e-id: #1baf7a; --e-email: #eda100;
  --e-loc: #e87ba4; --e-bank: #008300; --e-date: #4a3aa7; --e-secret: #e34948;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Hiragino Sans", "Noto Sans JP", "PingFang SC", "PingFang TC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --paper: #0d1322; --surface: #121a2d; --ink: #e6ebf5; --slate: #a3aec2; --rule: #26324a;
    --grid: rgba(160, 190, 255, 0.06); --teal: #4fc1c8; --teal-ink: #6fd3d9; --track: #1b2640;
    --code-bg: #0f1729; --forbid: #ff8a7a;
    --e-per: #3987e5; --e-phone: #d95926; --e-id: #199e70; --e-email: #c98500;
    --e-loc: #d55181; --e-bank: #008300; --e-date: #9085e9; --e-secret: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d1322; --surface: #121a2d; --ink: #e6ebf5; --slate: #a3aec2; --rule: #26324a;
  --grid: rgba(160, 190, 255, 0.06); --teal: #4fc1c8; --teal-ink: #6fd3d9; --track: #1b2640;
  --code-bg: #0f1729; --forbid: #ff8a7a;
  --e-per: #3987e5; --e-phone: #d95926; --e-id: #199e70; --e-email: #c98500;
  --e-loc: #d55181; --e-bank: #008300; --e-date: #9085e9; --e-secret: #e66767;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }  /* class rules like .tokens { display: flex } must not defeat the hidden attribute */
html { font-size: 17px; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0; color: var(--ink); background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  font: 1.05rem/1.65 var(--serif); -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
a { color: var(--teal-ink); text-underline-offset: 3px; }
code { font: 0.86em var(--mono); background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 20; font: 0.9rem var(--sans); }
.skip:focus { left: 8px; }

/* header */
.bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule); }
.bar-in { display: flex; align-items: center; gap: 22px; min-height: 54px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.15rem var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand-sub { font: 500 0.82rem var(--sans); color: var(--slate); border-left: 1px solid var(--rule); padding-left: 10px; letter-spacing: 0; }
.bar nav { display: flex; gap: 20px; flex: 1; font: 0.9rem var(--sans); }
.bar nav a { color: var(--slate); text-decoration: none; padding: 4px 0; }
.bar nav a:hover { color: var(--ink); text-decoration: underline; }
.bar-end { display: flex; align-items: center; gap: 12px; font: 0.9rem var(--sans); }
.gh { color: var(--ink); }
.theme { background: none; border: 1px solid var(--rule); color: var(--ink); width: 34px; height: 34px; border-radius: 4px; display: grid; place-items: center; cursor: pointer; }
.theme:hover { border-color: var(--slate); }

/* hero */
.hero { padding-top: 64px; padding-bottom: 28px; }
h1, h2, h3 { text-wrap: balance; }
.lede, .col p { text-wrap: pretty; }
h1 { font: 600 clamp(2.15rem, 5.2vw, 3.7rem)/1.08 var(--serif); letter-spacing: -0.022em; margin: 0 0 22px; max-width: 17em; }
.lede { font-size: 1.2rem; line-height: 1.55; color: var(--slate); max-width: 38em; margin: 0 0 26px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 44px; }
.btn { font: 600 0.95rem var(--sans); text-decoration: none; padding: 10px 18px; border: 1px solid var(--ink); color: var(--ink); border-radius: 3px; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--teal-ink); border-color: var(--teal-ink); }

/* figures */
.fig { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 22px; }
.fig figcaption { font: 0.84rem/1.5 var(--sans); color: var(--slate); margin-top: 16px; max-width: 70ch; }
.fig figcaption strong { color: var(--ink); }
.fig-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; flex-wrap: wrap; }
.seg-btn { font: 600 0.85rem var(--sans); background: transparent; color: var(--slate); border: 0; padding: 7px 14px; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--rule); }
.seg-btn:hover { color: var(--ink); background: var(--track); }
.seg-btn[aria-pressed="true"], .seg-btn[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.live { margin: 0; font: 0.88rem/1.45 var(--sans); color: var(--slate); min-height: 2.9em; flex: 1 1 24rem; display: flex; align-items: center; }

/* Figure 1: tagged tokens */
.tokens { display: flex; flex-wrap: wrap; gap: 18px 8px; padding: 10px 0 4px; min-height: 4.8rem; }
.tok { display: flex; flex-direction: column; align-items: flex-start; min-width: 2.2rem; }
.tok .w { font: 1.3rem var(--mono); padding: 2px 8px 5px; }
.tok .bar-c { height: 4px; width: 100%; background: var(--rule); border-radius: 1px; }
.tok.ent .bar-c { background: var(--c); }
.tok .t { font: 0.85rem var(--mono); color: var(--slate); padding: 6px 8px 0; }
.tok.ent .t { color: var(--ink); font-weight: 700; }
.masked { font: 1.3rem/1.8 var(--mono); margin: 0; padding: 10px 0 4px; min-height: 4.8rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.masked .m { padding: 2px 7px; border-radius: 3px; border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); font-weight: 700; }

/* sections */
.sec { padding-top: 56px; padding-bottom: 12px; display: grid; grid-template-columns: minmax(0, 68ch) minmax(190px, 1fr); gap: 0 56px; align-items: start; }
.sec > .fig { grid-column: 1 / -1; margin: 22px 0 30px; }
.col { grid-column: 1; }
.col > :first-child { margin-top: 0; }
.col p { margin: 0 0 1.05em; }
h2 { font: 600 1.9rem/1.2 var(--serif); letter-spacing: -0.012em; margin: 0 0 18px; }
h3 { font: 600 1.25rem/1.3 var(--serif); margin: 22px 0 10px; }
.note { grid-column: 2; grid-row: 1; border-left: 2px solid var(--rule); padding-left: 16px; font: 0.88rem/1.55 var(--sans); color: var(--slate); margin-top: 52px; }
.note p { margin: 0 0 0.8em; }

/* pipeline + architecture svg */
.pipe, .arch { width: 100%; height: auto; display: block; color: var(--slate); font-family: var(--sans); }
.p-box rect, .a-in rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.4; }
.p-box.out rect { fill: color-mix(in srgb, var(--teal) 16%, var(--paper)); stroke: var(--teal-ink); }
.p-box text, .a-pack text, .a-core text { fill: var(--ink); font-size: 15px; font-weight: 600; }
.a-in text { fill: var(--ink); font-size: 13px; font-weight: 600; }
.pipe .sub, .arch .sub { fill: var(--slate); font-size: 12.5px; font-weight: 400; }
.pipe .n { font: 700 13px var(--mono); fill: var(--teal-ink); }
.a-core rect { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.a-core .h { font-size: 15px; font-weight: 700; }
.a-pack rect { fill: var(--paper); stroke: var(--teal-ink); stroke-width: 1.4; }
.a-pack .h { font: 700 17px var(--mono); }

/* trellis */
.trellis { width: 100%; height: auto; display: block; font-family: var(--mono); }
.trellis .t-edge { stroke: var(--rule); stroke-width: 1; fill: none; opacity: 0.8; }
.trellis .t-best { stroke: var(--teal); stroke-width: 3.2; fill: none; stroke-linecap: butt; }
.trellis .t-forbid { stroke: var(--forbid); stroke-width: 1.8; stroke-dasharray: 5 5; fill: none; }
.trellis .t-x { fill: var(--forbid); font-size: 16px; font-weight: 700; }
.trellis .t-node { fill: var(--surface); stroke: var(--slate); stroke-width: 1.4; }
.trellis .t-node.on { fill: var(--teal); stroke: var(--teal); }
.trellis .t-state { fill: var(--slate); font-size: 13px; }
.trellis .t-word { fill: var(--ink); font-size: 15px; font-weight: 600; }
.trellis .t-word.on { fill: var(--teal-ink); }
.trellis .t-tag { fill: var(--teal-ink); font-size: 12px; font-weight: 700; }

/* entities table */
.ents, .tview table { width: 100%; border-collapse: collapse; font: 0.95rem var(--sans); }
.ents th, .ents td, .tview th, .tview td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.ents thead th, .tview thead th { font-weight: 600; color: var(--slate); font-size: 0.85rem; }
.ents tbody th { width: 9.5rem; font-weight: 400; }
.chip { display: inline-flex; align-items: center; gap: 7px; font: 700 0.8rem var(--mono); border: 1px solid var(--rule); border-radius: 3px; padding: 3px 9px 3px 7px; background: var(--paper); color: var(--ink); }
.chip::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--c); flex: none; }
.e-per { --c: var(--e-per); } .e-phone { --c: var(--e-phone); } .e-id { --c: var(--e-id); } .e-email { --c: var(--e-email); }
.e-loc { --c: var(--e-loc); } .e-bank { --c: var(--e-bank); } .e-date { --c: var(--e-date); } .e-secret { --c: var(--e-secret); }

/* accuracy bars */
.bars { font-family: var(--sans); }
.bar-row { display: grid; grid-template-columns: 15rem minmax(0, 1fr) 3.6rem; grid-template-areas: "name track val" ". weak weak"; align-items: center; column-gap: 14px; padding: 8px 0 10px; border-radius: 3px; }
.bar-row:hover, .bar-row:focus-visible { background: color-mix(in srgb, var(--teal) 8%, transparent); }
.bar-name { grid-area: name; font-size: 0.95rem; font-weight: 600; }
.bar-name span { font: 0.78rem var(--mono); color: var(--slate); font-weight: 400; margin-left: 6px; white-space: nowrap; }
.bar-track { grid-area: track; height: 16px; background: linear-gradient(90deg, transparent calc(50% - 0.5px), var(--rule) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px)), var(--track); border-radius: 0 4px 4px 0; }
.bar-fill { height: 100%; width: calc(var(--v) * 100%); background: var(--teal); border-radius: 0 4px 4px 0; }
.bar-val { grid-area: val; font: 700 0.95rem var(--mono); text-align: right; }
.bar-weak { grid-area: weak; font-size: 0.84rem; color: var(--slate); margin-top: 3px; }
.bar-axis { display: grid; grid-template-columns: 15rem minmax(0, 1fr) 3.6rem; column-gap: 14px; margin-top: 4px; }
.bar-axis .ticks { grid-column: 2; display: flex; justify-content: space-between; font: 0.76rem var(--mono); color: var(--slate); }
.tview { margin-top: 18px; font-family: var(--sans); overflow-x: auto; }
.tview summary { cursor: pointer; font-size: 0.9rem; color: var(--teal-ink); font-weight: 600; }
.tview table { margin-top: 10px; min-width: 640px; }

/* code */
.code { position: relative; background: var(--code-bg); border: 1px solid var(--rule); border-radius: 4px; margin: 0 0 1.2em; }
.code pre { margin: 0; padding: 44px 18px 16px; overflow-x: auto; font: 0.87rem/1.65 var(--mono); }
.code code { background: none; padding: 0; font-size: inherit; }
.copy { position: absolute; top: 9px; right: 9px; font: 600 0.78rem var(--sans); background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 3px; padding: 4px 10px; cursor: pointer; }
.copy:hover { border-color: var(--slate); }

/* screenshots */
.shots .tabs { margin-bottom: 16px; }
.shot-frame img { display: block; max-width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 3px; }

/* footer */
.foot { margin-top: 64px; border-top: 1px solid var(--rule); padding: 30px 0 48px; font: 0.92rem var(--sans); color: var(--slate); background: var(--paper); }
.foot p { margin: 0 0 10px; }
.foot a { margin-right: 18px; }
.foot .fine { font-size: 0.82rem; }

/* narrow screens: the margin column folds under the text */
@media (max-width: 860px) {
  .sec { grid-template-columns: minmax(0, 1fr); }
  .col, .note { grid-column: 1; grid-row: auto; }
  .note { margin: 4px 0 18px; }
  .bar-row { grid-template-columns: minmax(0, 1fr) 3.6rem; }
  .bar-row { grid-template-areas: "name val" "track track" "weak weak"; row-gap: 6px; }
  .bar-axis { grid-template-columns: minmax(0, 1fr); }
  .bar-axis .ticks { grid-column: 1; }
}
@media (max-width: 640px) {
  html { font-size: 16px; }
  .hero { padding-top: 40px; }
  .bar-in { gap: 6px 14px; padding-top: 6px; padding-bottom: 6px; }
  .bar nav { order: 3; flex-basis: 100%; gap: 16px; overflow-x: auto; }
  .fig { padding: 16px; }
  .ents tbody th { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* phones: keep diagram text legible by letting the figure scroll sideways instead of shrinking the SVG */
@media (max-width: 760px) {
  .fig.wide { overflow-x: auto; }
  .pipe, .arch { min-width: 620px; }
  .trellis { min-width: 600px; }
  .shot-frame { overflow-x: auto; }
  .shot-frame img { max-width: none; }
}


/* language switch */
.langsel select { font: 0.85rem var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; height: 34px; padding: 0 8px; cursor: pointer; }
.langsel select:hover { border-color: var(--slate); }
:lang(ko), :lang(ja), :lang(zh) { --serif: var(--sans); }
:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }
:lang(ko) h1, :lang(ko) h2, :lang(ko) h3, :lang(ja) h1, :lang(ja) h2, :lang(ja) h3, :lang(zh) h1, :lang(zh) h2, :lang(zh) h3 { letter-spacing: -0.01em; }
:lang(ko) body, :lang(ja) body, :lang(zh) body { line-height: 1.78; }
:lang(ko) .lede, :lang(ja) .lede, :lang(zh) .lede { line-height: 1.7; font-size: 1.12rem; }
:lang(ja) h1, :lang(zh) h1, :lang(ko) h1 { font-size: clamp(1.9rem, 4.2vw, 2.85rem); line-height: 1.28; max-width: 22em; }
