:root {
  --ink: #18181b;
  --muted: #5f6368;
  --paper: #fbfbf8;
  --paper-soft: #f3f0e8;
  --line: #ddd8cc;
  --teal: #0f766e;
  --teal-dark: #0b4f4a;
  --rose: #e11d48;
  --gold: #f59e0b;
  --blue: #2563eb;
  --charcoal: #111113;
  --white: #ffffff;
  --shadow: 0 24px 70px rgb(24 24 27 / 0.14);
  --shadow-soft: 0 14px 35px rgb(24 24 27 / 0.1);
  --radius: 8px;
  --transition: 180ms ease;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  color: var(--rose);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 2000;
  background: var(--white);
  color: var(--ink);
  padding: 0.65rem 0.85rem;
  border: 2px solid var(--teal);
  border-radius: var(--radius);
  transition: top var(--transition);
}

.skip-link:focus {
  top: 1rem;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: rgb(251 251 248 / 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.site-mark,
.site-nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-mark {
  color: var(--ink);
  font-weight: 800;
}

.site-mark-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--white);
  background: var(--ink);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--teal);
}

.site-nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.site-nav-links a:hover {
  color: var(--ink);
}

.hero-cassm {
  min-height: 680px;
  background:
    radial-gradient(circle at 72% 22%, rgb(15 118 110 / 0.22), transparent 30rem),
    radial-gradient(circle at 18% 12%, rgb(245 158 11 / 0.2), transparent 22rem),
    linear-gradient(135deg, #f9f6ec 0%, #ffffff 44%, #eef7f4 100%);
  border-bottom: 1px solid var(--line);
}

.hero-shell {
  width: min(1200px, calc(100% - 3rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: 3rem;
  align-items: center;
  padding: 4.5rem 0 5rem;
}

.hero-copy {
  min-width: 0;
}

.eyebrow,
.section-kicker {
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.publication-title {
  margin: 0.7rem 0 1.35rem;
  color: var(--ink);
  font-size: 3.2rem;
  line-height: 1.08;
  font-weight: 800;
  overflow-wrap: break-word;
}

.hero-subtitle {
  max-width: 760px;
  color: #36383d;
  font-size: 1.2rem;
  line-height: 1.7;
  margin: 0 0 1.4rem;
}

.publication-authors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0 0 0.85rem;
  font-weight: 700;
}

.author-separator {
  color: var(--gold);
  font-weight: 800;
}

.venue-line {
  max-width: 680px;
  color: var(--muted);
  font-size: 0.98rem;
  margin: 0 0 1.65rem;
}

.publication-links,
.code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.button {
  border-radius: var(--radius) !important;
  border: 1px solid transparent !important;
  font-weight: 800 !important;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.button.is-dark {
  background: var(--ink) !important;
  color: var(--white) !important;
  box-shadow: var(--shadow-soft);
}

.button.is-dark:hover {
  background: var(--teal) !important;
  color: var(--white) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.lorenz-stage {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.08), transparent),
    var(--charcoal);
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  aspect-ratio: 46 / 31;
}

.lorenz-stage canvas,
.lorenz-stage img {
  display: block;
  width: 100%;
  height: 100%;
}

.lorenz-stage figcaption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.lorenz-stage figcaption span {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.2rem 0.6rem;
  color: #f6f4ed;
  background: rgb(17 17 19 / 0.74);
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.section {
  padding: 4.6rem 1.5rem;
}

.paper-summary {
  background: var(--white);
}

.title.is-3 {
  color: var(--ink);
  font-size: 2rem;
  line-height: 1.18;
  font-weight: 800;
  margin: 0.45rem 0 1.5rem !important;
}

.content.has-text-justified {
  color: #3f4146;
  font-size: 1.06rem;
  line-height: 1.85;
}

.content.has-text-justified p {
  margin-bottom: 1.15rem;
}

.method-section {
  background: var(--paper-soft);
}

.method-section .container {
  max-width: 1120px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.method-card {
  min-width: 0;
  padding: 1.4rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgb(24 24 27 / 0.07);
}

.method-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  color: var(--white);
  background: var(--teal);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.method-card:nth-child(2) .method-icon {
  background: var(--rose);
}

.method-card:nth-child(3) .method-icon {
  background: var(--blue);
}

.method-card h3 {
  margin: 0 0 0.55rem;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 800;
}

.method-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.code-section {
  background: var(--white);
}

.code-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--charcoal);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

pre {
  margin: 0 !important;
  padding: 1rem !important;
  overflow-x: auto;
  background: transparent !important;
  color: #f5f7fa !important;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: var(--radius);
}

code {
  color: inherit !important;
  background: transparent !important;
  font-family: "SF Mono", "Monaco", "Cascadia Code", "Roboto Mono", monospace !important;
  font-size: 0.94rem;
}

.repo-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.repo-facts div {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.repo-facts strong,
.repo-facts span {
  display: block;
}

.repo-facts strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.repo-facts span {
  color: var(--muted);
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.conference-section {
  background:
    linear-gradient(90deg, rgb(15 118 110 / 0.08), transparent 45%),
    var(--paper-soft);
}

.conference-section p {
  color: #3f4146;
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  font-weight: 800;
  border-bottom: 2px solid var(--gold);
}

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

.citation-section {
  background: var(--white);
}

.bibtex-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.copy-bibtex-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.7rem;
  padding: 0.65rem 0.9rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--teal);
  color: var(--white);
  font-weight: 800;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.copy-bibtex-btn:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

.copy-bibtex-btn.copied {
  background: #15803d;
}

.footer {
  padding: 2.5rem 1.5rem;
  color: #55585f;
  background: var(--paper-soft);
  border-top: 1px solid var(--line);
}

.footer p {
  margin-bottom: 0.65rem;
}

.scroll-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-2px);
  background: var(--teal);
}

.button:focus,
.copy-bibtex-btn:focus,
.scroll-to-top:focus,
a:focus {
  outline: 3px solid rgb(245 158 11 / 0.75);
  outline-offset: 3px;
}

@media screen and (max-width: 980px) {
  .hero-shell {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 3.5rem 0 4rem;
  }

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

  .method-grid,
  .repo-facts {
    grid-template-columns: 1fr;
  }

  .code-panel {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 768px) {
  .site-nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.8rem 1rem;
  }

  .site-nav-links {
    width: 100%;
    justify-content: space-between;
    gap: 0.4rem;
  }

  .site-nav-links a {
    font-size: 0.82rem;
  }

  .hero-shell {
    width: min(100% - 2rem, 1200px);
    padding: 2.5rem 0 3rem;
  }

  .publication-title {
    font-size: 2.25rem;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .publication-links .button,
  .code-actions .button {
    width: 100%;
    justify-content: center;
  }

  .section {
    padding: 3.2rem 1rem;
  }

  .title.is-3 {
    font-size: 1.65rem;
  }

  .bibtex-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media screen and (max-width: 480px) {
  .publication-title {
    font-size: 1.9rem;
  }

  .site-nav-links {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .lorenz-stage figcaption {
    position: static;
    padding: 0.85rem;
    background: var(--charcoal);
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .site-nav,
  .scroll-to-top {
    display: none;
  }

  body {
    background: var(--white);
  }
}
