/* ============================================================
   AFTER-HOURS — minimal, monochrome, editorial
   ============================================================ */

:root {
  --bg: #f4f2ee;
  --fg: #0a0a0a;
  --muted: #6b6862;
  --line: rgba(10, 10, 10, 0.12);
  --line-soft: rgba(10, 10, 10, 0.06);
  --paper: #ebe8e2;
  --accent: #0a0a0a;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --fg: #f4f2ee;
  --muted: #8a877f;
  --line: rgba(244, 242, 238, 0.14);
  --line-soft: rgba(244, 242, 238, 0.06);
  --paper: #131313;
  --accent: #f4f2ee;
}

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

html {
  scroll-behavior: smooth;
}

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

body {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

/* Use native cursor everywhere */
html, body, * { cursor: auto; }
a, button, .project-row, .script-card, .hero-cta, .theme-toggle, .nav-links a, .nav-link, .nav-brand, .back-link, .mega-item, .mega-footer-link, .cat-tab { cursor: pointer; }
.cursor-dot, .cursor-ring { display: none !important; }

/* ----------- Layout ----------- */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 720px) {
  .container { padding: 0 20px; }
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.rule {
  height: 1px;
  background: var(--line);
  width: 100%;
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), padding 0.4s var(--ease);
}
.nav.scrolled {
  border-bottom-color: var(--line-soft);
  padding: 14px 32px;
}
@media (max-width: 720px) {
  .nav, .nav.scrolled { padding: 14px 20px; }
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.nav-mark {
  width: 12px;
  height: 12px;
  background: var(--fg);
  border-radius: 50%;
  position: relative;
}
.nav-mark::before {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid var(--fg);
  border-radius: 50%;
  opacity: 0.3;
  animation: pulse 3s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.4); opacity: 0; }
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--fg);
}
.theme-toggle-glyph {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1;
  display: inline-block;
  transform: translateY(-0.5px);
}
.theme-toggle-label { font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .theme-toggle-label { display: none; }
  .theme-toggle { padding: 8px; width: 34px; height: 34px; justify-content: center; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* Prevent mega menu overflow on small screens */
@media (max-width: 860px) {
  .nav-item-wrap:has(.mega-cols) .mega-menu {
    min-width: calc(100vw - 40px);
    left: 0;
  }
  .mega-cols {
    flex-direction: column;
  }
  .mega-divider {
    width: 100%;
    height: 1px;
    margin: 4px 0;
  }
}

/* ============================================================
   MEGA MENU
   ============================================================ */

.nav-links {
  position: static;
}

.nav-item-wrap {
  position: relative;
}

/* Caret under each nav link */
.nav-link {
  position: relative;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nav-link:hover,
.nav-link--active {
  color: var(--fg);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--fg);
  transition: width 0.4s var(--ease);
}
.nav-link:hover::after,
.nav-link--active::after {
  width: 100%;
}
.nav-link-caret {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.5;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-link--active .nav-link-caret {
  transform: rotate(225deg) translateY(-2px);
  opacity: 1;
}

/* The panel itself */
.mega-menu {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 320px;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 24px 64px rgba(0,0,0,0.10), 0 4px 16px rgba(0,0,0,0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.3s var(--ease);
  z-index: 200;
  /* small upward notch */
}
.mega-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: var(--bg);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}
.mega-menu--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* For two-column menus, widen the panel and align to left edge */
.mega-cols {
  display: flex;
  gap: 0;
}
/* Two-col panel: pin left edge to nav item, not center */
.nav-item-wrap:has(.mega-cols) .mega-menu {
  left: 0;
  transform: translateX(0) translateY(8px);
  min-width: 580px;
}
.nav-item-wrap:has(.mega-cols) .mega-menu::before {
  left: 60px;
}
.nav-item-wrap:has(.mega-cols) .mega-menu--visible {
  transform: translateX(0) translateY(0);
}

.mega-menu-inner {
  padding: 12px;
}

.mega-col {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.mega-col--single {
  min-width: 300px;
}

.mega-divider {
  width: 1px;
  background: var(--line);
  margin: 8px 0;
  flex-shrink: 0;
}

.mega-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 2px;
  transition: background 0.2s var(--ease);
  text-decoration: none;
  color: var(--fg);
  position: relative;
}
.mega-item:hover {
  background: var(--paper);
}
.mega-item--soon {
  opacity: 0.45;
  pointer-events: none;
}

.mega-item-n {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
  flex-shrink: 0;
  min-width: 22px;
}

.mega-item-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mega-item-label {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  font-style: normal;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: letter-spacing 0.3s var(--ease);
}
.mega-item:hover .mega-item-label {
  letter-spacing: 0.005em;
}

.mega-item-desc {
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.mega-soon-tag {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-style: normal;
}

.mega-footer-link {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  margin-top: 4px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  transition: color 0.25s var(--ease);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.mega-footer-link:hover {
  color: var(--fg);
}
.mega-footer-link .mega-item-label {
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Keep nav border visible when mega open */
.nav--menu-open {
  border-bottom-color: var(--line-soft);
}

/* Overlay dim behind mega menu (subtle) */
.nav--menu-open::after {
  content: "";
  position: fixed;
  inset: 0;
  top: 0;
  background: color-mix(in srgb, var(--bg) 0%, transparent);
  pointer-events: none;
  z-index: 99;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 120px 0 60px;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at 50% 40%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, black 30%, transparent 80%);
  pointer-events: none;
  opacity: 0.7;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 60px;
}
.hero-meta span { display: flex; align-items: center; gap: 8px; }
.hero-meta .dot {
  width: 6px; height: 6px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 8px #4ade80;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(64px, 14vw, 220px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin-bottom: 40px;
}
.hero-title .line {
  display: block;
  overflow: hidden;
}
.hero-title .line span {
  display: inline-block;
  transform: translateY(110%);
  animation: heroLineUp 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-title .line:nth-child(1) span { animation-delay: 0.1s; }
.hero-title .line:nth-child(2) span { animation-delay: 0.25s; }
.hero-title .line:nth-child(3) span { animation-delay: 0.4s; }
@keyframes heroLineUp {
  from { transform: translateY(110%); }
  to { transform: translateY(0); }
}

.hero-title em {
  font-style: italic;
  color: var(--muted);
}

.hero-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  align-items: end;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
@media (max-width: 880px) {
  .hero-bottom { grid-template-columns: 1fr; gap: 24px; }
}

.hero-lede {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  max-width: 36ch;
  color: var(--fg);
}
.hero-lede strong {
  font-weight: 500;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 14px 18px;
  border: 1px solid var(--fg);
  border-radius: 999px;
  transition: all 0.4s var(--ease);
  background: var(--bg);
  cursor: pointer;
}
@media (max-width: 880px) { .hero-cta { justify-self: start; } }
.hero-cta:hover {
  background: var(--fg);
  color: var(--bg);
  padding-right: 28px;
}
.hero-cta .arrow {
  display: inline-block;
  transition: transform 0.4s var(--ease);
}
.hero-cta:hover .arrow { transform: translateX(4px); }

.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hero-scroll-line {
  width: 1px; height: 40px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.hero-scroll-line::after {
  content: "";
  position: absolute;
  left: 0; top: -40px;
  width: 1px; height: 40px;
  background: var(--fg);
  animation: scrollDown 2.4s var(--ease) infinite;
}
@keyframes scrollDown {
  0% { top: -40px; }
  100% { top: 40px; }
}

/* ============================================================
   MARQUEE TICKER
   ============================================================ */
.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 18px 0;
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
  gap: 60px;
  animation: tickerScroll 50s linear infinite;
  font-family: var(--serif);
  font-style: italic;
  font-size: 36px;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.ticker-track span {
  display: inline-flex;
  align-items: center;
  gap: 60px;
}
.ticker-track .sep {
  width: 8px; height: 8px;
  background: var(--fg);
  border-radius: 50%;
  display: inline-block;
}
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============================================================
   MANIFESTO (pinned line-by-line reveal)
   ============================================================ */
.manifesto {
  position: relative;
}
.manifesto-pin {
  height: 280vh;
}
.manifesto-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
}
.manifesto-stage .container { width: 100%; }
.manifesto-wrap {
  display: grid;
  grid-template-columns: 1fr 2.4fr;
  gap: 80px;
}
@media (max-width: 960px) {
  .manifesto-wrap { grid-template-columns: 1fr; gap: 40px; }
}
.manifesto-side {
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.manifesto-side .num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 64px;
  line-height: 1;
  color: var(--muted);
}
.manifesto-text {
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 64px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.manifesto-text .word {
  display: inline-block;
  opacity: 0.18;
  transition: opacity 0.5s var(--ease);
}
.manifesto-text .word.lit { opacity: 1; }
.manifesto-text em {
  font-style: italic;
  color: var(--muted);
}

/* ============================================================
   PROJECTS INDEX
   ============================================================ */
.projects {
  padding: 120px 0 60px;
  border-top: 1px solid var(--line);
}
.projects-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 80px;
  gap: 40px;
  flex-wrap: wrap;
}
.projects-title {
  font-family: var(--serif);
  font-size: clamp(48px, 8vw, 120px);
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.projects-title em { font-style: italic; color: var(--muted); }

.projects-meta {
  text-align: right;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  line-height: 1.8;
}

.project-row {
  display: grid;
  grid-template-columns: 80px 1fr 2fr 200px 60px;
  gap: 32px;
  align-items: center;
  padding: 36px 0;
  border-top: 1px solid var(--line);
  position: relative;
  transition: padding 0.5s var(--ease), background 0.5s var(--ease);
  cursor: pointer;
}
.project-row:last-of-type { border-bottom: 1px solid var(--line); }
.project-row::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}
.project-row:hover::before { transform: scaleX(1); }
.project-row.coming-soon { opacity: 0.45; }
.project-row.coming-soon:hover { opacity: 0.7; }

.project-row > .num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
.project-row .name {
  font-family: var(--serif);
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.project-row .name em { font-style: italic; }
.project-row .desc {
  font-size: 14px;
  color: var(--muted);
  max-width: 50ch;
}
.project-row .tags {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-align: right;
}
.project-row .arrow {
  font-family: var(--serif);
  font-size: 28px;
  text-align: right;
  transition: transform 0.5s var(--ease);
}
.project-row:hover .arrow { transform: translateX(8px); }

@media (max-width: 880px) {
  .project-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 24px 0;
  }
  .project-row .tags, .project-row .arrow { text-align: left; }
}

/* ============================================================
   FIVEM SECTION
   ============================================================ */
.fivem {
  padding: 160px 0 120px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  transition: background 0.5s var(--ease);
}
.fivem-page {
  padding-top: 140px;
}
.fivem-back {
  margin-bottom: 48px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  transition: color 0.3s var(--ease);
}
.back-link:hover { color: var(--fg); }
.back-link .arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}
.back-link:hover .arrow { transform: translateX(-4px); }

.fivem-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  margin-bottom: 100px;
  align-items: end;
}
@media (max-width: 880px) {
  .fivem-head { grid-template-columns: 1fr; gap: 32px; }
}

.fivem-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 24px;
}
.fivem-label::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--muted);
}

.fivem-title {
  font-family: var(--serif);
  font-size: clamp(56px, 9vw, 140px);
  line-height: 0.92;
  letter-spacing: -0.035em;
}
.fivem-title em { font-style: italic; color: var(--muted); }

.fivem-intro {
  font-size: 18px;
  line-height: 1.6;
  color: var(--fg);
  max-width: 44ch;
  padding-bottom: 12px;
}
.fivem-intro p + p { margin-top: 16px; }
.fivem-intro .accent { color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 22px; }

/* Why-different bullets */
.fivem-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 100px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 40px 0;
}
@media (max-width: 880px) { .fivem-pillars { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .fivem-pillars { grid-template-columns: 1fr; } }

.pillar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pillar .pn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}
.pillar .ph {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.pillar .pd {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 28ch;
}

/* Script cards */
.scripts-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.scripts-head h3 {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.scripts-head .count {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* Catalogue — sectioned */
.catalogue {
  display: flex;
  flex-direction: column;
  gap: 72px;
}
.cat-section {
  display: flex;
  flex-direction: column;
}

/* Tabbed browser */
.cat-browser {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cat-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--tab-count, 5), 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}
.cat-tabs-indicator {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 0;
  width: calc(100% / var(--tab-count, 5));
  transform: translateX(calc(var(--active-index, 0) * 100%));
  background: var(--fg);
  transition: transform 0.55s var(--ease);
  z-index: 0;
  pointer-events: none;
}
.cat-tab {
  position: relative;
  z-index: 1;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 22px 20px 20px;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: baseline;
  color: var(--fg);
  transition: color 0.35s var(--ease);
  font: inherit;
}
.cat-tab:last-child { border-right: 0; }
.cat-tab:hover .cat-tab-label { letter-spacing: 0.005em; }
.cat-tab.active { color: var(--bg); }
.cat-tab.active .cat-tab-n,
.cat-tab.active .cat-tab-count {
  color: color-mix(in srgb, var(--bg) 65%, transparent);
}

.cat-tab-n {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.35s var(--ease);
}
.cat-tab-label {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.015em;
  font-style: italic;
  transition: letter-spacing 0.35s var(--ease);
}
.cat-tab-count {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.35s var(--ease);
}

@media (max-width: 860px) {
  .cat-tabs {
    grid-template-columns: 1fr;
  }
  .cat-tabs-indicator {
    width: 100%;
    height: calc(100% / var(--tab-count, 5));
    transform: translateY(calc(var(--active-index, 0) * 100%));
    transition: transform 0.5s var(--ease);
  }
  .cat-tab {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .cat-tab:last-child { border-bottom: 0; }
  .cat-tab-label { font-size: 22px; }
}

.cat-stage {
  animation: cat-in 0.5s var(--ease) both;
}
.cat-stage.is-out {
  animation: cat-out 0.25s var(--ease) both;
}
@keyframes cat-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cat-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); }
}

.cat-section {
  display: flex;
  flex-direction: column;
}
.cat-section-head {
  display: grid;
  grid-template-columns: 1.1fr 2fr auto;
  gap: 32px;
  align-items: end;
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--line);
}
.cat-section-meta {
  display: flex;
  align-items: baseline;
  gap: 18px;
}
.cat-section-n {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}
.cat-section-label {
  font-family: var(--serif);
  font-size: 56px;
  line-height: 0.95;
  letter-spacing: -0.025em;
  font-weight: 400;
  font-style: italic;
}
.cat-section-blurb {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 52ch;
}
.cat-section-count {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  white-space: nowrap;
}
@media (max-width: 960px) {
  .cat-section-head {
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
  }
  .cat-section-label { font-size: 44px; }
}

.scripts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
@media (max-width: 960px) { .scripts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .scripts-grid { grid-template-columns: 1fr; } }

.script-card {
  padding: 32px 28px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  position: relative;
  cursor: pointer;
  transition: background 0.5s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 320px;
}
.script-card:nth-child(3n) { border-right: 0; }
@media (max-width: 960px) {
  .script-card { border-right: 1px solid var(--line); }
  .script-card:nth-child(3n) { border-right: 1px solid var(--line); }
  .script-card:nth-child(2n) { border-right: 0; }
}
@media (max-width: 600px) { .script-card { border-right: 0 !important; } }

.script-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--fg);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.5s var(--ease);
  z-index: 0;
}
.script-card:hover::after { transform: scaleY(1); }
.script-card:hover { color: var(--bg); }
.script-card > * { position: relative; z-index: 1; }

.sc-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  transition: color 0.4s var(--ease);
}
.script-card:hover .sc-top { color: color-mix(in srgb, var(--bg) 60%, transparent); }

.sc-name {
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-top: auto;
}
.sc-name em { font-style: italic; color: var(--muted); transition: color 0.4s var(--ease); }
.script-card:hover .sc-name em { color: color-mix(in srgb, var(--bg) 60%, transparent); }

.sc-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  transition: color 0.4s var(--ease);
}
.script-card:hover .sc-desc { color: color-mix(in srgb, var(--bg) 75%, transparent); }

.sc-bottom {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  transition: border-color 0.4s var(--ease);
}
.script-card:hover .sc-bottom { border-color: color-mix(in srgb, var(--bg) 30%, transparent); }
.sc-price {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.01em;
}
.sc-price small {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-left: 6px;
  transition: color 0.4s var(--ease);
}
.script-card:hover .sc-price small { color: color-mix(in srgb, var(--bg) 60%, transparent); }

.sc-arrow {
  font-family: var(--serif);
  font-size: 22px;
  transition: transform 0.4s var(--ease);
}
.script-card:hover .sc-arrow { transform: translate(4px, -4px) rotate(-12deg); }

.sc-soon {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.script-card.soon { opacity: 0.55; }
.script-card.soon::after { display: none; }
.script-card.soon:hover { color: inherit; }

/* CTA strip */
.fivem-cta {
  margin-top: 100px;
  padding: 60px 40px;
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
@media (max-width: 720px) { .fivem-cta { grid-template-columns: 1fr; padding: 40px 24px; } }
.fivem-cta h4 {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.fivem-cta h4 em { font-style: italic; color: var(--muted); }
.fivem-cta p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  max-width: 40ch;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 100px 0 32px;
  border-top: 1px solid var(--line);
  position: relative;
}
.footer-mega {
  font-family: var(--serif);
  font-size: clamp(80px, 18vw, 280px);
  line-height: 0.85;
  letter-spacing: -0.05em;
  margin-bottom: 80px;
  text-align: center;
}
.footer-mega em { font-style: italic; color: var(--muted); }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  margin-bottom: 60px;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

.footer-col h5 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a {
  font-size: 14px;
  position: relative;
  transition: color 0.3s var(--ease);
}
.footer-col a:hover { color: var(--muted); }

.footer-blurb {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  max-width: 32ch;
}
.footer-blurb em { font-style: italic; color: var(--muted); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.fade-up.in { opacity: 1; transform: translateY(0); }

.fade-up-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.fade-up-stagger.in > *:nth-child(1) { transition-delay: 0.05s; }
.fade-up-stagger.in > *:nth-child(2) { transition-delay: 0.12s; }
.fade-up-stagger.in > *:nth-child(3) { transition-delay: 0.19s; }
.fade-up-stagger.in > *:nth-child(4) { transition-delay: 0.26s; }
.fade-up-stagger.in > *:nth-child(5) { transition-delay: 0.33s; }
.fade-up-stagger.in > *:nth-child(6) { transition-delay: 0.40s; }
.fade-up-stagger.in > * { opacity: 0; transform: translateY(24px); }
.fade-up-stagger.in > * { opacity: 1; transform: translateY(0); }

/* the above two duplicate rules were intentional; specificity-safe override: */
.fade-up-stagger.in > * { opacity: 1 !important; transform: translateY(0) !important; }

/* parallax helper */
.parallax-y {
  will-change: transform;
}

/* Hide native scrollbar polish */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
