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

:root {
  --site-shell-width: min(calc(100% - 2rem), var(--content));
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--abyss);
}

body {
  margin: 0;
  min-width: 0;
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

/* Marine Depth Background — single shared CSS module.
   Loaded here with the shell: one cached local grain asset, no decorative JS.
   Explicit large-viewport height avoids bottom-inset sizing during toolbar motion.
   Theme owns color/tempo; these two fixed siblings own decorative geometry.
   Never filter, transform, fade or isolate body / a navigation ancestor. */
body {
  min-height: 100svh;
  background:
    radial-gradient(ellipse 110% 46rem at 42% -7rem,
      var(--depth-surface) 0%, var(--depth-midwater) 48%, transparent 100%),
    linear-gradient(180deg, var(--depth-surface) 0%,
      var(--depth-midwater) 36%, var(--deep) var(--depth-deep-stop, 70%),
      var(--abyss) var(--depth-floor-stop, 100%));
}

/* Reach the turtle's blue water before the closing copy and carry it through
   the footer. This is one page gradient, without a separate section rectangle. */
body.landing-page {
  --abyss: #062d46;
  --depth-deep-stop: 48%;
  --depth-floor-stop: 70%;
}

body:has(> main)::before,
body:has(> main)::after {
  content: "";
  position: fixed;
  z-index: 0;
  top: -6lvh;
  left: 0;
  right: 0;
  height: 112lvh;
  pointer-events: none;
}

/* Soft, non-repeating fans enter from above the waterline. Gradient stops
   create diffusion without a full-viewport blur, sharp stripes or blend modes. */
body:has(> main)::before {
  background:
    radial-gradient(ellipse 68% 40% at 34% 8%,
      var(--depth-light) 0%, transparent 100%),
    conic-gradient(from 149deg at 18% -4%,
      transparent 0deg, var(--depth-beam) 11deg 15deg, transparent 27deg,
      transparent 360deg),
    conic-gradient(from 177deg at 84% -6%,
      transparent 0deg, var(--depth-beam) 12deg 16deg, transparent 30deg,
      transparent 360deg);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 100%);
}

/* The photographic grain needs more contrast than the native photo sample to
   survive a reduced mobile view. It remains a static tile below the content.
   More defined dark-water pockets travel with the same refraction layer. */
body:has(> main)::after {
  background:
    url("assets/textures/marine-water-grain.svg?v=marine-p9") repeat,
    radial-gradient(ellipse 46% 30% at 6% 48%,
      rgba(var(--depth-shadow-rgb), 0.54) 12%, transparent 100%),
    radial-gradient(ellipse 42% 29% at 94% 76%,
      rgba(var(--depth-shadow-rgb), 0.48) 10%, transparent 100%),
    radial-gradient(ellipse 62% 23% at 48% 100%,
      rgba(var(--depth-shadow-rgb), 0.32) 8%, transparent 100%),
    radial-gradient(ellipse 82% 30% at 24% -4%,
      transparent 44%, var(--depth-glint) 63%, transparent 84%),
    radial-gradient(ellipse 68% 24% at 86% 2%,
      transparent 42%, var(--depth-glint) 66%, transparent 88%);
}

body > main,
body > .site-footer {
  position: relative;
  z-index: 1;
}

/* Constant time-based drift is intentionally independent of scroll speed.
   10lvh / 20s and 9lvh / 26s per half-cycle; vertical travel cannot add width.
   Negative quarter-cycle delays avoid a nearly motionless ease-in startup.
   Static is the default: unknown/reduced-motion preferences never animate. */
@media (prefers-reduced-motion: no-preference) {
  body:has(> main)::before {
    animation: marine-depth-drift var(--depth-drift-period) ease-in-out -5s infinite alternate;
  }

  body:has(> main)::after {
    animation: marine-depth-refraction var(--depth-refraction-period) ease-in-out -6.5s infinite alternate;
  }
}

@keyframes marine-depth-drift {
  from { transform: translateY(-5lvh); }
  to { transform: translateY(5lvh); }
}

@keyframes marine-depth-refraction {
  from { transform: translateY(4.5lvh); }
  to { transform: translateY(-4.5lvh); }
}

@media (prefers-reduced-motion: reduce) {
  body:has(> main)::before,
  body:has(> main)::after { animation: none; }
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more), (forced-colors: active) {
  body { background: var(--abyss); }
  body:has(> main)::before,
  body:has(> main)::after { display: none; animation: none; }
}

@media (forced-colors: active) {
  body { background: Canvas; color: CanvasText; }
}

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

/* Shared Marine card surface. Editorial Mosaic controls photo layout and may
   tint this material; reading cards and Landing use the same border, radius
   and shadow without a second card foundation. */
:where(.record-card, .editorial-mosaic__card) {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass-background);
  box-shadow: var(--glass-shadow);
}


/* Marine Card Interaction Contract: one selectable object, one primary link.
   Entry uses transform; interaction uses independent translate; Mosaic parallax
   lives on its outer article. These properties never overwrite each other. */
[data-card] { position: relative; min-width: 0; }
[data-card="interactive"] {
  --card-lift: -0.2rem;
  transition: translate var(--motion-medium) var(--ease-natural),
    box-shadow var(--motion-medium) ease, border-color var(--motion-medium) ease;
}
[data-card="interactive"]:is(:focus-visible, :has(:focus-visible)) {
  outline: 2px solid var(--sea);
  outline-offset: 3px;
  border-color: var(--sea);
  box-shadow: 0 0.65rem 1.4rem rgba(var(--ink-rgb), 0.45);
}
.card-link[href]::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; }
@media (hover: hover) and (pointer: fine) {
  [data-card="interactive"]:hover {
    border-color: var(--sea);
    box-shadow: 0 0.65rem 1.4rem rgba(var(--ink-rgb), 0.45);
  }
}
@media (prefers-reduced-motion: no-preference) {
  [data-card="interactive"]:is(:focus-visible, :has(:focus-visible)) { translate: 0 var(--card-lift); }
  @media (hover: hover) and (pointer: fine) {
    [data-card="interactive"]:hover { translate: 0 var(--card-lift); }
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-card] { translate: none; transition: none; }
}

a {
  color: inherit;
}

button,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
}

.nav-shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: var(--site-shell-width);
  margin: 0 auto;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  text-shadow: 0 1px 3px rgba(var(--ink-rgb), 0.85);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-mark {
  width: 2rem;
  height: auto;
  flex: none;
  /* Keep the approved black master unchanged; tint this image only. */
  filter: invert(1);
}

.desktop-nav {
  display: none;
}

.mobile-nav {
  position: relative;
}

.mobile-nav summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mobile-nav summary::-webkit-details-marker {
  display: none;
}

.mobile-nav nav {
  position: absolute;
  top: 2.25rem;
  right: 0;
  display: grid;
  min-width: 13rem;
  max-height: calc(100svh - 6rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--navigation-background);
  -webkit-backdrop-filter: var(--navigation-filter);
  backdrop-filter: var(--navigation-filter);
  box-shadow: var(--navigation-shadow);
}

.mobile-nav nav a {
  padding: 0.8rem 0.9rem;
  border-radius: 0.65rem;
  text-decoration: none;
}

/* Landing composition: a 4:3 frame with a modestly closer Anemone below desktop,
   fading its lower water into the same page depth. */
.landing-page main {
  font-family: var(--font-editorial);
  font-size: clamp(1.05rem, 0.98rem + 0.2vw, 1.15rem);
}

.hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  padding: clamp(21rem, 68vw, 28rem) 0 var(--space-6);
  background: linear-gradient(180deg, var(--depth-surface) 0%, transparent 100%);
}

.hero-media {
  position: absolute;
  z-index: 0;
  inset: 0 0 auto;
  aspect-ratio: 4 / 3;
  height: auto;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 64%, rgba(0, 0, 0, 0.72) 78%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 64%, rgba(0, 0, 0, 0.72) 78%, transparent 100%);
  pointer-events: none;
}

.hero-media picture,
.hero-image { display: block; width: 100%; height: 100%; }
.hero-image {
  object-fit: cover;
  object-position: center 46%;
  transform: scale(1.1);
  transform-origin: 50% 38%;
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(var(--ink-rgb), 0.44) 0%, transparent 24%,
    rgba(var(--ink-rgb), 0.28) 58%, rgba(var(--ink-rgb), 0.8) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: var(--site-shell-width);
  min-width: 0;
  margin-inline: auto;
}
.hero h1 {
  max-width: 18ch;
  margin: 0 0 var(--space-4);
  font-family: var(--font-editorial);
  font-size: var(--type-display);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero-content p { max-width: 48ch; margin: 0; color: var(--text); }

.eyebrow {
  font-family: var(--font-ui);
  margin: 0 0 var(--space-3);
  color: var(--sea);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Shared control material: the circular reading buttons establish the language.
   Route styles own only layout and icon sizing, never another button skin. */
.marine-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass-background);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--glass-shadow);
  color: var(--text);
  font: 500 0.875rem / 1.35 var(--font-ui);
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
  cursor: pointer;
  transition: border-color var(--motion-fast) ease, color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}
.marine-control:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--sea);
  color: var(--sea);
}
.marine-control:is(:active, [aria-pressed="true"], [aria-current="true"], [aria-checked="true"]) {
  border-color: var(--sea);
  box-shadow: inset 0 0 0 1px var(--sea);
}
.marine-control:focus-visible {
  outline: 2px solid var(--sea);
  outline-offset: 0.2rem;
}
.marine-control:disabled, .marine-control[aria-disabled="true"] { opacity: 0.4; cursor: default; }

.text-link::after {
  content: "→";
  color: var(--sea);
  transition: transform var(--motion-fast) ease;
}

.text-link:hover::after { transform: translateX(0.25rem); }

.mission {
  width: var(--site-shell-width);
  max-width: 62rem;
  margin-inline: auto;
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  text-align: center;
}

.mission h2 {
  max-width: 24ch;
  margin: 0 auto;
  font-size: var(--type-section);
  font-weight: 400;
  line-height: 1.22;
  text-wrap: balance;
}

.landing-themes {
  position: relative;
  isolation: isolate;
  width: var(--site-shell-width);
  margin: 0 auto clamp(4rem, 8vw, 7rem);
}
/* A diffuse water tint follows the closing About photo into the turtle scene.
   It falls back to the shared depth field before the next section starts. */
.landing-themes::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto -5vw calc(-1 * clamp(4rem, 8vw, 7rem)) 12%;
  height: clamp(22rem, 48vw, 44rem);
  background: radial-gradient(ellipse closest-side at 72% 52%,
    rgba(8, 81, 102, 0.32) 0%, rgba(8, 60, 81, 0.16) 46%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 25%, #000 58%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 25%, #000 58%, transparent 100%);
  pointer-events: none;
}
.landing-themes-head { margin-bottom: var(--space-5); }
.landing-themes-head h2 {
  margin: 0;
  font-family: var(--font-editorial);
  font-size: var(--type-section);
  font-weight: 400;
  line-height: 1.2;
}
.feature {
  width: 100%;
  margin: 0;
}

.feature-grid {
  position: relative;
  display: grid;
  overflow: hidden;
  isolation: isolate;
  /* The shared depth field continues through this section and into the footer. */
  background: transparent;
}

.feature-media,
.feature-copy {
  grid-area: 1 / 1;
}

.feature-media {
  position: absolute;
  inset: 0 0 auto;
  height: clamp(26rem, 65vw, 39rem);
  overflow: hidden;
  /* The image itself dissolves into the page; no opaque rectangle is needed
     behind its mobile-to-copy transition. */
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 52%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 52%, transparent 100%);
}

.feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
  transform: scale(1.15);
}

.feature-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(var(--ink-rgb), 0.08), transparent 38%);
  pointer-events: none;
}

.feature-copy {
  position: relative;
  z-index: 2;
  align-self: start;
  width: var(--site-shell-width);
  max-width: 48rem;
  margin-inline: auto;
  padding: clamp(22rem, 58vw, 33rem) 0 clamp(4rem, 8vw, 6rem);
  text-shadow: 0 2px 12px rgba(var(--ink-rgb), 0.82);
}

.feature-copy h2 {
  max-width: 16ch;
  margin: 0 0 var(--space-4);
  font-family: var(--font-editorial);
  font-size: var(--type-section);
  font-weight: 400;
  line-height: 1.12;
}

.feature-copy > p {
  max-width: 42rem;
  margin: 0 0 var(--space-4);
  color: var(--text);
}

.feature-caption {
  max-width: 30rem;
  margin: var(--space-5) 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.feature-kicker {
  font-family: var(--font-ui);
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--sea);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.feature-caption h3 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-editorial);
  font-size: var(--type-subhead);
  font-weight: 400;
  line-height: 1.1;
}

.feature-caption p {
  margin: 0;
  color: var(--muted);
}

/* Shared image ambience used by record cards outside the Landing. */
.record-card-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  isolation: isolate;
  contain: paint;
  background: var(--deep);
}

.record-card-media::before,
.record-card-media::after {
  content: "";
  display: var(--ambient-layer-display, block);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.record-card-media::before {
  inset: -1.25rem;
  background: var(--card-ambient-image, none) center / cover no-repeat;
  filter: blur(20px);
}

.record-card-media::after { background: rgb(0 0 0 / 50%); }

.record-card-media > img {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--space-4);
}

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-shell {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  width: var(--site-shell-width);
  margin: 0 auto;
  padding: var(--space-5) 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-shell a {
  text-decoration: none;
}

@media (min-width: 48rem) {
  :root {
    --site-shell-width: min(calc(100% - 4rem), var(--content));
  }
}

@media (min-width: 64rem) {
  .desktop-nav a {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 650;
  }
  .desktop-nav a:hover { color: white; }
  .hero {
    display: flex;
    align-items: center;
    min-height: clamp(43rem, 70svh, 56rem);
    padding: 8rem 0 6rem;
  }
  .hero-content { margin-left: max(2rem, calc((100% - var(--content)) / 2)); width: min(42ch, 42%); }
  .hero-media {
    inset: 0 0 0 30%; height: 100%; aspect-ratio: auto;
    /* Fade the actual photo plane to zero at its left boundary. A colored
       scrim alone cannot match the moving water underneath that boundary. */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 24%),
      linear-gradient(180deg, #000 0%, #000 64%, rgba(0, 0, 0, 0.72) 78%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 24%),
      linear-gradient(180deg, #000 0%, #000 64%, rgba(0, 0, 0, 0.72) 78%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
  }
  .hero-image { object-position: center 50%; transform: none; }
  .hero-media::after {
    background:
      linear-gradient(90deg, var(--depth-surface) 0%, rgba(var(--ink-rgb), 0.78) 18%, transparent 48%),
      linear-gradient(180deg, rgba(var(--ink-rgb), 0.36) 0%, transparent 24%, rgba(var(--ink-rgb), 0.45) 100%);
  }

  /* A wide photo still sits to the right of the copy, but a single radial
     alpha fade removes the left, top and bottom edges without moving heads. */
  .feature-grid { min-height: 40rem; }
  .feature-media {
    inset: 0 0 0 auto;
    width: 70%;
    height: 100%;
    -webkit-mask-image: radial-gradient(ellipse 80% 52% at 80% 50%, #000 35%, transparent 100%);
    mask-image: radial-gradient(ellipse 80% 52% at 80% 50%, #000 35%, transparent 100%);
  }
  .feature-media img { transform: none; object-position: 35% 50%; }
  .feature-media::after { background: none; }
  .feature-copy { width: min(36%, 28rem); margin-left: max(2rem, calc((100% - var(--content)) / 2)); margin-right: auto; padding-block: 4rem; align-self: center; }
}

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

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

/* M1.3 — Native feel */

/* Keep navigation above its backdrop without isolating the header from the page.
   Filter only the sibling backdrop, never the mobile menu's ancestors. */
.site-header::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: var(--navigation-background);
  -webkit-backdrop-filter: var(--navigation-filter);
  backdrop-filter: var(--navigation-filter);
  box-shadow: var(--navigation-shadow);
  opacity: 0;
  transition: opacity var(--motion-fast) ease;
}

.site-header.is-scrolled::before,
:is(.section-page, .gallery-page, .admin-page) .site-header::before,
.site-header:has(.mobile-nav[open])::before {
  opacity: 1;
}

.site-header.is-scrolled .nav-shell {
  border-bottom-color: transparent;
}

a,
summary {
  outline-offset: 0.3rem;
}

:where(a, summary):focus-visible {
  outline: 2px solid var(--sea);
  border-radius: 0.35rem;
}

.desktop-nav a,
.mobile-nav nav a,
.footer-shell a {
  transition:
    color var(--motion-fast) ease,
    background-color var(--motion-fast) ease;
}

.mobile-nav nav a:hover,
.mobile-nav nav a:focus-visible {
  background: rgba(var(--sea-rgb), 0.08);
}

.mobile-nav[open] nav a[aria-current] {
  font-weight: 700;
}

.js :is([data-reveal], [data-card]) {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity var(--motion-slow) ease,
    transform var(--motion-slow) var(--ease-natural),
    translate var(--motion-medium) var(--ease-natural),
    box-shadow var(--motion-medium) ease, border-color var(--motion-medium) ease;
}

.js :is([data-reveal], [data-card]).is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js :is([data-reveal], [data-card]) {
    opacity: 1;
    transform: none;
  }

  .site-header::before {
    transition: none;
  }
}

/* Four primary destinations fit the desktop shell from this width. */
@media (min-width: 64rem) {
  .mobile-nav {
    display: none;
  }

  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }
}
