:root {
  --bg: #0b1224;
  --ink: #f4f6fb;
  --muted: rgba(244, 246, 251, 0.68);
  --line: rgba(244, 246, 251, 0.22);
  --accent: #8fa6ff;
  --sans: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 0 24px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  background-image: linear-gradient(rgba(7, 12, 25, 0.2), rgba(7, 12, 25, 0.38)), url("/assets/scene/pond-poster.webp");
  background-size: cover;
  background-position: center;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { font-weight: 300; margin: 0; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
::selection { background: var(--accent); color: #070c19; }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 200; padding: 10px 14px;
  background: var(--ink); color: var(--bg); border-radius: 999px; text-decoration: none;
  transform: translateY(-160%); transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: none; }
.noscript-note {
  position: fixed; left: 50%; bottom: max(32px, env(safe-area-inset-bottom)); z-index: 70;
  width: min(88vw, 42rem); transform: translateX(-50%); text-align: center;
  color: var(--ink); text-shadow: var(--shadow);
}

/* Wordmark */
.wordmark {
  font-family: var(--sans); font-weight: 300; letter-spacing: 0.03em; text-decoration: none;
  font-size: 1.35rem; line-height: 1; color: var(--ink); text-shadow: var(--shadow);
}
.wordmark span { font-family: var(--serif); font-style: italic; margin-left: 0.28em; color: var(--ink); }
.wordmark--large { font-size: clamp(2rem, 5vw, 3rem); }

/* Canvas */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
body.no-gl #gl { display: none; }

/* Loader */
.loader {
  position: fixed; inset: 0; z-index: 100; background: #070c19; color: var(--ink);
  display: grid; grid-template-rows: 1fr auto; align-items: end; justify-items: center;
  padding: 0 24px calc(28px + env(safe-area-inset-bottom)); text-align: center;
  transition: opacity 1.1s var(--ease), visibility 0s linear 1.2s; opacity: 1; visibility: visible;
}
.loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader__eyes { width: min(92vw, 720px); height: min(46vw, 330px); align-self: center; display: block; }
.loader__text { max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.loader__tagline { color: var(--muted); font-size: 1.05rem; max-width: 34em; margin: 0; }
.loader__progress { width: min(320px, 70vw); height: 1px; background: var(--line); overflow: hidden; }
.loader__progress span { display: block; height: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0); transition: transform 0.25s linear; }
.loader__meta { display: flex; gap: 14px; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1.4em; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em; padding: 0.7em 1.35em; border-radius: 999px;
  font-size: 0.98rem; font-weight: 400; letter-spacing: 0.01em; line-height: 1; border: 1px solid var(--ink);
  transition: background 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease), border-color 0.35s var(--ease);
}
.btn--fill { background: var(--ink); color: #0b1224; }
.btn--fill:hover { background: #fff; transform: translateY(-1px); }
.btn--ghost { color: var(--ink); border-color: var(--line); text-shadow: var(--shadow); }
.btn--ghost:hover { border-color: var(--ink); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn__arrow { transition: transform 0.35s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* Header */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 3vw, 44px); opacity: 0; transform: translateY(-8px); z-index: 60;
  transition: opacity 1s var(--ease) 0.2s, transform 1s var(--ease) 0.2s;
}
.header.is-visible { opacity: 1; transform: none; }
.nav { display: flex; gap: clamp(18px, 2.4vw, 34px); }
.nav__item, .footer__links :where(button, a) {
  font-family: var(--serif); font-size: 17px; font-weight: 400; letter-spacing: 0.01em;
  color: var(--ink); text-shadow: var(--shadow); position: relative; padding: 4px 0;
}
.nav__item::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease); }
.nav__item:hover::after, .nav__item.is-current::after { transform: scaleX(1); }
.menu-toggle { display: none; font-size: 0.98rem; text-shadow: var(--shadow); }

/* "← Home" — the way back out of an area. Only shown while in a section. */
.to-home { display: none; align-items: center; gap: 0.4em; font-size: 0.98rem; color: var(--ink); text-shadow: var(--shadow); transition: opacity 0.35s var(--ease); }
.to-home:hover { opacity: 0.75; }
body.in-section .to-home { display: inline-flex; }
body.in-section .nav { display: none; }
body.in-section .menu-toggle { display: none; }

/* Moon white-out overlay. Fades to white as the moon floods, covering the swap
   between home and an area, then fades back to reveal the new area. */
.flash { position: fixed; inset: 0; z-index: 80; background: #fff; opacity: 0; pointer-events: none; transition: opacity 0.56s var(--ease); }
.flash.is-on { opacity: 1; transition: opacity 0.47s var(--ease); }

/* Hero copy sits in the headline zone from the spec: x 0.33–0.67, y 0.12–0.44. */
.hero-copy {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 20; width: min(92vw, 640px);
  text-align: center; opacity: 0; transition: opacity 1.4s var(--ease); pointer-events: none;
}
.hero-copy.is-visible { opacity: 1; }
body.in-section .hero-copy, body.menu-open .hero-copy { opacity: 0; pointer-events: none; transition-duration: 0.35s; }
.hero-copy > *, .hero-copy .hero-actions { pointer-events: auto; }
.eyebrow { font-size: 0.8rem; letter-spacing: 0.14em; color: var(--muted); margin: 0 0 14px; text-shadow: var(--shadow); }
.hero-copy h1 { font-size: clamp(2.3rem, 5vw, 4.1rem); line-height: 1.02; letter-spacing: -0.015em; text-shadow: var(--shadow); }
.hero-copy h1 em { font-size: 1.06em; }
.hero-copy .lede { margin: 18px auto 22px; max-width: 30em; font-size: clamp(1rem, 1.35vw, 1.15rem); color: var(--muted); text-shadow: var(--shadow); }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-copy .lede, .hero-copy .eyebrow { color: rgba(244, 246, 251, 0.82); }

/* Footer */
.footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px clamp(20px, 3vw, 44px) calc(18px + env(safe-area-inset-bottom)); font-size: 0.82rem; color: var(--muted); text-shadow: var(--shadow);
  opacity: 0; transition: opacity 1s var(--ease) 0.4s;
}
.footer.is-visible { opacity: 1; }
.footer__links { display: flex; gap: 18px; }
.footer__left { display: flex; gap: 18px; align-items: center; }
.sound-toggle { font-size: 0.82rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.sound-toggle:hover { color: var(--ink); }
.sound-toggle .sound-bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 10px; }
.sound-toggle .sound-bars i { display: block; width: 2px; height: 4px; background: currentColor; }
.sound-toggle.is-on .sound-bars i { animation: bars 0.9s ease-in-out infinite alternate; }
.sound-toggle.is-on .sound-bars i:nth-child(2) { animation-delay: 0.2s; }
.sound-toggle.is-on .sound-bars i:nth-child(3) { animation-delay: 0.45s; }
@keyframes bars { from { height: 3px; } to { height: 10px; } }
.loader__alt { font-size: 0.85rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.loader__alt:hover { color: var(--ink); }
.loader__actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 6px; opacity: 0; transform: translateY(8px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.loader__actions.is-ready { opacity: 1; transform: none; }
.footer__links :where(button, a) { font-size: 0.8rem; color: var(--muted); text-decoration: none; }
.footer__links :where(button, a):hover { color: var(--ink); }

/* Panels */
.panels { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.panels.is-active { pointer-events: auto; }
/* Each section is a full, solid "area" (not a translucent modal). The moon
   white-out (#flash) covers the swap, so the panel itself shows/hides instantly. */
.panel {
  position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #0a1120;
  opacity: 0; visibility: hidden;
  padding: clamp(90px, 14vh, 140px) clamp(20px, 6vw, 96px) 80px;
}
.panel.is-open { opacity: 1; visibility: visible; }
.panel__inner { max-width: 1120px; margin: 0 auto; }
.panel__inner--narrow { max-width: 680px; }
.panel h2 { font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.02; letter-spacing: -0.015em; margin-bottom: 0.6em; outline: none; }
.panel h3 { font-size: 1.35rem; font-weight: 400; margin-bottom: 0.5em; }
.panel p { color: rgba(244, 246, 251, 0.86); max-width: 38em; }
.panel a { text-underline-offset: 0.16em; }
.panel .lede--panel { font-size: 1.1rem; margin-bottom: 2em; }
.cols { display: grid; gap: 40px; margin: 2em 0; }
.cols--3 { grid-template-columns: repeat(3, 1fr); }
.cols--4 { grid-template-columns: repeat(4, 1fr); }
.cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel__cta { margin-top: 1.5em; }
.product-group { margin-top: 2.2em; }
.product-group + .product-group { margin-top: 2.8em; }
.product-group__title { color: var(--muted); }
.product-group .products { margin: 0.75em 0 0; }
.product { display: flex; flex-direction: column; gap: 6px; padding: 24px 0; border-top: 1px solid var(--line); text-decoration: none; transition: border-color 0.4s var(--ease); }
.product:hover { border-color: var(--ink); }
.product__name { font-family: var(--serif); font-style: italic; font-size: 2rem; line-height: 1; }
.product__for { color: var(--muted); }
.product__open { margin-top: 8px; font-size: 0.9rem; }

/* Product "step through": the clicked tile grows from its place to fill the
   screen with a soft moon bloom — like stepping through a doorway into the
   product — then the product site opens. Built as a one-off portal element. */
.portal {
  position: fixed; inset: 0; z-index: 70; overflow: hidden; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(130% 130% at 50% 45%, rgba(30, 44, 82, 0.72), rgba(7, 12, 25, 0.98) 64%);
  transform-origin: 0 0;
  transform: translate3d(var(--portal-x), var(--portal-y), 0) scale(var(--portal-scale-x), var(--portal-scale-y));
  transition: transform 0.72s var(--ease);
  will-change: transform;
}
.portal.is-open { transform: none; }
.portal__bloom { position: absolute; inset: 0; opacity: 0; background: radial-gradient(58% 58% at 50% 44%, rgba(199, 214, 255, 0.55), transparent 70%); transition: opacity 0.72s var(--ease); }
.portal.is-open .portal__bloom { opacity: 1; }
.portal__name { position: relative; font-family: var(--serif); font-style: italic; font-size: clamp(2rem, 9vw, 7rem); color: var(--ink); text-shadow: var(--shadow); opacity: 0.9; transform: scale(0.9); transition: transform 0.72s var(--ease), opacity 0.72s var(--ease); }
.portal.is-open .portal__name { transform: scale(1.05); opacity: 1; }
.contact__email a { font-family: var(--serif); font-style: italic; font-size: clamp(1.6rem, 3.5vw, 2.6rem); text-decoration: none; border-bottom: 1px solid var(--line); }
.contact__email a:hover { border-color: var(--ink); }
.faq { margin: 0; }
.faq dt { font-weight: 400; font-size: 1.15rem; margin-top: 1.4em; }
.faq dd { margin: 0.35em 0 0; color: rgba(244, 246, 251, 0.82); max-width: 38em; }

/* Drill-down (Services overview -> a single service's zone) */
.panel__view { display: none; }
.panel__view.is-shown { display: block; }

/* Contact — the "behind the rock" hollow, in place on home (no white-out). The
   camera eases into the sheltered framing and this form floats in over the live
   scene: underlined fields, white text, no cards or boxes. Home typography. */
.confide-layer {
  position: fixed; inset: 0; z-index: 55; display: flex; align-items: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 1s var(--ease), visibility 0s linear 1s;
}
.confide-layer.is-open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 1.3s var(--ease) 0.35s; }
.confide { width: min(92vw, 600px); margin: 0 auto; padding: 0 clamp(20px, 6vw, 96px); }
.confide__close {
  position: absolute; top: max(22px, env(safe-area-inset-top)); right: clamp(20px, 3vw, 44px);
  min-height: 44px; display: inline-flex; align-items: center; gap: 0.5em; color: var(--muted);
}
.confide__close span { font-size: 1.5rem; line-height: 1; }
.confide__close:hover { color: var(--ink); }
.confide__h { font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1.02; letter-spacing: -0.015em; text-shadow: var(--shadow); margin: 0 0 0.5em; }
.confide__sub { color: rgba(244, 246, 251, 0.82); max-width: 40ch; margin: 0 0 2rem; text-shadow: var(--shadow); }
.cform { display: flex; flex-direction: column; gap: 1.5rem; max-width: 30em; }
.cfield { display: flex; flex-direction: column; gap: 0.4rem; }
.cfield label { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); text-shadow: var(--shadow); }
.cfield input, .cfield textarea {
  background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--ink);
  font-family: var(--sans); font-size: 1.1rem; padding: 0.5rem 0; outline: none; resize: none; width: 100%;
  transition: border-color 0.35s var(--ease);
}
.cfield input:focus, .cfield textarea:focus { border-color: var(--accent); }
.cfield input[aria-invalid="true"], .cfield textarea[aria-invalid="true"] { border-color: #ffb5b5; }
.cfield__error { min-height: 1.1em; color: #ffd0d0; font-size: 0.82rem; }
.cf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cform__send { align-self: flex-start; margin-top: 0.4rem; }
.cform.is-sent .cform__send { display: none; }
.cform__note { min-height: 1.4em; color: rgba(244, 246, 251, 0.82); font-size: 0.95rem; text-shadow: var(--shadow); margin: 0.4rem 0 0; }
.cform__note a { color: var(--accent); border-bottom: 1px solid var(--line); }

/* Legal pages (terms / privacy / disclaimer): a whisper-faint code rain drifts
   behind the text — subtle, on-palette, never fighting readability. */
.coderain { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; opacity: 0.15; pointer-events: none; display: none; }
.panel.is-open .coderain { display: block; }
.panel--legal .panel__inner { position: relative; z-index: 1; }
.panel--legal h3 { margin-top: 1.6em; }
.legal-updated { color: var(--muted); font-size: 0.85rem; margin-top: 2.4em; }
.legal-list { max-width: 38em; margin: 0 0 1.5em; padding-inline-start: 1.25em; color: rgba(244, 246, 251, 0.86); }
.legal-list li { margin-block: 0.45em; padding-inline-start: 0.3em; }

/* Section reveal: content assembles itself in a soft, sequenced rise (set per-child
   by app.js via --i). One motion mechanism for every area, home included. */
.panel__inner.reveal > * { animation: revealUp 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 62ms); }
@keyframes revealUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.drill { margin: 2em 0 1.6em; }
.drill__item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: clamp(16px, 3vw, 40px);
  width: 100%; text-align: left; padding: 26px 0; border-top: 1px solid var(--line); text-decoration: none;
  transition: border-color 0.4s var(--ease);
}
.drill__item:last-of-type { border-bottom: 1px solid var(--line); }
.drill__item:hover, .drill__item:focus-visible { border-color: var(--ink); outline: none; }
.drill__num { font-family: var(--serif); font-style: italic; font-size: 1.4rem; color: var(--muted); }
.drill__body { display: flex; flex-direction: column; gap: 6px; }
.drill__title { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 300; letter-spacing: -0.01em; }
.drill__desc { color: var(--muted); max-width: 40em; }
.drill__go { font-size: 0.95rem; color: var(--muted); white-space: nowrap; transition: color 0.35s var(--ease), transform 0.35s var(--ease); }
.drill__item:hover .drill__go, .drill__item:focus-visible .drill__go { color: var(--ink); transform: translateX(3px); }

.steps { color: var(--muted); font-size: 0.92rem; letter-spacing: 0.02em; margin: 0 0 2em; }
.steps span { color: var(--ink); }
.steps i { font-style: normal; margin: 0 0.45em; color: var(--line); }

.panel__back { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.6em; transition: color 0.35s var(--ease); }
.panel__back:hover { color: var(--ink); }

:where(a, button, input, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.cfield :where(input, textarea):focus-visible { outline-offset: 2px; }

.ticks { list-style: none; margin: 0 0 2em; padding: 0; max-width: 40em; }
.ticks li { position: relative; padding-left: 1.5em; margin-bottom: 0.7em; color: rgba(244, 246, 251, 0.86); }
.ticks li::before { content: "\2192"; position: absolute; left: 0; color: var(--accent); }

/* Small screens */
@media (max-width: 860px) {
  .cols--2, .cols--3, .cols--4 { grid-template-columns: 1fr; gap: 28px; }
  .menu-toggle { display: block; }
  .nav {
    position: fixed; inset: 0; z-index: -1; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
    background: rgba(7, 12, 25, 0.9); opacity: 0; visibility: hidden; transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s;
  }
  body.menu-open .nav { opacity: 1; visibility: visible; transition: opacity 0.4s var(--ease); }
  .nav__item { font-size: 1.8rem; font-family: var(--serif); font-style: italic; }
  .footer { flex-direction: column; align-items: flex-start; gap: 8px; }
  .panel__inner { transform: none; }
  .drill__item { grid-template-columns: auto 1fr; }
  .drill__go { grid-column: 2; margin-top: 4px; }
  .footer__links { gap: 8px 14px; flex-wrap: wrap; }
}
@media (pointer: coarse) {
  .nav__item, .footer__links :where(button, a), .sound-toggle, .loader__alt, .menu-toggle, .to-home, .panel__back {
    min-height: 44px; min-width: 44px; display: inline-flex; align-items: center;
  }
  .footer__links :where(button, a) { padding-inline: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .panel__inner.reveal > * { animation: none !important; }
}
