/* ============================================================
   Lunacomet - umbrella front door
   Quiet surface, decisive trajectory.
   ============================================================ */

/* ---- Reset ------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
:focus-visible {
  outline: 2px solid var(--ion-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- Tokens ----------------------------------------------- */
:root {
  /* Color - committed navy anchor (logo), star-atlas neutrals, one ion accent */
  --navy: #101a3d; /* brand anchor, exact logo match */
  --navy-deep: oklch(0.17 0.055 267);
  --ink: oklch(0.215 0.045 267); /* body + headings on light */
  --muted: oklch(0.445 0.035 267); /* secondary text - verified ≥4.5:1 */
  --line: oklch(0.885 0.014 267); /* hairlines */
  --surface: oklch(0.986 0.004 267); /* cool off-white body (NOT cream) */
  --surface-2: oklch(0.966 0.007 267); /* subtle raised panel */
  --on-navy: oklch(0.972 0.006 267); /* near-white on navy */
  --on-navy-soft: oklch(0.84 0.022 267);
  --ion: oklch(0.74 0.13 226); /* comet ion-cyan - rare accent */
  --ion-deep: oklch(0.58 0.13 233);

  /* Type */
  --display: "Bodoni Moda", "Hoefler Text", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Spacing rhythm */
  --gut: clamp(1.25rem, 5vw, 3rem);
  --section: clamp(5rem, 12vh, 9rem);
  --maxw: 1200px;
  --measure: 62ch;

  /* Motion */
  --ease-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);

  /* z-scale (semantic) */
  --z-sky: 0;
  --z-content: 1;
  --z-comet: 2;
  --z-masthead: 30;
}

/* ---- Base ------------------------------------------------- */
body {
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
  font-kerning: normal;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -4rem;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--navy);
  color: var(--on-navy);
  padding: 0.7rem 1.25rem;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: top 0.2s var(--ease-quint);
}
.skip-link:focus {
  top: 0;
}

strong {
  font-weight: 600;
  color: var(--ink);
}
em {
  font-style: italic;
}

/* ============================================================
   Celestial layer - an ink-on-paper star atlas
   ============================================================ */
.sky {
  position: fixed;
  inset: 0;
  z-index: var(--z-sky);
  pointer-events: none;
  overflow: hidden;
}
/* faint sky-depth wash where the comet originates */
.sky::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      58% 48% at 84% 6%,
      color-mix(in oklch, var(--navy) 9%, transparent),
      transparent 70%
    ),
    radial-gradient(
      50% 50% at 12% 96%,
      color-mix(in oklch, var(--navy) 5%, transparent),
      transparent 70%
    );
}
.sky__chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.sky__stars circle {
  fill: var(--navy);
  opacity: 0.16;
}
.sky__constellation line {
  stroke: var(--navy);
  stroke-width: 1;
  opacity: 0.07;
}
.sky__twinkle {
  position: absolute;
  inset: 0;
}
.sky__twinkle span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ion-deep);
  opacity: 0;
}

/* ============================================================
   Masthead
   ============================================================ */
.masthead {
  position: relative;
  z-index: var(--z-masthead);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.25rem, 3vw, 2rem) var(--gut);
  max-width: var(--maxw);
  margin-inline: auto;
}
.masthead__brand img {
  width: clamp(140px, 16vw, 178px);
  height: auto;
}
.masthead__contact {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition:
    color 0.25s,
    border-color 0.25s;
}
.masthead__contact:hover {
  color: var(--ink);
  border-color: var(--ink);
}
@media (max-width: 540px) {
  .masthead__contact {
    display: none;
  }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  z-index: var(--z-content);
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(2rem, 7vh, 5.5rem) var(--gut) clamp(4rem, 9vh, 7rem);
  min-height: clamp(600px, 90vh, 880px);
  display: flex;
  align-items: center;
}
.hero__inner {
  max-width: 36ch;
  position: relative;
  z-index: var(--z-content);
}

/* WebGL cosmic plate - fills the hero behind the content. Fades in only once
   the shader has taken over; until then the static comet (below) carries it. */
.hero-fx {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  z-index: var(--z-sky);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s var(--ease-quint);
}
.fx-on .hero-fx {
  opacity: 1;
}
.fx-on .comet {
  display: none;
}

/* The shader makes the hero a dark cosmic field - flip its text to light.
   (The masthead and the rest of the page keep the light surface.) */
.fx-on .hero__title {
  color: var(--on-navy);
}
.fx-on .hero__lede {
  color: color-mix(in oklch, var(--on-navy-soft) 94%, transparent);
}
.fx-on .hero__lede strong {
  color: var(--on-navy);
}
.fx-on .hero__cue {
  color: var(--on-navy);
}
.fx-on .hero__cue svg {
  color: var(--ion);
}
/* Left scrim: keep the text zone dark so the bright disk on the right never
   bleeds under the light headline. The disk side stays untouched. */
.fx-on .hero::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: 100vw;
  height: 100%;
  z-index: var(--z-sky);
  pointer-events: none;
  background: linear-gradient(
    100deg,
    rgba(5, 8, 20, 0.92) 0%,
    rgba(5, 8, 20, 0.62) 30%,
    rgba(5, 8, 20, 0) 54%
  );
}

.hero__title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.6rem, 7.4vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.022em;
  color: var(--navy);
  text-wrap: balance;
  margin-bottom: 1.6rem;
}

.hero__lede {
  font-size: clamp(1.05rem, 1.4vw, 1.22rem);
  line-height: 1.6;
  color: var(--muted);
  max-width: 46ch;
}

.hero__cue {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  /* Padding gives the primary CTA a >=44px touch target; the offset margins
     keep the text optically where the vertical rhythm places it. */
  margin-top: calc(clamp(2.25rem, 5vh, 3.5rem) - 0.7rem);
  margin-bottom: -0.7rem;
  padding-block: 0.7rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}
.hero__cue svg {
  color: var(--ion-deep);
  transition: transform 0.3s var(--ease-quint);
}
.hero__cue:hover svg {
  transform: translateY(4px);
}

/* ---- The comet ------------------------------------------- */
.comet {
  position: absolute;
  z-index: var(--z-comet);
  top: 50%;
  right: clamp(-3rem, -2vw, 0rem);
  width: clamp(360px, 46vw, 640px);
  height: auto;
  transform: translateY(-54%);
  pointer-events: none;
  filter: drop-shadow(0 18px 40px color-mix(in oklch, var(--navy) 16%, transparent));
}
.comet__group {
  transform-box: fill-box;
  transform-origin: 78% 75%;
}
.comet__spark {
  mix-blend-mode: screen;
}

@media (max-width: 860px) {
  .hero {
    min-height: 72vh;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: clamp(1.5rem, 5vh, 3rem);
  }
  .hero__inner {
    max-width: none;
  }
  .comet {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    width: min(78%, 420px);
    margin: clamp(2.5rem, 6vh, 4rem) auto 0;
    opacity: 0.92;
  }
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   Intro / about
   ============================================================ */
.intro {
  position: relative;
  z-index: var(--z-content);
  max-width: var(--maxw);
  margin-inline: auto;
  padding: var(--section) var(--gut);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.intro__statement {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.4vw, 2.85rem);
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}
.intro__statement em {
  color: var(--navy);
}
.intro__body {
  display: grid;
  gap: 1.1rem;
  max-width: var(--measure);
  padding-top: 0.5rem;
}
.intro__body p {
  color: var(--muted);
  font-size: 1.05rem;
  text-wrap: pretty;
}
@media (max-width: 760px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

/* ============================================================
   The two doors
   ============================================================ */
.paths {
  position: relative;
  z-index: var(--z-content);
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0 var(--gut) var(--section);
}
.paths__title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
  text-wrap: balance;
}
.paths__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1rem, 2.2vw, 1.75rem);
}
@media (max-width: 720px) {
  .paths__grid {
    grid-template-columns: 1fr;
  }
  .hero {
    min-height: 56vh;
  }
}

.door {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: clamp(300px, 38vw, 404px);
  padding: clamp(1.75rem, 3vw, 2.75rem);
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.5s var(--ease-expo),
    box-shadow 0.5s var(--ease-expo);
}
.door__motif {
  position: absolute;
  top: clamp(1.5rem, 3vw, 2.5rem);
  right: clamp(1.25rem, 3vw, 2.5rem);
  width: clamp(70px, 9vw, 104px);
  opacity: 0.85;
  transition:
    transform 0.6s var(--ease-expo),
    opacity 0.4s;
}
.door__role {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  letter-spacing: -0.015em;
  line-height: 1;
  margin-top: 0.25rem;
}
.door__line {
  margin-top: 1rem;
  max-width: 34ch;
  font-size: 1.04rem;
  line-height: 1.55;
  text-wrap: pretty;
}
.door__foot {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
.door__host {
  font-size: 0.88rem;
  font-weight: 500;
  font-feature-settings: "tnum";
  letter-spacing: -0.005em;
}
.door__go {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
}
.door__go svg {
  transition: transform 0.4s var(--ease-expo);
}
.door:hover,
.door:focus-visible {
  transform: translateY(-6px);
}
.door:hover .door__go svg,
.door:focus-visible .door__go svg {
  transform: translateX(6px);
}
.door:hover .door__motif,
.door:focus-visible .door__motif {
  transform: translate(4px, -4px) rotate(-4deg);
}

/* sweeping ion light on hover/focus */
.door::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    60% 70% at 110% -10%,
    color-mix(in oklch, var(--ion) 50%, transparent),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.6s var(--ease-expo);
}
.door:hover::after,
.door:focus-visible::after {
  opacity: 0.55;
}

/* Consulting - the night world */
.door--dark {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--on-navy);
  box-shadow:
    0 1px 0 color-mix(in oklch, var(--on-navy) 8%, transparent) inset,
    0 20px 50px -28px color-mix(in oklch, var(--navy) 80%, transparent);
}
.door--dark .door__role {
  color: var(--on-navy);
}
.door--dark .door__line {
  color: var(--on-navy-soft);
}
.door--dark .door__host {
  color: color-mix(in oklch, var(--on-navy-soft) 90%, transparent);
}
.door--dark .door__go {
  color: #fff;
}
.door--dark .door__go svg {
  color: var(--ion);
}
.door--dark:hover {
  box-shadow:
    0 1px 0 color-mix(in oklch, var(--on-navy) 12%, transparent) inset,
    0 30px 60px -26px color-mix(in oklch, var(--navy) 85%, transparent);
}

/* Agency - the daylight world */
.door--light {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}
.door--light .door__role {
  color: var(--navy);
}
.door--light .door__line {
  color: var(--muted);
}
.door--light .door__host {
  color: var(--muted);
}
.door--light .door__go {
  color: var(--navy);
}
.door--light .door__go svg {
  color: var(--ion-deep);
}
.door--light:hover {
  border-color: color-mix(in oklch, var(--navy) 35%, var(--line));
  box-shadow: 0 24px 50px -30px color-mix(in oklch, var(--navy) 50%, transparent);
}

/* ============================================================
   Colophon
   ============================================================ */
.colophon {
  position: relative;
  z-index: var(--z-content);
  border-top: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface) 70%, var(--surface-2));
}
.colophon__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(2.5rem, 5vw, 3.5rem) var(--gut);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.colophon__mark {
  display: inline-flex;
  opacity: 0.85;
  transition: opacity 0.25s;
}
.colophon__mark:hover {
  opacity: 1;
}
.colophon__mark img {
  width: clamp(110px, 12vw, 130px);
  height: auto;
}
.colophon__meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--muted);
}
.colophon__meta a {
  transition: color 0.2s;
}
.colophon__meta a:hover {
  color: var(--ink);
}

/* ============================================================
   Motion - enhances an already-visible default
   ============================================================ */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes comet-arrive {
  0% {
    opacity: 0;
    transform: translate(-44%, -40%) scaleX(1.55);
  }
  55% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) scaleX(1);
  }
}
@keyframes comet-bob {
  0%,
  100% {
    transform: translateY(-54%);
  }
  50% {
    transform: translateY(-50%);
  }
}
@keyframes halo-pulse {
  0%,
  100% {
    opacity: 0.75;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}
@keyframes twinkle {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 0.9;
  }
}

/* Hero load reveals - only once JS confirms it's safe */
.is-ready [data-rise] {
  animation: rise 0.75s var(--ease-quint) both;
  animation-delay: calc(var(--i, 0) * 95ms + 0.12s);
}
.hero__title {
  --i: 0;
}
.hero__lede {
  --i: 1;
}
.hero__cue {
  --i: 2;
}

/* Scroll reveals - content is ALWAYS visible by default; the entrance only
   plays as an animation when JS adds .is-visible. If JS or the observer never
   fires (headless render, frozen timers, no-JS), the section still shows. */
@keyframes reveal-rise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* fill: backwards (not both) so the finished entrance releases `transform`
   back to the element. With `both`, the filled final keyframe outranks the
   `.door:hover` / `:focus-visible` lift and the cards never move. The base
   state is already opacity:1 / no-transform, so releasing the fill is seamless. */
.is-ready [data-reveal].is-visible {
  animation: reveal-rise 0.8s var(--ease-quint) backwards;
}

/* Comet choreography - gated on JS + motion preference */
.is-ready .comet__group {
  animation: comet-arrive 1.15s var(--ease-expo) both;
}
.is-ready .comet__halo {
  transform-box: fill-box;
  transform-origin: center;
  animation: halo-pulse 4.8s ease-in-out 1.2s infinite;
}
@media (min-width: 861px) {
  .is-ready .comet {
    animation: comet-bob 9s ease-in-out 1.3s infinite;
  }
}
.comet__halo {
  transform-box: fill-box;
  transform-origin: center;
}

/* ---- Reduced motion: everything settles, nothing moves ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .is-ready [data-rise],
  .is-ready [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
  .comet {
    transform: translateY(-54%) !important;
  }
  @media (max-width: 860px) {
    .comet {
      transform: none !important;
    }
  }
}
