:root {
  --ink: #2d2d2d;
  --muted: #60646b;
  --blue: #126dcc;
  --line: #dedede;
  --soft: #f7f7f7;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: var(--sans);
  line-height: 1.68;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
button, input { font: inherit; }

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 760px;
  padding: 92px 32px 84px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.hero-inner { width: min(1320px, 100%); }

.hero h1 {
  max-width: 1220px;
  margin: 0 auto;
  font-size: clamp(54px, 5.4vw, 82px);
  font-weight: 500;
  line-height: 1.16;
}

.hero h1 span { color: var(--blue); }

.subtitle {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 25px;
}

.authors {
  margin: 56px 0 0;
  font-size: clamp(20px, 2.1vw, 31px);
  line-height: 1.5;
}

.date { margin: 12px 0 0; color: var(--muted); font-size: 16px; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 45px;
}

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 148px;
  min-height: 58px;
  padding: 0 23px;
  color: #fff;
  background: #343434;
  border-radius: 29px;
  font-size: 18px;
  font-weight: 500;
  text-decoration: none;
}

.action:hover,
.action:focus-visible { background: #111; }

.action svg,
.example-button svg,
.copy-button svg { width: 19px; height: 19px; stroke-width: 1.8; }

.paper-section { padding: 96px 24px; border-bottom: 1px solid var(--line); }
.narrow-shell { width: min(860px, 100%); margin: 0 auto; }
.wide-shell { width: min(1120px, 100%); margin: 0 auto; }

.paper-section h2 {
  margin: 0 0 32px;
  font-size: clamp(34px, 4vw, 50px);
  font-weight: 500;
  line-height: 1.2;
}

.paper-section p { margin: 0 0 22px; font-size: 18px; }
.abstract-copy { font-size: 18px; }
.abstract-copy p:first-child { font-size: 20px; }

.display-math {
  margin: 28px 0;
  overflow-x: auto;
  color: #0f5ca7;
  font-size: 19px;
}

.paper-meta {
  margin-top: 42px;
  padding-top: 24px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.paper-meta p { margin: 8px 0; font-size: 13px; }

.section-label {
  margin-bottom: 13px !important;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 12px !important;
  font-weight: 500;
  text-transform: uppercase;
}

.theorem-box {
  margin: 0 0 38px;
  padding: 30px 34px;
  background: var(--soft);
  border-left: 3px solid var(--blue);
}

.theorem-box p { margin: 0; }
.theorem-box .display-math { margin-bottom: 0; }
.theorem-name { margin: 42px 0 12px !important; color: var(--blue); font-family: var(--mono); font-size: 12px !important; text-transform: uppercase; }

.paper-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 500;
  text-underline-offset: 4px;
}

.paper-link svg { width: 15px; height: 15px; stroke-width: 1.8; }

.concept-section { background: #fff; }

.concept-section .wide-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(500px, 1.15fr);
  gap: 72px;
  align-items: center;
}

.fan-panel { border: 1px solid var(--line); }
#divisor-fan { display: block; width: 100%; height: 420px; background: #fff; }

.fan-controls { padding: 21px 25px 24px; border-top: 1px solid var(--line); }
.slider-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; }
.slider-row label { font-size: 15px; }
.slider-row input { width: 100%; accent-color: var(--blue); }
.slider-row output { min-width: 52px; color: var(--blue); font-family: var(--mono); font-size: 14px; text-align: right; }
.fan-controls dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 20px 0 0; border-top: 1px solid var(--line); }
.fan-controls dl div { padding: 14px 8px 0 0; }
.fan-controls dt { color: var(--muted); font-size: 12px; }
.fan-controls dd { margin: 3px 0 0; font-family: var(--mono); font-size: 13px; }
.fan-controls > p { margin: 18px 0 0; color: var(--blue); font-family: var(--mono); font-size: 13px; }

.certificate-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(540px, 1.2fr);
  gap: 72px;
  align-items: center;
}

.certificate-tool { padding: 28px; background: var(--soft); border: 1px solid var(--line); }
.input-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.input-row label { display: grid; gap: 7px; }
.input-row label span { color: var(--muted); font-family: var(--mono); font-size: 10px; text-transform: uppercase; }
.input-row input { width: 100%; height: 46px; padding: 0 12px; background: #fff; border: 1px solid #c9cdd2; border-radius: 4px; outline: none; }
.input-row input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18,109,204,0.1); }

.certificate-status { min-height: 26px; margin-top: 15px; color: var(--blue); font-size: 12px; }
.certificate-status.invalid { color: #b44235; }
.certificate-equation { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 112px; overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 25px; }
.fraction { display: inline-grid; grid-template-rows: auto auto; min-width: 44px; text-align: center; line-height: 1.2; }
.fraction b { padding: 0 8px 3px; border-bottom: 1px solid currentColor; font-weight: 400; }
.fraction i { padding: 3px 8px 0; font-style: normal; }
.certificate-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
.detail-item { display: grid; gap: 2px; }
.detail-item span { color: var(--muted); font-family: var(--mono); font-size: 9px; text-transform: uppercase; }
.detail-item strong { font-family: var(--mono); font-size: 11px; font-weight: 400; overflow-wrap: anywhere; }

.example-button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  border: 1px solid #bbb;
  border-radius: 6px;
}

.example-button { margin-top: 20px; color: var(--ink); background: #fff; }
.example-button:hover,
.example-button:focus-visible { border-color: var(--blue); color: var(--blue); }

.section-intro { width: min(860px, 100%); margin-bottom: 58px; }
.proof-outline { border-bottom: 1px solid var(--line); }
.proof-row {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(0, 1.3fr);
  gap: 64px;
  padding: 38px 0 42px;
  border-top: 1px solid var(--line);
}

.proof-row > div { min-width: 0; }
.proof-row > div:first-child span { color: var(--blue); font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.proof-row h3,
.result-list h3 { margin: 10px 0 0; font-size: 24px; font-weight: 500; line-height: 1.35; }
.proof-row p { font-size: 16px; }
.proof-row .display-math { margin: 20px 0; font-size: 16px; }

.result-list { margin: 48px 0 30px; border-bottom: 1px solid var(--line); }
.result-list article { padding: 31px 0 34px; border-top: 1px solid var(--line); }
.result-list h3 { margin: 0 0 16px; }
.result-list article p { font-size: 16px; }
.result-list .display-math { font-size: 17px; }

.formalization-section { background: var(--soft); border-bottom: 0; }
.lean-line { margin: 34px 0 20px; padding: 22px 24px; overflow-x: auto; color: #282828; background: #fff; border: 1px solid var(--line); font-family: var(--mono); font-size: 13px; line-height: 1.7; }
.lean-line span { color: #8a459c; }
.text-links { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.text-links a { color: var(--blue); font-family: var(--mono); font-size: 12px; text-underline-offset: 4px; }

.bibtex-wrap { position: relative; }
.bibtex-wrap pre { margin: 0; padding: 32px; overflow-x: auto; color: #efefef; background: #343434; border-radius: 6px; font-family: var(--mono); font-size: 12px; line-height: 1.75; }
.copy-button { position: absolute; top: 12px; right: 12px; min-height: 34px; padding: 0 11px; color: #fff; background: #454545; border-color: #666; font-size: 11px; }

@media (max-width: 900px) {
  .hero { min-height: 700px; }
  .concept-section .wide-shell,
  .certificate-layout,
  .proof-row { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 620px) {
  .hero { min-height: auto; padding: 100px 24px 82px; }
  .hero h1 { font-size: 44px; }
  .subtitle { font-size: 20px; }
  .authors { margin-top: 42px; font-size: 20px; }
  .hero-actions { display: grid; grid-template-columns: 1fr; width: min(280px, 100%); margin-right: auto; margin-left: auto; }
  .action { min-height: 54px; }
  .paper-section { padding: 72px 20px; }
  .paper-section p, .abstract-copy p:first-child { font-size: 17px; }
  .theorem-box { padding: 24px 20px; }
  #divisor-fan { height: 360px; }
  .fan-controls dl { grid-template-columns: 1fr; }
  .fan-controls dl div { display: flex; justify-content: space-between; }
  .input-row { grid-template-columns: 1fr; }
  .certificate-tool { padding: 22px 18px; }
  .certificate-equation { justify-content: flex-start; font-size: 22px; }
  .certificate-details { grid-template-columns: 1fr; }
  .section-intro { margin-bottom: 42px; }
  .proof-row { padding: 31px 0 35px; }
  .lean-line { padding: 18px; font-size: 11px; }
  .bibtex-wrap pre { padding: 58px 18px 22px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
