/* ============================================================================
   Cinematic editorial vocabulary for the public site.

   Layered ON TOP of the premium-shell aesthetic in base.html — does not
   replace anything. Used by index.html, about.html, research.html,
   models.html, products.html.

   Sections (in order):
     1. Reveal-on-scroll utility
     2. Section index (sticky vertical scroll markers)
     3. Acts: spacing, headers, numbered pillars
     4. Editorial typography (Fraunces pull quotes)
     5. Self-referential motifs (calibration bar, gap grid, dividers)
     6. Placeholder badge + concept cards
     7. Editorial footer
   ============================================================================ */


/* ── 1. Reveal-on-scroll ─────────────────────────────────────────────────── */

/* IntersectionObserver-driven. The hidden state is gated on the attribute
   itself, so if scroll-reveal.js never runs the content is still visible
   (we set in-view in the no-JS fallback below). Per-child stagger via
   --reveal-delay set by the caller. */
[data-reveal-on-scroll] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 900ms cubic-bezier(.2, .8, .2, 1),
    transform 900ms cubic-bezier(.2, .8, .2, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal-on-scroll].in-view {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal-on-scroll] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/* ── 2. Acts: spacing, header, numbered pillars ──────────────────────────── */

/* Each scroll act gets generous breathing room. Tighter on mobile so the
   page isn't a thousand-pixel scroll in the small viewport. */
.act-section {
  position: relative;
  padding-block: clamp(5.5rem, 12vw, 11rem);
}

/* Eyebrow with a leading dash. Used as "ACT 01" / "ACT II" caption. */
.act-header {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--neural);
}
.act-header::before {
  content: "";
  display: inline-block;
  width: 2.4rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neural));
  opacity: 0.85;
}

/* Numbered pillar block (used for the four metacognition pillars on home,
   the three principles on about). */
.pillar {
  position: relative;
  padding: 1.4rem 0;
}
.pillar-index {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.36em;
  color: rgba(140, 148, 167, 0.65);
  display: inline-block;
}
.pillar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--mist);
  margin-top: 0.55rem;
}
.pillar-body {
  color: rgba(214, 221, 230, 0.72);
  font-size: 1.02rem;
  line-height: 1.72;
  margin-top: 1rem;
  max-width: 38rem;
}


/* ── 4. Editorial typography ─────────────────────────────────────────────── */

/* The big editorial moment in each act. Fraunces italic — used sparingly,
   as one statement per act, to set the tone the way Rockstar's marketing
   uses giant editorial type. The optical-size axis (variation-settings)
   gives Fraunces its expressive curves at large sizes. */
.editorial-h2 {
  font-family: 'Fraunces', 'Spectral', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: rgba(243, 245, 248, 0.96);
  text-wrap: balance;
  font-variation-settings: "opsz" 144;
  font-feature-settings: "kern", "liga", "ss02";
}
.editorial-h2 strong {
  font-style: normal;
  font-weight: 400;
  color: #fff;
}

/* A smaller editorial line for secondary moments. */
.editorial-line {
  font-family: 'Fraunces', 'Spectral', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: rgba(243, 245, 248, 0.82);
  font-variation-settings: "opsz" 72;
}

/* Editorial body — Inter, slightly looser than the default copy. */
.editorial-body {
  color: rgba(214, 221, 230, 0.78);
  font-size: 1.08rem;
  line-height: 1.8;
  max-width: 40rem;
}


/* ── 5. Self-referential motifs ──────────────────────────────────────────── */

/* Calibration bar — a 1px hairline that fills horizontally on .in-view.
   Variable: --cal-target (default 100%). Conceptually represents
   confidence, calibration, the "knowing how well you know" theme. */
.calibration-bar {
  position: relative;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.calibration-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(34, 211, 238, 0.7) 30%,
    var(--neural) 60%,
    rgba(34, 211, 238, 0) 100%);
  transition: width 1.6s cubic-bezier(.2, .8, .2, 1);
  transition-delay: 200ms;
}
[data-reveal-on-scroll].in-view .calibration-bar::before {
  width: var(--cal-target, 100%);
}

/* Gap grid — a faint dotted lattice with a radial mask, evoking missing
   knowledge ("things we don't know yet"). Decorative background only. */
.gap-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at center,
      rgba(255, 255, 255, 0.16) 0.5px,
      transparent 1.5px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
          mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

/* Editorial divider — a hairline rule plus an Orbitron caption row.
   Used to separate acts visually beyond just whitespace. */
.editorial-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.4rem;
  margin-block: 2rem;
}
.editorial-divider::before,
.editorial-divider::after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}
.editorial-divider .label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.36em;
  color: rgba(140, 148, 167, 0.65);
  text-transform: uppercase;
}


/* ── 6. Placeholder badge + concept cards ────────────────────────────────── */

/* Honest pill that flags not-yet-shipped sections (research / models /
   products). We make the not-shipped status explicit instead of hiding it. */
.placeholder-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(215, 181, 109, 0.92);
  background: rgba(215, 181, 109, 0.08);
  border: 1px solid rgba(215, 181, 109, 0.22);
}
.placeholder-badge::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--aureate);
  box-shadow: 0 0 10px rgba(215, 181, 109, 0.55);
  animation: placeholder-pulse 2.4s ease-in-out infinite;
}
@keyframes placeholder-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* Concept card — the "in development" research/model/product previews.
   Distinct from .glass-panel: tighter, more editorial, more deliberate. */
.concept-card {
  position: relative;
  padding: 1.6rem 1.6rem 1.7rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.005));
  border-radius: 12px;
  isolation: isolate;
  overflow: hidden;
}
.concept-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(34, 211, 238, 0.45), transparent);
  opacity: 0.7;
}
.concept-card .concept-meta {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.32em;
  color: rgba(140, 148, 167, 0.7);
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}
.concept-card .concept-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--mist);
}
.concept-card .concept-body {
  margin-top: 0.85rem;
  color: rgba(214, 221, 230, 0.7);
  font-size: 0.95rem;
  line-height: 1.65;
}
.concept-card .concept-status {
  margin-top: 1.15rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--neural);
}
.concept-card .concept-status::before {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: var(--neural);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
}


/* ── 7. Editorial footer ─────────────────────────────────────────────────── */

.editorial-footer {
  position: relative;
  margin-top: 4rem;
  padding-block: 4rem 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.editorial-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neural), transparent);
  opacity: 0.6;
}
.editorial-footer h4 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(140, 148, 167, 0.7);
  margin-bottom: 1rem;
}
.editorial-footer a {
  display: block;
  padding: 0.18rem 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  color: rgba(214, 221, 230, 0.78);
  text-decoration: none;
  transition: color 220ms ease;
}
.editorial-footer a:hover {
  color: var(--mist);
}
.editorial-footer .footer-note {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: rgba(140, 148, 167, 0.6);
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  justify-content: space-between;
}


/* ============================================================================
   8. Responsive overrides
   ============================================================================ */

/* Tablet (≤1024px) — relax dense grids slightly. */
@media (max-width: 1024px) {
  .act-section { padding-block: clamp(4rem, 9vw, 7rem); }
}

/* Mobile (≤768px) — compress acts and drop the sticky section index. */
@media (max-width: 768px) {
  .act-section { padding-block: clamp(3rem, 9vw, 5rem); }
  .pillar { padding: 1rem 0; }
  .pillar-body { font-size: 0.96rem; line-height: 1.65; }
  .editorial-body { font-size: 1rem; line-height: 1.7; }
  .editorial-h2 { font-size: clamp(2rem, 8vw, 3.6rem); line-height: 1.05; }
  .editorial-line { font-size: clamp(1.2rem, 4.6vw, 1.6rem); }
  .concept-card { padding: 1.3rem 1.3rem 1.4rem; }
  .editorial-footer { padding-block: 3rem 2.5rem; }
  .editorial-footer .footer-note { gap: 0.5rem; flex-direction: column; }
  /* Section index always hidden ≤lg, but make sure it doesn't bleed in. */
  .section-index { display: none !important; }
}

/* Small mobile (≤480px). */
@media (max-width: 480px) {
  .act-section { padding-block: clamp(2.5rem, 11vw, 4rem); }
  .editorial-divider { gap: 0.7rem; margin-block: 1.5rem; }
  .editorial-divider .label { font-size: 0.55rem; letter-spacing: 0.28em; }
  .pillar-title { font-size: clamp(1.3rem, 6vw, 1.8rem); }
  .placeholder-badge { font-size: 0.55rem; padding: 0.3rem 0.7rem; letter-spacing: 0.22em; }
  .act-header { font-size: 0.58rem; letter-spacing: 0.28em; }
  .act-header::before { width: 1.5rem; }
}
