/* Scribe3D project page: centered academic layout, serif headings, one card per section.
   Colors: navy ink, the drawing-order gradient of the strokes (purple to yellow) as the one accent, edited-part red. */
:root {
  --navy: #1f3a68;
  --ink: #1f2937;
  --body: #3b4453;
  --muted: #5d6676;
  --line: #dce2ea;
  --page: #f5f7fa;
  --panel: #f3f5f9;
  --link: #1f5fbf;
  --edit: #d94f4f;
  --add-bg: #e6f2e8;
  --del-bg: #fbe9e9;
  --order: linear-gradient(90deg, #440154, #3b528b, #21918c, #5ec962, #fde725);
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --mono: "Source Code Pro", ui-monospace, Menlo, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--body); font: 400 16.5px/1.6 var(--sans); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 3px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* masthead */
.masthead { max-width: 980px; margin: 0 auto; padding: 52px 20px 26px; text-align: center; }
.title { margin: 0; font-family: var(--serif); color: var(--navy); }
.title-name { display: inline-flex; align-items: center; gap: 16px; font-size: clamp(44px, 7vw, 68px); line-height: 1.05; font-weight: 700; letter-spacing: -0.01em; }
.logo { width: 0.82em; height: 0.82em; flex: none; }
.title-rest { display: block; margin: 14px auto 0; max-width: 46ch; text-wrap: balance; font-size: clamp(20px, 2.6vw, 27px); line-height: 1.3; font-weight: 600; }
.authors { margin: 18px 0 0; font-size: 16px; line-height: 1.5; color: var(--ink); font-weight: 600; }
.authors a { color: var(--ink); }
.affil { font-weight: 400; color: var(--muted); font-size: 15px; }
.links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; margin-top: 16px; }
.link { font-weight: 600; font-size: 15px; color: var(--link); }
.link.is-pending { color: var(--muted); font-weight: 600; cursor: default; }

/* cards */
main { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 34px 44px 32px; margin: 0 0 16px; }
.card > h2 { margin: 0 0 22px; text-align: center; font: 700 30px/1.2 var(--serif); color: var(--navy); }
.card > h2::after { content: ""; display: block; width: 46px; height: 3px; margin: 10px auto 0; border-radius: 2px; background: var(--order); }
.claim { margin: 20px auto 0; max-width: 62ch; text-align: center; font: 700 19px/1.4 var(--serif); color: var(--navy); }
.sub { margin: 8px auto 0; max-width: 70ch; text-align: center; color: var(--body); }
.intro { margin: -6px auto 18px; max-width: 70ch; text-align: center; color: var(--muted); }
.summary { margin: 0 auto; max-width: 70ch; font-size: 18px; line-height: 1.6; color: var(--ink); text-align: center; }
.full-abstract { max-width: 860px; margin: 18px auto 0; text-align: center; }
.full-abstract summary { display: inline-block; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--link); padding: 4px 8px; border-radius: 4px; }
.full-abstract summary:hover { background: var(--panel); }
.full-abstract[open] summary { margin-bottom: 10px; }
.abstract { margin: 0 auto; max-width: 860px; text-align: justify; hyphens: auto; font-size: 15.5px; }
.abstract strong { color: var(--ink); }

.fig { margin: 0 auto; }
.fig img { width: 100%; }
.fig-mid { max-width: 860px; }
.fig-narrow { max-width: 560px; }

/* hero */
.hero { padding: 16px 16px 26px; }
.hero-stage { height: min(64vh, 600px); min-height: 360px; }
.hero-bar {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: min(88%, 860px); display: flex; align-items: center; gap: 12px;
  padding: 9px 16px; border-radius: 999px;
  background: rgba(31, 41, 55, 0.88); color: #f3f4f6;
  font: 400 13px/1.4 var(--mono); pointer-events: none; overflow: hidden;
}
.hero-label { flex: none; font: 600 12.5px/1 var(--sans); color: #fff; padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); }
/* the stroke text grows at its right end, so it is clipped on the left; program lines are clipped on the right */
.hero-text { flex: 1; min-width: 0; display: flex; justify-content: flex-end; overflow: hidden; }
.hero-text > span { flex: none; white-space: pre; }
.hero-text.from-start { justify-content: flex-start; }
.hero-text.from-start > span { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hero-play {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.92);
  font: 600 13px/1.3 var(--sans); color: var(--ink); cursor: pointer;
}
.hero-play:hover { background: #fff; border-color: var(--muted); }
.hero-cat { position: absolute; top: 14px; left: 16px; right: 96px; font: 600 14px/1.3 var(--sans); color: var(--muted); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 3D stages and the demo */
.demo { max-width: 960px; margin: 0 auto; }
.demo .toolbar { justify-content: center; }
.demo .parts-list { justify-content: center; margin-top: 12px; }
.demo .stage-note { text-align: center; }
.stage {
  position: relative; height: min(66vh, 560px); min-height: 340px;
  border-radius: 4px; overflow: hidden; touch-action: none;
  background: radial-gradient(120% 90% at 50% 35%, #fdfdfe 0%, var(--panel) 72%);
  border: 1px solid #e6eaf0;
}
.stage canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.stage canvas:active { cursor: grabbing; }
.stage-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); font-size: 15px; pointer-events: none; }
.stage-msg:empty { display: none; }
.tip { position: absolute; pointer-events: none; z-index: 2; padding: 3px 8px; border-radius: 4px; background: var(--ink); color: #fff; font: 500 12.5px/1.4 var(--mono); transform: translate(12px, -28px); white-space: nowrap; }
.order-key { position: absolute; left: 14px; bottom: 12px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); pointer-events: none; }
.order-key i { width: 84px; height: 6px; border-radius: 3px; background: var(--order); }
.stage-note { margin: 10px 0 0; font-size: 14.5px; color: var(--muted); }
.stage-note strong { color: var(--ink); font-weight: 600; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.seg button { min-height: 32px; padding: 5px 12px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font: 600 14px/1.2 var(--sans); cursor: pointer; }
.seg button:hover { background: var(--panel); }
.seg button[aria-checked="true"] { background: var(--navy); color: #fff; }

.code { margin: 0; padding: 10px 12px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); font: 400 12px/1.55 var(--mono); color: #2a3142; tab-size: 4; }
.parts-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.parts-list li { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border: 1px solid var(--line); border-radius: 999px; font: 500 12px/1.5 var(--mono); background: #fff; cursor: default; }
.parts-list li i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.parts-list li.is-hot { border-color: var(--ink); }

/* results numbers */
.numbers { display: flex; justify-content: center; gap: 56px; margin: 0 0 22px; }
.num-block { display: flex; flex-direction: column; align-items: center; }
.num-block .big { font: 700 46px/1 var(--serif); color: var(--navy); font-variant-numeric: tabular-nums; }
.num-block .lbl { margin-top: 6px; font-size: 14.5px; color: var(--ink); font-weight: 600; }
.num-block.muted .big { color: #8a93a3; }
.num-block.muted .lbl { color: var(--muted); font-weight: 400; }

/* bibtex */
.bib { position: relative; max-width: 860px; margin: 0 auto; }
.code-bib { max-height: none; white-space: pre; font-size: 13px; padding: 16px 18px; background: #fff; }
.copy { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; }
.copy svg { width: 16px; height: 16px; fill: none; stroke: var(--link); stroke-width: 1.8; }
.copy.done svg { stroke: #2e7d4f; }

.foot { max-width: 1140px; margin: 0 auto; padding: 10px 20px 40px; text-align: center; font-size: 14px; color: var(--muted); }
.foot p { margin: 0; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  main { padding: 0 10px; }
  .card { padding: 24px 16px 22px; }
  .hero { padding: 10px 10px 20px; }
  .card > h2 { font-size: 25px; }
  .claim { font-size: 17.5px; }
  .sub, .claim, .summary { text-align: left; }
  .abstract { text-align: left; }
  .hero-stage { height: 58vh; min-height: 300px; max-height: 460px; }
  .hero-bar { width: calc(100% - 20px); bottom: 10px; font-size: 12px; padding: 7px 12px; }
  .stage { height: 56vh; min-height: 300px; max-height: 440px; }
  .numbers { gap: 30px; }
  .num-block .big { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
