/* =========================================================
   NextRise Labs · brand tokens (from Identity v2)
   ========================================================= */
:root {
  --void: #0A0B0D;
  --graphite: #16181D;
  --electric: #2F6BFF;
  --ion: #9DB8FF;
  --bone: #EDEBE6;

  --text: var(--bone);
  --muted: rgba(237, 235, 230, .62);
  --dim: rgba(237, 235, 230, .36);
  --line: rgba(237, 235, 230, .07);

  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Crimson Text', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
  --gutter: clamp(16px, 4vw, 48px);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip; /* 'clip' (not 'hidden') keeps sticky sections working */
}
html.intro-active body { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; }
:focus-visible { outline: 2px solid var(--ion); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--electric); color: #fff; }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; }
.dim { color: var(--dim); }

/* =========================================================
   INTRO
   ========================================================= */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--void);
  transition: transform 1.15s var(--ease-io);
}
.intro::after { /* soft light leak at the bottom edge while it lifts */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--electric), var(--ion), var(--electric), transparent);
  box-shadow: 0 0 40px 6px rgba(47, 107, 255, .55);
  opacity: 0;
  transition: opacity .3s;
}
.intro.is-out { transform: translateY(-100%); }
.intro.is-out::after { opacity: 1; }
.no-intro .intro { display: none; }

.intro-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 25%, transparent 80%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 25%, transparent 80%);
  opacity: 0;
  transition: opacity 1.4s ease;
}
.intro.is-on .intro-grid { opacity: 1; }

.intro-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
}
.intro-mark {
  width: min(40vh, 64vw);
  height: auto;
  overflow: visible;
}

/* guide lines */
.guide {
  stroke: rgba(157, 184, 255, .32);
  stroke-width: 1;
  stroke-dasharray: 4 6;
  transform-box: fill-box;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 1.1s var(--ease-out) var(--d), opacity .8s ease;
}
.guide-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .2em;
  fill: var(--ion);
  opacity: 0;
  transition: opacity .8s ease .5s;
}
.intro.is-on .guide { transform: scaleX(1); }
.intro.is-on .guide-label { opacity: .55; }
.intro.is-word .guide, .intro.is-word .guide-label { opacity: .18; }

.halo, .glow { opacity: 0; transition: opacity 1.2s ease; }
.intro.is-lit .halo { opacity: 1; }
.intro.is-lit .glow { opacity: .85; }

.angle-line {
  stroke: var(--electric);
  stroke-width: 1.2;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  transition: stroke-dashoffset 1s var(--ease-out);
}
.angle-arc {
  fill: none;
  stroke: var(--electric);
  stroke-width: 1.2;
  stroke-dasharray: 32;
  stroke-dashoffset: 32;
  transition: stroke-dashoffset .7s var(--ease-out) .25s;
}
.angle-text {
  font-family: var(--mono);
  font-size: 13px;
  fill: var(--ion);
  opacity: 0;
  transition: opacity .6s ease .45s;
}
.intro.is-lit .angle-line, .intro.is-lit .angle-arc { stroke-dashoffset: 0; }
.intro.is-lit .angle-text { opacity: 1; }
.intro.is-word .angle { opacity: .35; transition: opacity 1s ease; }

/* wordmark */
.intro-word {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(10px, 3vh, 28px);
}
.intro-word .word {
  font-weight: 500;
  font-size: clamp(26px, 5.2vw, 58px);
  letter-spacing: .42em;
  margin-right: -.42em; /* balance the trailing letter-space */
  line-height: 1;
}
.intro-word .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(.5em);
  filter: blur(8px);
  transition: opacity .7s ease, transform .9s var(--ease-out), filter .9s var(--ease-out);
  transition-delay: calc(var(--i) * 55ms);
}
.intro.is-word .ch { opacity: 1; transform: none; filter: none; }
.intro-word .labs {
  font-family: var(--sans);
  font-size: clamp(9px, 1vw, 12px);
  letter-spacing: .9em;
  margin-right: -.9em;
  margin-top: 14px;
  color: var(--muted);
  opacity: 0;
  transition: opacity .8s ease .5s;
}
.intro.is-word .labs { opacity: 1; }
.intro-tag {
  margin: clamp(14px, 3vh, 26px) 0 0;
  font-size: clamp(18px, 2.1vw, 24px);
  color: var(--bone);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .9s ease, transform 1s var(--ease-out);
}
.intro-tag em { color: var(--ion); }
.intro.is-tag .intro-tag { opacity: 1; transform: none; }

.intro-meta {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  opacity: 0;
  transition: opacity 1s ease .3s;
}
.intro.is-on .intro-meta { opacity: 1; }
.intro-meta--tl { top: 24px; left: var(--gutter); }
.intro-meta--tr { top: 24px; right: var(--gutter); text-align: right; }
.intro-meta--bl { bottom: 26px; left: var(--gutter); }

.intro-skip {
  position: absolute;
  right: var(--gutter);
  bottom: 18px;
  padding: 11px 18px;
  font-size: 10px;
  color: var(--muted);
  background: rgba(22, 24, 29, .6);
  border: 1px solid rgba(237, 235, 230, .14);
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.intro-skip:hover { color: var(--text); border-color: rgba(157, 184, 255, .5); }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  --mx: 0px; --my: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 22px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 999px;
  transform: translate(var(--mx), var(--my));
  transition: transform .5s var(--ease-out), background-color .25s, color .25s, border-color .25s, box-shadow .3s;
  -webkit-tap-highlight-color: transparent;
}
.btn .arrow { transition: transform .4s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }
.btn:active { transform: translate(var(--mx), var(--my)) scale(.97); }

.btn--primary {
  min-height: 52px;
  padding: 0 28px;
  background: var(--electric);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(47, 107, 255, 0), 0 10px 40px -10px rgba(47, 107, 255, .7);
}
.btn--primary:hover { box-shadow: 0 0 0 6px rgba(47, 107, 255, .16), 0 14px 50px -10px rgba(47, 107, 255, .9); }
.btn--ghost {
  min-height: 52px;
  color: var(--text);
  border: 1px solid rgba(237, 235, 230, .18);
}
.btn--ghost:hover { border-color: rgba(157, 184, 255, .6); }
.btn--pill {
  font-size: 14px;
  color: var(--void);
  background: var(--bone);
}
.btn--pill:hover { background: #fff; }

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--gutter);
  padding-top: max(18px, env(safe-area-inset-top));
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .9s ease .5s, transform 1s var(--ease-out) .5s;
}
.hero-in .nav, .no-js .nav { opacity: 1; transform: none; }
.nav-logo img { height: 30px; width: auto; }
.nav-links {
  display: flex;
  gap: 4px;
  padding: 5px;
  font-size: 14px;
  color: var(--muted);
  background: rgba(22, 24, 29, .55);
  border: 1px solid rgba(237, 235, 230, .08);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
}
.nav-links a {
  padding: 8px 16px;
  border-radius: 999px;
  transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--text); background: rgba(237, 235, 230, .07); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  --mx: 70%; --my: 40%;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 110px var(--gutter) 96px;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 72% 42%, #000 15%, transparent 78%);
          mask-image: radial-gradient(ellipse 85% 75% at 72% 42%, #000 15%, transparent 78%);
}
.grid--lit {
  background-image:
    linear-gradient(rgba(47, 107, 255, .55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 107, 255, .55) 1px, transparent 1px);
  -webkit-mask-image: radial-gradient(260px circle at var(--mx) var(--my), rgba(0,0,0,.9), transparent 70%);
          mask-image: radial-gradient(260px circle at var(--mx) var(--my), rgba(0,0,0,.9), transparent 70%);
  opacity: 0;
  transition: opacity .6s ease;
}
.hero.has-pointer .grid--lit { opacity: 1; }
.hero-glow {
  position: absolute;
  right: -12vmax;
  top: -24vmax;
  width: 70vmax;
  height: 70vmax;
  background: radial-gradient(closest-side, rgba(47, 107, 255, .30), rgba(47, 107, 255, .08) 55%, transparent);
  opacity: 0;
  transition: opacity 2s ease .3s;
  animation: breathe 8s ease-in-out infinite;
}
.hero.is-in .hero-glow { opacity: 1; }
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08) translate(-2%, 2%); }
}

.hero-visual {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  height: min(78vh, 780px);
  perspective: 1200px;
}
.hero-visual::before { /* bloom at the top of the rising stroke */
  content: "";
  position: absolute;
  left: 50%;
  top: 34%;
  width: 70%;
  aspect-ratio: 1;
  transform: translate(-30%, -50%);
  background: radial-gradient(closest-side, rgba(47, 107, 255, .38), rgba(47, 107, 255, .1) 55%, transparent);
  opacity: 0;
  transition: opacity 2.4s ease 1.2s;
  pointer-events: none;
}
.hero.is-in .hero-visual::before { opacity: 1; }
#heroCanvas {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .2s linear;
  touch-action: pan-y;
  cursor: crosshair;
}
.hero-hint {
  position: absolute;
  left: 50%;
  bottom: 2%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}
.hero.is-in .hero-hint { opacity: 1; transition-delay: 2.6s; }
.hero .hero-hint.is-gone { opacity: 0; transition-delay: 0s; }

.hero-copy { grid-column: 1; grid-row: 1; position: relative; z-index: 2; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--muted);
}
.pulse {
  position: relative;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--electric);
  box-shadow: 0 0 12px var(--electric);
}
.pulse::after {
  content: "";
  position: absolute; inset: -5px;
  border-radius: 50%;
  border: 1px solid var(--electric);
  animation: ping 2.4s var(--ease-out) infinite;
}
@keyframes ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

.hero-title {
  margin: 22px 0 26px;
  font-size: clamp(2.3rem, 5.6vw, 5.8rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.035em;
}
.hero-title .line {
  display: block;
  overflow: hidden;
  padding: 0 .1em .1em 0;
  margin-bottom: -.1em;
}
.hero-title .line > span {
  display: inline-block;
  transform: translateY(110%) rotate(2deg);
  transform-origin: left bottom;
  transition: transform 1.2s var(--ease-out);
  transition-delay: calc(var(--i) * 95ms + 120ms);
}
.hero-title em {
  font-size: 1.1em;
  letter-spacing: -.01em;
  background: linear-gradient(100deg, var(--bone) 0%, var(--ion) 40%, var(--electric) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  padding-right: .08em;
}

.hero-sub, .hero-ctas, .hero-copy .eyebrow {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1s ease, transform 1.1s var(--ease-out);
}
.hero-copy .eyebrow { transition-delay: .05s; }
.hero-sub {
  max-width: 34ch;
  margin: 0 0 34px;
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.55;
  color: var(--muted);
  transition-delay: .55s;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; transition-delay: .7s; }

.hero.is-in .hero-title .line > span { transform: none; }
.hero.is-in .hero-sub,
.hero.is-in .hero-ctas,
.hero.is-in .hero-copy .eyebrow { opacity: 1; transform: none; }

.hero-foot {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: max(24px, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  font-size: 10px;
  color: var(--dim);
  opacity: 0;
  transition: opacity 1.2s ease 1s;
}
.hero.is-in .hero-foot { opacity: 1; }
#clock { color: var(--muted); font-variant-numeric: tabular-nums; }
.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
.cue-line {
  position: relative;
  width: 1px;
  height: 44px;
  overflow: hidden;
  background: rgba(237, 235, 230, .12);
}
.cue-line::after {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 1px; height: 40%;
  background: var(--ion);
  animation: cue 2.2s var(--ease-io) infinite;
}
@keyframes cue { from { transform: translateY(260%); } to { transform: translateY(-110%); } }

/* =========================================================
   PLACEHOLDER NEXT SECTION
   ========================================================= */
.next {
  padding: 22vh var(--gutter);
  border-top: 1px solid var(--line);
}
.next h2 {
  margin: 20px 0 0;
  max-width: 14ch;
  font-size: clamp(2rem, 5vw, 4.4rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.03em;
}
.next h2 em { color: var(--ion); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-logo img { height: 26px; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: start;
    padding-top: 76px;
    padding-bottom: 110px;
  }
  .hero-visual {
    grid-column: 1;
    grid-row: 1;
    height: 40vh;
    height: 40svh;
    margin: 0 calc(-1 * var(--gutter));
  }
  .hero-copy { grid-row: 2; margin-top: 18px; }
  .hero-title { margin-top: 16px; }
  .hero-hint { bottom: 0; }
  .hero-glow { right: -40vmax; top: -30vmax; width: 110vmax; height: 110vmax; }
  .grid { -webkit-mask-image: radial-gradient(ellipse 100% 60% at 50% 22%, #000 10%, transparent 75%); mask-image: radial-gradient(ellipse 100% 60% at 50% 22%, #000 10%, transparent 75%); }
  .hide-sm { display: none; }
}
@media (max-width: 420px) {
  .btn--primary, .btn--ghost { flex: 1 1 auto; justify-content: center; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .intro-mark { width: min(32vh, 50vw); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  html { scroll-behavior: auto; }
}
