/* 3d-home.css: hero, ticker and about polish for the index. Loaded after 3d.css, so it may refine its rules.
   Decoration only (pseudo-elements, borders, masks). No copy lives here. */

/* ------------------------------------------------------------------ hero */

/* the kicker gets the same lime rule as the section labels */
.hero .kicker { display: flex; align-items: center; gap: 12px; }
.hero .kicker::before { content: ""; width: 28px; height: 1px; background: var(--accent); flex: none; }

/* a thin lime cue at the foot of the hero: one short light slides down a hairline (the first thing the camera will pass) */
main > .hero::before {
  display: block;
  content: "";
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 18px;
  width: 1px;
  height: 58px;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    linear-gradient(to bottom, transparent 0, rgba(var(--accent-rgb), 0.95) 45%, transparent 100%) no-repeat 0 -100% / 100% 55%,
    linear-gradient(to bottom, transparent, rgba(var(--accent-rgb), 0.2));
  opacity: 0;
  transition: opacity 1.4s var(--ease) 1.8s;
  animation: hero-cue 3.2s var(--ease-io) infinite;
}
html.is-ready main > .hero::before { opacity: 1; }
@keyframes hero-cue { from { background-position: 0 -100%, 0 0; } 70%, to { background-position: 0 260%, 0 0; } }

/* landscape phone: the crystal beside the copy, as on a desktop, not above it (the name would sit below the fold) */
@media (max-width: 980px) and (max-height: 520px) and (orientation: landscape) {
  .hero { grid-template-columns: 1.15fr 0.85fr; align-items: end; min-height: 0; padding-top: 16px; padding-bottom: 28px; }
  .hero-stage { order: 0; min-height: 0; height: 100%; }
  .hero-copy { padding: 16px 0 0 20px; }
  .hero h1 { font-size: clamp(48px, 13vh, 84px); }
  .hero-sub { margin-top: 14px; font-size: 16px; }
  .hero-actions { margin-top: 18px; }
  .kicker { margin-bottom: 12px; }
}

/* the hero copy sits on a slightly deeper pool on phones, where the crystal is right above it */
@media (max-width: 980px) {
  main > .hero::before { display: none; }
  .hero::after { background: radial-gradient(90% 55% at 30% 78%, rgba(var(--bg-rgb), 0.72), transparent 74%); }
}

/* ------------------------------------------------------------------ ticker */

/* a near-opaque band: the crystal slides behind it on the first scroll, and the letters never sit on a bright node */
.ticker {
  background: linear-gradient(90deg, rgba(var(--bg-rgb), 0.9), rgba(12, 14, 12, 0.88) 50%, rgba(var(--bg-rgb), 0.9));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
  border-color: rgba(var(--ink-rgb), 0.09);
}
html[data-q="low"] .ticker { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(var(--bg-rgb), 0.94); }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }
.ticker-track span { display: inline-block; }
/* a small lime lozenge between the entries */
.ticker-track span::after {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: 4px; height: 4px;
  margin-left: 56px;
  background: var(--accent);
  opacity: 0.42;
  transform: rotate(45deg);
}
.ticker:hover .ticker-track { animation-play-state: paused; }

/* ------------------------------------------------------------------ about */

#about .about-layout { gap: 56px; }
.about-aside { position: relative; padding-left: 30px; }
/* a hairline that fades down the aside, the same line language as the bezel and the gates in the 3D scene */
.about-aside::before {
  content: "";
  position: absolute;
  left: 0; top: 0.3em; bottom: 0.3em;
  width: 1px;
  background: linear-gradient(to bottom, rgba(var(--accent-rgb), 0.7), rgba(var(--accent-rgb), 0));
}
@media (max-width: 980px) {
  #about .about-layout { gap: 28px; }
  .about-aside { padding-left: 0; padding-top: 22px; }
  .about-aside::before { left: 0; right: auto; top: 0; bottom: auto; width: 36px; height: 1px; background: var(--accent); }
}

/* ------------------------------------------------------------------ calm / reduced */

html[data-calm] main > .hero::before { animation: none; background-position: 0 40%, 0 0; }
@media (prefers-reduced-motion: reduce) {
  main > .hero::before { animation: none; background-position: 0 40%, 0 0; }
}
html.no-webgl main > .hero::before { display: none; }

/* ------------------------------------------------------------------ first paint

   Until chrome.intro() adds is-ready the page is a black curtain (3d.css). A small wordmark breathes on it so a slow machine
   shows that something is loading, instead of a blank screen. It leaves with the curtain. */

html.js-3d::before {
  content: "CSG";
  position: fixed; left: 0; right: 0; top: 50%;
  z-index: 401;
  margin-top: -6px;
  text-align: center; text-indent: 0.32em;
  font: 500 11px/1 var(--font-mono); letter-spacing: 0.32em;
  color: var(--accent);
  pointer-events: none;
  opacity: 0;
  animation: csg-hold 2.4s ease-in-out 0.4s infinite;
}
html.js-3d.is-ready::before, html.js-3d.reveal-off::before { animation: none; opacity: 0; transition: opacity 0.3s; }
@keyframes csg-hold { 0%, 100% { opacity: 0; } 35%, 65% { opacity: 0.85; } }
@media (prefers-reduced-motion: reduce) { html.js-3d:not(.is-ready)::before { animation: none; opacity: 0.8; } }
