:root {
  --navy: #f8fafc;
  --ocean-deep: #7dd3fc;
  --ocean-mid: #bae6fd;
  --lagoon: #5eead4;
  --sand-warm: #fef7ed;
  --sand-deep: #fde6c7;
  --shell-pink: #fff5f0;
  --coral-soft: #fed7aa;
  --foam: #ecfeff;
  --sea-glass: #ccfbf1;
  --line: rgba(255, 255, 255, 0.18);
  --text: rgba(255, 255, 255, 0.96);
  --muted: rgba(226, 232, 240, 0.82);
  --cta: #14b8a6;
  --cta-hover: #0d9488;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.35);
  --shadow-card: none;
  --header-h: 68px;
  --section-y: clamp(5rem, 14vw, 9.5rem);
  --section-x: clamp(1.25rem, 5vw, 2.5rem);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  /* Let fixed underwater layer show through (was opaque --page-wash on top of the sea) */
  background: transparent;
  line-height: 1.6;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Horizontal scroll: clip on flow roots, not overflow-x on body (keeps sticky header reliable) */
main,
.site-footer {
  overflow-x: clip;
  max-width: 100%;
}

.shell {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: var(--section-x);
  padding-right: var(--section-x);
  min-width: 0;
}

/* ——— Three.js underwater backdrop (see underwater-3d.mjs) ——— */
.underwater-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  transform: translateZ(0);
}

/* Shown until WebGL runs (or if module fails); hidden when .underwater-3d-ready */
.underwater-backdrop__fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(185deg, #051830 0%, #020c18 45%, #01060e 100%);
  transition: opacity 0.75s ease;
}

body.underwater-3d-ready .underwater-backdrop__fallback {
  opacity: 0;
}

body.underwater-webgl-fallback .underwater-backdrop__fallback {
  opacity: 1;
}

.underwater-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.55s ease;
}

body.underwater-3d-ready .underwater-canvas {
  opacity: 1;
}

body.underwater-webgl-fallback .underwater-canvas {
  display: none;
}

.underwater-backdrop__vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(
    ellipse 110% 95% at 50% 42%,
    transparent 32%,
    rgba(0, 8, 14, 0.45) 70%,
    rgba(0, 2, 6, 0.72) 100%
  );
  mix-blend-mode: multiply;
  pointer-events: none;
  opacity: 0.95;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: #fff;
  color: var(--navy);
  border-radius: 8px;
}

.skip-link:focus {
  left: 0.5rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(2, 18, 28, 0.45);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: var(--header-h);
  gap: 1rem;
}

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

.nav-desktop {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 1rem;
}

.nav-desktop a.nav-link {
  position: relative;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.92);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.nav-desktop a.nav-link:hover:not(.nav-link--active) {
  color: #fff;
  border-bottom-color: rgba(125, 211, 252, 0.55);
}

.nav-desktop a.nav-link--active {
  color: #fff;
  border-bottom-color: transparent;
}

.nav-desktop a.nav-link--active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cta), rgba(125, 211, 252, 0.95));
  transform-origin: left center;
  animation: nav-active-bar 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.35);
}

@keyframes nav-active-bar {
  from {
    transform: scaleX(0);
    opacity: 0.35;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-desktop a.nav-link--active::after {
    animation: none;
    transform: scaleX(1);
    opacity: 1;
  }
}

.nav-actions {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: rgba(0, 20, 30, 0.35);
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: #fff;
  border-radius: 1px;
}

.mobile-panel {
  display: none;
  padding: 1rem 0 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-panel.is-open {
  display: block;
}

.mobile-panel nav {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mobile-panel a.nav-link {
  font-weight: 600;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.95);
  padding: 0.35rem 0.5rem;
  margin-left: -0.5rem;
  border-radius: 8px;
  border-left: 3px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.mobile-panel a.nav-link:hover:not(.nav-link--active) {
  background: rgba(255, 255, 255, 0.06);
}

.mobile-panel a.nav-link--active {
  color: #fff;
  background: rgba(20, 184, 166, 0.12);
  border-left-color: var(--cta);
  animation: nav-active-mobile 0.38s ease-out;
}

@keyframes nav-active-mobile {
  from {
    border-left-color: transparent;
    background: rgba(20, 184, 166, 0);
  }
  to {
    border-left-color: var(--cta);
    background: rgba(20, 184, 166, 0.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-panel a.nav-link--active {
    animation: none;
  }
}

@media (min-width: 1240px) {
  .nav-desktop {
    display: flex;
  }

  .nav-actions {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }
}

main {
  position: relative;
  z-index: 1;
  background: transparent;
  min-height: 50vh;
  color: var(--text);
}

main > .hero,
main > section.section,
main > article.section {
  background: transparent;
}

main .hero .shell,
main section.section .shell,
main article.section .shell {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.hero {
  padding: var(--section-y) 0;
}

.hero__grid {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr minmax(260px, 340px);
  }
}

.section {
  padding: var(--section-y) 0;
}

/* No rules/lines between sections — spacing only (padding on .section) */
.section--border {
  border-top: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 2.85rem);
  margin: 0 0 1rem;
}

.lead {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 1rem;
  max-width: 65ch;
}

.muted {
  color: var(--muted);
}

.grid-2 {
  display: grid;
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  gap: 1.25rem;
}

.grid-4 {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (min-width: 900px) {
  .grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.hero__grid > *,
.grid-2 > *,
.grid-3 > *,
.grid-4 > * {
  min-width: 0;
}

.card {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  box-shadow: none;
}

.card--muted {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.14);
}

.checklist {
  margin: 0;
  padding-left: 1.2rem;
}

.checklist li {
  margin-bottom: 0.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
  background: var(--cta);
  color: #fff;
  border-color: var(--cta);
}

.btn--primary:hover {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.45);
}

.btn--ghost:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.95);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table-wrap th,
.table-wrap td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.form-row {
  margin-bottom: 1rem;
}

.form-row label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
}

.form-row input,
.form-row select {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  font: inherit;
  background: rgba(0, 12, 20, 0.35);
  color: #fff;
}

.form-row input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.calc-output {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid rgba(45, 212, 191, 0.35);
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.95);
}

.accordion details {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.75rem 0;
}

.accordion summary {
  cursor: pointer;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.site-footer {
  position: relative;
  z-index: 1;
  background: rgba(0, 8, 14, 0.72);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.88);
  padding: 3rem 0 0;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.site-footer a {
  color: var(--sea-glass);
  text-decoration: none;
}

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

.site-footer h3 {
  color: #fff;
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.site-footer .muted {
  color: rgba(255, 255, 255, 0.7);
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.4rem;
}

.footer-strip {
  margin-top: 2.5rem;
  padding: 1.25rem 0 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

.mobile-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  justify-content: center;
  padding: 0.75rem var(--section-x) calc(0.75rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(1, 8, 14, 0.92));
  pointer-events: none;
}

.mobile-cta .btn {
  pointer-events: auto;
  box-shadow: var(--shadow);
}

@media (min-width: 1240px) {
  .mobile-cta {
    display: none;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

main a:not(.btn),
main article.section a:not(.btn) {
  color: #7dd3fc;
}

main a:not(.btn):hover,
main article.section a:not(.btn):hover {
  color: #bae6fd;
}

::selection {
  background: rgba(45, 212, 191, 0.45);
  color: #042028;
}

img {
  max-width: 100%;
  height: auto;
}
