:root {
  color-scheme: light;
  --bg: #f3f1ec;
  --bg-accent: #e4e7ea;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: #ffffff;
  --text: #17212b;
  --muted: #5b6773;
  --accent: #2e5d74;
  --accent-dark: #28485a;
  --border: rgba(23, 33, 43, 0.1);
  --shadow: 0 18px 44px rgba(23, 33, 43, 0.1);
}

@keyframes expandIn {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 1000px;
  }
}

@keyframes expandOut {
  from {
    opacity: 1;
    max-height: 1000px;
  }
  to {
    opacity: 0;
    max-height: 0;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(46, 93, 116, 0.12), transparent 36%),
    radial-gradient(circle at right top, rgba(228, 231, 234, 0.95), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, #fbfaf7 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(23, 33, 43, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 43, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent 85%);
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.site-header,
.hero,
.content-section,
.site-footer {
  backdrop-filter: blur(14px);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-nav a,
.link-card {
  text-decoration: none;
  color: var(--text);
}

.site-nav a {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  color: var(--muted);
}

.menu-button {
  display: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 10px 14px;
  font: inherit;
}

.section-card {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-section {
  background: linear-gradient(135deg, rgba(46, 93, 116, 0.08) 0%, rgba(46, 93, 116, 0.04) 100%);
  border: 1px solid rgba(46, 93, 116, 0.12);
  padding: clamp(32px, 5vw, 52px);
  text-align: center;
}

.hero-content h1 {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  margin: 12px 0 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.02rem;
  color: var(--muted);
}

.hero-copy-wrap {
  display: grid;
  align-content: start;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 16px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.hero h1,
.content-section h2 {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  line-height: 1.02;
}

.hero h1 {
  max-width: 12ch;
  font-size: clamp(2.4rem, 6vw, 4rem);
}

.hero-copy,
.content-section p,
.link-text,
.site-footer {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--muted);
}

.hero-copy {
  max-width: 60ch;
  margin: 10px 0 0;
  font-size: 1.02rem;
  line-height: 1.65;
}

.demo-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid rgba(40, 72, 90, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(245, 247, 248, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.panel-label,
.paper-kicker {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  padding: 14px 20px;
  border-radius: 999px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button {
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 22px rgba(46, 93, 116, 0.18);
}

.primary-button:hover {
  background: var(--accent-dark);
  box-shadow: 0 12px 28px rgba(46, 93, 116, 0.22);
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.55);
}

.panel-note {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}

.primary-button:hover,
.secondary-button:hover,
.link-card:hover {
  transform: translateY(-2px);
}

.content-section {
  margin-top: 16px;
  padding: 24px 26px;
}

.compact-section {
  padding: 20px 26px;
}

.download-section {
  padding: 20px 26px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.step-box {
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 16px;
  padding: 26px;
  border: 1px solid rgba(46, 93, 116, 0.1);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.75) 0%, rgba(245, 247, 248, 0.85) 100%);
  box-shadow: 0 4px 16px rgba(46, 93, 116, 0.08);
  align-content: start;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-heading-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-box h2 {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.4rem;
  line-height: 1.2;
  color: var(--text);
}

.step-description {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
}

.demo-button {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  box-shadow: 0 8px 20px rgba(46, 93, 116, 0.2);
}

.demo-button:hover {
  background: var(--accent-dark);
}

.content-section h2 {
  font-size: 1.4rem;
}

.content-section p {
  margin-bottom: 0;
  line-height: 1.7;
}

.source-code-callout {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 0 0;
  padding: 18px 20px;
  border: 1px solid rgba(46, 93, 116, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(46, 93, 116, 0.14), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(231, 236, 239, 0.95) 100%);
  box-shadow: 0 10px 24px rgba(46, 93, 116, 0.08);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 700;
  line-height: 1.55;
  color: var(--text);
}

.source-code-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 18px;
  background: rgba(46, 93, 116, 0.12);
  font-size: 2rem;
  line-height: 1;
}

.source-code-callout p {
  margin: 0;
  font-size: 1.03rem;
}

.source-code-callout a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.source-code-callout a:hover {
  color: var(--accent);
}

@media (max-width: 640px) {
  .source-code-callout {
    align-items: flex-start;
  }

  .source-code-icon {
    width: 52px;
    height: 52px;
    font-size: 1.6rem;
  }
}

.paper-cta {
  margin-top: 12px;
}

.paper-cta-compact {
  margin-top: 0;
}

.paper-cta a {
  color: var(--accent-dark);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 700;
  text-decoration: none;
  transition: color 180ms ease;
}

.paper-cta a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.paper-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  align-items: stretch;
}

.paper-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid rgba(40, 72, 90, 0.1);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(245, 249, 251, 0.8) 100%);
  box-shadow: 0 2px 8px rgba(46, 93, 116, 0.06);
  transition: box-shadow 160ms ease, transform 160ms ease;
  height: 100%;
}

.paper-card:hover {
  box-shadow: 0 6px 16px rgba(46, 93, 116, 0.12);
  transform: translateY(-2px);
}

.paper-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 0;
}

.paper-title-wrap {
  min-width: 0;
  flex: 1;
}

.paper-header h3 {
  margin: 8px 0 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.18rem;
  line-height: 1.15;
}

.paper-link {
  text-align: right;
  max-width: none;
  white-space: nowrap;
}

.paper-link-stack {
  display: grid;
  justify-items: end;
  gap: 2px;
  width: max-content;
  max-width: none;
}

.paper-link,
.code-links a {
  color: var(--accent-dark);
  text-decoration: none;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 700;
}

.paper-link:hover,
.code-links a:hover {
  text-decoration: underline;
}

.abstract-box {
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(46, 93, 116, 0.05) 0%, rgba(46, 93, 116, 0.02) 100%);
  border: 1px solid rgba(46, 93, 116, 0.08);
}

.abstract-box p {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}

.expandable-box {
  margin-top: 8px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(46, 93, 116, 0.05) 0%, rgba(46, 93, 116, 0.02) 100%);
  border: 1px solid rgba(46, 93, 116, 0.08);
  overflow: hidden;
}

.expandable-box summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 12px 14px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 700;
  user-select: none;
  list-style: none;
}

.expandable-box summary::-webkit-details-marker {
  display: none;
}

.expandable-box summary::before {
  content: "▸";
  display: inline-block;
  color: var(--accent-dark);
  transform: translateY(-1px);
  transition: transform 320ms ease;
}

.expandable-box[open] summary::before {
  transform: rotate(90deg) translateX(1px);
}

.expandable-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-4px);
  padding: 0 14px;
  transition:
    max-height 620ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 360ms ease,
    transform 620ms cubic-bezier(0.22, 1, 0.36, 1),
    padding 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

.expandable-box[open] .expandable-body {
  max-height: 1200px;
  opacity: 1;
  transform: translateY(0);
  padding: 0 14px 12px 14px;
}

.illustrated-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding-left: 20px;
}

.illustrated-list li {
  display: grid;
  gap: 10px;
}

.illustrated-list span {
  line-height: 1.55;
}

.step-illustration {
  display: block;
  width: min(220px, 100%);
  height: auto;
  object-fit: contain;
}

.step-illustration-wide {
  width: min(320px, 100%);
}

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

.mini-card {
  padding: 16px;
  border: 1px solid rgba(40, 72, 90, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.mini-card h3 {
  margin: 8px 0 10px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.25;
}

.code-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 12px;
}

.setup-body {
  color: var(--muted);
}

.setup-body p {
  margin: 0;
  line-height: 1.62;
}

.setup-body ol {
  margin: 12px 0 0;
  padding-left: 18px;
  line-height: 1.6;
}

.how-it-works-body {
  color: var(--muted);
}

.how-it-works-body ol {
  margin: 0;
  padding-left: 18px;
  line-height: 1.65;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 0.95rem;
}

.how-it-works-body li {
  margin: 8px 0;
}

.how-it-works-body strong {
  color: var(--text);
}

.end-section {
  display: grid;
  gap: 10px;
}

.about-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
  align-items: baseline;
}

.about-link-row a {
  color: var(--accent-dark);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 700;
  text-decoration: none;
}

.about-link-row a:hover {
  text-decoration: underline;
}

.about-link-row span {
  color: var(--muted);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.site-footer {
  padding: 20px 6px 0;
  text-align: center;
}

@media (max-width: 860px) {
  .hero h1 {
    max-width: 12ch;
  }

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

  .paper-list {
    grid-template-columns: 1fr;
  }

  .paper-header {
    min-height: 0;
  }

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

@media (max-width: 720px) {
  .site-header {
    flex-wrap: wrap;
  }

  .menu-button {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 10px;
  }

  .site-nav.is-open {
    display: flex;
  }

  .hero,
  .content-section {
    padding: 24px;
  }

  .demo-panel,
  .paper-card {
    padding: 18px;
  }

  .step-box {
    padding: 20px;
  }

  .step-box h2 {
    font-size: 1.2rem;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 12vw, 3.6rem);
  }

  .paper-header {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    min-width: 0;
    width: 100%;
  }

  .demo-button {
    width: 100%;
  }
}
