:root {
  --paper: #f4f0e7;
  --paper-2: #fbf8f1;
  --paper-3: #e9eee9;
  --ink: #162421;
  --ink-2: #354640;
  --muted: #6a7772;
  --teal: #0b8779;
  --teal-soft: #d8ebe5;
  --coral: #e45a39;
  --coral-soft: #f7ddd4;
  --amber: #f0bd45;
  --blue: #3189b6;
  --line: #d6d2c8;
  --line-dark: #aeb9b4;
  --shadow: 0 26px 75px rgba(18, 36, 32, 0.12);
  --serif: "Newsreader", Georgia, serif;
  --sans: "Manrope", sans-serif;
  --mono: "DM Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(22, 36, 33, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 80px 100%;
  font-family: var(--sans);
  text-rendering: optimizeLegibility;
}

body.viewer-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg,
video {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 50;
  width: min(1440px, calc(100% - 32px));
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 12px 10px 20px;
  border: 1px solid rgba(214, 210, 200, 0.88);
  border-radius: 18px;
  background: rgba(251, 248, 241, 0.86);
  box-shadow: 0 10px 35px rgba(22, 36, 33, 0.07);
  backdrop-filter: blur(20px);
  transform: translateX(-50%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.brand-glyph {
  width: 28px;
  height: 30px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.brand-glyph span {
  width: 7px;
  border-radius: 2px 2px 0 0;
  background: var(--teal);
}

.brand-glyph span:nth-child(1) {
  height: 15px;
}

.brand-glyph span:nth-child(2) {
  height: 27px;
}

.brand-glyph span:nth-child(3) {
  height: 21px;
  background: var(--coral);
}

nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 600;
}

nav a:hover {
  color: var(--teal);
}

.nav-proof {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--teal);
  background: var(--teal-soft);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.nav-proof i,
.verdict i,
.source-toolbar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.home-hero {
  width: min(1510px, 100%);
  min-height: 860px;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: center;
  gap: 6vw;
  margin: 0 auto;
  padding: 150px max(28px, 5vw) 80px;
}

.kicker {
  margin: 0 0 20px;
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 500;
}

.home-hero h1 {
  max-width: 790px;
  margin-bottom: 28px;
  font-size: clamp(4.1rem, 7.2vw, 8rem);
  letter-spacing: -0.068em;
  line-height: 0.88;
}

.home-hero h1 em {
  color: var(--coral);
  font-weight: 500;
}

.hero-lede {
  max-width: 690px;
  margin-bottom: 34px;
  color: var(--ink-2);
  font-size: clamp(1rem, 1.5vw, 1.24rem);
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
}

.button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 21px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-ink {
  color: white;
  background: var(--ink);
  box-shadow: 0 14px 30px rgba(22, 36, 33, 0.18);
}

.button-ink:hover {
  background: var(--teal);
}

.button-paper {
  border-color: var(--line);
  background: rgba(251, 248, 241, 0.76);
}

.button-line {
  color: var(--teal);
  border-color: rgba(11, 135, 121, 0.28);
  background: transparent;
}

.button-coral {
  color: white;
  background: var(--coral);
  box-shadow: 0 14px 30px rgba(228, 90, 57, 0.18);
}

.button-coral:hover {
  background: var(--ink);
}

.proof-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.72rem;
}

.proof-strip strong {
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 500;
}

.hero-stage {
  position: relative;
  min-height: 580px;
  isolation: isolate;
}

.hero-stage-grid {
  position: absolute;
  inset: 4% 0 0 5%;
  z-index: -2;
  border-radius: 50%;
  background:
    linear-gradient(rgba(11, 135, 121, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 135, 121, 0.12) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle, black 25%, transparent 72%);
}

.hero-orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(11, 135, 121, 0.28);
  border-radius: 50%;
}

.orbit-one {
  width: 480px;
  height: 480px;
  top: 50px;
  left: 12%;
}

.orbit-two {
  width: 320px;
  height: 320px;
  top: 135px;
  left: 26%;
  border-color: rgba(228, 90, 57, 0.3);
}

.floating-card {
  position: absolute;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(214, 210, 200, 0.94);
  border-radius: 20px;
  background: rgba(251, 248, 241, 0.96);
  box-shadow: var(--shadow);
}

.floating-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.59rem;
  letter-spacing: 0.11em;
}

.card-problem {
  width: 330px;
  min-height: 310px;
  top: 45px;
  left: 3%;
  padding: 22px;
  transform: rotate(-4deg);
  animation: float-a 6s ease-in-out infinite;
}

.card-problem strong {
  margin-top: auto;
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1.05;
}

.mini-axis {
  position: relative;
  height: 170px;
  margin: 20px 0;
  background:
    linear-gradient(90deg, transparent 49.5%, var(--line-dark) 49.5% 50.5%, transparent 50.5%),
    linear-gradient(transparent 49.5%, var(--line-dark) 49.5% 50.5%, transparent 50.5%);
}

.mini-curve {
  position: absolute;
  left: 40px;
  width: 220px;
  height: 3px;
  top: 80px;
  display: block;
  background: var(--coral);
  transform: rotate(54deg);
}

.curve-b {
  background: var(--blue);
  transform: rotate(-54deg);
}

.card-proof {
  width: 370px;
  min-height: 215px;
  right: 0;
  top: 190px;
  padding: 24px;
  transform: rotate(3deg);
  animation: float-b 6.8s ease-in-out infinite;
}

.mini-equation {
  margin-top: 28px;
  font-family: var(--serif);
  font-size: 1.65rem;
}

.mini-equation.accent {
  margin-top: 7px;
  color: var(--teal);
}

.card-answer {
  width: 245px;
  min-height: 155px;
  right: 18%;
  bottom: 10px;
  padding: 22px;
  color: white;
  border-color: var(--ink);
  background: var(--ink);
  transform: rotate(-2deg);
  animation: float-a 7.3s ease-in-out infinite reverse;
}

.card-answer .floating-label {
  color: #9eb0aa;
}

.card-answer strong {
  margin-top: 22px;
  color: #f4b19e;
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 500;
}

.card-answer > span:last-child {
  color: #9eb0aa;
  font-size: 0.66rem;
}

.upload-section {
  position: relative;
  padding: 120px max(28px, 5vw);
  color: #f8f5ec;
  background:
    radial-gradient(circle at 12% 8%, rgba(11, 135, 121, 0.26), transparent 27%),
    radial-gradient(circle at 91% 75%, rgba(228, 90, 57, 0.2), transparent 29%),
    var(--ink);
}

.upload-section::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.11) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(to right, black, transparent 85%);
}

.upload-intro,
.upload-workbench,
.generated-result {
  position: relative;
  z-index: 1;
}

.upload-intro {
  max-width: 1420px;
  display: grid;
  grid-template-columns: 1.05fr 0.7fr;
  column-gap: 8vw;
  margin: 0 auto 46px;
}

.upload-intro .kicker {
  grid-column: 1 / -1;
  color: #72d8c8;
}

.upload-intro h2 {
  max-width: 760px;
  margin-bottom: 0;
  font-family: var(--serif);
  font-size: clamp(3.3rem, 6vw, 7rem);
  font-weight: 500;
  letter-spacing: -0.062em;
  line-height: 0.9;
}

.upload-intro > p {
  align-self: end;
  margin-bottom: 0;
  color: #b8c5c0;
  line-height: 1.75;
}

.upload-notes {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 38px;
}

.upload-notes span {
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: #b8c5c0;
  font-family: var(--mono);
  font-size: 0.61rem;
}

.upload-workbench,
.generated-result {
  max-width: 1420px;
  margin-inline: auto;
}

.upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  background: rgba(248, 245, 236, 0.07);
  backdrop-filter: blur(14px);
}

.upload-drop {
  min-height: 190px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 18px;
  padding: 28px;
  border: 1px dashed rgba(114, 216, 200, 0.5);
  border-radius: 17px;
  cursor: pointer;
  background: rgba(11, 135, 121, 0.08);
  transition: border-color 180ms ease, background 180ms ease;
}

.upload-drop:hover {
  border-color: #72d8c8;
  background: rgba(11, 135, 121, 0.14);
}

.upload-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.upload-symbol {
  grid-row: 1 / 3;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: #72d8c8;
  font-family: var(--mono);
  font-size: 1.5rem;
}

.upload-drop strong {
  align-self: end;
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 500;
}

.upload-drop small {
  align-self: start;
  margin-top: 7px;
  color: #94a69f;
  font-size: 0.69rem;
}

.upload-form > .button {
  min-height: 100%;
}

.upload-status {
  grid-column: 1 / -1;
  margin: 0;
  color: #94a69f;
  font-size: 0.72rem;
}

.upload-status.success {
  color: #72d8c8;
}

.upload-status.error {
  color: #ffad98;
}

.upload-preview {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border-radius: 17px;
  background: #eef0ea;
}

.upload-preview img {
  width: 100%;
  height: 190px;
  display: block;
  object-fit: contain;
}

.upload-preview button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 8px 11px;
  border: 0;
  border-radius: 9px;
  color: white;
  cursor: pointer;
  background: rgba(22, 36, 33, 0.9);
  font-size: 0.64rem;
}

.generated-result {
  margin-top: 26px;
  padding: clamp(22px, 4vw, 52px);
  color: var(--ink);
  border-radius: 26px;
  background: var(--paper-2);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.2);
}

.generated-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.generated-heading h3 {
  margin-bottom: 0;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.05em;
}

.generated-verdict {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--teal);
  background: var(--teal-soft);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.generated-verdict i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.generated-question {
  max-width: 900px;
  margin: 30px 0;
  color: var(--ink-2);
  font-size: 1.05rem;
  line-height: 1.7;
}

.generated-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
}

.generated-scene {
  min-height: 460px;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper-3);
}

.generated-scene svg {
  width: 100%;
  max-height: 620px;
}

.generated-answer {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px;
  border-radius: 20px;
  color: white;
  background: var(--teal);
}

.generated-answer span {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.generated-answer strong {
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 500;
  line-height: 0.9;
}

.generated-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.generated-step {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.generated-step span {
  color: var(--coral);
  font-family: var(--mono);
  font-size: 0.61rem;
}

.generated-step h4 {
  margin: 12px 0 9px;
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 500;
}

.generated-step p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.generated-step ul {
  margin: 0;
  padding: 13px 13px 13px 30px;
  border-radius: 11px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.7;
}

.library-section {
  padding: 120px max(28px, 5vw);
  background: var(--paper-2);
}

.section-intro {
  max-width: 1420px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  align-items: end;
  gap: 8vw;
  margin: 0 auto 48px;
}

.section-intro h2,
.method-heading h2,
.reconstruction-intro h2 {
  max-width: 880px;
  margin-bottom: 0;
  font-size: clamp(3rem, 5.3vw, 6.1rem);
  letter-spacing: -0.06em;
  line-height: 0.94;
}

.section-intro > p,
.method-rail p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.72;
}

.filter-row {
  max-width: 1420px;
  display: flex;
  gap: 8px;
  margin: 0 auto 28px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-row button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.7rem;
}

.filter-row button.active {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
}

.lesson-grid {
  max-width: 1420px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0 auto;
}

.library-card {
  min-width: 0;
  animation-delay: var(--delay);
}

.library-card > button {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: inherit;
  background: var(--paper-2);
  cursor: pointer;
  text-align: left;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.library-card > button:hover {
  border-color: var(--line-dark);
  box-shadow: 0 22px 45px rgba(22, 36, 33, 0.1);
  transform: translateY(-5px);
}

.card-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(11, 135, 121, 0.09), transparent 55%),
    #ebece5;
}

.card-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(22, 36, 33, 0.08));
  transition: transform 300ms ease;
}

.library-card button:hover img {
  transform: scale(1.035);
}

.card-number,
.featured-tag {
  position: absolute;
  top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.62rem;
}

.card-number {
  left: 14px;
  min-width: 38px;
  color: white;
  background: var(--ink);
}

.featured-tag {
  right: 14px;
  padding: 0 11px;
  color: #8d321d;
  background: var(--coral-soft);
}

.card-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  text-transform: uppercase;
}

.card-copy h3 {
  margin-bottom: 11px;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.card-copy > p {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.58;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.verdict {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--teal);
  font-size: 0.64rem;
  font-weight: 700;
}

.verdict-source-ambiguous {
  color: #a86e03;
}

.verdict-choice-resolved {
  color: var(--blue);
}

.open-arrow {
  color: var(--coral);
  font-family: var(--mono);
}

.method-section {
  padding: 130px max(28px, 5vw);
  color: #f8f5ee;
  background:
    radial-gradient(circle at 83% 4%, rgba(11, 135, 121, 0.65), transparent 30rem),
    var(--ink);
}

.method-heading,
.method-rail {
  max-width: 1420px;
  margin-inline: auto;
}

.method-heading .kicker {
  color: #74d6c7;
}

.method-heading h2 {
  max-width: 980px;
}

.method-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 70px;
  background: rgba(255, 255, 255, 0.18);
}

.method-rail article {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  padding: 25px;
  background: var(--ink);
}

.method-rail article > span {
  color: #71cfc1;
  font-family: var(--mono);
  font-size: 0.65rem;
}

.method-rail h3 {
  margin: auto 0 14px;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 500;
}

.method-rail p {
  font-size: 0.75rem;
}

.lesson-view {
  background: var(--paper);
}

.lesson-hero {
  min-height: 820px;
  padding: 130px max(28px, 6vw) 90px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 70px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
}

.back-link:hover {
  color: var(--teal);
}

.lesson-hero-grid {
  max-width: 1420px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(380px, 0.88fr);
  align-items: center;
  gap: 7vw;
  margin: 0 auto;
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
}

.lesson-meta > span:not(.verdict) {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
}

.lesson-meta .verdict {
  margin-left: 7px;
}

.lesson-hero h1 {
  max-width: 850px;
  margin-bottom: 24px;
  font-size: clamp(4rem, 7vw, 7.4rem);
  letter-spacing: -0.065em;
  line-height: 0.9;
}

.lesson-hero-copy > p {
  max-width: 710px;
  color: var(--ink-2);
  font-size: 1.08rem;
  line-height: 1.7;
}

.lesson-start-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 30px;
}

.lesson-start-row > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.question-card {
  position: relative;
  min-height: 470px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 33px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(11, 135, 121, 0.08), transparent 55%),
    var(--paper-2);
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}

.question-card::before {
  content: "";
  position: absolute;
  right: -100px;
  bottom: -130px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(228, 90, 57, 0.25);
  border-radius: 50%;
}

.question-label {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

.question-card > p {
  position: relative;
  z-index: 1;
  margin: auto 0;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.answer-veil {
  position: relative;
  z-index: 1;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
}

.reconstruction-section {
  padding: 120px max(28px, 6vw);
  background: var(--paper-2);
}

.reconstruction-intro {
  margin-bottom: 50px;
}

.source-stage {
  max-width: 1320px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: white;
  box-shadow: var(--shadow);
}

.source-toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.source-toolbar > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.source-toolbar button {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-2);
  background: var(--paper-2);
  cursor: pointer;
  font-size: 0.64rem;
}

.source-canvas {
  min-height: 620px;
  display: grid;
  place-items: center;
  padding: 35px;
  background:
    radial-gradient(circle at 90% 5%, rgba(11, 135, 121, 0.08), transparent 26rem),
    #f0f1eb;
}

.source-canvas svg {
  width: min(100%, 980px);
  max-height: 650px;
  filter: drop-shadow(0 16px 18px rgba(22, 36, 33, 0.08));
}

.fact-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
}

.fact-chip {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--paper-2);
  font-size: 0.66rem;
  transition: color 200ms ease, border 200ms ease, background 200ms ease;
}

.fact-chip.active {
  color: #87331e;
  border-color: #efaf9d;
  background: var(--coral-soft);
}

.reasoning-section {
  position: relative;
  padding: 105px max(28px, 5vw) 150px;
}

.reasoning-progress {
  position: sticky;
  top: 92px;
  z-index: 25;
  max-width: 1420px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 auto 35px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(244, 240, 231, 0.9);
  backdrop-filter: blur(15px);
}

.reasoning-progress > span {
  flex: 0 0 auto;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.6rem;
}

.reasoning-progress > div {
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.reasoning-progress i {
  width: 0;
  height: 100%;
  display: block;
  background: var(--coral);
  transition: width 350ms ease;
}

.reasoning-layout {
  max-width: 1420px;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(380px, 0.82fr);
  gap: 5vw;
  margin: 0 auto;
}

.sticky-column {
  position: relative;
}

.sticky-canvas-shell {
  position: sticky;
  top: 155px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper-2);
  box-shadow: 0 20px 55px rgba(22, 36, 33, 0.1);
}

.canvas-status {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.61rem;
  text-transform: uppercase;
}

.canvas-status span:last-child {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--coral);
}

.sticky-canvas {
  height: min(65vh, 660px);
  min-height: 440px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 18px;
  background:
    linear-gradient(rgba(22, 36, 33, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 36, 33, 0.035) 1px, transparent 1px),
    #eef0ea;
  background-size: 28px 28px;
}

.sticky-canvas svg {
  width: 100%;
  height: 100%;
  transition: all 550ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.sticky-canvas svg [id] {
  transition: opacity 430ms ease, filter 430ms ease;
}

.sticky-canvas svg .scene-primary {
  filter: saturate(1.12) drop-shadow(0 0 2px rgba(228, 90, 57, 0.35));
}

.active-facts {
  min-height: 65px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.active-facts span {
  padding: 6px 8px;
  border-radius: 7px;
  color: #803722;
  background: var(--coral-soft);
  font-size: 0.62rem;
}

.steps-column {
  min-width: 0;
}

.reasoning-step {
  min-height: 82vh;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 16px;
  align-items: center;
  opacity: 0.46;
  transition: opacity 280ms ease;
}

.reasoning-step.active {
  opacity: 1;
}

.step-marker {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6rem;
}

.step-marker i {
  width: 1px;
  height: 80px;
  background: var(--line-dark);
}

.reasoning-step.active .step-marker span {
  color: var(--coral);
}

.step-card {
  padding: clamp(24px, 3.2vw, 42px);
  border: 1px solid transparent;
  border-radius: 22px;
  transition: border 280ms ease, background 280ms ease, box-shadow 280ms ease;
}

.reasoning-step.active .step-card {
  border-color: var(--line);
  background: rgba(251, 248, 241, 0.85);
  box-shadow: 0 22px 50px rgba(22, 36, 33, 0.08);
}

.step-kicker {
  margin-bottom: 13px;
  color: var(--coral);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.step-card h3 {
  margin-bottom: 17px;
  font-family: var(--serif);
  font-size: clamp(2rem, 3vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.step-explanation {
  color: var(--ink-2);
  font-size: 0.83rem;
  line-height: 1.72;
}

.equation-block {
  margin: 24px 0 16px;
  overflow-wrap: anywhere;
  padding: 18px;
  border-left: 3px solid var(--amber);
  border-radius: 0 12px 12px 0;
  background: #f8f2df;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.65rem);
}

.board-lines {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.board-lines li {
  overflow-wrap: anywhere;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.5;
}

.step-card details {
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.step-card summary {
  color: var(--teal);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
}

.step-card details p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.6;
}

.takeaway {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 20px 0 0;
  color: var(--ink-2);
  font-size: 0.72rem;
}

.takeaway span {
  color: var(--coral);
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.1em;
}

.final-section {
  position: relative;
  overflow: hidden;
  padding: 130px max(28px, 7vw);
  color: white;
  background:
    radial-gradient(circle at 90% 8%, rgba(11, 135, 121, 0.7), transparent 30rem),
    var(--ink);
}

.final-number {
  position: absolute;
  top: 40px;
  right: 4vw;
  color: rgba(255, 255, 255, 0.04);
  font-family: var(--serif);
  font-size: clamp(8rem, 22vw, 24rem);
  letter-spacing: -0.08em;
  line-height: 1;
}

.final-main,
.insight-grid,
.media-card,
.replay-button {
  position: relative;
  z-index: 1;
  max-width: 1260px;
  margin-inline: auto;
}

.final-main .kicker {
  color: #79d6c8;
}

.final-main h2 {
  margin-bottom: 25px;
  color: #ffb7a3;
  font-size: clamp(5rem, 13vw, 13rem);
  letter-spacing: -0.07em;
  line-height: 0.85;
}

.final-derivation {
  max-width: 850px;
  color: #c1cec9;
  font-size: 1rem;
  line-height: 1.8;
}

.insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 65px;
  background: rgba(255, 255, 255, 0.18);
}

.insight-grid article {
  min-height: 190px;
  padding: 27px;
  background: var(--ink);
}

.insight-grid span,
.media-index {
  color: #73cdbf;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}

.insight-grid p {
  margin: 48px 0 0;
  color: #d0d9d6;
  font-family: var(--serif);
  font-size: 1.4rem;
  line-height: 1.35;
}

.media-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.65fr) minmax(420px, 1.35fr);
  gap: 40px;
  align-items: center;
  margin-top: 80px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.045);
}

.media-card h3 {
  margin: 15px 0 12px;
  font-family: var(--serif);
  font-size: 2.3rem;
  font-weight: 500;
  line-height: 1;
}

.media-card p {
  margin: 0;
  color: #9fb0aa;
  font-size: 0.73rem;
  line-height: 1.6;
}

.media-card video {
  width: 100%;
  border-radius: 14px;
  background: #0b1412;
}

.media-pending {
  min-height: 260px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  color: #9fb0aa;
  font-family: var(--mono);
  font-size: 0.66rem;
}

.replay-button {
  display: block;
  margin-top: 35px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid #71817b;
  color: #c7d2ce;
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
}

.replay-button:hover {
  color: white;
}

.fullscreen-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 50px;
  background: rgba(10, 18, 16, 0.94);
}

.fullscreen-viewer button {
  position: absolute;
  top: 20px;
  right: 24px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 9px;
  color: white;
  background: transparent;
  cursor: pointer;
}

.fullscreen-viewer > div {
  width: min(1200px, 95vw);
  height: min(820px, 85vh);
  display: grid;
  place-items: center;
  padding: 20px;
  border-radius: 20px;
  background: white;
}

.fullscreen-viewer svg {
  width: 100%;
  height: 100%;
}

.error-state {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 140px max(28px, 8vw);
}

.error-state > span {
  color: var(--coral);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.error-state h1 {
  max-width: 800px;
  margin: 20px 0;
  font-size: clamp(3.5rem, 7vw, 7rem);
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.error-state p {
  color: var(--muted);
}

footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 20px;
  padding: 32px max(28px, 5vw);
  color: var(--muted);
  background: var(--paper-2);
  font-size: 0.66rem;
}

footer p {
  margin: 0;
  text-align: center;
}

footer > span {
  text-align: right;
}

.footer-brand {
  font-size: 0.86rem;
}

.reveal {
  animation: rise 700ms both;
}

.reveal-delay {
  animation-delay: 140ms;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(17px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-a {
  50% {
    translate: 0 -10px;
  }
}

@keyframes float-b {
  50% {
    translate: 0 9px;
  }
}

@media (max-width: 1100px) {
  .home-hero,
  .lesson-hero-grid {
    grid-template-columns: 1fr;
  }

  .home-hero {
    padding-top: 160px;
  }

  .hero-stage {
    width: min(720px, 100%);
    margin: 0 auto;
  }

  .lesson-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .method-rail {
    grid-template-columns: 1fr 1fr;
  }

  .reasoning-layout {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.8fr);
    gap: 28px;
  }
}

@media (max-width: 820px) {
  .site-header nav a {
    display: none;
  }

  .home-hero h1 {
    font-size: clamp(3.7rem, 14vw, 6rem);
  }

  .section-intro,
  .upload-intro,
  .media-card {
    grid-template-columns: 1fr;
  }

  .upload-intro > p {
    margin-top: 26px;
  }

  .generated-layout {
    grid-template-columns: 1fr;
  }

  .generated-answer {
    min-height: 190px;
  }

  .lesson-hero {
    padding-top: 130px;
  }

  .back-link {
    margin-bottom: 45px;
  }

  .question-card {
    min-height: 390px;
  }

  .reasoning-layout {
    display: block;
  }

  .sticky-column {
    position: sticky;
    top: 134px;
    z-index: 16;
  }

  .sticky-canvas-shell {
    position: static;
  }

  .sticky-canvas {
    height: 40vh;
    min-height: 260px;
  }

  .active-facts {
    display: none;
  }

  .reasoning-step {
    min-height: 72vh;
    padding-top: 18vh;
  }

  .insight-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body {
    background-size: 48px 100%;
  }

  .site-header {
    top: 8px;
    width: calc(100% - 16px);
    min-height: 58px;
    padding-left: 14px;
  }

  .nav-proof {
    padding: 9px 10px;
  }

  .nav-proof i {
    display: none;
  }

  .home-hero {
    min-height: auto;
    padding: 125px 18px 60px;
  }

  .home-hero h1 {
    font-size: clamp(3.25rem, 15.5vw, 5rem);
  }

  .hero-stage {
    min-height: 490px;
    margin-top: 20px;
  }

  .card-problem {
    width: 270px;
    min-height: 270px;
  }

  .card-proof {
    width: 275px;
    right: -10px;
    top: 185px;
  }

  .card-answer {
    width: 205px;
    right: 7%;
  }

  .library-section,
  .upload-section,
  .method-section,
  .reconstruction-section,
  .reasoning-section,
  .final-section {
    padding-inline: 16px;
  }

  .section-intro h2,
  .method-heading h2,
  .reconstruction-intro h2 {
    font-size: clamp(2.8rem, 13vw, 4.2rem);
  }

  .lesson-grid,
  .generated-steps,
  .method-rail {
    grid-template-columns: 1fr;
  }

  .upload-form {
    grid-template-columns: 1fr;
  }

  .upload-form > .button {
    min-height: 58px;
  }

  .upload-intro h2 {
    font-size: clamp(3rem, 14vw, 4.7rem);
  }

  .generated-heading {
    display: block;
  }

  .generated-verdict {
    margin-top: 18px;
  }

  .generated-scene {
    min-height: 330px;
    padding: 6px;
  }

  .lesson-hero {
    min-height: auto;
    padding: 110px 16px 70px;
  }

  .lesson-hero h1 {
    font-size: clamp(3.4rem, 15vw, 5.2rem);
  }

  .question-card {
    min-height: 350px;
    padding: 25px;
  }

  .source-canvas {
    min-height: 360px;
    padding: 10px;
  }

  .reasoning-progress {
    top: 76px;
  }

  .sticky-column {
    top: 126px;
  }

  .sticky-canvas {
    height: 34vh;
    min-height: 220px;
    padding: 8px;
  }

  .canvas-status {
    min-height: 42px;
  }

  .reasoning-step {
    grid-template-columns: 25px 1fr;
    gap: 7px;
  }

  .step-card {
    padding: 22px 17px;
  }

  .board-lines li {
    font-size: 0.61rem;
  }

  .final-main h2 {
    font-size: clamp(4.6rem, 23vw, 8rem);
  }

  .media-card {
    padding: 20px;
  }

  .media-pending {
    min-height: 190px;
  }

  .fullscreen-viewer {
    padding: 44px 10px 12px;
  }

  footer {
    grid-template-columns: 1fr;
    text-align: left;
  }

  footer p,
  footer > span {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
