:root {
  color-scheme: dark;
  --ink: #e6eef8;
  --muted: #9cb4c8;
  --paper-deep: #020811;
  --surface: rgba(8, 22, 33, 0.84);
  --line: rgba(157, 196, 222, 0.14);
  --teal: #52d6cd;
  --moon: #f3e9c8;
  --amber: #f7b45e;
  --rose: #d77ca4;
  --signal: #8fe0d6;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }
html {
  min-width: 320px;
  scroll-behavior: smooth;
  background:
    radial-gradient(circle at top, rgba(39, 80, 131, 0.38), transparent 46%),
    linear-gradient(180deg, #10283b 0%, #07131d 42%, #02070e 100%);
}
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 24% 16%, rgba(119, 183, 255, 0.1), transparent 18%),
    radial-gradient(circle at 78% 4%, rgba(82, 214, 205, 0.08), transparent 18%);
}
a { color: inherit; }
button { font: inherit; }

.skip-link {
  position: fixed;
  z-index: 50;
  top: 12px;
  left: 12px;
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--paper-deep);
  background: var(--moon);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.site-header,
main,
.site-footer {
  width: min(1260px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 92px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 5px);
  gap: 4px;
  width: 24px;
  height: 24px;
  padding: 5px;
  border: 2px solid var(--teal);
  border-radius: 8px;
  transform: rotate(-8deg);
}

.brand-mark i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--amber);
}

.site-nav {
  display: inline-flex;
  gap: 18px;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.hero {
  padding: clamp(56px, 9vw, 110px) 0 48px;
}

.hero h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: clamp(3.7rem, 11vw, 7.8rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.lede {
  max-width: 720px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.65vw, 1.2rem);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.primary-link,
.ghost-link,
.profile-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.primary-link {
  color: #04131b;
  background: linear-gradient(135deg, var(--moon), #f8c98a);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.24);
}

.ghost-link,
.profile-button {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(9, 22, 34, 0.56);
}

.primary-link:hover,
.ghost-link:hover,
.profile-button:hover {
  transform: translateY(-2px);
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 36px 0 0;
}

.status-strip div {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(6, 16, 24, 0.5);
  backdrop-filter: blur(10px);
}

.status-strip dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-strip dd {
  margin: 8px 0 0;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  font-weight: 700;
}

.experience-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(320px, 0.76fr);
  gap: 28px;
  align-items: start;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.section-heading p {
  margin: 0;
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-heading h2,
.panel-title-row h2,
.note-card h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  letter-spacing: -0.03em;
}

.section-heading h2 {
  max-width: 760px;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.harbor-frame,
.dock-panel,
.note-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.harbor-frame {
  position: relative;
  min-height: 740px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(17, 40, 59, 0.92) 0%, rgba(8, 20, 30, 0.96) 40%, rgba(4, 8, 15, 0.98) 100%);
}

/* Storm watch treatment: driven by the JS data attribute on the frame. */
.harbor-frame[data-weather="storm"] {
  background:
    linear-gradient(180deg, rgba(10, 24, 38, 0.96) 0%, rgba(5, 13, 21, 0.97) 42%, rgba(1, 4, 9, 0.99) 100%);
}

.harbor-frame[data-weather="storm"] .sky-glow {
  background:
    radial-gradient(circle at 65% 8%, rgba(243, 233, 200, 0.08), transparent 20%),
    radial-gradient(circle at 30% 34%, rgba(74, 104, 134, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(12, 27, 43, 0.85), rgba(5, 12, 20, 0));
}

.harbor-frame[data-weather="storm"] .moon-wrap {
  filter: brightness(0.68) saturate(0.62);
}

/* The sweep animation owns opacity, so dim the beam with a filter instead —
   an opacity override here would be dead CSS while the animation runs. */
.harbor-frame[data-weather="storm"] .beam {
  filter: brightness(0.68);
}

.harbor-frame[data-weather="storm"] .water-back,
.harbor-frame[data-weather="storm"] .water-front {
  filter: brightness(0.84) saturate(0.8);
}

/* Slanted driving rain: vertical line sheet masked into short dashes that fall.
   The whole sheet translates 198px — exactly three mask periods, so the loop is
   seamless at the same ~92px/s speed the old mask-position version had, but
   transform animation composites without repainting the layer every frame.
   The tall inset leaves headroom for the 198px travel in both directions. */
.harbor-frame[data-weather="storm"]::before {
  content: "";
  position: absolute;
  inset: -240px -14%;
  background-image: repeating-linear-gradient(90deg, transparent 0 24px, rgba(178, 205, 228, 0.09) 24px 25px);
  -webkit-mask-image: repeating-linear-gradient(180deg, transparent 0 40px, #000 40px 66px);
  mask-image: repeating-linear-gradient(180deg, transparent 0 40px, #000 40px 66px);
  transform: rotate(9deg);
  animation: rain-fall 2.15s linear infinite;
  pointer-events: none;
}

/* Squall vignette pressing in from the edges. */
.harbor-frame[data-weather="storm"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 6%, transparent 44%, rgba(1, 4, 8, 0.42) 100%);
  pointer-events: none;
}

.sky-glow {
  position: absolute;
  inset: -14% -18% auto -18%;
  height: 48%;
  background:
    radial-gradient(circle at 65% 8%, rgba(243, 233, 200, 0.2), transparent 18%),
    radial-gradient(circle at 14% 18%, rgba(82, 214, 205, 0.08), transparent 20%),
    linear-gradient(180deg, rgba(19, 45, 67, 0.7), rgba(9, 21, 31, 0));
}

.moon-wrap {
  position: absolute;
  top: 86px;
  right: 84px;
  width: 136px;
  height: 136px;
}

.moon,
.moon-halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.moon {
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.72), transparent 14%),
    radial-gradient(circle at 64% 32%, rgba(255, 255, 255, 0.12), transparent 18%),
    radial-gradient(circle at 46% 66%, rgba(178, 153, 115, 0.12), transparent 20%),
    var(--moon);
  box-shadow: 0 0 36px rgba(243, 233, 200, 0.22);
}

/* Phase shadow: renderClock slides this dark disc aside by the lit share of
   the computed moon phase (--moon-cover), so the painted moon waxes and wanes
   with the announced label instead of always showing full. The default keeps
   it fully clear for the pre-JS paint. */
.moon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(3, 9, 15, 0.88);
  transform: translateX(var(--moon-cover, -120%));
}

.moon-halo {
  inset: -24px;
  background: radial-gradient(circle, rgba(243, 233, 200, 0.14), transparent 62%);
}

.starfield i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(242, 248, 255, 0.9);
  box-shadow: 0 0 8px rgba(242, 248, 255, 0.55);
  animation: twinkle 4.2s ease-in-out infinite;
}

.starfield i:nth-child(1) { top: 94px; left: 14%; animation-delay: 0s; }
.starfield i:nth-child(2) { top: 146px; left: 28%; animation-delay: 0.8s; }
.starfield i:nth-child(3) { top: 88px; left: 42%; animation-delay: 1.6s; }
.starfield i:nth-child(4) { top: 168px; left: 57%; animation-delay: 2.1s; }
.starfield i:nth-child(5) { top: 126px; left: 71%; animation-delay: 1.2s; }
.starfield i:nth-child(6) { top: 202px; left: 82%; animation-delay: 0.4s; }
.starfield i:nth-child(7) { top: 228px; left: 18%; animation-delay: 2.4s; }
.starfield i:nth-child(8) { top: 72px; left: 63%; animation-delay: 1.4s; }
.starfield i:nth-child(9) { top: 116px; left: 8%; animation-delay: 3s; }
.starfield i:nth-child(10) { top: 214px; left: 47%; animation-delay: 2.8s; }

.starfield .meteor {
  position: absolute;
  top: 108px;
  left: 24%;
  width: 84px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(242, 248, 255, 0.95), rgba(242, 248, 255, 0));
  box-shadow: 0 0 12px rgba(242, 248, 255, 0.6);
  opacity: 0;
  transform: rotate(-14deg) translateX(0);
  animation: meteor-streak 11s ease-in 4s infinite;
  pointer-events: none;
}

.lighthouse {
  position: absolute;
  top: 182px;
  left: 9%;
  width: 140px;
  height: 280px;
}

.tower {
  position: absolute;
  left: 32px;
  bottom: 0;
  width: 40px;
  height: 220px;
  background: linear-gradient(180deg, rgba(203, 222, 237, 0.65), rgba(111, 140, 160, 0.18));
  clip-path: polygon(28% 0, 72% 0, 100% 100%, 0 100%);
  border: 1px solid rgba(242, 248, 255, 0.2);
  box-shadow: 0 0 28px rgba(145, 196, 226, 0.1);
}

.lamp {
  position: absolute;
  left: 20px;
  top: 22px;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 233, 200, 0.95), rgba(243, 233, 200, 0.06) 72%, transparent 72%);
}

.beam {
  position: absolute;
  left: 58px;
  top: 40px;
  width: 360px;
  height: 180px;
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(243, 233, 200, 0.18), rgba(243, 233, 200, 0));
  clip-path: polygon(0 45%, 100% 0, 100% 100%);
  animation: sweep 14s ease-in-out infinite;
}

.shoreline {
  position: absolute;
  inset: auto 0 240px;
  height: 210px;
  background:
    radial-gradient(circle at 12% 58%, rgba(29, 57, 76, 0.95), transparent 16%),
    radial-gradient(circle at 26% 36%, rgba(17, 35, 49, 0.96), transparent 18%),
    radial-gradient(circle at 54% 48%, rgba(13, 28, 39, 0.96), transparent 24%),
    radial-gradient(circle at 76% 42%, rgba(23, 46, 62, 0.96), transparent 22%),
    linear-gradient(180deg, transparent, rgba(3, 7, 12, 0.9));
}

.shoreline span {
  position: absolute;
  bottom: 0;
  width: 2px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, rgba(83, 122, 147, 0.22), rgba(83, 122, 147, 0.75));
}

.shoreline span:nth-child(1) { left: 11%; height: 150px; }
.shoreline span:nth-child(2) { left: 15%; height: 132px; }
.shoreline span:nth-child(3) { left: 69%; height: 176px; }
.shoreline span:nth-child(4) { left: 74%; height: 140px; }

.water {
  position: absolute;
  inset-inline: -14%;
  border-radius: 100% 100% 0 0;
}

.water-back {
  bottom: 90px;
  height: 38%;
  background:
    radial-gradient(circle at 50% 0, rgba(123, 183, 255, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(16, 54, 79, 0.62), rgba(6, 17, 25, 0.18));
  transform: rotate(-1.8deg);
}

.water-front {
  bottom: -36px;
  height: 44%;
  background:
    radial-gradient(circle at 18% 12%, rgba(123, 183, 255, 0.12), transparent 16%),
    radial-gradient(circle at 76% 6%, rgba(82, 214, 205, 0.1), transparent 16%),
    linear-gradient(180deg, rgba(13, 44, 63, 0.72), rgba(3, 9, 15, 0.98));
}

/* Soft moon reflection shimmering on both water layers. */
.water::after {
  content: "";
  position: absolute;
  top: 4%;
  right: 16%;
  width: 110px;
  height: 64%;
  border-radius: 999px;
  background: repeating-linear-gradient(180deg, rgba(243, 233, 200, 0.13) 0 3px, transparent 3px 16px);
  filter: blur(1px);
  opacity: 0.28;
  animation: moon-shimmer 6s ease-in-out infinite;
  pointer-events: none;
}

.water-front::after {
  top: 2%;
  right: 18%;
  opacity: 0.22;
  animation-delay: -2.2s;
}

.ship-layer {
  position: absolute;
  inset: 0;
}

/* Ship centres ride --x/--y custom properties written by JS; the horizontal
   clamp keeps wide hulls fully inside the frame at narrow widths instead of
   clipping the outermost ships' bows and sterns. */
.ship-node {
  position: absolute;
  --ship-half: 84px;
  width: 168px;
  left: clamp(var(--ship-half), var(--x), calc(100% - var(--ship-half)));
  top: var(--y);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transform: translate(-50%, -50%);
  cursor: pointer;
  animation: ship-bob 6.8s ease-in-out infinite;
  animation-delay: var(--bob-delay, 0s);
}

.ship-node::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 54px;
  width: calc(var(--wake-width, 72px) + 30px);
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle at left, rgba(255, 255, 255, 0.42), rgba(123, 183, 255, 0.1) 42%, transparent 76%);
  opacity: var(--wake-opacity, 0.55);
  filter: blur(2px);
  transform: translateX(calc(var(--wake-shift, 10px) * -1));
}

.ship-node[data-status="quiet"]::before { --wake-opacity: 0.32; }
.ship-node[data-status="steady"]::before { --wake-opacity: 0.46; }
.ship-node[data-status="busy"]::before { --wake-opacity: 0.72; }
.ship-node[data-status="pulse"]::before { --wake-opacity: 0.82; }

.ship-node[data-status="degraded"] {
  --signal: var(--amber);
}

.ship-node[data-status="degraded"]::before {
  --wake-opacity: 0.68;
  background: radial-gradient(circle at left, rgba(247, 180, 94, 0.5), rgba(247, 180, 94, 0.12) 46%, transparent 76%);
}

.ship-node[data-status="trouble"] {
  --signal: var(--rose);
}

.ship-node[data-status="trouble"]::before {
  --wake-opacity: 0.88;
  background: radial-gradient(circle at left, rgba(215, 124, 164, 0.55), rgba(215, 124, 164, 0.14) 46%, transparent 78%);
}

/* Heavier hulls churn their wakes; stagger reuses the bob delay. */
.ship-node[data-status="busy"]::before,
.ship-node[data-status="pulse"]::before,
.ship-node[data-status="degraded"]::before,
.ship-node[data-status="trouble"]::before {
  animation: wake-roll 3.4s ease-in-out infinite;
  animation-delay: var(--bob-delay, 0s);
}

.ship-node[aria-pressed="true"] .ship-body {
  border-color: rgba(247, 180, 94, 0.68);
  box-shadow: 0 0 0 1px rgba(247, 180, 94, 0.22), 0 22px 44px rgba(0, 0, 0, 0.28);
}

.ship-body {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 18px 16px 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px 22px 18px 18px;
  background:
    linear-gradient(180deg, rgba(18, 42, 58, 0.94), rgba(8, 18, 28, 0.96));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.ship-body::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: -8px;
  width: 54px;
  height: 18px;
  border-radius: 0 0 28px 28px;
  background: rgba(8, 18, 28, 0.92);
}

.ship-lights {
  display: flex;
  gap: 6px;
}

.ship-lights i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 10px var(--signal);
}

.ship-lights i:nth-child(2) { opacity: 0.75; }
.ship-lights i:nth-child(3) { opacity: 0.45; }

.ship-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ship-role,
.ship-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.ship-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.scene-caption {
  position: absolute;
  left: 22px;
  bottom: 18px;
  margin: 0;
  color: rgba(230, 238, 248, 0.76);
  font-size: 0.78rem;
}

.dock-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.panel-block {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(4, 12, 18, 0.44);
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--moon);
  background: rgba(243, 233, 200, 0.08);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.profile-buttons {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.profile-button {
  justify-content: flex-start;
  width: 100%;
  min-height: 52px;
  padding-inline: 16px;
  color: var(--ink);
}

.profile-button[aria-pressed="true"] {
  border-color: rgba(82, 214, 205, 0.36);
  background: rgba(82, 214, 205, 0.14);
  box-shadow: inset 0 0 0 1px rgba(82, 214, 205, 0.08);
}

.copy-link {
  margin-top: 12px;
}

.copy-status {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.copy-helper {
  position: fixed;
  top: 0;
  left: -9999px;
  opacity: 0;
}

.node-card {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.node-header {
  display: grid;
  gap: 6px;
}

.node-header h3,
.node-facts dt {
  margin: 0;
}

.node-header h3 {
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.node-header p,
.node-note,
.event-log li {
  margin: 0;
  color: var(--muted);
}

.node-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.node-facts div,
.event-log li {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(11, 24, 35, 0.72);
}

/* Entries that jump to a ship carry the card styling on the button itself. */
.event-log li.has-jump {
  padding: 0;
  background: none;
}

.event-jump {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  background: rgba(11, 24, 35, 0.72);
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.event-jump:hover {
  background: rgba(18, 37, 52, 0.85);
}

.event-jump:hover .event-text,
.event-jump:focus-visible .event-text {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.node-facts dt {
  color: rgba(230, 238, 248, 0.72);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.node-facts dd {
  margin: 8px 0 0;
  font-size: 1rem;
  font-weight: 700;
}

.node-note {
  line-height: 1.7;
}

.event-log {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.event-time {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--moon);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.note-card {
  padding: 24px;
}

.note-card p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.78;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 88px;
  padding: 30px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer nav {
  display: flex;
  gap: 22px;
}

/* Fragment targets (skip link, hero CTA) receive programmatic focus, so the
   stage shows the same visible ring when keyboard focus lands on it. */
a:focus-visible,
button:focus-visible,
.harbor-frame:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 4px;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes sweep {
  0%, 100% { transform: rotate(-14deg); opacity: 0.38; }
  50% { transform: rotate(12deg); opacity: 0.76; }
}

@keyframes ship-bob {
  0%, 100% { transform: translate(-50%, calc(-50% - 3px)); }
  50% { transform: translate(-50%, calc(-50% + 2px)); }
}

@keyframes wake-roll {
  0%, 100% {
    opacity: calc(var(--wake-opacity, 0.55) * 0.72);
    transform: translateX(calc(var(--wake-shift, 10px) * -1)) scaleX(1);
  }
  50% {
    opacity: var(--wake-opacity, 0.55);
    transform: translateX(calc(var(--wake-shift, 10px) * -0.55)) scaleX(1.07);
  }
}

@keyframes meteor-streak {
  0%, 91% { opacity: 0; transform: rotate(-14deg) translateX(0); }
  92.5% { opacity: 0.9; }
  97%, 100% { opacity: 0; transform: rotate(-14deg) translateX(300px); }
}

@keyframes moon-shimmer {
  0%, 100% { opacity: 0.18; transform: scaleY(0.92); }
  50% { opacity: 0.38; transform: scaleY(1.06); }
}

@keyframes rain-fall {
  to {
    transform: rotate(9deg) translateY(198px);
  }
}

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

  .dock-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dock-panel .panel-block:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 32px, 1260px);
  }

  .site-header {
    min-height: 74px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-top: 18px;
  }

  .hero {
    padding-top: 38px;
  }

  .status-strip,
  .notes-grid,
  .dock-panel {
    grid-template-columns: 1fr;
  }

  .harbor-frame {
    min-height: 620px;
  }

  .moon-wrap {
    top: 72px;
    right: 36px;
    width: 108px;
    height: 108px;
  }

  .lighthouse {
    left: 4%;
    transform: scale(0.85);
    transform-origin: bottom left;
  }
}

@media (max-width: 520px) {
  .hero h1 {
    font-size: clamp(3rem, 18vw, 4.4rem);
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-link,
  .ghost-link {
    width: 100%;
  }

  .harbor-frame {
    min-height: 560px;
  }

  .ship-node {
    --ship-half: 66px;
    width: 132px;
  }

  .ship-body {
    gap: 8px;
    padding: 14px 12px 14px 16px;
    border-radius: 20px 20px 16px 16px;
  }

  .ship-name {
    font-size: 0.92rem;
  }

  .ship-role,
  .ship-meta {
    font-size: 0.72rem;
  }

  .scene-caption {
    left: 16px;
    right: 16px;
    bottom: 12px;
  }

  .node-facts {
    grid-template-columns: 1fr;
  }

  .site-footer {
    display: grid;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Ambient harbor life is motion-only decoration; switch it off outright. */
  .ship-node,
  .ship-node[data-status]::before,
  .water::after {
    animation: none !important;
  }

  .starfield .meteor {
    display: none;
  }

  /* Rain frozen mid-fall reads as stuck motion; hide the sheet entirely. */
  .harbor-frame[data-weather="storm"]::before {
    display: none;
  }

  /* With sweep suppressed, the lamp rests mid-sweep instead of raw full power. */
  .beam {
    opacity: 0.55;
  }
}

@media (forced-colors: active) {
  .primary-link,
  .ghost-link,
  .profile-button,
  .panel-block,
  .harbor-frame,
  .note-card,
  .status-strip div,
  .ship-body,
  .node-facts div,
  .event-log li {
    border: 1px solid CanvasText;
  }

  /* Pressed state otherwise rides colour/shadow, which forced palettes erase. */
  .profile-button[aria-pressed="true"],
  .ship-node[aria-pressed="true"] .ship-body {
    border-color: Highlight;
  }
}
