@import url('./tokens.css');

:root {
  --sb-w: 72px; --ease-cinema: cubic-bezier(.22,.61,.36,1); --ease-smooth: cubic-bezier(.16,1,.3,1);
}
html { scroll-behavior: auto; }
body {
  background: var(--obsidian); color: var(--snow);
  font-family: var(--ff-body); -webkit-font-smoothing: antialiased;
  overflow-x: hidden; cursor: default; margin: 0;
}
::selection { background: var(--gold-soft); color: var(--gold-bright); }
html[lang="en"] body { font-family: var(--ff-latin-body); }
html[lang="en"] .goldtext, html[lang="en"] .scene-title { font-family: var(--ff-latin-display); }
html[lang="ar"] body { font-family: 'Tajawal', sans-serif; }
html[lang="ar"] .goldtext, html[lang="ar"] .scene-title { font-family: 'Tajawal', sans-serif; }

.goldtext {
  background: var(--text-gold-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.kicker {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: .14em;
  color: var(--gold-bright); font-weight: 500; text-transform: uppercase;
  margin-bottom: 20px; display: block; opacity: .7;
}
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s var(--ease-cinema), transform .9s var(--ease-cinema); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.scene-title {
  font-family: var(--ff-display); font-size: clamp(34px, 6vw, 58px);
  font-weight: 800; line-height: 1.05; letter-spacing: -.025em; margin-bottom: 20px;
}
.scene-p {
  font-size: clamp(15px, 1.2vw, 17px); color: var(--mist);
  line-height: 1.85; max-width: 540px;
}

/* ═══ LEFT FLOATING SIDEBAR ═══ */
.cine-sidebar {
  position: fixed; left: 24px; top: 50%; transform: translateY(-50%); z-index: 1000;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 24px 14px; border-radius: 16px;
  background: rgba(21,19,15,0.45);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--hairline);
  box-shadow: 0 8px 40px rgba(8,7,5,0.5), inset 0 1px 0 rgba(247,242,230,0.04);
  transition: transform .6s var(--ease-cinema), opacity .6s var(--ease-cinema);
  will-change: transform;
}
.cine-sidebar.hidden { transform: translateY(-50%) translateX(-120%); opacity: 0; }
.sidebar-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.sidebar-item {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  position: relative; transition: opacity .35s var(--ease-cinema);
}
.sidebar-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--hairline-strong); transition: all .5s var(--ease-cinema);
}
.sidebar-item.active .sidebar-dot {
  background: var(--gold-bright);
  box-shadow: 0 0 12px rgba(221,184,104,0.4);
}
.sidebar-label {
  font-family: var(--ff-mono); font-size: 8px; letter-spacing: .1em;
  color: var(--mist-dim); text-transform: uppercase;
  opacity: 0; transition: opacity .35s var(--ease-cinema);
  white-space: nowrap;
}
.sidebar-item:hover .sidebar-label,
.sidebar-item.active .sidebar-label { opacity: .8; }
.sidebar-lang { margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.lang-toggle {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  border-radius: 4px; background: rgba(247,242,230,0.04);
  border: 1px solid var(--hairline); color: var(--mist);
  font-size: 10px; font-weight: 600; letter-spacing: .04em;
  cursor: pointer; font-family: var(--ff-mono);
  transition: background .3s var(--ease-cinema), border-color .3s var(--ease-cinema);
}
.lang-toggle:hover { background: rgba(247,242,230,0.08); border-color: var(--gold); color: var(--snow); }
.lang-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 8px rgba(221,184,104,.4); }
@media (max-width: 768px) {
  .cine-sidebar {
    left: auto; right: 20px; top: auto; bottom: 20px;
    transform: none; padding: 0; border-radius: 50%;
    width: 52px; height: 52px; overflow: hidden;
    flex-direction: row; justify-content: center;
    cursor: pointer; transition: width .5s var(--ease-cinema), height .5s var(--ease-cinema), border-radius .5s var(--ease-cinema);
  }
  .cine-sidebar.expanded { width: auto; height: auto; border-radius: 16px; flex-direction: column; padding: 18px 14px; }
  .sidebar-inner { display: none; }
  .cine-sidebar.expanded .sidebar-inner { display: flex; }
  .sidebar-lang { display: none; }
  .cine-sidebar.expanded .sidebar-lang { display: block; }
  .sidebar-label { display: none; }
  .cine-sidebar.expanded .sidebar-label { display: block; }
}

/* ═══ CINEMATIC HERO ═══ */
.cinema-scene {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
#houseCanvas {
  position: absolute; inset: 0; z-index: 1;
  display: block; pointer-events: none;
}
.hero-overlay {
  position: relative; z-index: 2;
  width: 100%; max-width: 1200px; margin: 0 auto;
  padding: 0 48px 0 120px;
  pointer-events: none;
}
.hero-overlay * { pointer-events: auto; }
.hero-inner { max-width: 620px; }
.hero-kicker {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .18em;
  color: var(--gold-bright); font-weight: 500; text-transform: uppercase;
  margin-bottom: 28px; opacity: 0;
}
.hero-title {
  font-family: var(--ff-display); margin-bottom: 24px;
}
.hero-title-line {
  display: block; font-size: clamp(42px, 7.5vw, 76px);
  font-weight: 800; line-height: 1.04; letter-spacing: -.03em;
  opacity: 0; transform: translateY(40px);
}
.hero-sub {
  font-size: clamp(15px, 1.3vw, 18px); color: var(--mist);
  line-height: 1.8; max-width: 480px; margin-bottom: 36px;
  opacity: 0; transform: translateY(20px);
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; opacity: 0; transform: translateY(20px); }
.hero-cta {
  padding: 16px 32px; border-radius: 4px; background: var(--grad-gold);
  color: var(--obsidian); font-weight: 700; font-size: 15px;
  letter-spacing: .01em; text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
  transition: transform .5s var(--ease-cinema), box-shadow .5s var(--ease-cinema);
}
.hero-cta:hover { transform: translateY(-3px); box-shadow: 0 0 40px rgba(221,184,104,.3); }
.cta-arrow { transition: transform .4s var(--ease-cinema); display: inline-block; }
.hero-cta:hover .cta-arrow { transform: translateX(5px); }
.hero-secondary {
  padding: 15px 28px; border-radius: 4px;
  border: 1px solid var(--hairline-strong); color: var(--mist);
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: border-color .4s var(--ease-cinema), color .4s var(--ease-cinema);
}
.hero-secondary:hover { border-color: var(--gold); color: var(--snow); }
.scroll-indicator {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; opacity: 0;
}
.scroll-label {
  font-family: var(--ff-mono); font-size: 8px; letter-spacing: .14em;
  color: var(--mist-dim); text-transform: uppercase;
}
.scroll-line { width: 1px; height: 32px; background: linear-gradient(to bottom, var(--gold-bright), transparent); animation: scrollLine 2.2s ease-in-out infinite; }
@keyframes scrollLine { 0% { transform: scaleY(.3); opacity: .2; } 50% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(.3); opacity: .2; } }
@media (max-width: 768px) {
  .hero-overlay { padding: 0 24px 0 24px; text-align: center; }
  .hero-inner { max-width: none; }
  .hero-sub { max-width: none; }
  .hero-actions { justify-content: center; }
}

/* ═══ SCENE CONTENT ═══ */
.scene-content {
  position: relative; z-index: 2;
  max-width: 1000px; margin: 0 auto; padding: 80px 48px;
}
.scene-content--center { text-align: center; }
.scene-content--center .scene-p { margin: 0 auto; }
.scene-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
}
.scene-story .scene-bg {
  background: radial-gradient(40% 45% at 20% 50%, rgba(221,184,104,.03), transparent 60%);
}
.scene-phil .scene-bg {
  background: radial-gradient(50% 40% at 50% 25%, rgba(221,184,104,.05), transparent 55%);
}
.scene-intel .scene-bg {
  background: radial-gradient(35% 40% at 70% 50%, rgba(221,184,104,.03), transparent 55%);
}
.scene-cta .scene-bg {
  background: radial-gradient(50% 40% at 50% 50%, rgba(221,184,104,.06), transparent 60%);
}

/* ═══ PHILOSOPHY CARDS ═══ */
.phil-quote {
  font-family: var(--ff-display); font-size: clamp(28px, 4vw, 42px);
  font-weight: 700; line-height: 1.3; letter-spacing: -.015em;
  margin-bottom: 48px; max-width: 700px; margin-left: auto; margin-right: auto;
}
.phil-quote-gold { color: var(--gold-bright); }
.phil-grid { display: flex; gap: 20px; max-width: 900px; margin: 0 auto; }
.phil-card {
  flex: 1; padding: 32px 28px; border-radius: 12px;
  background: linear-gradient(160deg, rgba(36,32,25,.5), rgba(27,23,18,.3));
  border: 1px solid var(--panel-border-soft);
  backdrop-filter: blur(8px); transition: transform .6s var(--ease-cinema);
}
.phil-card:hover { transform: translateY(-6px); }
.phil-num {
  font-family: var(--ff-mono); font-size: 10px; font-weight: 600;
  color: var(--gold-bright); margin-bottom: 14px; letter-spacing: .06em;
}
.phil-card-title { font-size: 17px; font-weight: 700; color: var(--snow); margin-bottom: 10px; }
.phil-card-desc { font-size: 14px; color: var(--mist-dim); line-height: 1.7; }
@media (max-width: 768px) { .phil-grid { flex-direction: column; gap: 14px; } }

/* ═══ FOOTER ═══ */
.cine-footer {
  border-top: 1px solid var(--hairline); padding: 32px 48px;
}
.footer-inner {
  max-width: 1000px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.footer-copy { font-size: 12px; color: var(--mist-dim); }
.footer-links { display: flex; gap: 20px; }
.footer-link {
  font-size: 12px; color: var(--mist); text-decoration: none; transition: color .3s var(--ease-cinema);
}
.footer-link:hover { color: var(--snow); }
@media (max-width: 768px) { .cine-footer { padding: 32px 24px; } .footer-inner { flex-direction: column; text-align: center; } }

/* ═══ RTL ═══ */
html[dir="rtl"] .hero-overlay { padding: 0 120px 0 48px; }
html[dir="rtl"] .cine-sidebar { left: auto; right: 24px; }
html[dir="rtl"] .hero-cta:hover .cta-arrow { transform: translateX(-5px); }
html[dir="rtl"] .scene-content { text-align: right; }
html[dir="rtl"] .scene-p { max-width: none; }
html[dir="rtl"] .phil-card { text-align: right; }
html[dir="rtl"] .phil-quote { text-align: center; }
@media (max-width: 768px) {
  html[dir="rtl"] .hero-overlay { padding: 0 24px; }
  html[dir="rtl"] .cine-sidebar { left: auto; right: 20px; }
}

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-kicker, .hero-title-line, .hero-sub, .hero-actions, .scroll-indicator { opacity: 1; transform: none; }
  #houseCanvas { display: none; }
}
