/* CEC Shared Theme - Dark & Bold */
:root {
  /* Core palette */
  --color-primary: #1E99FF;    /* Cyan - Primary brand, buttons, links */
  --color-secondary: #faeb01;  /* Yellow - Accents, highlights, CTAs */
  --color-accent: #fb110d;     /* Red - Errors, warnings, important actions */
  --color-background: #000000; /* Black - Page background */
  --color-text: #ffffff;       /* White - Primary text */
  --color-neutral: #b0b0b0;    /* Light Gray - Secondary text */
  --color-highlight: #faeb01;  /* Yellow - Highlights */
  
  /* State variations */
  --color-primary-hover: #5dd4ff;  /* Lighter Cyan for dark bg */
  --color-secondary-hover: #fff44d; /* Lighter Yellow for dark bg */
  --color-accent-hover: #ff3a36;    /* Lighter Red for dark bg */
  --color-background-light: #1a1a1a; /* Dark Gray */
  --color-background-dark: #000000;  /* Black */
  
  /* Semantic assignments */
  --color-success: #00e676;    /* Bright Green */
  --color-warning: #faeb01;    /* Yellow */
  --color-error: #fb110d;      /* Red */
  
  /* Surface colors */
  --surface-card: #1a1a1a;     /* Dark Gray card background */
  --surface-tile: #1a1a1a;     /* Dark Gray tile background */
  --surface-1: #1a1a1a;        /* Primary surface */
  --surface-2: #0d0d0d;        /* Darker surface for contrast */
  
  /* Text colors */
  --text-primary: #ffffff;     /* White */
  --text-secondary: #b0b0b0;   /* Light Gray */
  --text-1: #ffffff;           /* White */
  --text-on-dark: #ffffff;     /* White on dark backgrounds */
  --text-on-primary: #000000;  /* Black on cyan */
  
  /* Border colors */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-color: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(65, 202, 246, 0.5);
  
  /* RGB helpers */
  --color-primary-rgb: 65, 202, 246;
  --color-secondary-rgb: 250, 235, 1;
  --color-accent-rgb: 251, 17, 13;
  --color-text-rgb: 255, 255, 255;
  --color-background-rgb: 0, 0, 0;
}

/* Page */
html { scroll-behavior: smooth; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--color-background);
  color: var(--text-primary);
}

main { padding: 20px; }
header {
  width: 100%;
  position: sticky; top: 0; z-index: 100;
  background: #1a1a1a;
  color: #ffffff;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
header .header-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 26px) clamp(20px, 4vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 4vw, 36px);
}

header .header-brand {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 18px);
  flex: 1 1 auto;
  min-width: 0;
}

header .header-brand .logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  max-width: 100%;
  overflow: visible;
  flex: 0 0 auto;
}

header .header-brand .logo-image {
  height: clamp(52px, 6vw, 86px);
  width: auto;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.65));
}

header .header-brand .wordmark {
  width: auto;
  height: auto;
  max-height: clamp(52px, 6vw, 86px);
  display: block;
  overflow: visible;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.55));
}

header .header-brand .wordmark text {
  stroke: rgba(0,0,0,0.75);
  stroke-width: 8;
  paint-order: stroke fill;
}

header .header-title {
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}

header .header-actions {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 24px);
}

.primary-nav {
  display: flex;
  align-items: center;
}

.primary-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 20px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-nav__item {
  position: relative;
}

.primary-nav__link {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease, text-shadow 0.2s ease;
}

.primary-nav__link:hover,
.primary-nav__link:focus {
  color: #000;
  background: var(--color-secondary);
  text-shadow: none;
}

.primary-nav__link.is-active {
  color: #000;
  background: var(--color-secondary);
  box-shadow: 0 0 18px rgba(var(--color-secondary-rgb), 0.55);
}

@media (max-width: 900px) {
  header .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    text-align: center;
  }

  header .header-actions {
    flex-direction: column;
    gap: 16px;
  }

  .primary-nav__list {
    justify-content: center;
  }

  .header-cta {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }
}

@media (max-width: 520px) {
  header .header-brand {
    flex-direction: column;
    gap: 12px;
  }

  header .header-title {
    white-space: normal;
    text-align: center;
  }

  .primary-nav__list {
    flex-wrap: wrap;
    gap: 12px 18px;
  }
}

/* Cards & tiles */
.card { background: var(--surface-card); border:1px solid var(--border-subtle); border-radius: 20px; padding: 24px; box-shadow: 0 8px 20px rgba(var(--color-text-rgb), 0.08); color: var(--text-primary); }
.card { padding-bottom: 40px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 24px; }
.fiction-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; margin-top: 12px; }
.models-summary { margin-bottom: 8px; color: var(--text-secondary); font-size: 14px; }
.card > .grid { gap: 32px 28px; }
.card > .grid { padding-bottom: 20px; }
.card .carousel { padding-bottom: 20px; }
.updates-card { padding-bottom: 40px; }
.updates-card > .updates-grid {
  gap: 44px 28px !important;
  row-gap: 44px !important;
  column-gap: 28px !important;
  margin-bottom: 32px !important;
}
.tile { background: var(--surface-tile); border:1px solid var(--border-subtle); border-radius: 16px; padding: 12px; position:relative; overflow:hidden; color: var(--text-primary); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
a.tile { display:block; }
.tile img { display:block; width:100%; height:auto; border-radius: 12px; object-fit: cover; aspect-ratio: 840/473; }
.tile img.portrait { aspect-ratio: 2/3; }
.title { font-weight: 700; font-size: 15px; margin: 10px 0 6px; color: var(--color-primary); line-height: 1.25; }
.meta { color: var(--text-secondary); font-size: 12px; display:flex; align-items:center; gap:6px; flex-wrap: wrap; }
.badge { display:inline-block; background: var(--color-secondary); border:none; border-radius:999px; padding:4px 8px; font-size:11px; color: #000000; font-weight:600; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
.update-blurb { word-break: break-word; overflow-wrap: anywhere; }
.section-divider { height: 0; border-top: 1px solid var(--border-subtle); margin: 20px 0; }

.tile:hover { border-color: var(--color-primary); box-shadow: 0 8px 18px rgba(var(--color-text-rgb), 0.1); transform: translateY(-2px); }
.tile:focus-within { outline: none; box-shadow: 0 8px 18px rgba(var(--color-text-rgb), 0.12); }
.tile:focus-within::after { content:""; position:absolute; inset:8px; border-radius:10px; pointer-events:none; box-shadow: 0 0 0 2px var(--color-primary); }
.tile.snap:focus, .tile.snap:focus-visible { outline: none !important; }

/* Carousel */
.carousel { overflow:auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; padding-inline: 8px; }
.carousel { scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.carousel-track { display:flex; gap:12px; padding-bottom: 8px; }
.snap { scroll-snap-align: start; min-width: 460px; max-width: 520px; flex: 1 0 auto; }
.play-overlay {
  position:absolute; inset:auto 8px 8px auto;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  border: 0; color: #fff; padding:8px 12px; border-radius:999px; font-size:12px; font-weight:700;
  box-shadow: 0 3px 10px rgba(var(--color-text-rgb), 0.15);
  pointer-events: none;
}
.play-overlay::before { content: "▶"; margin-right: 6px; font-size: 12px; line-height: 1; }
.carousel-controls { display:flex; gap:8px; justify-content:flex-end; margin-bottom:8px; }
.ctrl { background: var(--color-secondary); color: #000000; border:0; padding:8px 12px; border-radius:999px; font-size:12px; font-weight:700; box-shadow: 0 3px 8px rgba(var(--color-text-rgb), 0.12); transition: background-color 0.2s ease; }
.ctrl:hover:not([disabled]) { background: var(--color-secondary-hover); }
.ctrl[disabled] { opacity:.4; cursor:not-allowed; }

/* Chips */
.chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.chip { background: rgba(var(--color-secondary-rgb), 0.15); border:1px solid rgba(var(--color-secondary-rgb), 0.3); color: var(--text-primary); border-radius:999px; padding:4px 10px; font-size:11px; font-weight:600; }
.meta a[data-trailer] {
  display:inline-flex; align-items:center; gap:6px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: #fff; padding:8px 12px; border-radius:999px; font-weight:700; text-decoration:none; border:0;
  box-shadow: 0 3px 10px rgba(var(--color-text-rgb), 0.15);
  transition: filter 0.2s ease;
}
.meta a[data-trailer]:hover { filter: saturate(1.1) brightness(1.05); }
.meta a[data-trailer]::before { content:"▶"; font-size:12px; line-height:1; }

/* Hero */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 36px 28px; color: var(--text-on-primary); background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 60%, var(--color-accent) 100%); box-shadow: 0 10px 25px rgba(var(--color-text-rgb), 0.12); }
.hero__title { font-size: 32px; line-height: 1.1; margin: 0 0 8px; letter-spacing: .2px; }
.hero__tag { margin: 0 0 16px; color: var(--text-on-primary); font-weight: 600; background: rgba(var(--color-text-rgb), 0.2); display:inline-block; padding:6px 10px; border-radius: 999px; }
.hero__cta { display:flex; gap:10px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: var(--text-on-primary);
  border: none;
  border-radius: 999px;
  padding: 14px 32px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(var(--color-primary-rgb), 0.35);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn:hover,
.btn:focus {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(var(--color-primary-rgb), 0.45);
  color: var(--text-on-primary);
}

.btn--inverse {
  background: rgba(255,255,255,0.25);
  color: var(--text-on-primary);
  backdrop-filter: blur(4px);
  box-shadow: none;
}

.btn--inverse:hover {
  background: rgba(255,255,255,0.35);
  color: var(--text-on-primary);
}

.btn.header-cta {
  padding: 12px 26px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #000;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  box-shadow: 0 10px 24px rgba(var(--color-primary-rgb), 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn.header-cta:hover,
.btn.header-cta:focus {
  background: linear-gradient(135deg, var(--color-primary-hover) 0%, var(--color-secondary) 100%);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(var(--color-primary-rgb), 0.45);
  color: #000;
}
.hero::before, .hero::after { content:""; position:absolute; border-radius: 50%; filter: blur(30px); opacity:.35; }
.hero::before { width: 240px; height: 240px; background: var(--color-secondary); top: -60px; right: -40px; }
.hero::after { width: 180px; height: 180px; background: var(--color-accent); bottom: -40px; left: -30px; }

/* Section titles */
.section-title { display:flex; align-items:center; gap:10px; font-size:20px; margin:0 0 12px; color: var(--color-secondary); font-weight: 600; position: relative; padding-left: 36px; }
.section-title::before {
  content:""; width:10px; height:10px; border-radius:50%; background: var(--color-primary);
  box-shadow: 12px 0 0 var(--color-secondary), 24px 0 0 var(--color-accent);
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
}

/* Anchor offset for sticky header */
.anchor { position: relative; top: -64px; visibility: hidden; }

/* Alert messages */
.alert {
  max-width: 1100px;
  margin: 20px auto;
  padding: 16px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  line-height: 1.5;
}

.alert i {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.alert-success {
  background: rgba(0, 230, 118, 0.15);
  border: 1px solid var(--color-success);
  color: var(--color-success);
}

.alert-error {
  background: rgba(251, 17, 13, 0.15);
  border: 1px solid var(--color-error);
  color: var(--color-error);
}

.lightbox { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(var(--color-text-rgb), 0.85); z-index: 9999; }
.lightbox[aria-hidden="false"] { display: flex; }
.lightbox__dialog { width: min(960px, 92vw); background: var(--color-background-dark); border:1px solid rgba(255,255,255,0.1); border-radius: 12px; position: relative; overflow: hidden; z-index: 2; }
.lightbox__close { position: absolute; top: 8px; right: 8px; background: rgba(var(--color-text-rgb), 0.5); color: var(--text-on-primary); border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; padding: 6px 10px; cursor: pointer; z-index: 3; }
.lightbox__backdrop { position: absolute; inset: 0; z-index: 1; }
.lightbox video { display:block; width:100%; height:auto; background: var(--color-background-dark); }

/* Tour pagination spacing */
.updates-card .tour-pagination { margin-top: 64px !important; padding-top: 20px; border-top: 1px solid var(--border-subtle); position: relative; z-index: 1; clear: both; }
.updates-card .tour-pagination .pagination { margin-top: 16px !important; }
.updates-card .pagination { margin-top: 24px !important; margin-bottom: 20px !important; }

/* Footer */
footer {
  background: var(--color-background-dark);
  color: var(--text-on-dark);
  margin-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
footer a { color: rgba(255,255,255,0.85); text-decoration: none; }
footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.footer-sections {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: nowrap;
}
.footer-brand {
  min-width: 0;
  text-align: center;
}
.footer-brand strong { font-size: 20px; display: block; }
.footer-brand p { margin: 8px 0 0; color: rgba(255,255,255,0.75); }
.footer-links-group h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--color-secondary);
  font-weight: 700;
  letter-spacing: .3px;
}
.footer-links-group nav {
  display: grid;
  gap: 6px;
}
.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255,255,255,0.85);
  padding: 6px 0;
  transition: color 0.2s ease, transform 0.2s ease;
}
.footer-link i {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  transition: color 0.2s ease;
}
.footer-link:hover {
  color: #ffffff;
  text-decoration: none;
  transform: translateX(2px);
}
.footer-link:hover i {
  color: #41caf6;
}
.footer-links-list a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  padding: 6px 0;
}
.footer-tagline {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}

/* Responsive */
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .snap { min-width: 70%; }
}
