/* Scientific / modern visual system for quantum-chemistry.org */
:root {
  --ink: #10202e;
  --ink-soft: #2c4050;
  --muted: #667786;
  --navy: #071d31;
  --navy-2: #0d304d;
  --navy-3: #174c68;
  --accent: #1c8894;
  --accent-bright: #49c3c9;
  --accent-soft: #e7f6f7;
  --cyan-faint: rgba(73,195,201,.12);
  --paper: #ffffff;
  --canvas: #f4f7f9;
  --canvas-2: #edf3f5;
  --line: #dbe5e9;
  --line-strong: #c6d6dc;
  --shadow-sm: 0 8px 24px rgba(6,29,49,.06);
  --shadow: 0 24px 64px rgba(6,29,49,.12);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 30px;
  --content: 1180px;
  --reading: 900px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--canvas);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(73,195,201,.055), transparent 26rem),
    radial-gradient(circle at 88% 42%, rgba(23,76,104,.045), transparent 30rem),
    var(--canvas);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:visited { color: var(--accent); }
a:hover { color: var(--navy-2); }

h1, h2, h3, h4, h5, h6 {
  color: var(--navy);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -.035em;
  line-height: 1.12;
}

h1 { font-size: clamp(2.7rem, 6vw, 5.4rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.55rem); }
h3 { font-size: 1.25rem; }

.article-wrap { text-align: left; }

/* Header -------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(247,250,251,.88);
  border-bottom: 1px solid rgba(198,214,220,.78);
  backdrop-filter: blur(18px) saturate(140%);
}

.site-header-inner {
  width: min(calc(100% - 44px), var(--content));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--navy) !important;
  font-size: .98rem;
  font-weight: 800;
  letter-spacing: -.025em;
  white-space: nowrap;
}

.site-brand-mark {
  position: relative;
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 32%, rgba(91,232,234,.7), transparent 22%),
    linear-gradient(145deg, var(--navy-3), var(--navy));
  color: white;
  font-size: .84rem;
  font-weight: 800;
  box-shadow: 0 7px 22px rgba(7,29,49,.2);
}

.site-brand-mark::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 8px;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 50%;
  transform: rotate(-28deg);
}

.modern-nav ul {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.modern-nav li { margin: 0; }

.modern-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  color: #3a4c59;
  font-size: .88rem;
  font-weight: 600;
  transition: background .18s ease, color .18s ease;
}

.modern-nav a:hover {
  background: rgba(28,136,148,.08);
  color: var(--navy);
}

.modern-nav a.is-active {
  background: var(--navy);
  color: #fff !important;
}

/* Home hero ------------------------------------------------ */
.home-hero {
  position: relative;
  overflow: hidden;
  min-height: 650px;
  display: flex;
  align-items: center;
  color: white;
  background:
    linear-gradient(105deg, rgba(4,20,35,.985) 0%, rgba(5,30,49,.955) 48%, rgba(8,48,70,.79) 100%),
    var(--hero-image) center / cover no-repeat;
  isolation: isolate;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .36;
  background-image:
    linear-gradient(rgba(130,225,229,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130,225,229,.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to right, transparent, black 45%, black);
}

.home-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 650px;
  height: 650px;
  right: -120px;
  top: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(73,195,201,.18), rgba(73,195,201,.035) 45%, transparent 70%);
  filter: blur(6px);
}

.hero-inner {
  width: min(calc(100% - 44px), var(--content));
  margin: 0 auto;
  padding: 92px 0 88px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr);
  gap: 68px;
  align-items: center;
}

.hero-copy { position: relative; z-index: 2; }

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: #a8e4e7;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero-kicker::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--accent-bright);
}

.home-hero h1 {
  max-width: 760px;
  margin: 0;
  color: #fff;
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: .98;
}

.hero-role {
  margin: 17px 0 0;
  color: #9fd4dc;
  font-size: clamp(.9rem, 1.6vw, 1.02rem);
  font-weight: 600;
  letter-spacing: .02em;
}

.hero-subtitle {
  max-width: 720px;
  margin: 24px 0 0;
  color: #dbe8ed;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  line-height: 1.72;
}

.hero-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.hero-topic {
  padding: 7px 11px;
  border: 1px solid rgba(166,225,228,.2);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: #cce6e9;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .025em;
}

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

.button-primary,
.button-secondary,
.button-dark,
.button-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.button-primary {
  background: #fff;
  color: var(--navy) !important;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}

.button-secondary {
  border: 1px solid rgba(220,245,246,.28);
  background: rgba(255,255,255,.055);
  color: #fff !important;
}

.button-dark {
  background: var(--navy);
  color: white !important;
  box-shadow: 0 10px 25px rgba(7,29,49,.12);
}

.button-light {
  border: 1px solid var(--line-strong);
  background: white;
  color: var(--navy) !important;
}

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

/* Scientific hero graphic */
.hero-visual {
  position: relative;
  min-height: 430px;
  display: grid;
  place-items: center;
}

.quantum-panel {
  position: relative;
  width: min(100%, 455px);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid rgba(177,235,238,.2);
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 46%, rgba(73,195,201,.13), transparent 42%),
    linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.018));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.1),
    0 28px 80px rgba(0,0,0,.22);
  backdrop-filter: blur(4px);
}

.quantum-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .22;
  background-image:
    linear-gradient(rgba(175,235,237,.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(175,235,237,.11) 1px, transparent 1px);
  background-size: 30px 30px;
}

.quantum-svg {
  position: absolute;
  inset: 5%;
  width: 90%;
  height: 90%;
  overflow: visible;
}

.quantum-orbit {
  transform-origin: 50% 50%;
  animation: orbit-drift 15s linear infinite;
}

.quantum-orbit.reverse { animation-direction: reverse; animation-duration: 20s; }

.quantum-node {
  filter: drop-shadow(0 0 12px rgba(73,195,201,.52));
}

.hero-equation {
  position: absolute;
  z-index: 2;
  padding: 7px 10px;
  border: 1px solid rgba(188,235,238,.14);
  border-radius: 9px;
  background: rgba(3,22,37,.57);
  color: #cbe7ea;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: .77rem;
  letter-spacing: .01em;
  backdrop-filter: blur(6px);
}

.hero-eq-1 { top: 10%; left: 7%; }
.hero-eq-2 { right: 7%; bottom: 12%; }
.hero-eq-3 { left: 9%; bottom: 20%; }

@keyframes orbit-drift {
  to { transform: rotate(360deg); }
}

/* Main content -------------------------------------------- */
.home-main,
.site-main {
  width: min(calc(100% - 44px), var(--content));
  margin: 0 auto;
}

.home-main { padding: 84px 0 100px; }

.intro-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(285px, .65fr);
  gap: 62px;
  align-items: start;
}

.intro-grid::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 0;
  width: 72px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
}

.intro-copy {
  color: #2b3e4c;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.13rem;
  line-height: 1.86;
}

.intro-copy p { margin-bottom: 1.2rem; }
.intro-copy strong { color: var(--navy); }

.profile-panel {
  position: relative;
  overflow: hidden;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow-sm);
}

.profile-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright), transparent);
}

.profile-panel .bio-photo {
  width: 88px;
  height: 88px;
  margin-bottom: 17px;
  border: 4px solid #fff;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 9px 25px rgba(7,29,49,.12);
}

.profile-panel p {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
}

.profile-panel .author-social {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 4px 8px 4px 0;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: .78rem;
  font-weight: 600;
}

.profile-panel .author-social:hover {
  border-color: #b2d9dc;
  background: var(--accent-soft);
}

.section-block {
  position: relative;
  margin-top: 96px;
}

.section-block::before {
  content: "";
  position: absolute;
  top: -46px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent 78%);
}

.section-eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.section-heading {
  max-width: 820px;
  margin: 0 0 14px;
}

.section-lead {
  max-width: 780px;
  margin: 0 0 34px;
  color: var(--muted);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.04rem;
  line-height: 1.72;
}

/* Research cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 18px;
}

.research-card,
.work-card {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.9);
  box-shadow: 0 8px 28px rgba(7,29,49,.045);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.research-card { padding: 25px 25px 27px; }

.research-card::after {
  content: "";
  position: absolute;
  right: -55px;
  bottom: -62px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(28,136,148,.09);
  border-radius: 50%;
  box-shadow:
    0 0 0 22px rgba(28,136,148,.035),
    0 0 0 44px rgba(28,136,148,.022);
}

.research-card:hover,
.work-card:hover {
  transform: translateY(-5px);
  border-color: #bad6dc;
  box-shadow: 0 18px 48px rgba(7,29,49,.09);
}

.card-icon {
  width: auto;
  height: auto;
  display: inline-flex;
  margin-bottom: 21px;
  padding: 5px 8px;
  border: 1px solid #cce6e8;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
}

.research-card h3,
.work-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 11px;
  font-size: 1.06rem;
  letter-spacing: -.025em;
}

.research-card p,
.work-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.68;
}

/* Selected work */
.work-card {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.work-card::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright), #9bdadf);
}

.work-card > * { margin-left: 24px; margin-right: 24px; }
.work-card .meta {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 23px;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .105em;
  text-transform: uppercase;
}

.work-card h3 { font-size: 1.02rem; line-height: 1.35; }
.work-card p { margin-bottom: 0; }

.work-card a {
  width: fit-content;
  margin-top: auto;
  margin-bottom: 23px;
  padding-top: 18px;
  color: var(--navy);
  font-size: .82rem;
  font-weight: 750;
}

/* MolSpin */
.molspin-callout {
  position: relative;
  overflow: hidden;
  margin-top: 96px;
  padding: 43px 46px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  border: 1px solid rgba(157,226,230,.15);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 88% 40%, rgba(73,195,201,.22), transparent 22rem),
    linear-gradient(130deg, #061b2e 0%, #0b3150 70%, #0e5666 130%);
  color: white;
  box-shadow: 0 26px 70px rgba(7,29,49,.18);
}

.molspin-callout::after {
  content: "ρ(t)";
  position: absolute;
  right: 22%;
  bottom: -38px;
  color: rgba(255,255,255,.035);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 8rem;
  font-weight: 600;
  transform: rotate(-7deg);
}

.molspin-callout h2 {
  margin: 0 0 12px;
  color: white;
}

.molspin-callout p {
  max-width: 760px;
  margin: 0;
  color: #d7e7ec;
  font-family: "Source Serif 4", Georgia, serif;
  line-height: 1.72;
}

.molspin-callout .section-eyebrow { color: #8fdee2 !important; }
.molspin-callout .button-primary { position: relative; z-index: 1; white-space: nowrap; }

/* Page hero ------------------------------------------------ */
.page-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(circle at 80% 0%, rgba(73,195,201,.16), transparent 28rem),
    linear-gradient(128deg, #061b2e 0%, #0d304d 72%, #14566a 120%);
  color: white;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .22;
  background-image:
    linear-gradient(rgba(130,225,229,.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130,225,229,.09) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to left, black, transparent 72%);
}

.page-hero-inner {
  position: relative;
  width: min(calc(100% - 44px), var(--reading));
  margin: 0 auto;
  padding: 72px 0 62px;
}

.page-hero-inner::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 42px;
  right: 0;
  top: 50%;
  border: 1px solid rgba(170,231,234,.16);
  border-radius: 50%;
  transform: rotate(-17deg);
  box-shadow:
    0 0 0 22px rgba(170,231,234,.025),
    0 0 0 44px rgba(170,231,234,.016);
}

.page-kicker {
  margin: 0 0 12px;
  color: #91dce0;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.page-hero h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: white;
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: -.05em;
}

.page-hero p {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 14px 0 0;
  color: #d6e5ea;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.03rem;
}

/* Inner pages --------------------------------------------- */
.site-main { padding: 58px 0 104px; }

.page-content {
  width: min(100%, var(--reading));
  margin: 0 auto;
  padding: clamp(30px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 15px 48px rgba(7,29,49,.06);
}

.page-content h2 {
  margin-top: 2.8rem;
  margin-bottom: 1rem;
  padding-top: .2rem;
  font-size: 1.62rem;
}

.page-content h3 {
  margin-top: 2.25rem;
  margin-bottom: .72rem;
  color: var(--navy-2);
  font-size: 1.18rem;
}

.page-content h2:first-child,
.page-content h3:first-child { margin-top: 0; }

.page-content p,
.page-content li { color: #334856; }

.page-content p {
  font-family: "Source Serif 4", Georgia, serif;
  line-height: 1.84;
}

.page-content li {
  margin-bottom: .58rem;
  line-height: 1.68;
}

.page-content hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.page-content a {
  border-bottom: 1px solid rgba(28,136,148,.25);
  font-weight: 600;
}

.page-content a:hover { border-color: var(--accent); }

.page-content > ul,
.page-content > ol { padding-left: 1.35rem; }

/* Research page */
.page-research .page-content { counter-reset: research-section; }

.page-research .page-content > h3 {
  position: relative;
  margin-top: 2.7rem;
  padding: 18px 18px 18px 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(231,246,247,.8), rgba(255,255,255,.65));
}

.page-research .page-content > h3::before {
  counter-increment: research-section;
  content: "0" counter(research-section);
  position: absolute;
  left: 17px;
  top: 17px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
}

/* Publications page */
.page-publications .site-main { width: min(calc(100% - 44px), 1120px); }
.page-publications .page-content { width: 100%; max-width: none; }

.page-publications .page-content > h2 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 3.2rem;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.page-publications .page-content > h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(28,136,148,.25), transparent);
}

.page-publications .page-content > ul {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-publications .page-content > ul > li {
  position: relative;
  margin: 0;
  padding: 17px 20px 17px 23px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: #425462;
  font-size: .9rem;
  line-height: 1.67;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.page-publications .page-content > ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  bottom: 15px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(var(--accent), var(--accent-bright));
  opacity: .8;
}

.page-publications .page-content > ul > li:hover {
  transform: translateX(3px);
  border-color: #bfdadd;
  box-shadow: 0 9px 28px rgba(7,29,49,.055);
}

.page-publications .page-content > ul > li a {
  color: var(--navy);
  border-bottom-color: rgba(28,136,148,.18);
}

.page-publications .page-content > ul > li strong {
  color: var(--accent);
  font-weight: 750;
}

/* About / software page refinements */
.page-about .page-content > ul:last-of-type {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 0;
  list-style: none;
}

.page-about .page-content > ul:last-of-type li {
  margin: 0;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: .82rem;
}

.page-software .page-content > h2:first-of-type {
  position: relative;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(120deg, var(--accent-soft), #fff);
}

/* Footer --------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(28,136,148,.025), transparent 30%),
    #edf2f4;
}

.site-footer-inner {
  width: min(calc(100% - 44px), var(--content));
  margin: 0 auto;
  padding: 34px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  color: #71808c;
  font-size: .78rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.footer-links a {
  color: #526773;
  font-weight: 650;
}

.footer-links a:hover { color: var(--accent); }

.cc-window { font-family: "Inter", sans-serif !important; }

/* Responsive ----------------------------------------------- */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
    gap: 35px;
  }

  .quantum-panel { max-width: 365px; }
  .intro-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .site-header-inner {
    min-height: auto;
    padding: 13px 0 12px;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .modern-nav {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .modern-nav::-webkit-scrollbar { display: none; }
  .modern-nav ul { width: max-content; }

  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 350px; margin-top: -10px; }
  .quantum-panel { width: 350px; max-width: 100%; }
  .home-hero { min-height: auto; }
  .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .molspin-callout { grid-template-columns: 1fr; }
  .page-hero-inner::after { opacity: .5; }
}

@media (max-width: 620px) {
  body { font-size: 15px; }

  .site-header-inner,
  .hero-inner,
  .home-main,
  .site-main,
  .site-footer-inner,
  .page-hero-inner {
    width: min(calc(100% - 28px), var(--content));
  }

  .site-brand-mark { width: 33px; height: 33px; }
  .modern-nav a { padding: 0 9px; font-size: .8rem; }

  .hero-inner { padding: 58px 0 54px; }
  .home-hero h1 { font-size: clamp(3rem, 15vw, 4.2rem); }
  .hero-visual { min-height: 300px; }
  .quantum-panel { width: 300px; }
  .hero-equation { font-size: .66rem; }

  .home-main { padding: 58px 0 76px; }
  .section-block, .molspin-callout { margin-top: 68px; }
  .section-block::before { top: -34px; }

  .card-grid { grid-template-columns: 1fr; }
  .molspin-callout { padding: 30px 27px; border-radius: 22px; }

  .page-hero-inner { padding: 48px 0 42px; }
  .page-content { padding: 28px 21px; border-radius: 18px; }

  .page-publications .site-main { width: min(calc(100% - 28px), 1120px); }
  .page-publications .page-content > ul > li { padding: 15px 15px 15px 19px; }

  .site-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

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


/* ---------------------------------------------------------
   Radical-pair hero: compact, spin-dynamics-specific, uncropped
   --------------------------------------------------------- */
.home-hero {
  min-height: 0;
  background:
    radial-gradient(circle at 82% 22%, rgba(73,195,201,.12), transparent 23rem),
    radial-gradient(circle at 16% 82%, rgba(31,104,132,.12), transparent 28rem),
    linear-gradient(118deg, #041524 0%, #07263f 58%, #0b3a50 118%);
}

.home-hero::before {
  opacity: .22;
  background-size: 46px 46px;
}

.home-hero::after {
  width: 400px;
  height: 400px;
  right: -85px;
  top: -105px;
  opacity: .72;
}

.hero-inner {
  padding-top: 74px;
  padding-bottom: 74px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.35fr) 400px;
  gap: 56px;
  align-items: center;
}

.hero-visual {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.radical-pair-panel {
  position: relative;
  width: 390px;
  max-width: 100%;
  overflow: hidden;
  padding: 15px 16px 12px;
  border: 1px solid rgba(177,235,238,.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 64% 27%, rgba(73,195,201,.10), transparent 36%),
    linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.014));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 18px 54px rgba(0,0,0,.18);
  backdrop-filter: blur(4px);
}

.radical-pair-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  background-image:
    linear-gradient(rgba(175,235,237,.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(175,235,237,.11) 1px, transparent 1px);
  background-size: 28px 28px;
}

.rp-panel-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.rp-label {
  color: #9bdde1;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.rp-state-badge {
  padding: 4px 8px;
  border: 1px solid rgba(174,232,235,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  color: #cdebed;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: .68rem;
}

.radical-pair-svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.rp-b0 line,
.rp-coupling,
.rp-hyperfine line,
.rp-precession-ring,
.rp-st-cue path,
.rp-trace-axis,
.rp-trace,
.rp-envelope {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rp-b0 line {
  stroke: rgba(197,241,243,.58);
  stroke-width: 1.35;
}

.rp-b0 path {
  fill: rgba(205,242,244,.8);
}

.rp-b0 text,
.rp-coupling-label,
.rp-radical-label,
.rp-st-cue text,
.rp-trace-label,
.rp-time-label {
  fill: #d5ebed;
  font-family: "Inter", sans-serif;
}

.rp-b0 text {
  font-size: 11px;
  font-weight: 700;
}

.rp-coupling {
  stroke: url(#rpCoupling);
  stroke-width: 2;
  stroke-dasharray: 7 7;
  animation: rp-coupling-flow 4.8s linear infinite;
}

.rp-coupling-label {
  fill: #8fd7dc;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .04em;
}

.rp-radical-halo {
  fill: rgba(56,184,194,.06);
  stroke: rgba(130,226,230,.25);
  stroke-width: 1.1;
}

.rp-radical-core {
  fill: url(#rpGlow);
  filter: drop-shadow(0 0 10px rgba(105,219,224,.42));
}

.rp-electron {
  fill: #06253c;
  font-family: "Inter", sans-serif;
  font-size: 8px;
  font-weight: 800;
}

.rp-radical-label {
  font-size: 10px;
  font-weight: 650;
}

.rp-hyperfine circle {
  fill: rgba(113,218,223,.72);
  filter: drop-shadow(0 0 4px rgba(105,219,224,.28));
}

.rp-hyperfine line {
  stroke: rgba(113,218,223,.18);
  stroke-width: 1;
}

.rp-precession-ring {
  stroke: rgba(150,229,232,.25);
  stroke-width: 1.15;
  stroke-dasharray: 3 5;
}

.rp-spin line {
  stroke: #e4ffff;
  stroke-width: 2.25;
}

.rp-spin path {
  fill: #e4ffff;
}

.rp-spin-left,
.rp-spin-right {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.rp-spin-left {
  animation: rp-precess-left 6.4s ease-in-out infinite;
}

.rp-spin-right {
  animation: rp-precess-right 7.2s ease-in-out infinite;
}

.rp-st-cue {
  opacity: .78;
  animation: rp-st-pulse 4.8s ease-in-out infinite;
}

.rp-st-cue text {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 11px;
}

.rp-st-cue path {
  stroke: rgba(147,225,229,.4);
  stroke-width: 1.1;
}

.rp-trace-label {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 10px;
}

.rp-time-label {
  fill: #7fb8bf;
  font-size: 8px;
}

.rp-trace-axis {
  stroke: rgba(128,215,220,.18);
  stroke-width: 1;
}

.rp-trace {
  stroke: url(#rpTrace);
  stroke-width: 1.75;
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  animation: rp-trace-draw 5.2s ease-in-out infinite;
}

.rp-envelope {
  stroke: rgba(115,218,223,.15);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.hero-equations {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 2px;
  margin-top: 0;
  padding: 11px 4px 1px;
  border-top: 1px solid rgba(190,235,238,.12);
}

.hero-equation,
.hero-eq-1,
.hero-eq-2,
.hero-eq-3 {
  position: static;
  padding: 3px 1px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #c9e5e8;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: .72rem;
  line-height: 1.42;
  letter-spacing: 0;
  backdrop-filter: none;
}

.hero-equation .MathJax {
  color: inherit !important;
}

@keyframes rp-precess-left {
  0%, 100% { transform: rotate(-9deg); }
  50% { transform: rotate(12deg); }
}

@keyframes rp-precess-right {
  0%, 100% { transform: rotate(11deg); }
  50% { transform: rotate(-10deg); }
}

@keyframes rp-st-pulse {
  0%, 100% { opacity: .48; }
  50% { opacity: .95; }
}

@keyframes rp-coupling-flow {
  to { stroke-dashoffset: -28; }
}

@keyframes rp-trace-draw {
  0% { stroke-dashoffset: 340; opacity: .45; }
  48%, 78% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -40; opacity: .55; }
}

/* Current news */
.page-news .site-main {
  width: min(calc(100% - 44px), 1040px);
}

.page-news .page-content {
  width: 100%;
  max-width: none;
}

.news-list {
  display: grid;
  gap: 15px;
  margin-top: 1.5rem;
}

.news-item {
  position: relative;
  padding: 24px 26px 23px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(7,29,49,.04);
}

.news-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 19px;
  bottom: 19px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(var(--accent), var(--accent-bright));
}

.news-meta {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.news-item h3 {
  margin: 0 0 9px;
  color: var(--navy);
  font-size: 1.08rem;
}

.news-item p {
  margin: 0;
  font-size: .95rem;
  line-height: 1.72;
}

.news-item a {
  font-weight: 700;
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 36px;
  }

  .radical-pair-panel {
    width: 340px;
  }
}

@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    justify-content: flex-start;
    margin-top: 24px;
  }

  .radical-pair-panel {
    width: 330px;
  }
}

@media (max-width: 620px) {
  .hero-inner {
    padding-top: 52px;
    padding-bottom: 50px;
  }

  .hero-visual {
    min-height: 0;
    margin-top: 20px;
  }

  .radical-pair-panel {
    width: min(100%, 320px);
    padding: 12px 12px 10px;
    border-radius: 18px;
  }

  .hero-equation {
    font-size: .64rem;
  }

  .page-news .site-main {
    width: min(calc(100% - 28px), 1040px);
  }

  .news-item {
    padding: 20px 20px 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rp-spin-left,
  .rp-spin-right,
  .rp-st-cue,
  .rp-coupling,
  .rp-trace {
    animation: none !important;
  }
}
