/* ==========================================================================
   eclipsing music - v3 "Title Sequence", refined cut
   Three frames: title, identity/register, credits. No persistent chrome.
   The eclipse acts on the typography: terminator, occlusion, corona seam.
   Static, self-contained. See DESIGN_DIRECTION.md.
   ========================================================================== */

/* ---- Font (local only, no external requests) ---- */
@font-face {
  font-family: "General Sans";
  src: url("fonts/GeneralSans-Variable.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens ---- */
:root {
  --void: #0a0c10;
  --umbra: #12141a;
  --penumbra: #242833;
  --shadow: #05060a;
  --ink: #e8eaef;
  --ink-bright: #f2f4f8;
  --ink-2: #adb3bf;
  --ink-3: #7f8694;
  --corona-core: #e5f6fb;
  --corona-cyan: #6fd3e8;
  --corona-blue: #6a93e6;
  --corona-violet: #7f6bd0;

  --accent: var(--corona-cyan);
  --hairline: rgba(36, 40, 51, 0.75);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(20px, 6vw, 86px);

  /* z scale: content < occlusion < grain */
  --z-occlude: 2;
  --z-grain: 30;
}
@supports (color: oklch(50% 0 0)) {
  :root {
    --void: oklch(13% 0.008 255);
    --umbra: oklch(17% 0.009 255);
    --penumbra: oklch(26% 0.012 255);
    --shadow: oklch(9% 0.006 255);
    --ink: oklch(94% 0.006 250);
    --ink-bright: oklch(96% 0.005 250);
    --ink-2: oklch(75% 0.01 250);
    --ink-3: oklch(62% 0.01 250);
    --corona-core: oklch(96% 0.02 210);
    --corona-cyan: oklch(80% 0.095 210);
    --corona-blue: oklch(68% 0.10 255);
    --corona-violet: oklch(58% 0.11 290);
  }
}

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--void);
  color: var(--ink-2);
  font-family: "General Sans", system-ui, "Segoe UI", -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* grain: one fixed compositor layer, felt not seen */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

::selection { background: rgba(111, 211, 232, 0.28); color: #fff; }

h1, h2 { margin: 0; color: var(--ink); }
p { margin: 0; text-wrap: pretty; }
dl, dt, dd { margin: 0; }

a { color: inherit; -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: fixed;
  top: 0.75rem; left: 0.75rem;
  z-index: calc(var(--z-grain) + 1);
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--void);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-300%);
}
.skip:focus-visible { transform: none; }

/* ---- Buttons & links ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 530;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.18s var(--ease-out),
    color 0.18s var(--ease-out),
    transform 0.14s var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--ink); color: var(--void); }
.btn-primary:hover { background: #f4f7fa; }

.mail {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(111, 211, 232, 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  transition: color 0.18s var(--ease-out), text-decoration-color 0.18s var(--ease-out);
}
.mail:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ==========================================================================
   Frame 1: title card
   ========================================================================== */

.frame { position: relative; }

.title {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100svh;
  padding: 8vh var(--gutter) 7vh;
  overflow: clip;
}

.wordmark {
  align-self: center;
  position: relative;
  z-index: 1;
  color: var(--ink-bright);
  font-size: clamp(4.25rem, 17vw, 16rem);
  font-weight: 580;
  letter-spacing: -0.035em;
  line-height: 0.94;
  text-wrap: nowrap;
}

/* the CTA belongs to the credit block: one grouped stack, lower-left */
.title-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.35rem;
  max-width: 40ch;
}

.credit-line {
  font-size: clamp(0.9375rem, 1.2vw, 1.0625rem);
  color: var(--ink-2);
}

/* the resting terminator: lit left, corona seam, then a steep fall into
   penumbra so the wordmark reads as partially occluded. Pure gradient,
   masked to fade before frame edges; nothing can clip rectangularly. */
.terminator {
  position: absolute;
  inset: -2%;
  z-index: var(--z-occlude);
  pointer-events: none;
  background: linear-gradient(102deg,
    transparent 0%,
    transparent 43.6%,
    rgba(229, 246, 251, 0.4) 45.2%,
    rgba(111, 211, 232, 0.3) 45.9%,
    rgba(106, 147, 230, 0.17) 46.7%,
    rgba(127, 107, 208, 0.1) 47.5%,
    rgba(5, 6, 10, 0.24) 49.5%,
    rgba(5, 6, 10, 0.42) 55%,
    rgba(5, 6, 10, 0.54) 63%,
    rgba(5, 6, 10, 0.65) 78%,
    rgba(5, 6, 10, 0.78) 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 82%, transparent 100%);
  transform: translateX(0);
  transition: transform 1.6s var(--ease-out) 0.1s;
}
@starting-style {
  .terminator { transform: translateX(-9%); }
}

.title-foot {
  opacity: 1;
  transition: opacity 0.9s var(--ease-out) 0.7s;
}
@starting-style {
  .title-foot { opacity: 0; }
}

/* ==========================================================================
   Frame 2: identity and the services register
   ========================================================================== */

.identity {
  padding: clamp(4.5rem, 10vh, 7rem) var(--gutter) clamp(3rem, 7vh, 4.5rem);
  /* the title's shadow side continues faintly through the frame */
  background:
    linear-gradient(102deg, transparent 52%, rgba(5, 6, 10, 0.24) 80%, rgba(5, 6, 10, 0.34) 100%),
    linear-gradient(180deg, rgba(18, 20, 26, 0.35), transparent 30%);
}
.identity::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 12vh;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 6, 10, 0.45), transparent);
}

.identity-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 2rem clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

.statement-line {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 550;
  letter-spacing: -0.022em;
  line-height: 1.1;
}
.statement-line .occ { max-width: 16ch; text-wrap: balance; }

.identity-body { max-width: 54ch; }
.spec-line {
  margin-top: 1.1rem;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

/* services: the imprint register. Bounded hairlines, indexed entries. */
.services {
  margin-top: clamp(2.25rem, 5vh, 3.5rem);
  border-block: 1px solid var(--hairline);
}
.svc {
  display: grid;
  grid-template-columns: clamp(200px, 26vw, 320px) minmax(0, 1fr);
  gap: 0.75rem clamp(2.5rem, 6vw, 6rem);
  align-items: baseline;
  padding: 1.65rem 0;
}
.svc + .svc { border-top: 1px solid var(--hairline); }

.svc dt {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1;
  color: var(--ink);
}
.idx {
  flex: none;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}
.svc dd { max-width: 56ch; }

/* occlusion wrapper: the shadow that slides off display type */
.occ {
  position: relative;
  display: inline-block;
  overflow: clip;
  padding: 0.1em 0.14em;
  margin: -0.1em -0.14em;
}
.occ-shade {
  position: absolute;
  inset: -5%;
  pointer-events: none;
  background: linear-gradient(96deg,
    transparent 0%,
    transparent 16%,
    rgba(229, 246, 251, 0.3) 18%,
    rgba(111, 211, 232, 0.2) 19.4%,
    rgba(127, 107, 208, 0.08) 21.5%,
    rgba(5, 6, 10, 0.55) 28%,
    rgba(5, 6, 10, 0.9) 52%,
    rgba(5, 6, 10, 0.94) 100%);
  transform: translateX(114%);
}
html.rv-on :is(.svc, .statement-line, .credits-title) .occ-shade {
  transform: translateX(0);
}
html.rv-on :is(.svc.in, .statement-line.in, .credits-title.in) .occ-shade {
  transform: translateX(114%);
  transition: transform 0.9s var(--ease-out) 0.05s;
}

/* ==========================================================================
   Frame 3: credits register
   ========================================================================== */

.credits {
  padding: clamp(3.75rem, 8.5vh, 6rem) var(--gutter) clamp(4.25rem, 9.5vh, 7rem);
  overflow: clip;
  background:
    linear-gradient(102deg, transparent 62%, rgba(5, 6, 10, 0.2) 88%, rgba(5, 6, 10, 0.26) 100%);
}
.credits::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 12vh;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 6, 10, 0.45), transparent);
}

.credits-title {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 560;
  letter-spacing: -0.022em;
  line-height: 1.1;
}

.register {
  margin-top: clamp(1.6rem, 3.5vh, 2.4rem);
  max-width: 920px;
  border-block: 1px solid var(--hairline);
}
.reg-row {
  display: grid;
  grid-template-columns: clamp(180px, 24vw, 260px) minmax(0, 1fr);
  gap: 0.75rem 2rem;
  align-items: baseline;
  padding: 1.05rem 0;
}
.reg-row + .reg-row { border-top: 1px solid var(--hairline); }
.reg-primary { padding: 1.35rem 0 1.3rem; }

.reg-row dt {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-3);
}
.reg-row dd { color: var(--ink); overflow-wrap: anywhere; }

.mail-lg {
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  font-weight: 550;
  letter-spacing: -0.015em;
}

.notice {
  margin-top: 1.6rem;
  max-width: 62ch;
  font-size: 0.9375rem;
  color: var(--ink-3);
}

/* third contact: light returns at the bottom edge, fading well inside */
.horizon {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 28vh;
  pointer-events: none;
  background: radial-gradient(50% 66% at 50% 108%,
    rgba(111, 211, 232, 0.11) 0%,
    rgba(106, 147, 230, 0.05) 46%,
    transparent 74%);
}

/* ---- Footer: one quiet line, not a nav ---- */
.site-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  padding: 1.4rem var(--gutter);
  border-top: 1px solid rgba(36, 40, 51, 0.7);
  font-size: 0.8125rem;
  color: var(--ink-3);
}
.foot-link {
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.18s var(--ease-out);
}
.foot-link:hover { color: var(--ink); }

/* ---- Reveals (JS opt-in; everything visible without it) ----
   Display type reveals via the occlusion shade; prose rises quietly. */
html.rv-on .rv:not(.svc):not(.statement-line):not(.credits-title) {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.6s var(--ease-out),
    transform 0.6s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}
html.rv-on .rv.in:not(.svc):not(.statement-line):not(.credits-title) {
  opacity: 1;
  transform: none;
}

html.rv-on .svc dd {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.55s var(--ease-out) 0.3s, transform 0.55s var(--ease-out) 0.3s;
}
html.rv-on .svc.in dd { opacity: 1; transform: none; }

/* ---- Responsive ---- */
@media (max-width: 880px) {
  .title { padding: 6vh 24px 6vh; }
  .wordmark { font-size: clamp(3.4rem, 17vw, 6rem); }

  .identity { padding: 3.25rem 24px 2.75rem; }
  .identity-head { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }

  .svc { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; padding: 1.35rem 0; }
  .svc dd { max-width: none; }

  .credits { padding: 3.25rem 24px 4.5rem; }
  .reg-row { grid-template-columns: minmax(0, 1fr); gap: 0.3rem; padding: 0.95rem 0; }
  .reg-primary { padding: 1.15rem 0; }

  .site-foot { justify-content: flex-start; padding: 1.25rem 24px; }
}

/* ---- Reduced motion: terminator rests, shades gone, everything lit ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
