/* DexStitch project page — minimal academic template */

:root {
  --bg:          #ffffff;
  --bg-soft:     #f6f7f9;
  --bg-raised:   #ffffff;
  --text:        #15171a;
  --text-muted:  #5b6169;
  --text-faint:  #8a9099;
  --border:      #e2e5ea;
  --accent:      #6b3fa0;
  --accent-soft: #f1ebf8;
  --btn-bg:      #22262b;
  --btn-text:    #ffffff;
  --shadow:      0 1px 2px rgba(16, 18, 22, .06), 0 8px 24px rgba(16, 18, 22, .06);
  --radius:      12px;
  --maxw:        1080px;
  --font-sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard",
                 "Apple SD Gothic Neo", "Noto Sans KR", Helvetica, Arial, sans-serif;
  --font-serif:  "Newsreader", Charter, Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0f1115;
    --bg-soft:     #15181d;
    --bg-raised:   #171a1f;
    --text:        #e8eaed;
    --text-muted:  #a3abb6;
    --text-faint:  #767d87;
    --border:      #272b32;
    --accent:      #b794e6;
    --accent-soft: #241d33;
    --btn-bg:      #e8eaed;
    --btn-text:    #0f1115;
    --shadow:      0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

:root[data-theme="dark"] {
  --bg:          #0f1115;
  --bg-soft:     #15181d;
  --bg-raised:   #171a1f;
  --text:        #e8eaed;
  --text-muted:  #a3abb6;
  --text-faint:  #767d87;
  --border:      #272b32;
  --accent:      #b794e6;
  --accent-soft: #241d33;
  --btn-bg:      #e8eaed;
  --btn-text:    #0f1115;
  --shadow:      0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

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

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

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-brand {
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
  flex: none;
}
.nav-brand:hover { text-decoration: none; }

.nav-links {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-left: auto;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  color: var(--text-muted);
  font-size: 14.5px;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

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

.hero {
  padding: 64px 0 36px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.18;
  letter-spacing: -.02em;
  margin: 0 auto 20px;
  max-width: 900px;
}

.hero h1 .name { color: var(--accent); }

.badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 22px;
}

.authors {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0 0 6px;
}

.affil {
  color: var(--text-faint);
  font-size: 14.5px;
  margin: 0 0 28px;
}

/* ---------- buttons ---------- */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn svg { width: 16px; height: 16px; fill: currentColor; flex: none; }

.btn.is-disabled {
  background: transparent;
  color: var(--text-faint);
  border-color: var(--border);
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- sections ---------- */

section { padding: 56px 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: 0; }

h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -.015em;
  margin: 0 0 24px;
  text-align: center;
}

h3 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.01em;
  margin: 36px 0 10px;
}

p { margin: 0 0 16px; }

.lead {
  max-width: 760px;
  margin: 0 auto;
  text-align: justify;
  color: var(--text-muted);
}
.lead strong { color: var(--text); font-weight: 600; }

.narrow { max-width: 820px; margin: 0 auto; }

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

figure {
  margin: 0 0 8px;
}

figure img, figure video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

figcaption {
  margin-top: 12px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: left;
}
figcaption b { color: var(--text); font-weight: 600; }

.fig-narrow { max-width: 560px; margin-left: auto; margin-right: auto; }

/* placeholder slot for media that is not in the repo yet */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  aspect-ratio: 16 / 9;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text-faint);
  font-size: 14.5px;
  text-align: center;
  padding: 24px;
}
.placeholder code {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- highlight cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h4 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 650;
}
.card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ---------- stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 0 auto 36px;
  max-width: 820px;
}

.stat {
  text-align: center;
  padding: 18px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.stat .num {
  display: block;
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--accent);
}
.stat .label {
  display: block;
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--text-muted);
}

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

.table-scroll { overflow-x: auto; margin-bottom: 10px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

caption {
  caption-side: top;
  text-align: left;
  font-size: 14.5px;
  color: var(--text-muted);
  padding-bottom: 10px;
}
caption b { color: var(--text); font-weight: 600; }

th, td {
  padding: 9px 12px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
th:first-child, td:first-child { text-align: left; }

thead th {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--text-faint);
}

thead tr:first-child th { border-bottom-color: var(--border); }

tbody tr.is-ours { background: var(--accent-soft); }
tbody tr.is-ours td { font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }

td.group, th.group {
  color: var(--text-faint);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-top: 16px;
}

/* ---------- lists ---------- */

ul.clean {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--text-muted);
}
ul.clean li { margin-bottom: 8px; }
ul.clean li strong { color: var(--text); font-weight: 600; }

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

footer {
  padding: 40px 0 56px;
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
  border-top: 1px solid var(--border);
}
footer p { margin: 0 0 8px; }

.notice {
  max-width: 680px;
  margin: 0 auto 20px;
  padding: 14px 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 44px 0 28px; }
  section { padding: 44px 0; }
  h2 { font-size: 25px; }
  .lead { text-align: left; }
  .nav-brand { display: none; }
  .nav-links { margin-left: 0; }
}

/* two-column ablation table reads better constrained */
.table-sm { max-width: 520px; margin-left: auto; margin-right: auto; }
