:root {
  --_esther-ds: "esthersjw-v1";
  --blue: #6e8fc1;
  --blue-soft: #a2c1d6;
  --blue-deep: #04416d;
  --yellow: #ffe09a;
  --cream: #f8fafc;
  --warm: #fffdf8;
  --mist: #edf4f8;
  --ink: #102a3a;
  --text: #486273;
  --quiet: #718795;
  --dark: #062f4d;
  --border: rgba(4, 65, 109, 0.15);
  --gutter: clamp(20px, 5vw, 64px);
  --section-space: clamp(76px, 10vw, 136px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  overflow-x: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(1rem, 1.35vw, 1.08rem);
  line-height: 1.75;
}
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, a { touch-action: manipulation; }
::selection { background: var(--yellow); color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue-deep); outline-offset: 3px; }

.skip-link { position: fixed; z-index: 1000; top: -100px; left: 16px; padding: 10px 16px; background: var(--yellow); border-radius: 8px; font-weight: 700; }
.skip-link:focus { top: 16px; }
.container { width: min(calc(100% - 2 * var(--gutter)), 1120px); margin-inline: auto; }
.narrow { width: min(calc(100% - 2 * var(--gutter)), 760px); margin-inline: auto; }

h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 600; letter-spacing: -0.025em; }
h1 { font-size: clamp(3.2rem, 8vw, 6.6rem); line-height: 0.98; }
h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); line-height: 1.1; }
h3 { font-size: clamp(1.18rem, 2.5vw, 1.5rem); line-height: 1.25; }
p { color: var(--text); }
.section { padding: var(--section-space) 0; }
.section-alt { background: var(--mist); }
.section-header { margin-bottom: clamp(38px, 6vw, 68px); }
.section-header h2 { max-width: 15ch; }
.section-header p { max-width: 60ch; margin-top: 14px; }

.site-nav {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 70px;
  padding: 10px var(--gutter);
  background: rgba(248, 250, 252, 0.94);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s ease;
}
.site-nav.scrolled { border-color: var(--border); }
.nav-logo { justify-self: start; font: 700 1.2rem Fraunces, Georgia, serif; text-decoration: none; }
.nav-logo span { color: var(--blue); }
.nav-links { display: flex; align-items: center; gap: clamp(22px, 3vw, 40px); }
.nav-links a { color: var(--text); font-size: 0.84rem; font-weight: 650; text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--blue-deep); text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.connect-button, .button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 19px;
  border: 1px solid var(--blue-deep);
  border-radius: 10px;
  background: var(--blue-deep);
  color: var(--cream);
  font-size: 0.85rem;
  font-weight: 750;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.connect-button { justify-self: end; }
.connect-button:hover, .button:hover { background: transparent; color: var(--blue-deep); }
.button-secondary { background: transparent; color: var(--blue-deep); }
.button-secondary:hover { background: var(--blue-deep); color: var(--cream); }
.menu-toggle, .mobile-menu { display: none; }

.home-hero {
  min-height: 92svh;
  display: grid;
  align-items: center;
  padding: clamp(116px, 14vw, 158px) var(--gutter) clamp(70px, 9vw, 104px);
  background: var(--warm);
}
.home-hero-grid { width: min(100%, 1120px); margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(270px, 0.62fr); gap: clamp(48px, 8vw, 100px); align-items: center; }
.home-kicker { margin-bottom: 18px; color: var(--blue-deep); font-size: 0.82rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.home-hero h1 { margin-bottom: 24px; }
.hero-subtitle { max-width: 630px; font-size: clamp(1.08rem, 2vw, 1.28rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.portrait { overflow: hidden; aspect-ratio: 4 / 5; border-radius: 16px; background: var(--mist); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }

.story-layout { display: grid; grid-template-columns: minmax(220px, 0.38fr) minmax(0, 1fr); gap: clamp(42px, 8vw, 96px); align-items: start; }
.story-layout .section-header { position: sticky; top: 110px; }
.story-copy { max-width: 760px; }
.story-copy p + p { margin-top: 23px; }
.story-copy .story-lead { color: var(--ink); font: 600 clamp(1.35rem, 2.8vw, 2rem)/1.45 Fraunces, Georgia, serif; }
.story-question { margin: clamp(44px, 7vw, 70px) 0; padding: clamp(30px, 5vw, 46px) 0; border-top: 3px solid var(--yellow); border-bottom: 1px solid var(--border); color: var(--blue-deep); font: italic 600 clamp(1.65rem, 3.8vw, 2.65rem)/1.38 Fraunces, Georgia, serif; }

.background-grid { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: clamp(50px, 8vw, 96px); }
.background-column > h3 { margin-bottom: 26px; }
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: grid; grid-template-columns: 94px 1fr; gap: 18px; padding: 24px 0; border-top: 1px solid var(--border); }
.timeline-year { color: var(--blue-deep); font: 600 0.73rem/1.6 "Fira Code", monospace; }
.timeline-item h3 { font-size: 1.14rem; }
.timeline-item p { margin-top: 5px; font-size: 0.9rem; }

.page-hero { padding: clamp(150px, 18vw, 210px) 0 clamp(80px, 10vw, 124px); background: var(--warm); }
.page-hero h1 { max-width: 11ch; }
.page-hero p { max-width: 680px; margin-top: 22px; font-size: clamp(1.08rem, 2vw, 1.26rem); }
.overview-grid { display: grid; grid-template-columns: 0.42fr 1fr; gap: clamp(44px, 8vw, 96px); align-items: start; }
.overview-grid > div { max-width: 740px; }
.overview-grid > div p + p { margin-top: 21px; }
.overview-grid .lead { color: var(--ink); font: 600 clamp(1.4rem, 3vw, 2.15rem)/1.42 Fraunces, Georgia, serif; }
.focus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 5vw, 54px); }
.focus-item { padding-top: 20px; border-top: 3px solid var(--blue); }
.focus-item:nth-child(2) { border-color: var(--yellow); }
.focus-item:nth-child(3) { border-color: var(--blue-deep); }
.focus-item h3 { margin-bottom: 10px; }
.focus-item p { font-size: 0.92rem; }
.methods { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }
.methods span { padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--warm); color: var(--ink); font-size: 0.77rem; font-weight: 650; }

.publication-list { display: flex; flex-direction: column; }
.publication-entry { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: clamp(16px, 3vw, 32px); align-items: start; padding: 24px 0; border-top: 1px solid var(--border); }
.pub-year { color: var(--blue-deep); font: 600 0.72rem/1.55 "Fira Code", monospace; }
.pub-citation { color: var(--text); font-size: 0.89rem; line-height: 1.65; overflow-wrap: anywhere; }
.pub-citation strong { color: var(--ink); }
.pub-link { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--blue-deep); text-decoration: none; }
.pub-link:hover { background: var(--blue-deep); color: var(--cream); }
.pub-link-empty { color: var(--quiet); border-style: dashed; }
.work-list { margin-top: clamp(56px, 8vw, 90px); }
.work-list h3 { margin-bottom: 20px; }
.work-list .publication-entry { grid-template-columns: 105px minmax(0, 1fr); }

.memova-intro { max-width: 760px; }
.memova-intro p + p { margin-top: 22px; }
.memova-intro .lead { color: var(--ink); font: 600 clamp(1.4rem, 3vw, 2.15rem)/1.42 Fraunces, Georgia, serif; }
.showcase-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.showcase-card { min-height: 320px; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(26px, 4vw, 42px); background: var(--warm); border: 1px solid var(--border); border-radius: 16px; text-decoration: none; }
.showcase-card h3 { margin-bottom: 10px; }
.showcase-card p { max-width: 42ch; }
.showcase-preview { min-height: 170px; display: grid; place-items: center; margin-bottom: 32px; border: 1px dashed var(--border); border-radius: 10px; background: var(--mist); color: var(--blue-deep); font: 400 2.5rem Fraunces, Georgia, serif; }
.showcase-placeholder { border-style: dashed; }
.showcase-status { color: var(--quiet); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.showcase-empty { border-style: dashed; }
.showcase-card:not(.showcase-empty):hover { border-color: var(--blue-deep); }

.cta { padding: clamp(72px, 9vw, 112px) 0; background: var(--dark); color: var(--cream); }
.cta-grid { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.cta h2 { max-width: 16ch; }
.cta p { max-width: 55ch; margin-top: 12px; color: var(--blue-soft); }
.cta .button { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.cta .button:hover { background: transparent; color: var(--yellow); }

.site-footer { padding: 28px var(--gutter); background: var(--dark); color: var(--blue-soft); font-size: 0.75rem; }
.footer-inner { width: min(100%, 1120px); margin-inline: auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { text-underline-offset: 4px; }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.1s; }

@media (max-width: 900px) {
  .home-hero-grid, .story-layout, .background-grid, .overview-grid, .cta-grid { grid-template-columns: 1fr; }
  .home-hero { min-height: auto; }
  .portrait { width: min(78vw, 380px); }
  .story-layout .section-header { position: static; }
  .focus-grid { grid-template-columns: 1fr; }
  .showcase-grid { grid-template-columns: 1fr; }
  .cta .button { justify-self: start; }
}

@media (max-width: 720px) {
  .site-nav { grid-template-columns: 1fr auto auto; gap: 10px; min-height: 66px; }
  .nav-links { display: none; }
  .connect-button { min-height: 44px; padding: 9px 13px; font-size: 0.78rem; }
  .menu-toggle { display: inline-grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--warm); color: var(--ink); font-size: 1.1rem; cursor: pointer; }
  .mobile-menu { position: fixed; z-index: 99; inset: 66px 0 0; display: flex; flex-direction: column; gap: 8px; padding: 32px var(--gutter); background: var(--cream); transform: translateX(100%); visibility: hidden; transition: transform 0.24s ease, visibility 0.24s ease; }
  .mobile-menu.open { transform: translateX(0); visibility: visible; }
  .mobile-menu a { padding: 14px 0; border-bottom: 1px solid var(--border); font: 600 1.5rem Fraunces, serif; text-decoration: none; }
  .hero-actions { flex-direction: column; }
  .hero-actions .button, .cta .button { width: 100%; }
  .timeline-item { grid-template-columns: 1fr; gap: 5px; }
  .publication-entry, .work-list .publication-entry { grid-template-columns: 1fr; gap: 8px; }
  .footer-inner { flex-direction: column; }
}

@media (max-width: 380px) {
  .nav-logo { font-size: 1.03rem; }
  .connect-button { padding-inline: 9px; }
  h1 { font-size: 2.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .connect-button, .button, .mobile-menu { transition: none; }
}
