/* ==========================================================================
   THRESHOLD (020) — 1:1 Six-Worlds Brutalist Portal Dossier (RTL)
   Palette: #0A0A0A obsidian · #F2EFE9 warm cream · #DDFB24 acid chartreuse
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0A0A0A;
  --cream: #F2EFE9;
  --ink-dark: #111112;
  --white: #FFFFFF;
  --muted: #8A8A8E;
  --acid: #DDFB24;
  --line: rgba(255, 255, 255, 0.12);
  --line-dark: rgba(17, 17, 18, 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { background: var(--bg); color: var(--white); scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--white);
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  line-height: 1.65;
  overflow-x: clip;
  letter-spacing: 0 !important;
}
h1, h2, h3, h4, p, a, button, span { letter-spacing: 0; }
[dir="ltr"], [lang="en"] { font-family: 'JetBrains Mono', monospace; letter-spacing: 0.08em; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.thr-wrap {
  width: 100%;
  max-width: 1380px;
  margin-inline: auto;
  padding-inline: clamp(18px, 3.2vw, 44px);
}

/* Bottom Pinned Acid Progress Bar */
.thr-bottom-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  z-index: 90;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.thr-bottom-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--acid);
}

/* Fixed Top HUD Nav */
.thr-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 75;
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.78), transparent);
}
.thr-nav {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.thr-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Readex Pro', sans-serif;
  font-weight: 700;
  font-size: 1rem;
}
.thr-brand svg { width: 24px; height: 24px; stroke: var(--acid); }
.thr-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.82);
}
.thr-links a:hover { color: var(--acid); }
.thr-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.86rem;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.72);
  border: 1px solid var(--line);
}
.thr-counter b { color: var(--acid); }
@media (max-width: 720px) { .thr-links { display: none; } }
html.cfx-embed-preview .thr-dir-link { display: none !important; }

/* 1. Full-Bleed 6-World Arch Portal Hero */
.thr-portal {
  position: relative;
  min-height: 96vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 110px 0 38px;
  overflow: hidden;
}
.thr-portal-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.thr-world-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: filter 0.65s var(--ease), transform 0.85s var(--ease), clip-path 0.7s var(--ease);
}
.thr-world-img.is-pulsing {
  transform: scale(1.04);
}
.thr-portal-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, transparent 25%, rgba(10, 10, 10, 0.55) 85%),
    linear-gradient(to top, #0A0A0A 0%, rgba(10, 10, 10, 0.25) 45%, rgba(10, 10, 10, 0.45) 100%);
}

/* Giant Translucent Watermark Behind Arch */
.thr-watermark {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: clamp(2.8rem, 8.8vw, 7.6rem);
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.11);
  pointer-events: none;
  user-select: none;
}

.thr-portal-hud {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1.15fr auto;
  align-items: end;
  gap: 28px;
}
@media (max-width: 820px) { .thr-portal-hud { grid-template-columns: 1fr; } }

.thr-world-meta small {
  display: inline-block;
  color: var(--acid);
  font-size: 0.78rem;
  margin-bottom: 8px;
}
.thr-world-meta h1 {
  font-family: 'Readex Pro', sans-serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 4.4vw, 3.9rem);
  line-height: 1.12;
  margin-bottom: 10px;
}
.thr-world-meta p {
  max-width: 50ch;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.96rem;
  margin-bottom: 16px;
}
.thr-open-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--acid);
  color: var(--ink-dark);
  font-weight: 700;
  font-size: 0.88rem;
}

/* 6-World Portal Switcher */
.thr-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(10, 10, 10, 0.76);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
}
.thr-sw-btn {
  padding: 8px 13px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.thr-sw-btn:hover { color: #fff; border-color: var(--line); }
.thr-sw-btn.is-active {
  background: var(--acid);
  color: var(--ink-dark);
  font-weight: 700;
}

/* 2. Section 02 — Expedition Index (Acid Hover Flood Rows!) */
.thr-sec {
  padding: clamp(68px, 8.5vw, 116px) 0;
  border-top: 1px solid var(--line);
}
.thr-kicker {
  display: block;
  font-size: 0.76rem;
  color: var(--acid);
  margin-bottom: 10px;
}
.thr-h2 {
  font-family: 'Readex Pro', sans-serif;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  line-height: 1.18;
  margin-bottom: 12px;
}
.thr-sub {
  color: var(--muted);
  max-width: 56ch;
  margin-bottom: 36px;
}

.thr-index-table {
  border-top: 1px solid var(--line);
}
.thr-row {
  display: grid;
  grid-template-columns: 70px 1.3fr 1.1fr 1fr 48px;
  align-items: center;
  gap: 16px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, padding-inline 0.22s var(--ease);
}
.thr-row:hover, .thr-row.is-current {
  background: var(--acid);
  color: var(--ink-dark);
  padding-inline: 26px;
}
.thr-row span { color: var(--muted); font-size: 0.84rem; }
.thr-row:hover span, .thr-row.is-current span { color: rgba(17, 17, 18, 0.78); }
.thr-row strong { font-family: 'Readex Pro', sans-serif; font-size: 1.18rem; }
@media (max-width: 720px) {
  .thr-row { grid-template-columns: 50px 1fr auto; }
  .thr-row .hide-sm { display: none; }
}

/* 3. Section 03 — 3x2 Inverted Warm-Cream Conditions Bento Grid */
.thr-bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 860px) { .thr-bento { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .thr-bento { grid-template-columns: 1fr; } }

.thr-cond-card {
  background: var(--cream);
  color: var(--ink-dark);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.thr-cond-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.thr-cond-head b { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; opacity: 0.6; }
.thr-cond-head h3 { font-family: 'Readex Pro', sans-serif; font-size: 1.2rem; }
.thr-spec-list {
  border-top: 1px solid var(--line-dark);
}
.thr-spec-item {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-dark);
  font-size: 0.83rem;
}
.thr-spec-item span { opacity: 0.66; }
.thr-cond-note {
  font-size: 0.84rem;
  opacity: 0.78;
}

/* 4. Section 04 — Closing the Gate */
.thr-transit {
  position: relative;
  padding: clamp(88px, 12vw, 150px) 0;
  text-align: center;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 50%, rgba(221, 251, 36, 0.10), transparent 62%),
    #0A0A0A;
}
.thr-transit h2 {
  font-family: 'Readex Pro', sans-serif;
  font-size: clamp(2.1rem, 4.5vw, 3.8rem);
  line-height: 1.16;
  max-width: 18ch;
  margin: 14px auto 28px;
}
.thr-acid-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  border-radius: 999px;
  background: var(--acid);
  color: var(--ink-dark);
  font-weight: 800;
  font-size: 0.95rem;
}

/* 5. Warm-Cream Inverted 4-Column Footer */
.thr-footer {
  background: var(--cream);
  color: var(--ink-dark);
  padding: 56px 0 44px;
}
.thr-foot-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.1fr;
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line-dark);
}
@media (max-width: 780px) { .thr-foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .thr-foot-grid { grid-template-columns: 1fr; } }
.thr-foot-grid h4 {
  font-size: 0.78rem;
  opacity: 0.6;
  margin-bottom: 12px;
}
.thr-foot-grid ul { list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 0.88rem; }
.thr-foot-bottom {
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.84rem;
}
.thr-foot-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-dark);
  background: #fff;
  font-weight: 600;
  font-size: 0.82rem;
}
