:root {
  color-scheme: light;
  --black: #f6f3ec;
  --ink: #fbf9f4;
  --deep: #f1ede4;
  --panel: #e8e3d8;
  --paper: #101619;
  --mist: #45555b;
  --steel: #55666c;
  --rule: #d3ccbe;
  --cyan: #0f6f7c;
  --harbor: #bfdfe4;
  --font-display: "IBM Plex Sans Condensed", "Aptos Condensed", "Arial Narrow", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", monospace;
  --page-pad: clamp(18px, 3vw, 42px);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  overflow-x: clip;
  scroll-behavior: smooth;
  background: var(--black);
}

body {
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), var(--rule) calc(25% - 1px), var(--rule) 25%, transparent 25%, transparent calc(50% - 1px), var(--rule) calc(50% - 1px), var(--rule) 50%, transparent 50%, transparent calc(75% - 1px), var(--rule) calc(75% - 1px), var(--rule) 75%, transparent 75%),
    linear-gradient(180deg, var(--black), var(--ink) 42%, var(--black));
  color: var(--paper);
  font-family: var(--font-mono);
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    repeating-linear-gradient(0deg, transparent 0, transparent 31px, var(--rule) 32px),
    radial-gradient(circle at 78% 8%, var(--harbor), transparent 34%),
    linear-gradient(140deg, var(--black), var(--panel));
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: .32;
  background-image:
    linear-gradient(90deg, transparent 0 48%, var(--cyan) 49% 51%, transparent 52%),
    linear-gradient(0deg, transparent 0 48%, var(--steel) 49% 51%, transparent 52%);
  background-size: 160px 160px;
  mask-image: linear-gradient(180deg, #f6f3ec, transparent 72%);
}

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

a {
  color: inherit;
  text-decoration-color: var(--cyan);
  text-underline-offset: .22em;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  transform: translateY(-160%);
  padding: 10px 12px;
  border: 1px solid var(--cyan);
  background: var(--paper);
  color: var(--black);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

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

.masthead {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  min-height: 72px;
  border-bottom: 1px solid var(--rule);
  background: var(--black);
}

.identity,
.nav-contact,
.nav-links a {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 clamp(14px, 2.6vw, 28px);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: .14em;
  text-decoration: none;
  text-transform: uppercase;
}

.identity {
  gap: 12px;
  border-right: 1px solid var(--rule);
  font-weight: 500;
}

.identity-mark {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--cyan);
  color: var(--cyan);
}

.nav-links {
  display: flex;
  min-width: 0;
}

.nav-links a {
  border-right: 1px solid var(--rule);
}

.nav-links a:first-child {
  border-left: 1px solid var(--rule);
}

.nav-contact {
  justify-content: flex-end;
  border-left: 1px solid var(--rule);
  color: var(--cyan);
}

.hero,
.section,
.footer {
  width: min(100%, 1720px);
  margin-inline: auto;
}

.hero {
  position: relative;
  padding: clamp(24px, 4vw, 68px) var(--page-pad) clamp(38px, 8vw, 110px);
  border-bottom: 1px solid var(--rule);
}

.grid-plane::before,
.grid-plane::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}

.grid-plane::before {
  background:
    linear-gradient(90deg, var(--rule) 1px, transparent 1px),
    linear-gradient(0deg, var(--rule) 1px, transparent 1px);
  background-size: min(14vw, 190px) min(14vw, 190px);
  opacity: .58;
}

.grid-plane::after {
  top: auto;
  height: 28%;
  background: linear-gradient(180deg, transparent, var(--black));
}

.hero-kicker {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 120px 1fr auto;
  border: 1px solid var(--rule);
  color: var(--mist);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero-kicker span,
.hero-kicker a {
  min-width: 0;
  padding: 13px 16px;
  border-right: 1px solid var(--rule);
  text-decoration: none;
}

.hero-kicker a {
  border-right: 0;
  color: var(--cyan);
  text-align: right;
}

.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: clamp(22px, 4vw, 72px);
  align-items: start;
  padding-top: clamp(42px, 9vw, 124px);
}

.coordinate,
.eyebrow,
.cell-code,
.panel-caption,
.board-header,
.signal-ruler,
dt {
  color: var(--mist);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.coordinate {
  margin: 0 0 20px;
  color: var(--cyan);
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.045em;
  text-transform: uppercase;
}

h1 {
  max-width: 980px;
  margin-bottom: 24px;
  font-size: clamp(62px, 12.2vw, 190px);
}

.hero-lede,
.lead,
.record-copy p {
  max-width: 760px;
  color: var(--mist);
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 48px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -.035em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 18px;
  border: 1px solid var(--cyan);
  font-size: 11px;
  letter-spacing: .16em;
  text-decoration: none;
  text-transform: uppercase;
}

.button.primary {
  background: var(--cyan);
  color: var(--black);
}

.button.secondary {
  background: var(--black);
  color: var(--paper);
}

.hero-board {
  border: 1px solid var(--rule);
  background: var(--deep);
}

.board-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--cyan);
}

.coordinate-table {
  margin: 0;
}

.coordinate-table div,
.spec-ledger div,
.registry div {
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr);
  border-bottom: 1px solid var(--rule);
}

.coordinate-table div:last-child,
.spec-ledger div:last-child,
.registry div:last-child {
  border-bottom: 0;
}

dt,
dd {
  margin: 0;
  padding: 16px 14px;
}

dt {
  border-right: 1px solid var(--rule);
}

dd {
  color: var(--paper);
  overflow-wrap: anywhere;
}

.signal-ruler {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--rule);
}

.signal-ruler span {
  min-height: 56px;
  padding: 10px;
  border-right: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--panel), var(--deep));
}

.signal-ruler span:last-child {
  border-right: 0;
}

.tide-panel {
  position: relative;
  z-index: 1;
  margin-top: clamp(32px, 6vw, 86px);
  border: 1px solid var(--rule);
  background: var(--black);
  overflow: hidden;
}

.panel-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
}

.tide-panel img {
  width: 100%;
  min-height: 220px;
  object-fit: cover;
  background: var(--black);
}

.tide-scan {
  position: absolute;
  inset: 41px 0 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0 46%, var(--cyan) 50%, transparent 54%);
  opacity: .36;
  transform: translateX(-102%);
}

.section {
  position: relative;
  display: grid;
  grid-template-columns: clamp(72px, 12vw, 180px) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 60px);
  padding: clamp(54px, 8vw, 118px) var(--page-pad);
  border-bottom: 1px solid var(--rule);
}

.section-index {
  color: var(--harbor);
  font-family: var(--font-display);
  font-size: clamp(86px, 13vw, 210px);
  font-weight: 700;
  line-height: .78;
  letter-spacing: -.07em;
}

.section > :not(.section-index) {
  grid-column: 2;
}

.section-head h2,
.product-copy h2,
.record-copy h2 {
  max-width: 940px;
  margin-bottom: 0;
  overflow-wrap: break-word;
  hyphens: auto;
  font-size: clamp(46px, 7.4vw, 118px);
}

.product-copy h2 {
  font-size: clamp(40px, 5.2vw, 78px);
}

.eyebrow {
  margin-bottom: 16px;
  color: var(--cyan);
}

.maritime-table {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(30px, 5vw, 72px);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.maritime-table article {
  position: relative;
  min-height: 340px;
  padding: 18px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background:
    linear-gradient(180deg, transparent, var(--deep)),
    repeating-linear-gradient(90deg, transparent 0, transparent 28px, var(--rule) 29px);
}

.maritime-table h3 {
  margin: clamp(54px, 8vw, 108px) 0 18px;
  overflow-wrap: break-word;
  hyphens: auto;
  font-size: clamp(30px, 3vw, 44px);
}

.maritime-table p,
.engineering-lanes p,
.record-copy p {
  color: var(--mist);
  font-size: 15px;
}

.cell-code {
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--cyan);
}

.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: clamp(22px, 5vw, 76px);
  align-items: start;
}

.product-copy .button {
  margin-top: 22px;
}

.spec-ledger,
.registry {
  margin: 0;
  border: 1px solid var(--rule);
  background: var(--deep);
}

.engineering-lanes {
  display: grid;
  gap: 0;
  margin: clamp(30px, 5vw, 70px) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.engineering-lanes li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  min-height: 132px;
  border-bottom: 1px solid var(--rule);
}

.engineering-lanes li > span {
  padding: 18px;
  border-right: 1px solid var(--rule);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 54px;
  font-weight: 700;
  line-height: .86;
}

.engineering-lanes div {
  padding: 20px clamp(18px, 4vw, 54px);
}

.engineering-lanes h3 {
  margin-bottom: 8px;
  font-size: clamp(30px, 4vw, 64px);
}

.record {
  align-items: start;
}

.registry a {
  color: var(--cyan);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px var(--page-pad) 40px;
  color: var(--mist);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.footer a {
  color: var(--cyan);
  text-decoration: none;
}

html.js [data-rise] {
  opacity: 1;
  transform: translateY(26px);
  transition:
    transform 700ms ease;
}

html.js [data-rise].is-in {
  opacity: 1;
  transform: translateY(0);
}

html.js.reveals-complete [data-rise] {
  opacity: 1;
  transform: none;
  transition: none;
}

html.js .tide-panel.is-in .tide-scan {
  animation: tide-sweep 5200ms cubic-bezier(.2, .8, .2, 1) 500ms infinite;
}

@keyframes tide-sweep {
  0% { transform: translateX(-104%); }
  48% { transform: translateX(104%); }
  100% { transform: translateX(104%); }
}

@media (hover: hover) {
  .nav-links a:hover,
  .identity:hover,
  .nav-contact:hover,
  .footer a:hover {
    background: var(--harbor);
  }

  .button:hover {
    background: var(--paper);
    color: var(--black);
  }
}

@media (max-width: 980px) {
  .masthead {
    position: static;
    grid-template-columns: 1fr;
  }

  .identity,
  .nav-contact,
  .nav-links a {
    min-height: 52px;
    border-bottom: 1px solid var(--rule);
  }

  .identity,
  .nav-contact {
    justify-content: flex-start;
    border-left: 0;
    border-right: 0;
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-links a:first-child,
  .nav-links a {
    border-left: 0;
  }

  .hero-kicker,
  .hero-layout,
  .section,
  .product-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-layout > *,
  .hero-copy,
  .hero-board {
    min-width: 0;
    max-width: 100%;
  }

  .section > *,
  .product-grid > * {
    grid-column: 1;
    min-width: 0;
  }

  .section > :not(.section-index) {
    grid-column: 1;
  }

  .section-index {
    font-size: clamp(70px, 24vw, 138px);
  }

  .maritime-table {
    grid-template-columns: 1fr;
  }

  .maritime-table article {
    min-height: 260px;
  }
}

@media (max-width: 620px) {
  :root {
    --page-pad: 16px;
  }

  .nav-links {
    grid-template-columns: 1fr;
  }

  .tide-scan {
    display: none;
  }

  .identity,
  .nav-contact,
  .nav-links a {
    padding-inline: 16px;
  }

  .hero-kicker {
    display: block;
  }

  .hero-kicker span,
  .hero-kicker a {
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    text-align: left;
  }

  .hero-kicker a {
    border-bottom: 0;
  }

  h1 {
    font-size: clamp(50px, 16vw, 74px);
  }

  .hero-lede,
  .lead,
  .record-copy p {
    font-size: clamp(23px, 8vw, 36px);
  }

  .hero-actions,
  .footer,
  .panel-caption {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .coordinate-table div,
  .spec-ledger div,
  .registry div,
  .engineering-lanes li {
    grid-template-columns: 1fr;
  }

  dt,
  .engineering-lanes li > span {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .maritime-table h3,
  .engineering-lanes h3 {
    font-size: clamp(36px, 13vw, 54px);
  }

  .section,
  .section-head,
  .maritime-table,
  .engineering-lanes {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .maritime-table article,
  .engineering-lanes li,
  .engineering-lanes li > span,
  .engineering-lanes li > div {
    min-width: 0;
    max-width: 100%;
  }

  .maritime-table h3,
  .engineering-lanes h3 {
    overflow-wrap: anywhere;
    hyphens: auto;
    font-size: clamp(34px, 11vw, 46px);
  }
}

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

  html.js [data-rise] {
    opacity: 1;
    transform: none;
  }

  .tide-scan {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   Theme switch.

   The page is light by default — that is the chosen direction — and carries the
   original dark palette as an opt-in. Only the ten tokens change; every rule
   below reads them, so nothing else has to know which theme is running.
   --------------------------------------------------------------------------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --black: #070c0f;
  --ink: #0b1114;
  --deep: #0f1619;
  --panel: #121b1f;
  --paper: #eef2f2;
  --mist: #a8b6bb;
  --steel: #6d7f86;
  --rule: #212c31;
  --cyan: #7fc9d3;
  --harbor: #10454f;
}

.masthead {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
}

.theme-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 clamp(14px, 2.6vw, 28px);
  border: 0;
  border-left: 1px solid var(--rule);
  background: none;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
}

.theme-switch:hover {
  color: var(--cyan);
}

/* A half-filled disc, read as a moon phase: it rotates through the switch. */
.theme-phase {
  width: 12px;
  height: 12px;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  background: linear-gradient(90deg, var(--cyan) 0 50%, transparent 50%);
  transition: transform 620ms cubic-bezier(.2, .8, .2, 1);
}

:root[data-theme="dark"] .theme-phase {
  transform: rotate(180deg);
}

/* The tide chart ships in two inks; the switch swaps the file. */
.tide-panel img[data-art-dark] {
  display: none;
}

:root[data-theme="dark"] .tide-panel img[data-art-light] {
  display: none;
}

:root[data-theme="dark"] .tide-panel img[data-art-dark] {
  display: block;
}

/* The change itself: the new theme is drawn across the page like a tide line,
   left to right going dark, right to left coming back. */
::view-transition-old(root),
::view-transition-new(root) {
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  animation: theme-hold 620ms linear both;
}

::view-transition-new(root) {
  animation: theme-flood-right 620ms cubic-bezier(.2, .8, .2, 1) both;
}

:root:not([data-theme="dark"])::view-transition-new(root) {
  animation-name: theme-flood-left;
}

@keyframes theme-hold {
  from { opacity: 1; }
  to { opacity: 1; }
}

@keyframes theme-flood-right {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

@keyframes theme-flood-left {
  from { clip-path: inset(0 0 0 100%); }
  to { clip-path: inset(0 0 0 0); }
}

/* Browsers without view transitions still get a considered change rather than
   a jump: the palette itself is what animates. */
html.is-theming *,
html.is-theming *::before,
html.is-theming *::after {
  transition: background-color 420ms ease, border-color 420ms ease, color 420ms ease, fill 420ms ease;
}

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

  .theme-switch {
    justify-content: flex-start;
    min-height: 52px;
    border-left: 0;
    border-bottom: 1px solid var(--rule);
  }
}

@media (max-width: 620px) {
  .theme-switch {
    padding-inline: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 1ms;
  }

  .theme-phase,
  html.is-theming *,
  html.is-theming *::before,
  html.is-theming *::after {
    transition-duration: 1ms;
  }
}
