:root {
  --ink: #122226;
  --paper: #f9f9f9;
  --paper-2: #eeeeee;
  --teal: #165a63;
  --teal-deep: #0e3d44;
  --coral: #e07a5f;
  --surf-orange: #ff7147;
  --gold: #c9a15b;
  --muted: #5b686a;
  --ocean-surface: #0a51cf;
  --ocean: #063d9b;
  --ocean-deep: #06275f;
  --ocean-floor: #031733;
  --foam: #f3f7ff;
  --foam-muted: #b9cae3;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: clip; }
html { scroll-behavior: smooth; }
body {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  background: var(--ocean-floor);
  color: var(--ink);
  line-height: 1.55;
}

a { color: inherit; }
button { font: inherit; }

.ocean-layer {
  --ocean-cut: 100vh;
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  clip-path: inset(var(--ocean-cut) 0 0 0);
  pointer-events: none;
  will-change: clip-path;
}
.ocean-layer > * {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.site-nav {
  position: fixed;
  top: clamp(0.65rem, 1.4vw, 1rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  width: min(58rem, calc(100% - 2rem));
  min-height: 3.75rem;
  padding: 0.38rem 0.42rem 0.38rem 1.2rem;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border: 1px solid color-mix(in srgb, var(--ocean-surface) 30%, var(--paper));
  border-radius: 999px;
  box-shadow: 0 18px 48px rgba(3, 23, 51, 0.16), 0 3px 12px rgba(3, 23, 51, 0.08);
  backdrop-filter: blur(18px) saturate(1.18);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.58rem;
  flex-shrink: 0;
  text-decoration: none;
  font-family: ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.01em;
  text-transform: none;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--teal-deep);
  white-space: nowrap;
}
.brand img { height: 34px; width: auto; }
.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.12rem;
  margin-left: auto;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 550;
}
.nav-links a {
  padding: 0.58rem 0.74rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  transition: color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}
.nav-links a:hover { background: color-mix(in srgb, var(--ocean-surface) 8%, transparent); }
.nav-links a:focus-visible {
  outline: 2px solid var(--ocean-surface);
  outline-offset: 2px;
}
.nav-links a:nth-child(3) { color: var(--ocean-surface); }
.nav-links a:last-child {
  padding-inline: 1.05rem;
  background: var(--ink);
  color: var(--paper);
}
.nav-links a:last-child:hover {
  background: var(--ocean-deep);
  color: var(--paper);
  transform: translateY(-1px);
}

.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: stretch;
  padding: 0;
  background: var(--paper);
}
.hero-copy {
  position: relative;
  z-index: 2;
  padding: 8vh 6vw 6vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.kicker {
  font-family: ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--teal);
  margin: 0 0 1rem;
}
h1 {
  font-size: clamp(3.2rem, 8vw, 7.2rem);
  line-height: 0.88;
  letter-spacing: -0.04em;
  margin: 0 0 1.2rem;
  font-weight: 600;
}
.lede {
  max-width: 38rem;
  font-size: 1.18rem;
  color: var(--muted);
  margin: 0 0 2rem;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-deep);
}
.hero-stage {
  position: relative;
  z-index: 2;
  background: transparent;
  min-height: 70vh;
  overflow: hidden;
  isolation: isolate;
}
.hero-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.caption {
  position: absolute;
  left: 1.2rem;
  bottom: 1.1rem;
  color: #f9f9f9;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.8;
}

.molecule-viewer {
  position: absolute;
  inset: 0;
  color: var(--paper);
  background: transparent;
  overflow: hidden;
}
.hero-water-content {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(140, 205, 255, 0.2), transparent 42%),
    linear-gradient(180deg, var(--ocean-surface) 0%, var(--ocean) 52%, var(--ocean-deep) 100%);
}
.hero-water-source {
  z-index: 0;
  opacity: 0;
  pointer-events: none;
}
.hero-liquid-output {
  z-index: 2 !important;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  filter: saturate(1.1) contrast(1.08);
  transition: opacity 180ms ease-out;
}
.hero-liquid-output[data-liquid-active="true"] { opacity: 0.46; }
#molecule-canvas { z-index: 3; }
.molecule-viewer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(249, 249, 249, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(249, 249, 249, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}
.molecule-viewer canvas {
  cursor: grab;
  touch-action: pan-y;
}
.molecule-viewer canvas:active { cursor: grabbing; }
.molecule-readout {
  position: absolute;
  z-index: 4;
  top: 1.45rem;
  left: 1.45rem;
  max-width: min(72%, 25rem);
  pointer-events: none;
}
.molecule-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.55rem;
  color: color-mix(in srgb, var(--paper) 68%, transparent);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.molecule-eyebrow span + span {
  padding-left: 0.85rem;
  border-left: 1px solid color-mix(in srgb, var(--paper) 22%, transparent);
}
.molecule-readout strong {
  display: block;
  font-size: clamp(1.9rem, 3.7vw, 3.25rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.96;
}
.molecule-readout p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.55rem;
  margin: 0.65rem 0 0;
  color: color-mix(in srgb, var(--paper) 72%, transparent);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.045em;
}
.molecule-picker {
  position: absolute;
  z-index: 5;
  top: 50%;
  right: 1.15rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.08rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  transform: translateY(-42%);
}
.molecule-option {
  min-width: 7.8rem;
  min-height: 40px;
  padding: 0.45rem 0.78rem;
  border: 0;
  border-radius: 999px;
  color: color-mix(in srgb, var(--paper) 72%, transparent);
  background: transparent;
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.8rem;
  letter-spacing: normal;
  font-weight: 550;
  text-align: center;
  text-transform: none;
  transition: color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}
.molecule-option:hover {
  color: var(--surf-orange);
  background: color-mix(in srgb, var(--paper) 7%, transparent);
}
.molecule-option:focus-visible {
  outline: 2px solid var(--surf-orange);
  outline-offset: 2px;
}
.molecule-option.active {
  color: var(--paper);
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--surf-orange) 54%, transparent);
}
.molecule-hint {
  position: absolute;
  z-index: 4;
  left: 1.45rem;
  bottom: 1.2rem;
  margin: 0;
  color: color-mix(in srgb, var(--paper) 52%, transparent);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  pointer-events: none;
}
.molecule-hint::before {
  content: "\2194";
  margin-right: 0.45rem;
  color: var(--coral);
}

@media (min-width: 861px) {
  .hero {
    position: relative;
    display: block;
    overflow: hidden;
  }
  .hero-copy {
    position: absolute;
    z-index: 7;
    inset: 0;
    display: block;
    padding: 0 5.5vw;
    pointer-events: none;
  }
  .hero-copy > .kicker {
    position: absolute;
    top: 7.5vh;
    left: 5.5vw;
    margin: 0;
  }
  .hero-copy h1 {
    position: absolute;
    top: 43%;
    right: 5.5vw;
    left: 5.5vw;
    margin: 0;
    transform: translateY(-50%);
    background: none;
    color: var(--ink);
    font-size: clamp(5rem, 10.2vw, 9.5rem);
    line-height: 0.82;
    letter-spacing: -0.055em;
    white-space: nowrap;
  }
  .hero-copy h1::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% + 0.35em);
    display: block;
    color: var(--paper);
    clip-path: var(--name-water-clip, inset(50% 0 0 0));
    pointer-events: none;
  }
  .hero-copy .lede {
    position: absolute;
    top: calc(43% + 7.25rem);
    left: 5.5vw;
    max-width: 34rem;
    margin: 0;
    color: color-mix(in srgb, var(--paper) 88%, transparent);
    font-size: clamp(1rem, 1.35vw, 1.2rem);
  }
  .hero-copy .hero-meta {
    position: absolute;
    bottom: 3.2rem;
    left: 5.5vw;
    color: color-mix(in srgb, var(--paper) 78%, transparent);
  }
  .hero-stage {
    position: absolute;
    inset: 43% 0 0;
    min-height: 0;
  }
  .molecule-readout {
    top: 5.1rem;
    left: 57%;
    max-width: 27%;
  }
  .molecule-readout strong {
    font-size: clamp(1.7rem, 2.7vw, 2.75rem);
  }
  .molecule-hint { left: 57%; }
}
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

section { padding: 6.5rem 6vw; scroll-margin-top: 5.5rem; }
section:not(.hero) {
  position: relative;
  z-index: 2;
  color: var(--foam);
  background: transparent;
}
section + section { border-top: 0; }
section:not(.hero) .kicker { color: #78c7ff; }
.section-title {
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
}
.section-sub { max-width: 44rem; color: var(--foam-muted); margin: 0 0 2.4rem; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.2rem 3rem;
}
.card {
  background: rgba(229, 240, 255, 0.075);
  padding: 1.4rem 1.5rem 1.5rem;
  border: 1px solid rgba(214, 231, 255, 0.12);
  border-radius: 2px;
}
.card h3 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.card p { margin: 0; color: var(--foam-muted); }

.pubs { display: grid; gap: 1rem; }
.pub {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(214, 231, 255, 0.14);
}
.pub .year {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--coral);
}
.pub h3 { margin: 0 0 0.25rem; font-size: 1.15rem; }
.pub h3 a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--coral), var(--coral));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 180ms var(--ease);
}
.pub h3 a:hover,
.pub h3 a:focus-visible { background-size: 100% 1px; }
.pub p { margin: 0; color: var(--foam-muted); }

.posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.1rem;
}
.post-card {
  background: rgba(229, 240, 255, 0.075);
  border: 1px solid rgba(214, 231, 255, 0.12);
  padding: 1.15rem 1.25rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 100%;
}
.post-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #78c7ff;
}
.post-card .lang { color: var(--coral); }
.post-card h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.post-body p { margin: 0 0 0.55rem; color: var(--foam-muted); font-size: 0.96rem; }
.post-toggle {
  appearance: none;
  border: 0;
  padding: 0.2rem 0;
  background: transparent;
  cursor: pointer;
  color: #78c7ff;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  align-self: flex-start;
}
.post-toggle::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.35rem;
  transition: transform 160ms var(--ease);
}
.post-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.post-toggle:hover { color: #c9e8ff; }
.post-toggle:focus-visible {
  outline: 2px solid var(--water-blue);
  outline-offset: 4px;
}
.post-links {
  margin: auto 0 0;
  padding-top: 0.4rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
}
.post-links a { color: #8fd2ff; }

.about-person {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
  align-items: start;
  gap: clamp(2rem, 5vw, 5.5rem);
  margin-top: 2.2rem;
}
.about-portrait {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 24px 70px rgba(0, 8, 24, 0.28);
}
.about-portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
}
.about-copy {
  display: grid;
  gap: 1.35rem;
  color: var(--foam-muted);
  font-size: clamp(1rem, 1.3vw, 1.16rem);
}
.about-copy p { margin: 0; }

footer {
  position: relative;
  z-index: 2;
  padding: 2.4rem 6vw 3rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: transparent;
  border-top: 0;
  font-size: 0.9rem;
  color: var(--foam-muted);
}
footer > div {
  display: flex;
  gap: 0.35rem 0.75rem;
  flex-wrap: wrap;
}
footer a {
  text-underline-offset: 0.18em;
  transition: color 160ms var(--ease);
}
footer a:hover { color: var(--surf-orange); }
.site-credit { justify-content: flex-end; }
.site-credit > span:first-child { color: var(--foam); }

@media (max-width: 860px) {
  .hero, .grid-2, .pub { grid-template-columns: 1fr; }
  .hero-copy {
    padding: 6.5rem 6vw 3.5rem;
    background: transparent;
  }
  .hero-stage { min-height: min(72svh, 42rem); }
  .molecule-picker {
    top: auto;
    right: 0.9rem;
    bottom: 0.9rem;
    left: 0.9rem;
    flex-direction: row;
    gap: 0.08rem;
    overflow-x: auto;
    padding: 0.2rem 0.1rem;
    border-radius: 0;
    transform: none;
    scrollbar-width: none;
  }
  .molecule-picker::-webkit-scrollbar { display: none; }
  .molecule-option {
    min-width: auto;
    min-height: 44px;
    padding-inline: 0.8rem;
    white-space: nowrap;
    text-align: center;
  }
  .molecule-hint { bottom: 4.7rem; }
  section { padding: 4.2rem 6vw; }
  .about-person { grid-template-columns: 1fr; }
  .about-copy {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 2rem;
  }
}

@media (max-width: 520px) {
  .site-nav {
    top: 0.45rem;
    width: calc(100% - 0.75rem);
    min-height: 3.2rem;
    gap: 0.28rem;
    padding: 0.28rem 0.3rem 0.28rem 0.65rem;
  }
  .brand {
    gap: 0.36rem;
    font-size: 0.62rem;
    letter-spacing: -0.01em;
  }
  .nav-links { gap: 0; font-size: 0.66rem; }
  .nav-links a { padding: 0.48rem 0.4rem; }
  .nav-links a:last-child { padding-inline: 0.58rem; }
  .molecule-option { font-size: 0.66rem; }
  .molecule-readout { top: 1.1rem; left: 1.1rem; max-width: 78%; }
  .molecule-readout strong { font-size: 2rem; }
  .molecule-hint { left: 1.1rem; }
  .about-copy { grid-template-columns: 1fr; }
}

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