/* ==========================================================================
   A Geodesic Cut-Cell Prior for Neural Skinning — project page
   Accent palette mirrors the cut-cell graph figures:
   orange = interior, green = surface intersections, blue = input mesh.
   ========================================================================== */

:root {
  --ink:        #14171c;
  --ink-body:   #2c333c;
  --ink-soft:   #5a636f;
  --ink-faint:  #8b939d;

  --bg:         #ffffff;
  --bg-alt:     #f6f7f9;
  --bg-sunk:    #eef0f3;
  --line:       #e2e5ea;
  --line-soft:  #edeff2;

  --interior:   #d9682c;
  --surface:    #6f9f3f;
  --mesh:       #4a80ac;
  --accent:     var(--interior);
  --accent-tint:#fdf4ef;

  /* One content column: prose, figures, captions, tables and equations are all
     exactly this wide, so every left and right edge lines up. A fixed width
     rather than a `ch` measure keeps that true across platform font stacks. */
  --wrap:         1180px;
  --wrap-content:  760px;

  --radius:    14px;
  --radius-sm:  8px;
  --shadow:    0 1px 2px rgba(20, 23, 28, .04), 0 8px 24px rgba(20, 23, 28, .05);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-body);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: var(--ink); text-decoration-color: rgba(217, 104, 44, .45); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

.mono { font-family: var(--font-mono); font-size: .92em; }

/* ------------------------------- layout ---------------------------------- */

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap-content { max-width: calc(var(--wrap-content) + 48px); }

.section { padding: 76px 0; border-top: 1px solid var(--line-soft); }
.section-alt { background: var(--bg-alt); border-top-color: var(--line); }

.section-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  line-height: 1.2;
  letter-spacing: -.022em;
  color: var(--ink);
  margin: 0 0 26px;
  font-weight: 680;
}
.section-title::after {
  content: "";
  display: block;
  width: 46px; height: 3px;
  margin-top: 14px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--interior), var(--surface));
}

.sub-title {
  font-size: 1.22rem;
  font-weight: 650;
  letter-spacing: -.012em;
  color: var(--ink);
  margin: 54px 0 14px;
}
.section-title + .prose > p:first-child,
.section-title + .prose.lead > p:first-child { margin-top: 0; }
.sub-title:first-of-type { margin-top: 8px; }

.prose p { margin: 0 0 18px; }
.prose p:last-child { margin-bottom: 0; }
.prose.lead { font-size: 1.075rem; color: var(--ink-body); }
.prose em { font-style: italic; }
.prose strong { color: var(--ink); font-weight: 630; }

/* Math symbols carried over from the paper's notation. */
.sym { font-family: Georgia, "Times New Roman", serif; font-style: italic; }
.sym sub, .sym sup { font-style: normal; font-family: var(--font); font-size: .7em; }

.steps { margin: 0 0 18px; padding-left: 22px; }
.steps li { margin-bottom: 12px; padding-left: 4px; }
.steps li::marker { color: var(--accent); font-weight: 650; }

/* ------------------------------- topbar ---------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 24px;
  height: 56px; display: flex; align-items: center; gap: 28px;
}
.topbar-brand {
  font-weight: 650; font-size: .95rem; letter-spacing: -.012em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.topbar-brand::before {
  content: ""; display: inline-block; vertical-align: -1px;
  width: 9px; height: 9px; margin-right: 9px; border-radius: 2px;
  background: var(--interior);
}
.topbar-nav {
  display: flex; gap: 4px; margin-left: auto;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.topbar-nav::-webkit-scrollbar { display: none; }
.topbar-nav a {
  font-size: .875rem; color: var(--ink-soft); text-decoration: none;
  padding: 6px 11px; border-radius: 7px; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.topbar-nav a:hover { background: var(--bg-sunk); color: var(--ink); }
.topbar-nav a.is-current { color: var(--ink); background: var(--bg-sunk); font-weight: 560; }

@media (max-width: 720px) {
  .topbar-brand { display: none; }
  .topbar-nav { margin-left: 0; }
}

/* --------------------------------- hero ---------------------------------- */

.hero { padding: 68px 0 26px; text-align: center; }

.venue {
  display: inline-block;
  margin: 0 0 20px;
  padding: 5px 13px;
  font-size: .78rem; font-weight: 620; letter-spacing: .07em; text-transform: uppercase;
  color: var(--interior); background: var(--accent-tint);
  border: 1px solid rgba(217, 104, 44, .22); border-radius: 100px;
}

.title {
  font-size: clamp(2.1rem, 5.4vw, 3.5rem);
  line-height: 1.07;
  letter-spacing: -.036em;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 30px;
  text-wrap: balance;
}

.authors, .affiliations {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  column-gap: 20px; row-gap: 4px;
}
.authors { font-size: 1.06rem; color: var(--ink); margin-bottom: 12px; }
.authors .author { font-weight: 540; }
.authors sup, .affiliations sup { color: var(--accent); font-size: .68em; padding-left: 1px; }
.authors a { text-decoration: none; border-bottom: 1px solid rgba(217, 104, 44, .35); }
.authors a:hover { border-bottom-color: var(--accent); }

.affiliations { font-size: .95rem; color: var(--ink-soft); column-gap: 22px; }

.footnote { font-size: .84rem; color: var(--ink-faint); margin: 12px 0 0; }

.actions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin: 34px 0 0;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 19px;
  background: var(--ink); color: #fff;
  border-radius: 100px;
  font-size: .93rem; font-weight: 540; text-decoration: none;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { background: #262c35; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(20, 23, 28, .16); }
.btn:active { transform: translateY(0); }
.btn-icon { display: flex; opacity: .85; }
.btn-icon svg { width: 15px; height: 15px; display: block; }
.btn-tag {
  font-size: .68rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 100px;
  background: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .85);
}
.btn.is-disabled {
  background: var(--bg-sunk); color: var(--ink-faint);
  cursor: not-allowed; pointer-events: none;
}
.btn.is-disabled .btn-tag { background: rgba(20, 23, 28, .07); color: var(--ink-faint); }

/* -------------------------------- figures -------------------------------- */

/* Figures are flush with the text column: image and caption share the same left
   edge as the surrounding prose, so nothing appears indented. */
.figure { margin: 30px 0; }
.figure img {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: zoom-in;
}
.figure figcaption {
  margin: 13px 0 0;
  font-size: .875rem;
  line-height: 1.62;
  color: var(--ink-soft);
}
.figure figcaption strong { color: var(--ink); font-weight: 620; }
.figure figcaption .sym { color: var(--ink-body); }

.figure-teaser { margin: 44px 0 0; }
.figure-teaser figcaption { text-align: left; }

.figure-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; margin: 30px 0; }
.figure-row .figure { margin: 0; }
@media (max-width: 800px) { .figure-row { grid-template-columns: 1fr; gap: 0; } }

/* --------------------------------- video --------------------------------- */

.video-frame {
  margin-top: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0d0f12;
  box-shadow: var(--shadow);
  line-height: 0;
}
.video-frame video { width: 100%; height: auto; }

/* ------------------------------- equations ------------------------------- */

/* Inline flow (not flex) so that <sub> and <sup> keep their vertical alignment. */
.equation {
  margin: 28px 0;
  padding: 30px 22px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  overflow-x: auto;
}
.section-alt .equation { background: var(--bg); }
.eq-var { font-style: italic; font-family: Georgia, "Times New Roman", serif; }
.eq-sub, .eq-sup { font-style: normal; font-family: var(--font); font-size: .68em; }
.eq-rel { margin: 0 .45em; }
.eq-group { display: inline-flex; align-items: center; vertical-align: middle; }
.eq-paren { font-size: 2.8em; font-weight: 200; line-height: .74; color: var(--ink-soft); }
.eq-pow { font-size: .62em; }
.eq-norm { font-size: 1.45em; font-weight: 300; color: var(--ink-soft); margin: 0 .1em; vertical-align: -.14em; }

.frac {
  display: inline-flex; flex-direction: column; align-items: center;
  vertical-align: middle; margin: 0 .3em; line-height: 1.25;
}
.frac-num { padding: 0 .5em .2em; }
.frac-den { padding: .2em .5em 0; border-top: 1.5px solid var(--ink); }
.frac-inline { font-size: .95em; margin: 0 .18em; }

.bigop {
  display: inline-flex; flex-direction: column; align-items: center;
  vertical-align: middle; margin: 0 .34em; line-height: 1;
}
.bigop-sym { font-size: 1.7em; font-weight: 300; }
.bigop-word { font-size: 1em; font-style: normal; }
.bigop-top, .bigop-bot { font-size: .58em; color: var(--ink-soft); }
.bigop-top { margin-bottom: .18em; }
.bigop-bot { margin-top: .18em; }

/* --------------------------------- tables -------------------------------- */

.table-figure { margin: 30px 0; }
.table-caption { font-size: .875rem; color: var(--ink-soft); margin-bottom: 12px; }

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.data-table th, .data-table td { padding: 12px 16px; text-align: right; }
.data-table thead th {
  font-size: .8rem; font-weight: 620; color: var(--ink-soft);
  letter-spacing: .01em;
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
  vertical-align: bottom;
}
.data-table thead th.group-head {
  text-align: center; color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: inset 3px 0 0 -1px var(--line-soft);
}
.data-table thead th.group-head-alt { background: var(--bg-sunk); }
.data-table tbody th[scope="row"],
.data-table thead th:first-child {
  text-align: left; font-weight: 560; color: var(--ink); white-space: nowrap;
}
.data-table tbody tr + tr th, .data-table tbody tr + tr td { border-top: 1px solid var(--line-soft); }
.data-table .arrow { color: var(--ink-faint); font-size: .9em; }

.row-ours { background: var(--accent-tint); }
.row-ours th[scope="row"] { box-shadow: inset 3px 0 0 var(--accent); }
.row-ours strong { font-weight: 650; color: var(--ink); }

.row-delta { color: var(--surface); font-size: .86rem; }
.row-delta th[scope="row"] { color: var(--ink-soft) !important; font-weight: 520; }
.row-delta .is-neg { color: #b4472f; }

.gain {
  display: inline-block; margin-left: 6px;
  font-size: .78em; color: var(--ink-faint);
}

/* ---------------------------------- tabs --------------------------------- */

.tabs { margin-top: 36px; }
.tablist {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--bg-sunk); border-radius: 100px;
}
.tab {
  appearance: none; border: 0; cursor: pointer;
  padding: 8px 20px; border-radius: 100px;
  font: inherit; font-size: .92rem; font-weight: 540;
  color: var(--ink-soft); background: transparent;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] {
  background: var(--bg); color: var(--ink);
  box-shadow: 0 1px 3px rgba(20, 23, 28, .12);
}
.tabpanel { padding-top: 4px; }
.tabpanel[hidden] { display: none; }
.tabpanel:focus { outline: none; }
.panel-intro {
  margin: 24px 0 22px;
  font-size: .97rem; color: var(--ink-soft);
}

/* -------------------------------- code ----------------------------------- */

.code-block { position: relative; margin-top: 24px; }
.code-block pre {
  margin: 0; padding: 24px 26px;
  background: #14171c; color: #e6e9ee;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: .855rem;
  line-height: 1.65;
  tab-size: 2;
}
.copy-btn {
  position: absolute; top: 12px; right: 12px;
  appearance: none; cursor: pointer;
  padding: 6px 13px; border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .09); color: #e6e9ee;
  font: inherit; font-size: .78rem; font-weight: 540;
  transition: background-color .15s ease;
}
.copy-btn:hover { background: rgba(255, 255, 255, .17); }
.copy-btn.is-copied { background: var(--surface); border-color: var(--surface); color: #fff; }

/* -------------------------------- footer --------------------------------- */

.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 42px 0;
  text-align: center;
  font-size: .9rem;
  color: var(--ink-soft);
}
.footer p { margin: 0; }

/* ------------------------------- lightbox -------------------------------- */

.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 3vh 3vw;
  background: rgba(12, 14, 17, .93);
  cursor: zoom-out;
  animation: lb-in .16s ease-out;
}
.lightbox[hidden] { display: none; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox-img {
  max-width: 100%; max-height: 94vh;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}
.lightbox-close {
  position: absolute; top: 18px; right: 22px;
  appearance: none; border: 0; cursor: pointer;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff;
  font-size: 1.6rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .22); }

/* ------------------------------- responsive ------------------------------ */

@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 56px 0; }
  .hero { padding-top: 44px; }
  .wrap { padding: 0 18px; }
  .authors { column-gap: 14px; font-size: .98rem; }
  .figure { padding: 10px; }
  .equation { font-size: .95rem; padding: 20px 14px; justify-content: flex-start; }
  .tablist { display: flex; width: 100%; }
  .tab { flex: 1; padding: 8px 10px; font-size: .87rem; }
}

@media print {
  .topbar, .actions, .lightbox, .copy-btn { display: none !important; }
  .section { padding: 24px 0; break-inside: avoid; }
  .tabpanel[hidden] { display: block !important; }
  body { font-size: 11pt; }
}
