/* ============================================================
   LIMINAL — Visual System
   Palette: desaturated charcoal/ash/mist → warm amber arrival.
   Deliberately distinct from The Sovereignty's saturated
   cobalt/violet/magenta/gold + Orbitron pairing.
   ============================================================ */

:root {
  /* Base atmosphere */
  --void: #0a0a0d;
  --charcoal: #14141a;
  --ash: #3a3d4a;
  --mist: #c4c9d4;

  /* Warm arrival accent, intensifies with tier */
  --ember-low: #8a7a68;
  --ember-mid: #c19a6b;
  --amber: #e8b878;
  --amber-bright: #f5cf9a;

  /* Type color */
  --text-primary: #e8e6e0;
  --text-secondary: #9a98a0;
  --text-quiet: #6a6870;

  /* Card surfaces — translucent, not flat fills, so the backdrop
     shows through and reinforces the "glass over mist" motif */
  --card-bg: rgba(20, 20, 26, 0.55);
  --card-border: rgba(196, 201, 212, 0.12);
  --card-border-premium: rgba(232, 184, 120, 0.28);

  --radius-card: 18px;
  --radius-pill: 999px;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ============================================================
   BACKDROP — fixed atmospheric layer behind all content
   ============================================================ */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.backdrop-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  opacity: 0.35;
  filter: saturate(0.7) brightness(0.8);
}

.backdrop-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 13, 0.75) 0%,
    rgba(10, 10, 13, 0.55) 30%,
    rgba(10, 10, 13, 0.6) 70%,
    rgba(20, 16, 10, 0.5) 100%
  );
}

#glow-thread {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ============================================================
   LAYOUT PRIMITIVES
   ============================================================ */

.section {
  position: relative;
  z-index: 1;
  padding: 120px 24px;
}

.section-inner {
  max-width: 720px;
  margin: 0 auto;
}

/* Hero stays centered — the one deliberately centered moment on
   the page. Everything past it shifts to a left-aligned reading
   structure, per the design plan (avoids the "everything centered"
   generic-template tell). */
.hero {
  position: relative;
  z-index: 1;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 24px;
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.15;
  max-width: 780px;
  color: var(--text-primary);
  margin-bottom: 28px;
  letter-spacing: -0.01em;
}

.hero-description {
  max-width: 560px;
  margin-bottom: 8px;
}

.hero-description p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}

.hero-description-final {
  margin-top: 18px !important;
  color: var(--text-primary) !important;
  font-size: 1.1rem !important;
  font-weight: 500;
}

/* Section text — left-aligned once past the hero, per layout plan */
.section-kicker {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember-mid);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.section-description {
  font-size: 1.02rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 28px;
}

.cta-link {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--amber);
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.cta-link:hover {
  border-color: var(--amber);
}

/* ============================================================
   TIER SECTIONS
   ============================================================ */

/* ============================================================
   TIER CARD — one card per tier, shared background video
   ============================================================ */

.tier-section {
  position: relative;
  z-index: 1;
  padding: 60px 24px;
  max-width: 960px;
  margin: 0 auto;
}

.tier-card {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: var(--charcoal);
  transition: border-color 0.4s ease;
}

.tier-section[data-tier="premium"] .tier-card {
  border-color: var(--card-border-premium);
}

/* ---- Collapsed header: always visible, shows the tier's video,
   name, and tool count. Clicking this toggles the whole card. ---- */

.tier-card-header {
  position: relative;
  cursor: pointer;
  aspect-ratio: 21 / 9;
  overflow: hidden;
}

.tier-card-media {
  position: absolute;
  inset: 0;
}

.tier-card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.tier-card-header-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px 30px;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 13, 0.15) 0%,
    rgba(10, 10, 13, 0.75) 100%
  );
}

.tier-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

.tier-card-expand-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--amber);
  margin-top: 16px;
}

.tier-card-expand-hint svg {
  width: 12px;
  height: 12px;
  transition: transform 0.4s ease;
}

.tier-card.is-expanded .tier-card-expand-hint svg {
  transform: rotate(180deg);
}

/* ---- Expandable body: contains a SECOND copy of the same video,
   positioned as a continuous backdrop, with tool rows floating on
   top of it — this is what makes tools feel like they're set into
   the tier's atmosphere rather than sitting on a flat panel. ---- */

.tier-card-body {
  position: relative;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.tier-card.is-expanded .tier-card-body {
  max-height: 2000px; /* generous cap; real height varies by tool count */
}

.tier-card-body-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
  filter: saturate(0.75);
}

.tier-card-body-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 13, 0.55);
  backdrop-filter: blur(2px);
}

.tool-row-list {
  position: relative;
  z-index: 1;
  padding: 8px 24px 24px;
}

/* ---- Individual tool row — lightweight, no boxed card of its own,
   floats over the shared tier background. ---- */

.tool-row {
  position: relative;
  border-top: 1px solid var(--card-border);
  padding: 20px 4px;
  cursor: pointer;
}

.tool-row:first-child {
  border-top: none;
}

.tool-row-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--text-primary);
  margin: 6px 0 4px;
}

.tool-row-meta {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.tool-row-expand-hint {
  font-size: 0.8rem;
  color: var(--ember-mid);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-row-expand-hint svg {
  width: 11px;
  height: 11px;
  transition: transform 0.35s ease;
}

.tool-row.is-expanded .tool-row-expand-hint svg {
  transform: rotate(180deg);
}

.tool-row-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-row.is-expanded .tool-row-details {
  max-height: 220px;
}

.tool-row-details-inner {
  padding-top: 14px;
}

.tool-row-detail-row {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.tool-row-detail-label {
  color: var(--text-quiet);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}

.status-badge {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}

.status-badge[data-status="confirmed"] {
  background: rgba(138, 122, 104, 0.18);
  color: var(--ember-mid);
}

.status-badge[data-status="pending"] {
  background: rgba(154, 152, 160, 0.15);
  color: var(--text-secondary);
}

/* ============================================================
   FINALE — full transition to color
   ============================================================ */

.finale-section {
  padding-bottom: 160px;
}

.finale-assets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.finale-asset {
  border-radius: var(--radius-card);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.finale-asset video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Full saturation here, deliberately — this is the one place on
     the page where color is NOT desaturated, per the "arrival"
     narrative decision. */
  filter: none;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-quiet);
  font-size: 0.85rem;
  border-top: 1px solid var(--card-border);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
  .section, .tier-section { padding: 60px 16px; }
  .tier-card-header { aspect-ratio: 4 / 5; }
}
