:root {
  --bg-deep: #0c0b0a;
  --bg-surface: #151310;
  --bg-card: #1c1915;
  --bg-card-hover: #24201a;
  --paper-cream: #f5f0e6;
  --paper-muted: #b8b0a2;
  --ink-border: rgba(245, 240, 230, 0.12);
  --gold: #e8a838;
  --gold-soft: rgba(232, 168, 56, 0.16);
  --teal: #38a3a5;
  --teal-soft: rgba(56, 163, 165, 0.16);
  --eraser: #9a9a9a;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-ar: "Cairo", system-ui, -apple-system, sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-mono: "JetBrains Mono", monospace;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-deep);
  color: var(--paper-cream);
  font-family: var(--font-ar);
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
}

/* Subtle paper & charcoal grain */
.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.04;
  background-image: radial-gradient(rgba(245, 240, 230, 0.6) 0.7px, transparent 0.7px);
  background-size: 16px 16px;
}

.container {
  width: min(1220px, 92%);
  margin-inline: auto;
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 11, 10, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ink-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  box-shadow: 0 0 18px rgba(232, 168, 56, 0.25);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-dot {
  color: var(--gold);
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--paper-muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--paper-muted);
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--gold);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.84rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #d68c1d);
  color: #14110d;
  box-shadow: 0 8px 24px rgba(232, 168, 56, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 12px 28px rgba(232, 168, 56, 0.38);
}

.btn-ghost {
  background: rgba(245, 240, 230, 0.07);
  border-color: var(--ink-border);
  color: var(--paper-cream);
}

.btn-ghost:hover {
  border-color: var(--gold);
  background: rgba(232, 168, 56, 0.1);
}

.btn-outline {
  background: transparent;
  border-color: var(--ink-border);
  color: var(--paper-cream);
}

.btn-outline:hover {
  border-color: var(--paper-cream);
  background: rgba(245, 240, 230, 0.06);
}

.btn-yt {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--ink-border);
  color: var(--paper-cream);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-yt:hover {
  border-color: #ff4e45;
  color: #ff6b63;
}

.btn-lang {
  background: rgba(232, 168, 56, 0.12);
  border: 1px solid rgba(232, 168, 56, 0.35);
  color: var(--gold);
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-lang:hover {
  background: rgba(232, 168, 56, 0.24);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.mobile-menu-btn span {
  width: 24px;
  height: 2px;
  background: var(--paper-cream);
  border-radius: 2px;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 86vh;
  display: flex;
  align-items: center;
  padding: 5.5rem 0 4.5rem;
  overflow: hidden;
  border-bottom: 1px solid var(--ink-border);
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.45) contrast(1.06);
  transform: scale(1.02);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 75% 25%, rgba(232, 168, 56, 0.2), transparent 55%),
    linear-gradient(180deg, rgba(12, 11, 10, 0.55) 0%, rgba(12, 11, 10, 0.88) 70%, var(--bg-deep) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(232, 168, 56, 0.12);
  border: 1px solid rgba(232, 168, 56, 0.35);
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.nib-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.title-en {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.05;
  color: var(--paper-cream);
}

.title-ar {
  font-size: clamp(1.45rem, 2.8vw, 2.2rem);
  font-weight: 800;
  color: var(--gold);
}

.hero-desc {
  font-size: 1.12rem;
  color: #dcd4c6;
  max-width: 680px;
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.hero-stats {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  background: rgba(21, 19, 16, 0.78);
  border: 1px solid var(--ink-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--paper-muted);
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--ink-border);
}

/* Sections */
.section {
  padding: 5.5rem 0;
  position: relative;
}

.section-header {
  max-width: 680px;
  margin-bottom: 3rem;
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  color: var(--paper-muted);
  font-size: 1.02rem;
}

/* Films Grid */
.films-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.film-card {
  background: var(--bg-card);
  border: 1px solid var(--ink-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.film-card:hover {
  transform: translateY(-6px);
  border-color: rgba(232, 168, 56, 0.45);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
}

.film-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #080706;
  overflow: hidden;
}

.film-thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.film-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 11, 10, 0.55) 0%, transparent 45%, rgba(12, 11, 10, 0.7) 100%);
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

.film-number {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--gold);
  background: rgba(12, 11, 10, 0.7);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.film-duration {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--paper-cream);
  background: rgba(12, 11, 10, 0.7);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.play-trigger {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(245, 240, 230, 0.7);
  background: rgba(12, 11, 10, 0.72);
  color: var(--gold);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.play-trigger:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--gold);
  color: #14110d;
  border-color: var(--gold);
}

.film-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.film-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
}

.tag-gold {
  background: var(--gold-soft);
  color: var(--gold);
}

.tag-teal {
  background: var(--teal-soft);
  color: #66d2d4;
}

.tag-ink {
  background: rgba(245, 240, 230, 0.08);
  color: var(--paper-muted);
  font-family: var(--font-mono);
}

.tag-indigo {
  background: rgba(129, 140, 248, 0.16);
  color: #a5b4fc;
}

.tag-ruby {
  background: rgba(225, 29, 72, 0.18);
  color: #fda4af;
}

.tag-finale {
  background: linear-gradient(135deg, rgba(232, 168, 56, 0.28), rgba(225, 29, 72, 0.22));
  color: #fde68a;
  border: 1px solid rgba(232, 168, 56, 0.4);
}

.film-card-finale {
  border-color: rgba(232, 168, 56, 0.42);
  box-shadow: 0 0 32px rgba(232, 168, 56, 0.12);
}

.film-title {
  display: flex;
  flex-direction: column;
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.65rem;
}

.film-title-en {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--paper-muted);
}

.film-logline {
  font-size: 0.93rem;
  color: #d0c8ba;
  margin-bottom: 1.15rem;
  flex: 1;
}

.film-palette {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}

.swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.film-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.flow-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gold);
  opacity: 0.88;
  transition: opacity 0.2s ease;
}

.flow-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.flow-link-muted {
  color: var(--paper-muted);
}

/* Laws Section */
.laws-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--ink-border);
  border-bottom: 1px solid var(--ink-border);
}

.laws-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.law-card {
  background: var(--bg-card);
  border: 1px solid var(--ink-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
}

.law-index {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 700;
  color: rgba(232, 168, 56, 0.28);
  line-height: 1;
  margin-bottom: 0.75rem;
}

.law-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--paper-cream);
  margin-bottom: 0.75rem;
}

.law-card p {
  color: var(--paper-muted);
  font-size: 0.95rem;
}

/* Characters & Ingredients */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 2rem;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--ink-border);
  color: var(--paper-muted);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--gold);
  color: #14110d;
  border-color: var(--gold);
}

.chars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.35rem;
}

.char-card {
  background: var(--bg-card);
  border: 1px solid var(--ink-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.char-card:hover {
  border-color: rgba(232, 168, 56, 0.4);
  transform: translateY(-3px);
}

.char-card.hidden {
  display: none;
}

.char-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.char-role {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--gold);
}

.char-film-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  background: rgba(245, 240, 230, 0.06);
  color: var(--paper-muted);
}

.badge-teal {
  background: var(--teal-soft);
  color: #66d2d4;
}

.badge-indigo {
  background: rgba(129, 140, 248, 0.16);
  color: #a5b4fc;
}

.badge-ruby {
  background: rgba(225, 29, 72, 0.18);
  color: #fda4af;
}

.badge-finale {
  background: linear-gradient(135deg, rgba(232, 168, 56, 0.28), rgba(225, 29, 72, 0.22));
  color: #fde68a;
}

.char-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
}

.char-en {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--paper-muted);
  margin-bottom: 0.7rem;
}

.char-card p {
  font-size: 0.9rem;
  color: #cfc7b8;
}

/* Voices Registry Section */
.voices-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--ink-border);
}

.voices-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.35rem;
}

.voice-card {
  background: var(--bg-card);
  border: 1px solid var(--ink-border);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.voice-card:hover {
  border-color: rgba(232, 168, 56, 0.4);
  transform: translateY(-3px);
}

.voice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.voice-char {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--paper-cream);
}

.voice-name-chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid rgba(232, 168, 56, 0.35);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

.voice-film {
  font-size: 0.82rem;
  color: var(--paper-muted);
  font-weight: 600;
}

.voice-trait {
  font-size: 0.9rem;
  color: #dcd4c6;
}

/* Studio Section */
.studio-section {
  background: linear-gradient(180deg, var(--bg-deep) 0%, #14110e 100%);
  border-top: 1px solid var(--ink-border);
}

.studio-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.studio-visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--ink-border);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55);
}

.endframe-img {
  width: 100%;
  display: block;
}

.watermark-chip {
  position: absolute;
  bottom: 1rem;
  inset-inline-end: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(12, 11, 10, 0.85);
  border: 1px solid var(--ink-border);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.watermark-chip img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.studio-info p {
  color: var(--paper-muted);
  margin-bottom: 1.75rem;
  font-size: 1.02rem;
}

.studio-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--ink-border);
  padding: 2.25rem 0;
  background: #090807;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.footer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gold);
}

.footer-brand p {
  font-size: 0.82rem;
  color: var(--paper-muted);
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--paper-muted);
}

.footer-meta a:hover {
  color: var(--gold);
}

/* Cinema Modal */
.cinema-modal[hidden] {
  display: none;
}

.cinema-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.cinema-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 4, 0.9);
  backdrop-filter: blur(10px);
}

.cinema-dialog {
  position: relative;
  z-index: 2;
  width: min(980px, 100%);
  background: var(--bg-surface);
  border: 1px solid var(--ink-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
}

.cinema-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--ink-border);
}

.cinema-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-sub {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gold);
}

.cinema-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.format-switcher {
  display: inline-flex;
  background: var(--bg-deep);
  border: 1px solid var(--ink-border);
  border-radius: 999px;
  padding: 3px;
}

.fmt-btn {
  background: transparent;
  border: none;
  color: var(--paper-muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
}

.fmt-btn.active {
  background: var(--gold);
  color: #14110d;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--ink-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--paper-cream);
  font-size: 1rem;
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.cinema-stage {
  background: #000;
  display: grid;
  place-items: center;
  padding: 0.75rem;
}

.cinema-stage video {
  width: 100%;
  max-height: 75vh;
  border-radius: 8px;
}

.cinema-stage.shorts video {
  width: auto;
  max-width: min(400px, 90vw);
  max-height: 76vh;
}

/* Responsive */
@media (max-width: 1024px) {
  .films-grid,
  .laws-grid,
  .chars-grid,
  .voices-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 76px;
    inset-inline: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--ink-border);
    flex-direction: column;
    padding: 1.25rem;
    gap: 1rem;
  }

  .nav-links.open {
    display: flex;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .films-grid,
  .laws-grid,
  .chars-grid,
  .voices-grid {
    grid-template-columns: 1fr;
  }

  .btn-yt span {
    display: none;
  }
}
