:root {
  --ink: #1e2936;
  --ink-soft: #445566;
  --muted: #6e7f90;
  --paper: #f2f5f8;
  --paper-deep: #e2e8ef;
  --line: rgba(30, 41, 54, 0.12);
  --teal: #4a8fb8;
  --teal-deep: #1e2936;
  --teal-bright: #7eb6d9;
  --focus: #4a8fb8;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Syne", sans-serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-optical-sizing: auto;
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 160ms ease;
}

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

a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Atmosphere */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.atmosphere__wash {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 70% 55% at 15% 10%, rgba(126, 182, 217, 0.22), transparent 55%),
    radial-gradient(ellipse 55% 45% at 90% 20%, rgba(30, 41, 54, 0.1), transparent 50%),
    radial-gradient(ellipse 60% 50% at 70% 90%, rgba(226, 232, 239, 0.95), transparent 60%),
    linear-gradient(165deg, #eef3f7 0%, #f7f9fb 42%, #e4ebf2 100%);
  animation: wash-drift 22s ease-in-out infinite alternate;
}

.atmosphere__grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(30, 41, 54, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 41, 54, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 20%, transparent 75%);
  animation: grid-shift 28s linear infinite;
}

@keyframes wash-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-2%, 1.5%, 0) scale(1.04);
  }
}

@keyframes grid-shift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 56px 28px, 28px 56px;
  }
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(243, 246, 245, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, background 200ms ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(243, 246, 245, 0.88);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: clamp(1rem, 3vw, 1.75rem);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

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

/* Hero */
.hero {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: min(calc(100svh - 4.5rem), 44rem);
  padding: clamp(2rem, 6vh, 4rem) clamp(1.25rem, 4vw, 3rem)
    clamp(3rem, 8vh, 5rem);
}

.hero__copy {
  max-width: 38rem;
  animation: rise 900ms var(--ease) both;
}

.eyebrow {
  margin: 0 0 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}

.brand {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.6rem, 11vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: var(--teal-deep);
}

.lede {
  margin: 0 auto 2rem;
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  color: var(--ink-soft);
  max-width: 32rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.7rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    transform 180ms var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--teal-deep);
  color: #f4f8fb;
}

.btn--primary:hover {
  background: var(--teal);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--teal-deep);
  border-color: rgba(30, 41, 54, 0.35);
}

.btn--ghost:hover {
  border-color: var(--teal);
  color: var(--teal);
}

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

/* Sections */
.section {
  padding: clamp(3.5rem, 10vh, 6.5rem) clamp(1.25rem, 4vw, 3rem);
  max-width: 72rem;
  margin: 0 auto;
}

.js .section {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 700ms var(--ease),
    transform 700ms var(--ease);
}

.js .section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.section__intro {
  margin-bottom: 2rem;
}

.section h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--teal-deep);
}

.section__support {
  margin: 0.9rem 0 0;
  color: var(--ink-soft);
}

.section__body {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.2rem;
}

/* Papers */
.papers {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.paper {
  position: relative;
  padding: 1.6rem 0 1.7rem;
  border-bottom: 1px solid var(--line);
}

.paper__title {
  display: inline;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

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

.paper__meta,
.paper__doi,
.paper__note {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.paper__note {
  font-style: italic;
  color: var(--teal);
}

.paper__file {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--teal-deep);
  border-bottom: 1px solid rgba(30, 41, 54, 0.35);
}

.paper__file:hover {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

/* Get started */
.start-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.start-list li {
  border-bottom: 1px solid var(--line);
}

.start-list a {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 1fr;
  gap: 1rem 2rem;
  align-items: baseline;
  padding: 1.35rem 0;
  color: inherit;
  text-decoration: none;
  transition: padding-left 200ms var(--ease);
}

.start-list a:hover {
  padding-left: 0.35rem;
}

.start-list__label {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--teal-deep);
}

.start-list__desc {
  color: var(--ink-soft);
}

/* Footer */
.site-footer {
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem) 3rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(30, 41, 54, 0.25);
}

.site-footer a:hover {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

/* Responsive */
@media (max-width: 900px) {
  .hero {
    min-height: auto;
    padding-top: 2.5rem;
  }

  .brand {
    font-size: clamp(3.2rem, 16vw, 4.8rem);
  }

  .start-list a {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

@media (max-width: 560px) {
  .nav {
    display: none;
  }

  .site-header {
    justify-content: flex-start;
  }

  .brand {
    font-size: clamp(2.5rem, 11.5vw, 3.6rem);
    letter-spacing: -0.05em;
  }

  .lede {
    font-size: 1.05rem;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }
}

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

  .atmosphere__wash,
  .atmosphere__grid,
  .hero__copy,
  .section {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
