/* StablePrivacy project page */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --surface: #fcfcfb;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #898781;
  --line: #e6e5df;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --accent: #2a78d6;       /* StablePrivacy / ours */
  --accent-2: #6250d6;
  --orange: #eb6834;       /* w/o Injection Module */
  --other: #a8a6a0;        /* other methods */
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 860px; margin-left: auto; margin-right: auto; }
.narrow-left { max-width: 820px; }

/* ---------- nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--text-2); font-size: 14.5px; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ---------- hero ---------- */
.hero {
  position: relative; text-align: center; padding: 72px 0 36px; overflow: hidden;
  background:
    radial-gradient(600px 300px at 20% 0%, rgba(42, 120, 214, .10), transparent 70%),
    radial-gradient(600px 300px at 80% 10%, rgba(98, 80, 214, .10), transparent 70%);
}
.venue {
  display: inline-block; padding: 4px 14px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; letter-spacing: .04em;
  color: var(--accent); background: rgba(42, 120, 214, .09); border: 1px solid rgba(42, 120, 214, .22);
}
.title { font-size: clamp(44px, 7vw, 76px); font-weight: 800; letter-spacing: -.035em; margin: 18px 0 8px; }
.grad {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.subtitle { font-size: clamp(19px, 2.4vw, 25px); font-weight: 500; color: #2b2a28; margin: 0 auto 26px; max-width: 760px; line-height: 1.4; }
.hero .container { max-width: 1080px; }  /* wide enough for all six authors on one line */
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; font-size: 17.5px; font-weight: 500; }
.authors span, .authors a { color: var(--text); white-space: nowrap; }
.authors a { border-bottom: 1px solid rgba(42, 120, 214, .35); }
.authors a:hover { color: var(--accent); text-decoration: none; }
.authors sup, .affiliations sup { color: var(--muted); font-weight: 500; margin-left: 1px; }
.affiliations { margin-top: 8px; display: flex; justify-content: center; gap: 22px; color: var(--text-2); font-size: 15.5px; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  background: #16161a; color: #fff; font-weight: 600; font-size: 15px;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; background: #2c2c33; transform: translateY(-1px); }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: #f3f3f1; }

/* ---------- teaser ---------- */
.teaser { padding: 8px 0 40px; }
.player-card { background: #0e0e10; border-radius: 18px; padding: 10px; box-shadow: var(--shadow); }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; }
.thumb {
  flex: 1 0 120px; padding: 0; border: 2px solid transparent; border-radius: 9px; overflow: hidden;
  cursor: pointer; background: #222; opacity: .55; transition: opacity .2s ease, border-color .2s ease;
  aspect-ratio: 16 / 9;
}
.thumb { position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-ds {
  position: absolute; left: 5px; bottom: 5px; padding: 0 6px; border-radius: 5px;
  font-size: 10.5px; font-weight: 600; color: #fff; background: rgba(0, 0, 0, .6);
}
.thumb:hover { opacity: .85; }
.thumb.active { opacity: 1; border-color: #fff; }
.teaser-caption { text-align: center; color: var(--text-2); font-size: 15.5px; margin: 16px auto 0; max-width: 780px; }
.kbd { display: inline-block; padding: 0 8px; border-radius: 6px; background: var(--bg-alt); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--text); }

/* ---------- compare slider ---------- */
.compare {
  position: relative; width: 100%; overflow: hidden; border-radius: 10px;
  background: #1a1a1d; cursor: ew-resize; touch-action: pan-y; user-select: none;
}
.compare:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.compare video, .compare canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.compare video { object-fit: fill; }
.compare .handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px;
  background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .45); pointer-events: none;
}
.compare .handle::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; transform: translate(-50%, -50%);
  border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316161a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 7l-5 5 5 5M15 7l5 5-5 5'/%3E%3C/svg%3E");
  background-size: 18px; background-position: center; background-repeat: no-repeat;
}
.compare .tag {
  position: absolute; top: 10px; padding: 3px 10px; border-radius: 999px; pointer-events: none;
  font-size: 12.5px; font-weight: 600; color: #fff; background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px);
}
.compare .tag-left { left: 10px; }
.compare .tag-right { right: 10px; background: rgba(42, 120, 214, .9); }
.compare-lg {
  --ratio: 16 / 9;
  aspect-ratio: var(--ratio);
  width: min(100%, calc(560px * var(--ratio)));  /* clips differ in shape: cap the height, keep the shape */
  margin: 0 auto;
}
.compare-lg .tag { font-size: 14px; padding: 5px 14px; top: 14px; }
.compare-lg .tag-left { left: 14px; }
.compare-lg .tag-right { right: 14px; }
.compare-lg .handle::after { width: 40px; height: 40px; background-size: 22px; }
.gallery-4 .compare .tag { font-size: 11px; padding: 2px 7px; top: 6px; }
.gallery-4 .compare .tag-left { left: 6px; }
.gallery-4 .compare .tag-right { right: 6px; }
.gallery-4 .compare .handle::after { width: 22px; height: 22px; background-size: 14px; }

/* ---------- sections ---------- */
.section { padding: 80px 0; }
.section.alt { background: var(--bg-alt); }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-weight: 700; font-size: 13.5px; letter-spacing: .08em; text-transform: uppercase; }
.section-title { font-size: clamp(28px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 14px; }
.lead { color: var(--text-2); font-size: 18px; margin: 0 0 32px; }
.caption { color: var(--text-2); font-size: 15.5px; margin: 14px 0 0; }

/* highlights */
.highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 64px; }
.hl { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.hl-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px;
  background: rgba(42, 120, 214, .09); color: var(--accent);
}
.hl-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hl h3 { font-size: 18px; margin-bottom: 6px; }
.hl p { margin: 0; color: var(--text-2); font-size: 15.5px; line-height: 1.55; }
.hl-tasks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hl-tasks span {
  font-size: 12.5px; font-weight: 600; color: var(--accent); background: rgba(42, 120, 214, .09);
  border-radius: 999px; padding: 2px 10px;
}
.abstract p { text-align: justify; hyphens: auto; color: #23221f; }

/* method */
.figure { margin: 0 0 36px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.figure img { width: 100%; max-width: min(100%, 880px); margin: 0 auto; }
.figure figcaption { margin-top: 16px; color: var(--text-2); font-size: 15px; text-align: center; }
.components { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.comp { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.comp-tag {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .05em;
  color: #fff; background: var(--accent); border-radius: 6px; padding: 1px 8px; margin-bottom: 10px;
}
.comp h3 { font-size: 17px; margin-bottom: 6px; }
.comp p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.protocol {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; margin-top: 36px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
}
.protocol h3 { font-size: 20px; margin-bottom: 10px; }
.protocol p { color: var(--text-2); margin: 0 0 10px; font-size: 16px; }
.protocol img { width: 100%; max-width: min(100%, 460px); margin-left: auto; }

/* tabs and chips */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.tab, .chip {
  font: inherit; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 999px; padding: 8px 18px; font-size: 15px; font-weight: 600;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tab small { font-weight: 500; color: var(--muted); margin-left: 4px; font-size: 13px; }
.tab:hover, .chip:hover { border-color: #c9c8c2; }
.tab.active, .chip.active { background: #16161a; color: #fff; border-color: #16161a; }
.tab.active small { color: #b9b8b2; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { font-size: 14px; padding: 6px 14px; }
.chip .ds { color: var(--muted); font-weight: 500; margin-right: 6px; }
.chip.active .ds { color: #b9b8b2; }
.panel { display: none; }
.panel.active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* gallery */
.gallery { display: grid; gap: 18px; }
.gallery-2 { grid-template-columns: repeat(2, 1fr); }
/* 3 per row; flex so a short last row is centred */
.gallery-3 { display: flex; flex-wrap: wrap; justify-content: center; }
.gallery-3 > .item { width: calc((100% - 36px) / 3); }
.gallery-4 { grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 920px; margin: 0 auto; }
.item figcaption { margin-top: 8px; font-size: 14px; color: var(--text-2); }
.item figcaption b { color: var(--text); font-weight: 600; }
.item { margin: 0; }

/* baseline grid player */
.grid-player { position: relative; border-radius: 12px; overflow: hidden; background: #111; box-shadow: var(--shadow); }
.grid-player video { display: block; width: 100%; height: auto; }
.grid-labels { position: absolute; inset: 0; display: grid; pointer-events: none; }
.grid-labels .cell { position: relative; border: 1px solid rgba(255, 255, 255, .7); }
.grid-labels .cell span {
  position: absolute; top: 8px; left: 8px; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: #fff; background: rgba(0, 0, 0, .6);
}
.grid-labels .cell.ours { box-shadow: inset 0 0 0 3px var(--accent); }
.grid-labels .cell.ours span { background: var(--accent); }
.grid-labels .cell.gap { border-right: 5px solid #fff; }

/* ---------- results ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 8px 0 24px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.stat-label { font-size: 14.5px; color: var(--text-2); font-weight: 500; }
.stat-value { font-size: 36px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0; }
.stat-note { font-size: 14px; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.card-head h3 { font-size: 19px; margin-bottom: 4px; }
.card-head p { margin: 0 0 14px; color: var(--text-2); font-size: 15px; }
.card-note { margin: 14px 0 0; color: var(--text-2); font-size: 14.5px; }
.cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cards-2 .card { margin-bottom: 20px; }
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cards-3 .card { margin-bottom: 20px; }
.cards-3 .bar-row { grid-template-columns: 120px 1fr; font-size: 13.5px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--text-2); margin-bottom: 4px; }
.legend .key { display: inline-flex; align-items: center; gap: 7px; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chart { width: 100%; overflow-x: auto; }
.chart svg { width: 100%; min-width: 600px; height: auto; display: block; overflow: visible; }
.chart text { font-family: inherit; }
.pt { cursor: pointer; }
.pt:focus { outline: none; }
.pt:focus .mark, .pt:hover .mark { stroke: var(--text); }

.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 128px 1fr; align-items: center; gap: 10px; font-size: 14px; cursor: default; }
.bar-row .name { color: var(--text-2); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row.ours .name { color: var(--text); font-weight: 600; }
.bar-track { position: relative; height: 22px; display: flex; align-items: center; }
.bar { height: 18px; border-radius: 0 4px 4px 0; background: var(--other); min-width: 2px; transition: filter .15s ease; }
.bar-row.ours .bar { background: var(--accent); }
.bar-row.ref .bar { background: #6f6d68; }
.bar-row:hover .bar, .bar-row:focus .bar { filter: brightness(1.1); outline: 2px solid rgba(11, 11, 11, .15); outline-offset: 1px; }
.bar-row:focus { outline: none; }
.bar-value { margin-left: 8px; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; font-size: 13.5px; }
.multiples { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.multiples h4 { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.multiples .bar-row { grid-template-columns: 104px 1fr; font-size: 13.5px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: right; font-weight: 600; color: var(--text-2); font-size: 13.5px; border-bottom: 1px solid var(--axis); padding: 6px 10px; }
.tbl td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--grid); }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl tr.ours td { background: rgba(42, 120, 214, .08); font-weight: 600; }
.tbl tr.ours td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tbl tr.muted-row td { color: var(--muted); }
.tbl tr.group td { font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-top: 14px; }

.table-view { margin-top: 12px; font-size: 14.5px; }
.table-view summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.table-view .tbl { margin-top: 10px; max-width: 560px; }

.limits { margin-top: 12px; padding: 22px 24px; border-radius: var(--radius); background: #fff8eb; border: 1px solid #f3dfb5; }
.limits h3 { font-size: 17px; margin-bottom: 6px; }
.limits p { margin: 0; color: #4a4336; font-size: 15.5px; }

/* tooltip */
.tooltip {
  position: fixed; z-index: 50; pointer-events: none; opacity: 0; transition: opacity .12s ease;
  background: #16161a; color: #fff; border-radius: 8px; padding: 7px 10px; font-size: 13px; line-height: 1.4;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2); max-width: 260px;
}
.tooltip.show { opacity: 1; }
.tooltip .tt-value { font-weight: 700; font-size: 14px; }
.tooltip .tt-name { color: #c3c2b7; }

/* bibtex */
.bib { position: relative; }
.bib pre {
  margin: 0; padding: 22px 24px; border-radius: var(--radius); background: #16161a; color: #e9e8e3;
  font-size: 14px; line-height: 1.6; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.copy {
  position: absolute; top: 12px; right: 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); border-radius: 8px; padding: 4px 12px;
}
.copy:hover { background: rgba(255, 255, 255, .2); }

.footer { padding: 36px 0 48px; color: var(--muted); font-size: 14px; text-align: center; border-top: 1px solid var(--line); }
.footer p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .components { grid-template-columns: 1fr 1fr; }
  .cards-3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .nav-links { display: none; }
  .highlights, .stats, .cards-2, .protocol { grid-template-columns: 1fr; }
  .protocol img { margin: 0 auto; }
  .gallery-2 { grid-template-columns: 1fr; }
  .gallery-3 > .item { width: calc((100% - 18px) / 2); }
  .section { padding: 56px 0; }
  .grid-labels .cell span { font-size: 10.5px; padding: 1px 6px; top: 4px; left: 4px; }
}
@media (max-width: 520px) {
  .components, .multiples { grid-template-columns: 1fr; }
  .gallery-3 > .item { width: 100%; }
  .gallery-4 { grid-template-columns: repeat(2, 1fr); }
  body { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .panel.active { animation: none; }
}
