:root {
  color-scheme: light;
  --paper: #f3f0e7;
  --paper-strong: #e7e1d4;
  --surface: #fbfaf6;
  --ink: #202a26;
  --ink-soft: #59655f;
  --pine: #315347;
  --pine-dark: #203c34;
  --slate: #4c6877;
  --warm: #956247;
  --line: #c9c1b3;
  --focus: #166f8f;
  --surface-featured: #203c34;
  --surface-contact: #4c6877;
  --surface-footer: #202a26;
  --text-on-dark: #fbfaf6;
  --focus-on-dark: #fbfaf6;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #161d1a;
  --paper-strong: #1d2723;
  --surface: #202c27;
  --ink: #edf0ea;
  --ink-soft: #bcc7c0;
  --pine: #8db8a4;
  --pine-dark: #b0cfbf;
  --slate: #91b1bf;
  --warm: #d39a77;
  --line: #46534d;
  --focus: #79c7e3;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #161d1a;
    --paper-strong: #1d2723;
    --surface: #202c27;
    --ink: #edf0ea;
    --ink-soft: #bcc7c0;
    --pine: #8db8a4;
    --pine-dark: #b0cfbf;
    --slate: #91b1bf;
    --warm: #d39a77;
    --line: #46534d;
    --focus: #79c7e3;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body,
a {
  overflow-wrap: anywhere;
}

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

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

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

h1,
h2,
h3,
h4,
p,
dl,
dd {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

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

/* Dark surfaces use a light focus ring because the default blue loses contrast there. */
.featured-project :focus-visible,
.section--contact :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--focus-on-dark);
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: var(--surface);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  color: var(--surface);
  transform: translateY(0);
}

.page-shell {
  width: min(100% - clamp(2.5rem, 8vw, 6rem), 72rem);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.site-header__inner {
  display: flex;
  width: min(100% - clamp(2.5rem, 8vw, 6rem), 72rem);
  min-height: 4.5rem;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2.5rem;
}

.site-brand {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
}

.site-header__controls {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem 1.25rem;
}

.site-nav ul {
  display: flex;
  margin: 0;
  padding: 0;
  align-items: center;
  gap: 0.35rem 1.4rem;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

.site-nav__sandbox::after {
  margin-left: 0.35rem;
  content: "↗";
  color: var(--warm);
}

.theme-toggle {
  display: inline-flex;
  min-height: 2.75rem;
  padding: 0.45rem 0.7rem;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.2rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover {
  background: var(--paper-strong);
}

.theme-toggle__state {
  color: var(--pine);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero__layout {
  display: grid;
  min-height: calc(100vh - 4.5rem);
  padding-block: clamp(4rem, 9vw, 7.5rem);
  align-items: center;
  gap: clamp(3rem, 7vw, 7rem);
  grid-template-columns: minmax(0, 1.75fr) minmax(15rem, 0.65fr);
}

.hero__copy {
  position: relative;
  z-index: 1;
}

.hero__rail {
  position: relative;
  z-index: 1;
}

.hero-focus {
  display: none;
}

.eyebrow,
.section-index,
.project-status,
.field-note,
.field-card__label,
.work-number,
.principle-index {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.eyebrow,
.section-index,
.field-note {
  color: var(--pine);
}

.hero h1 {
  max-width: 13ch;
  margin-bottom: 1.75rem;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  letter-spacing: -0.035em;
}

.hero__lead {
  max-width: 65ch;
  margin-bottom: 1.5rem;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 2vw, 1.22rem);
}

.availability {
  display: flex;
  margin-bottom: 2rem;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.availability__marker {
  width: 0.65rem;
  height: 0.65rem;
  flex: 0 0 auto;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--pine);
  box-shadow: 0 0 0 1px var(--pine);
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  min-height: 2.9rem;
  padding: 0.65rem 1rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pine-dark);
  font-size: 0.88rem;
  font-weight: 750;
  text-decoration: none;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button--primary {
  background: var(--pine-dark);
  color: var(--surface);
}

.button--primary:hover {
  background: var(--pine);
  color: var(--surface);
}

.button--secondary {
  background: transparent;
}

.button--secondary:hover {
  background: var(--paper-strong);
}

.text-link {
  padding: 0.6rem 0.25rem;
  color: var(--pine-dark);
  font-size: 0.88rem;
  font-weight: 750;
}

.field-card {
  position: relative;
  z-index: 1;
  border-top: 2px solid var(--pine);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.field-card__label {
  margin: 0;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--warm);
}

.field-card dl {
  margin: 0;
}

.field-card dl div {
  display: grid;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  gap: 0.5rem;
  grid-template-columns: 5.5rem 1fr;
}

.field-card dl div:last-child {
  border-bottom: 0;
}

.field-card dt {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.field-card dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

/* The motif is intentionally faint and local so the field-guide reference never competes with copy. */
.contour-field {
  position: absolute;
  pointer-events: none;
}

.contour-field::before,
.contour-field::after {
  position: absolute;
  border-radius: 50%;
  background: repeating-radial-gradient(
    ellipse at 48% 52%,
    transparent 0 1.75rem,
    color-mix(in srgb, var(--pine) 22%, transparent) 1.8rem 1.88rem,
    transparent 1.93rem 3.35rem
  );
  content: "";
  inset: 0;
}

.contour-field::after {
  inset: 12% 8% 5% 18%;
  transform: rotate(18deg);
}

.contour-field--hero {
  top: 2rem;
  right: -12rem;
  width: 34rem;
  height: 34rem;
  opacity: 0.65;
  transform: rotate(-12deg);
}

.section {
  padding-block: clamp(4.5rem, 9vw, 8rem);
  border-bottom: 1px solid var(--line);
}

.section--work {
  background: var(--surface);
}

.section--work > .page-shell {
  position: relative;
}

.section-heading {
  max-width: 45rem;
  margin-bottom: clamp(2.75rem, 6vw, 4.5rem);
}

.section-heading--wide {
  max-width: 58rem;
}

.section-index {
  margin-bottom: 1rem;
}

.section-heading h2 {
  margin-bottom: 1.25rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.025em;
}

.section-heading > p:last-child {
  max-width: 65ch;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.featured-project {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 3.25rem);
  background: var(--surface-featured);
  color: var(--text-on-dark);
}

.featured-project__intro,
.ocean-visual,
.featured-project__details,
.engineering-evidence,
.architecture-strip,
.stack-line {
  position: relative;
  z-index: 1;
}

.featured-project__intro {
  display: grid;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
  align-items: end;
  gap: 1rem clamp(2rem, 6vw, 6rem);
  grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.85fr);
}

.project-status {
  margin-bottom: 1rem;
  color: #b7cbc1;
  grid-column: 1 / -1;
}

.featured-project h3 {
  margin-bottom: 0;
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  letter-spacing: -0.03em;
}

.featured-project__summary {
  margin-bottom: 1.25rem;
  color: #dbe3dd;
  font-size: 1.12rem;
}

.featured-project__link {
  color: var(--text-on-dark);
  font-size: 0.9rem;
  font-weight: 750;
}

.featured-project__link:hover {
  color: #ffffff;
}

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

.project-detail {
  min-width: 0;
  padding-top: 1.15rem;
  border-top: 1px solid #678177;
}

.project-detail h4 {
  margin-bottom: 0.85rem;
  color: #ffffff;
  font-size: 1.35rem;
}

.project-detail p {
  margin-bottom: 0;
  color: #d7e2dc;
  font-size: 0.97rem;
}

.architecture-strip {
  display: grid;
  margin: 3rem 0 0;
  padding: 0;
  border: 1px solid #58756a;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
}

.architecture-strip li {
  position: relative;
  display: flex;
  min-height: 5rem;
  padding: 1rem 1.25rem;
  align-items: center;
  gap: 0.8rem;
  border-right: 1px solid #58756a;
  font-size: 0.9rem;
  font-weight: 700;
}

.architecture-strip li:last-child {
  border-right: 0;
}

.architecture-strip li:not(:last-child)::after {
  position: absolute;
  right: -0.55rem;
  z-index: 1;
  width: 1.05rem;
  height: 1.05rem;
  background: var(--surface-featured);
  color: #b7cbc1;
  content: "→";
  line-height: 1;
  text-align: center;
}

.architecture-strip span {
  color: #9fb6ac;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.stack-line {
  margin: 1rem 0 0;
  color: #a9beb4;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

/* Ocean Intelligence research-view composition. Static-first: the figure is already
   complete without JavaScript. The motion classes below only add a narrow desktop entrance. */
.ocean-visual {
  --ocean-cyan: #6fc6d8; /* scoped cyan for the hollow bubble accents; the global theme palette is untouched */
  --ocean-lime: #b7ef68; /* scoped lime for the one-shot scanner beam and sonar pings */
  margin: clamp(2rem, 4vw, 3rem) 0;
}

.ocean-visual__stage {
  position: relative;
  isolation: isolate; /* keep the overlap and survey line contained on the dark featured surface */
  display: grid;
  gap: 1.25rem;
}

.ocean-visual__frame {
  position: relative;
  min-width: 0;
  border: 1px solid #58756a; /* existing dark-surface rule color */
  background: color-mix(in srgb, #0c1a17 35%, transparent);
  border-radius: 0.25rem;
}

.ocean-visual__frame img {
  display: block;
  width: 100%;
  height: auto; /* preserve each screenshot's intrinsic aspect ratio, uncropped */
}

.ocean-visual__frame--search {
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.2);
}

.ocean-visual__frame--research {
  border-color: #718b80; /* slightly lighter muted-green border separates the dominant frame from the dark surface */
  box-shadow:
    0 0.5rem 1.5rem rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04); /* subtle low-opacity light edge that still merges into the green */
}

/* The decorative scan line is hidden in the static completed state and on narrow layouts. */
.ocean-visual__survey-line {
  display: none;
}

.ocean-visual__caption {
  margin: 1.5rem 0 0;
  max-width: 52ch;
  color: #d7e2dc; /* lightened dark-surface body text for slightly clearer readability */
}

.ocean-visual__label {
  display: block;
  margin-bottom: 0.6rem;
  color: #9fb6ac; /* existing mono label color on the dark surface */
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.ocean-visual__caption p {
  margin: 0;
}

/* Decorative negative-space rail. Generated by JavaScript as a direct child of .ocean-visual
   (after the caption) only at 70rem+ with no reduced-motion and IntersectionObserver support.
   The rail is a structural exclusion zone: overflow:hidden and isolation:isolate guarantee
   that transformed bubbles and expanding pings cannot paint over the caption or screenshots.
   It paints nothing meaningful itself and adds no focus target. */
.ocean-visual__ambient {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  pointer-events: none; /* auto only when the fine-pointer interaction query matches (set inline) */
}

/* Particle layer fills the rail so normalized home coords resolve against the rail box. */
.ocean-visual__particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ocean-visual__particle {
  position: absolute;
  box-sizing: border-box; /* via the global rule; restated for the border math below */
  border: 1px solid var(--ocean-cyan);
  background: color-mix(in srgb, var(--ocean-cyan) 10%, transparent);
  /* Restrained cyan edge glow so hollow bubbles read over the dark featured surface. */
  box-shadow: 0 0 0.3rem 0 color-mix(in srgb, var(--ocean-cyan) 25%, transparent);
  border-radius: 50%;
  opacity: var(--particle-opacity, 0.4); /* per-bubble resting opacity set inline (0.2-0.48) */
  transform: translate3d(var(--particle-x, 0px), var(--particle-y, 0px), 0);
  transition: transform 0.18s ease-out;
  pointer-events: none;
}

/* Calmer eased return after the pointer leaves the rail. */
.ocean-visual__particles.is-returning .ocean-visual__particle {
  transition: transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* One-shot sonar pings: thin lime rings that expand and fade once after the scan sequence.
   Hidden until .is-settled triggers the animation; the element is inert otherwise. */
.ocean-visual__ping {
  position: absolute;
  box-sizing: border-box;
  width: 1.5rem;
  height: 1.5rem;
  margin-left: -0.75rem; /* center the base ring on its left/top coords */
  margin-top: -0.75rem;
  border: 1px solid var(--ocean-lime);
  border-radius: 50%;
  opacity: 0; /* hidden until the one-shot animation runs */
  transform: scale(0.3);
  pointer-events: none;
}

.engineering-evidence {
  display: grid;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #58756a;
  gap: 1.25rem 2rem;
  grid-template-columns: minmax(9rem, 0.35fr) minmax(0, 1.65fr);
}

.engineering-evidence h4 {
  margin: 0;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.engineering-evidence ol {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 1rem 1.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  counter-reset: engineering-evidence;
}

.engineering-evidence li {
  position: relative;
  min-width: 0;
  padding: 0.8rem 0 0 2.25rem;
  border-top: 1px solid #58756a;
  color: #d7e2dc;
  counter-increment: engineering-evidence;
  font-size: 0.93rem;
}

.engineering-evidence li::before {
  position: absolute;
  top: 0.85rem;
  left: 0;
  color: #9fb6ac;
  content: "0" counter(engineering-evidence);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

.project-field-note {
  display: none;
}

.secondary-project {
  margin-top: clamp(3rem, 7vw, 6rem);
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-top: 2px solid var(--pine);
  background: color-mix(in srgb, var(--paper) 45%, var(--surface));
}

.secondary-project__intro {
  display: grid;
  align-items: end;
  gap: 1.5rem clamp(2rem, 6vw, 6rem);
  grid-template-columns: minmax(12rem, 0.7fr) minmax(0, 1.3fr);
}

.secondary-project .project-status {
  margin-bottom: 1rem;
  color: var(--warm);
}

.secondary-project h3 {
  margin-bottom: 0;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  letter-spacing: -0.025em;
}

.secondary-project__summary {
  margin-bottom: 1rem;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.secondary-project__link {
  color: var(--pine-dark);
  font-size: 0.9rem;
  font-weight: 750;
}

.secondary-project__details {
  display: grid;
  margin-top: 2.5rem;
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.secondary-project__details > div {
  min-width: 0;
  padding: 1.5rem clamp(1rem, 3vw, 2rem) 0 0;
  border-right: 1px solid var(--line);
}

.secondary-project__details > div + div {
  padding-left: clamp(1rem, 3vw, 2rem);
}

.secondary-project__details > div:last-child {
  padding-right: 0;
  border-right: 0;
}

.secondary-project__details h4 {
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
}

.secondary-project__details p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.responsibility-strip {
  display: grid;
  margin: 2.5rem 0 0;
  padding: 0;
  border: 1px solid var(--line);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
}

.responsibility-strip li {
  display: grid;
  min-width: 0;
  min-height: 6rem;
  padding: 1rem 1.25rem;
  align-content: center;
  gap: 0.2rem 0.75rem;
  border-right: 1px solid var(--line);
  grid-template-columns: 2rem minmax(0, 1fr);
}

.responsibility-strip li:last-child {
  border-right: 0;
}

.responsibility-strip li > span:first-child {
  color: var(--warm);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  grid-row: 1 / 3;
  letter-spacing: 0.04em;
}

.responsibility-strip strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.2;
}

.responsibility-strip__text {
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.secondary-project__stack {
  margin: 1rem 0 0;
  color: var(--pine);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.secondary-project__attribution {
  max-width: 75ch;
  margin: 2rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.recent-work {
  margin-top: clamp(4rem, 8vw, 7rem);
}

.recent-work__heading {
  display: grid;
  margin-bottom: 2rem;
  align-items: end;
  gap: 0.75rem 2rem;
  grid-template-columns: 1fr 1fr;
}

.recent-work__heading h3 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
}

.recent-work__heading p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.recent-work__grid {
  display: grid;
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recent-work__grid article {
  min-width: 0;
  padding: 1.5rem clamp(1rem, 3vw, 2rem) 0 0;
  border-right: 1px solid var(--line);
}

.recent-work__grid article + article {
  padding-left: clamp(1rem, 3vw, 2rem);
}

.recent-work__grid article:last-child {
  padding-right: 0;
  border-right: 0;
}

.work-number {
  margin-bottom: 2rem;
  color: var(--warm);
}

.principle-index {
  margin-bottom: 2rem;
  color: var(--pine);
}

.recent-work h4 {
  margin-bottom: 1rem;
  font-size: 1.45rem;
}

.recent-work article > p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.section-grid {
  display: grid;
  align-items: start;
  gap: clamp(3rem, 8vw, 8rem);
  grid-template-columns: minmax(15rem, 0.75fr) minmax(0, 1.25fr);
}

.section-heading--sticky {
  position: sticky;
  top: 7rem;
}

.timeline {
  border-top: 2px solid var(--pine);
}

.timeline-entry {
  display: grid;
  padding-block: 2rem;
  border-bottom: 1px solid var(--line);
  gap: 1.5rem 2.5rem;
  grid-template-columns: minmax(8rem, 0.55fr) minmax(0, 1.45fr);
}

.timeline-entry__meta p {
  margin-bottom: 0.35rem;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.timeline-entry h3 {
  margin-bottom: 0.75rem;
  font-size: 1.45rem;
}

.timeline-entry div:last-child p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.section--approach {
  background: var(--paper-strong);
}

.principles {
  display: grid;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.principles article {
  min-width: 0;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.principle-index {
  margin-bottom: 1.5rem;
}

.principles h3 {
  margin-bottom: 0.8rem;
  font-size: 1.55rem;
}

.principles article > p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.toolkit {
  display: grid;
  margin-top: clamp(4rem, 8vw, 6rem);
  padding-top: 2rem;
  border-top: 2px solid var(--pine);
  gap: 2rem clamp(3rem, 8vw, 7rem);
  grid-template-columns: minmax(12rem, 0.6fr) minmax(0, 1.4fr);
}

.toolkit h3 {
  margin-bottom: 0;
  font-size: 2rem;
}

.toolkit__groups {
  margin: 0;
}

.toolkit__groups div {
  display: grid;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
  gap: 1rem 2rem;
  grid-template-columns: minmax(9rem, 0.55fr) minmax(0, 1.45fr);
}

.toolkit__groups div:first-child {
  padding-top: 0;
}

.toolkit__groups dt {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
}

.toolkit__groups dd {
  margin: 0;
  color: var(--ink-soft);
}

.about-copy {
  max-width: 42rem;
}

.about-copy p {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  line-height: 1.55;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.section--contact {
  position: relative;
  overflow: hidden;
  background: var(--surface-contact);
  color: var(--text-on-dark);
}

.contact-layout {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: end;
  gap: clamp(3rem, 8vw, 8rem);
  grid-template-columns: minmax(0, 1.3fr) minmax(15rem, 0.7fr);
}

.section--contact .section-index,
.section--contact .section-heading > p:last-child {
  color: #e0e9ed;
}

.section--contact .section-heading {
  margin-bottom: 0;
}

.contact-links {
  margin: 0;
  padding: 0;
  border-top: 1px solid #91a7b2;
  list-style: none;
}

.contact-links a {
  display: flex;
  min-height: 3.5rem;
  padding: 0.7rem 0;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #91a7b2;
  color: var(--text-on-dark);
  font-family: var(--font-display);
  font-size: 1.2rem;
  text-decoration: none;
}

.contact-links a::after {
  content: "↗";
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.contact-links a:hover {
  color: #ffffff;
  padding-left: 0.35rem;
}

.contour-field--contact {
  right: -7rem;
  bottom: -13rem;
  width: 31rem;
  height: 31rem;
  opacity: 0.3;
}

.section--contact .contour-field::before,
.section--contact .contour-field::after {
  background: repeating-radial-gradient(
    ellipse at 48% 52%,
    transparent 0 1.75rem,
    color-mix(in srgb, var(--text-on-dark) 20%, transparent) 1.8rem 1.88rem,
    transparent 1.93rem 3.35rem
  );
}

.sandbox-invitation {
  padding-block: clamp(3rem, 7vw, 5rem);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.sandbox-invitation__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem 4rem;
}

.sandbox-invitation h2 {
  max-width: 24ch;
  margin-bottom: 0;
  font-size: clamp(1.7rem, 4vw, 2.75rem);
}

.button--sandbox {
  flex: 0 0 auto;
  border-color: var(--warm);
  color: var(--warm);
}

.button--sandbox:hover {
  background: var(--warm);
  color: var(--surface);
}

.site-footer {
  padding-block: 1.5rem;
  background: var(--surface-footer);
  color: #d8ded9;
}

.site-footer .page-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-footer p,
.site-footer a {
  margin: 0;
  font-size: 0.78rem;
}

.site-footer a:hover {
  color: #ffffff;
}

@media (min-width: 56.0625rem) {
  :root {
    --desktop-section-space: clamp(3.75rem, 6vw, 6rem);
  }

  .hero__layout {
    min-height: auto;
    padding-block: clamp(3.25rem, 5vw, 4.75rem);
    gap: clamp(2.5rem, 5vw, 5rem);
    grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.75fr);
  }

  .hero h1 {
    max-width: 16ch;
  }

  .section {
    padding-block: var(--desktop-section-space);
  }

  .section-heading {
    margin-bottom: clamp(2.25rem, 3.5vw, 3.25rem);
  }

  /* This single survey line carries the hero boundary into Selected Work without changing document flow. */
  .section--work > .page-shell::before {
    position: absolute;
    top: calc(-1 * var(--desktop-section-space));
    left: 0;
    width: 3rem;
    height: calc(var(--desktop-section-space) - 0.75rem);
    border-bottom: 1px solid var(--pine);
    border-left: 1px solid var(--pine);
    content: "";
    pointer-events: none;
  }

  .featured-project {
    padding: clamp(1.75rem, 3vw, 2.75rem);
  }

  .featured-project__intro {
    margin-bottom: clamp(2rem, 3.5vw, 3.5rem);
    column-gap: clamp(2rem, 4vw, 4rem);
  }

  .recent-work {
    margin-top: clamp(3rem, 5vw, 5.25rem);
  }

  .section-grid {
    gap: clamp(3rem, 6vw, 6rem);
  }

  .toolkit {
    margin-top: clamp(3rem, 5vw, 4.5rem);
    column-gap: clamp(3rem, 6vw, 5.25rem);
  }

  .contact-layout {
    gap: clamp(3rem, 6vw, 6rem);
  }

  .sandbox-invitation {
    padding-block: clamp(2.5rem, 4vw, 4rem);
  }
}

/* Completed wide Ocean composition. Narrower layouts keep the stacked static layout
   from the base rules; this block only applies the overlapping two-panel view at 70rem+. */
@media (min-width: 70rem) {
  .ocean-visual__stage {
    grid-template-columns: minmax(0, 0.38fr) minmax(0, 0.62fr);
    gap: 0;
    align-items: start;
    padding: 0.75rem 1.5rem 0.75rem 0.75rem; /* room so borders, the scanner, and the overlap shadow do not clip */
  }

  /* Screenshot 2 sits behind and lower; the offset is structural, not a permanent transform. */
  .ocean-visual__frame--search {
    margin-top: 2rem;
    z-index: 1;
  }

  .ocean-visual__frame--research {
    z-index: 2; /* above the search frame */
    margin-left: -3rem; /* restrained overlap onto the search frame's right edge */
  }

  /* Ambient-ready caption-row layout: the script adds --ambient-ready only at 70rem+ with no
     reduced-motion and IntersectionObserver support, so no-JS, reduced-motion, and narrow
     fallbacks keep the existing stacked figure. The stage spans full width in row 1; the
     caption and ambient rail share row 2 so decoration stays in caption-level negative space. */
  .ocean-visual--ambient-ready {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 0.38fr);
    column-gap: clamp(1.5rem, 3vw, 3rem);
  }

  .ocean-visual--ambient-ready .ocean-visual__stage {
    grid-column: 1 / -1;
  }

  .ocean-visual--ambient-ready .ocean-visual__caption {
    grid-column: 1;
  }

  .ocean-visual--ambient-ready .ocean-visual__ambient {
    grid-column: 2;
    min-height: 7rem;
    margin-top: 1.5rem; /* align the rail top with the caption's existing top margin */
  }
}

@media (min-width: 75rem) {
  .page-shell,
  .site-header__inner {
    width: min(100% - clamp(4rem, 6vw, 6rem), 80rem);
  }

  .hero__rail {
    display: grid;
    align-content: center;
    gap: 2rem;
  }

  .hero-focus {
    display: block;
    max-width: 19rem;
  }

  .hero-focus .field-note {
    margin-bottom: 0.75rem;
    padding-inline: 1rem;
  }

  .hero-focus ul {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
    list-style: none;
    counter-reset: hero-focus;
  }

  .hero-focus li {
    display: grid;
    padding-block: 0.65rem;
    padding-inline: 1rem;
    border-bottom: 1px solid var(--line);
    gap: 0.75rem;
    grid-template-columns: 2rem 1fr;
    font-family: var(--font-display);
  }

  .hero-focus li::before {
    color: var(--warm);
    content: "0" counter(hero-focus);
    counter-increment: hero-focus;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
  }

  .contour-field--hero {
    top: 1.5rem;
    right: -10rem;
  }

  /* The wrapper ends with the featured project so this note releases before the secondary case study. */
  .featured-project-layout {
    display: grid;
    align-items: start;
    gap: clamp(2rem, 3vw, 3rem);
    grid-template-columns: minmax(0, 1fr) 8.5rem;
  }

  .project-field-note {
    position: sticky;
    top: 7rem;
    display: block;
    padding-top: 1rem;
    border-top: 2px solid var(--pine);
    color: var(--ink-soft);
    font-size: 0.82rem;
    line-height: 1.55;
  }

  .project-field-note .field-note {
    margin-bottom: 0.75rem;
  }

  .project-field-note p:last-child {
    margin-bottom: 0;
  }
}

@media (max-width: 56rem) {
  .site-header {
    position: static;
  }

  .site-header__inner {
    padding-block: 0.8rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .site-header__controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .site-nav ul {
    gap: 0 1rem;
    flex-wrap: wrap;
  }

  .site-nav a {
    min-height: 2.5rem;
  }

  .hero__layout {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .field-card {
    max-width: 35rem;
  }

  .featured-project__intro,
  .engineering-evidence,
  .secondary-project__intro,
  .recent-work__heading,
  .section-grid,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .section-heading--sticky {
    position: static;
  }

  .featured-project__details,
  .engineering-evidence ol,
  .secondary-project__details,
  .responsibility-strip,
  .recent-work__grid {
    grid-template-columns: 1fr;
  }

  .secondary-project__details > div,
  .secondary-project__details > div + div {
    padding: 1.5rem 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .secondary-project__details > div:last-child {
    border-bottom: 0;
  }

  .responsibility-strip li {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .responsibility-strip li:last-child {
    border-bottom: 0;
  }

  .recent-work__grid article,
  .recent-work__grid article + article {
    padding: 1.5rem 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .recent-work__grid article:last-child {
    border-bottom: 0;
  }

  .work-number {
    margin-bottom: 0.8rem;
  }
}

@media (max-width: 42rem) {
  body {
    font-size: 1rem;
  }

  .page-shell,
  .site-header__inner {
    width: min(100% - 2.5rem, 72rem);
  }

  .site-nav,
  .theme-toggle {
    width: 100%;
  }

  .theme-toggle {
    justify-content: space-between;
  }

  .site-nav ul {
    justify-content: space-between;
  }

  .site-nav li:last-child {
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(2.65rem, 14vw, 4.15rem);
  }

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

  .button,
  .text-link {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .featured-project {
    margin-inline: -1.25rem;
  }

  .architecture-strip {
    grid-template-columns: 1fr;
  }

  .architecture-strip li {
    border-right: 0;
    border-bottom: 1px solid #58756a;
  }

  .architecture-strip li:last-child {
    border-bottom: 0;
  }

  .architecture-strip li:not(:last-child)::after {
    right: auto;
    bottom: -0.55rem;
    left: 1.25rem;
    content: "↓";
  }

  .timeline-entry,
  .toolkit,
  .toolkit__groups div,
  .principles {
    grid-template-columns: 1fr;
  }

  .principles {
    border-left: 0;
  }

  .principles article {
    padding-inline: 0;
    border-right: 0;
  }

  .sandbox-invitation__inner,
  .site-footer .page-shell {
    align-items: stretch;
    flex-direction: column;
  }

  .button--sandbox {
    width: 100%;
  }

  .contour-field--hero {
    right: -21rem;
  }
}

/* Narrow one-shot desktop entrance for the Ocean composition. AGENTS.md generally
   prohibits reveal-on-scroll; this is the approved Ocean-only exception. The completed
   composition is already visible; these classes only nudge the frames into place. */
@media (min-width: 70rem) and (prefers-reduced-motion: no-preference) {
  .ocean-visual--motion-ready:not(.is-settled) .ocean-visual__frame--search {
    transform: translate(-1.5rem, 1.5rem);
  }

  .ocean-visual--motion-ready:not(.is-settled) .ocean-visual__frame--research {
    transform: translateX(2rem);
  }

  .ocean-visual--motion-ready .ocean-visual__frame {
    transition: transform 1.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  }

  .ocean-visual--motion-ready .ocean-visual__frame--research {
    transition-delay: 0.075s; /* <=75ms so the two frames read as one composition */
  }

  .ocean-visual--motion-ready.is-settled .ocean-visual__frame {
    transform: none;
  }

  /* Vertical scanner: one left-to-right pass above both frames, then hidden. Retuned to a
     thin lime sonar beam that reads separately from the cyan bubble accents. */
  .ocean-visual--motion-ready .ocean-visual__survey-line {
    display: block;
    position: absolute;
    z-index: 3; /* above both frames */
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: 1px;
    height: auto;
    background: var(--ocean-lime);
    /* Compact lime glow so the beam stays visible over the dark screenshots without blooming. */
    box-shadow: 0 0 0.4rem 0.1rem color-mix(in srgb, var(--ocean-lime) 52%, transparent);
    opacity: 0;
    pointer-events: none;
  }

  /* The scanner crosses once shortly after the frames begin settling, then disappears. */
  .ocean-visual--motion-ready.is-settled .ocean-visual__survey-line {
    animation: ocean-survey-pass 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.25s forwards;
  }

  @keyframes ocean-survey-pass {
    0% {
      left: 0;
      opacity: 0;
    }

    20% {
      opacity: 0.92;
    }

    100% {
      left: calc(100% - 1px);
      opacity: 0;
    }
  }

  /* Two sparse sonar pings expand and fade once after the scan, staggered via --ping-delay.
     They run only after .is-settled and never repeat. */
  .ocean-visual--motion-ready.is-settled .ocean-visual__ping {
    animation: ocean-sonar-ping 1.5s cubic-bezier(0.22, 0.61, 0.36, 1) var(--ping-delay, 0s)
      forwards;
  }

  @keyframes ocean-sonar-ping {
    0% {
      transform: scale(0.3);
      opacity: 0;
    }

    15% {
      opacity: 0.65;
    }

    100% {
      transform: scale(2.4);
      opacity: 0;
    }
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  /* Defensive Ocean fallback: force the completed static state even if motion classes linger. */
  .ocean-visual__frame {
    transform: none !important;
  }

  .ocean-visual__survey-line {
    display: none !important;
  }

  .ocean-visual__ambient {
    display: none !important;
  }

  .ocean-visual__particles {
    display: none !important;
  }

  .ocean-visual__particle {
    transform: none !important;
  }

  .ocean-visual__ping {
    display: none !important;
  }
}
