/* ==========================================================================
   DreamEngine — Cinematic Landing Page
   ========================================================================== */

:root {
  --black: #08080a;
  --near-black: #0e0e11;
  --panel: #141417;
  --cream: #f3ede2;
  --cream-dim: #b9b3a8;
  --gold: #d3a24c;
  --gold-dim: #8a6f3e;
  --gold-deep: #7a5f26;
  --gold-light: #e8d9a8;
  --line: rgba(243, 237, 226, 0.12);

  --font-display: 'Inter', sans-serif;
  --font-body: 'Manrope', sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--black);
  color: var(--cream);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: default;
}

img, video, canvas { display: block; max-width: 100%; }

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

section { position: relative; }

::selection { background: var(--gold); color: var(--black); }

/* ---------------- Custom cursor (desktop only) ---------------- */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  .cursor {
    position: fixed;
    top: 0; left: 0;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--cream);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    transition: width .25s var(--ease), height .25s var(--ease), background .25s var(--ease);
  }
  .cursor span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--black);
    opacity: 0;
    transition: opacity .2s var(--ease);
    white-space: nowrap;
  }
  .cursor.is-play {
    width: 84px; height: 84px;
    background: var(--gold);
  }
  .cursor.is-play span { opacity: 1; }
}
@media (hover: none), (pointer: coarse) {
  .cursor { display: none; }
}

/* ---------------- Preloader ---------------- */
.preloader {
  position: fixed; inset: 0;
  background: var(--black);
  z-index: 10000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px;
  transition: opacity .6s var(--ease), visibility .6s var(--ease);
}
.preloader__mark {
  width: clamp(110px, 22vw, 190px);
  height: auto;
  animation: preloaderPulse 1.6s var(--ease) infinite;
}
@keyframes preloaderPulse {
  0%, 100% { opacity: 0.75; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.03); }
}
.preloader__bar {
  width: 220px; height: 2px;
  background: var(--line);
  overflow: hidden;
}
.preloader__bar span {
  display: block; height: 100%; width: 0%;
  background: var(--gold);
  animation: loadbar 1.4s var(--ease) forwards;
}
@keyframes loadbar { to { width: 100%; } }
.preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------------- Letterbox bars ---------------- */
.letterbox {
  position: fixed; left: 0; right: 0;
  height: 6vh;
  background: #000;
  z-index: 9000;
  transition: height 1.1s var(--ease) .3s;
}
.letterbox--top { top: 0; }
.letterbox--bottom { bottom: 0; }
.letterbox.is-open { height: 0; }

/* ---------------- Nav ---------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px clamp(20px, 5vw, 56px);
  transition: padding .4s var(--ease), background .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  padding: 16px clamp(20px, 5vw, 56px);
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(10px);
  border-color: var(--line);
}
.nav__logo { display: flex; align-items: center; }
.nav__logo img {
  height: clamp(38px, 4.5vw, 52px);
  width: auto;
  transition: opacity .25s var(--ease);
}
.nav__logo:hover img { opacity: 0.85; }
.nav__links { display: flex; align-items: center; gap: 36px; }
.nav__links a {
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--cream-dim);
  transition: color .25s var(--ease);
  position: relative;
}
.nav__links a:hover { color: var(--cream); }
.nav__cta {
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--cream) !important;
}
.nav__cta:hover { border-color: var(--gold); color: var(--gold) !important; }

.nav__burger {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer;
  z-index: 600;
}
.nav__burger span { width: 26px; height: 2px; background: var(--cream); transition: transform .3s var(--ease), opacity .3s var(--ease); }

.mobile-menu {
  position: fixed; inset: 0;
  background: var(--black);
  z-index: 400;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 28px;
  transform: translateY(-100%);
  transition: transform .5s var(--ease);
}
.mobile-menu.is-open { transform: translateY(0); }
.mobile-menu a { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; letter-spacing: 0.04em; }

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(120% 100% at 50% 20%, #17141a 0%, #0a090b 60%, #050506 100%);
}
.hero__canvas, .hero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* Real video is present, so the canvas fallback stays loaded (in case the video
   fails to play) but hidden underneath rather than removed — js/main.js re-shows
   it automatically if the <video> errors out. */
.hero__canvas { display: none; }
.hero__canvas.is-fallback-active { display: block; }
.hero__vignette {
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 45%, transparent 35%, rgba(0,0,0,0.75) 100%);
  pointer-events: none;
}
.hero__grain {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.hero__content {
  position: relative; z-index: 2;
  text-align: center;
  padding: 0 20px;
  max-width: 900px;
}
.hero__crest {
  width: clamp(70px, 9vw, 110px);
  height: auto;
  margin: 0 auto 22px;
  opacity: 0.95;
  filter: drop-shadow(0 0 18px rgba(211, 162, 76, 0.25));
}
.hero__eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 22px;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3.2rem, 12vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: 0.01em;
}
.reveal-line { display: block; overflow: hidden; }
.reveal-word { display: inline-block; will-change: transform; }
.hero__tagline {
  margin: 28px auto 0;
  max-width: 520px;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--cream-dim);
  font-weight: 300;
}
.hero__actions {
  margin-top: 44px;
  display: flex; align-items: center; justify-content: center;
  gap: 18px; flex-wrap: wrap;
}
.btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 16px 30px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .3s var(--ease);
  display: inline-flex; align-items: center; gap: 10px;
}
.btn--primary { background: var(--gold); color: var(--black); font-weight: 700; }
.btn--primary:hover { background: var(--cream); transform: translateY(-2px); }
.btn--ghost { border-color: var(--line); color: var(--cream); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn__icon { font-size: 0.7rem; }

.hero__scroll {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--cream-dim);
  z-index: 2;
}
.hero__scroll-line { width: 1px; height: 46px; background: var(--line); overflow: hidden; }
.hero__scroll-line i { display: block; width: 100%; height: 40%; background: var(--gold); animation: scrolldrop 2s var(--ease) infinite; }
@keyframes scrolldrop {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(250%); }
}

/* ---------------- Manifesto ---------------- */
.manifesto {
  padding: clamp(90px, 14vw, 180px) clamp(20px, 8vw, 140px);
  background: var(--near-black);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.manifesto__text {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(1.6rem, 4vw, 3.1rem);
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: var(--cream-dim);
}
.manifesto__text .manifesto__accent,
.manifesto__text .reveal-word.is-in { color: var(--cream); }
.manifesto__accent { color: var(--gold) !important; font-weight: 700; }

/* ---------------- Section headers ---------------- */
.section-head {
  padding: clamp(70px, 10vw, 120px) clamp(20px, 8vw, 140px) clamp(30px, 6vw, 60px);
  max-width: 900px;
}
.section-head__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  color: var(--gold-dim);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
}
.section-head__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.4rem);
  margin: 14px 0 18px;
  letter-spacing: 0.01em;
}
.section-head__desc {
  color: var(--cream-dim);
  font-size: 1rem;
  max-width: 560px;
  font-weight: 300;
  line-height: 1.6;
}
.section-head--light .section-head__desc,
.section-head--light .section-head__title { color: var(--cream); text-shadow: 0 2px 18px rgba(0,0,0,0.55); }

/* ---------------- Work / film grid ---------------- */
.work { background: var(--black); padding-bottom: clamp(60px, 10vw, 120px); }
.film-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.4vw, 32px);
  padding: 0 clamp(20px, 8vw, 140px);
}
.film-card__media {
  position: relative;
  aspect-ratio: 900 / 1272;
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
}
.film-card__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease), filter .6s var(--ease);
}
.film-card:hover .film-card__media img { transform: scale(1.05); filter: brightness(1.08); }
.film-card__badge {
  position: absolute; top: 12px; left: 12px;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--black);
  background: var(--gold);
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 700;
}
.film-card__info { margin-top: 16px; }
.film-card__info h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: 0.01em; }
.film-card__info p { color: var(--cream-dim); font-size: 0.8rem; margin-top: 4px; }
.film-card__hook { font-weight: 300; line-height: 1.55; margin-top: 8px !important; max-width: 34ch; }

@media (max-width: 980px) {
  .film-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .film-grid { grid-template-columns: 1fr; }
}

/* ---------------- Future / AI concepts ---------------- */
.future {
  position: relative;
  background: var(--near-black);
  border-top: 1px solid var(--line);
  overflow: hidden;
  padding-bottom: clamp(60px, 10vw, 100px);
}
.future__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}
.future__canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.5; z-index: 1; }
.future__scrim {
  position: absolute; inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(6,6,7,0.55) 0%, rgba(6,6,7,0.22) 22%, rgba(14,14,17,0.28) 60%, rgba(14,14,17,0.55) 100%);
  pointer-events: none;
}
.future .section-head, .future .concept-grid, .future__note { position: relative; z-index: 2; }
.concept-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 26px);
  padding: 0 clamp(20px, 8vw, 140px);
}
.concept-card__media {
  position: relative;
  aspect-ratio: 900 / 1272;
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid rgba(211,162,76,0.35);
}
.concept-card__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.concept-card:hover .concept-card__media img { transform: scale(1.05); }
.concept-card__tag {
  position: absolute; top: 12px; right: 12px;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(10, 9, 8, 0.72);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(211,162,76,0.45);
  padding: 5px 10px;
  border-radius: 999px;
}
.concept-card h3 { font-family: var(--font-display); font-weight: 700; margin-top: 16px; font-size: 1.05rem; }
.concept-card__vs { font-family: var(--font-body); font-weight: 400; font-size: 0.7rem; color: var(--cream-dim); display: block; letter-spacing: 0.02em; margin-top: 2px; }
.concept-card p { color: var(--cream-dim); font-size: 0.78rem; margin-top: 4px; }
.future__note {
  margin: 50px clamp(20px, 8vw, 140px) 0;
  font-size: 0.8rem;
  color: var(--cream-dim);
  max-width: 640px;
  line-height: 1.6;
}
.future__note a {
  color: var(--gold);
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 1px;
  transition: opacity .25s var(--ease);
}
.future__note a:hover { opacity: 0.7; }

@media (max-width: 860px) {
  .concept-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .concept-grid { grid-template-columns: 1fr; }
}

/* ---------------- About / stats ---------------- */
.about {
  background: var(--black);
  padding: clamp(70px, 10vw, 120px) clamp(20px, 8vw, 140px);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  border-top: 1px solid var(--line);
}
.about__text p {
  color: var(--cream-dim);
  font-weight: 300;
  line-height: 1.7;
  max-width: 480px;
  margin-top: 16px;
}
.about__text p strong { color: var(--cream); font-weight: 600; }
.founders {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 30px;
}
.founder { display: flex; align-items: center; gap: 14px; }
.founder__photo {
  width: 72px; height: 72px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(211,162,76,0.4);
  filter: grayscale(1) contrast(1.02);
}
.founder__info { display: flex; flex-direction: column; }
.founder__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--cream);
}
.founder__role {
  font-size: 0.75rem;
  color: var(--cream-dim);
  margin-top: 2px;
}
.about__stats { display: flex; gap: clamp(24px, 4vw, 60px); align-items: flex-end; }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat__num { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.4rem, 5vw, 3.6rem); color: var(--gold); }
.stat__label { font-size: 0.78rem; color: var(--cream-dim); max-width: 120px; }

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
}

/* ---------------- What We Offer ---------------- */
.offer {
  background: var(--near-black);
  border-top: 1px solid var(--line);
  padding-bottom: clamp(70px, 10vw, 120px);
}
.offer__body {
  padding: 0 clamp(20px, 8vw, 140px);
  max-width: 700px;
}
.offer__hook {
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  color: var(--gold);
  line-height: 1.3;
}
.offer__lede {
  color: var(--cream-dim);
  font-weight: 300;
  line-height: 1.7;
  margin-top: 18px;
  max-width: 560px;
}
.offer__point { margin-top: 32px; }
.offer__point h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--cream);
  margin-bottom: 8px;
}
.offer__point p {
  color: var(--cream-dim);
  font-weight: 300;
  line-height: 1.7;
  max-width: 560px;
}
.offer__cta {
  margin-top: 36px;
  font-size: 0.95rem;
  color: var(--cream-dim);
}
.offer__cta a {
  color: var(--gold);
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 1px;
  transition: opacity .25s var(--ease);
  font-weight: 600;
}
.offer__cta a:hover { opacity: 0.7; }

/* ---------------- Contact ---------------- */
.contact {
  background: var(--near-black);
  border-top: 1px solid var(--line);
  padding: clamp(90px, 14vw, 180px) clamp(20px, 8vw, 140px);
  text-align: center;
}
.contact__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(2.4rem, 7vw, 5.2rem);
  line-height: 1.05;
}
.contact__email {
  display: inline-block;
  margin-top: 34px;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  color: var(--gold);
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 4px;
  transition: opacity .25s var(--ease);
}
.contact__email:hover { opacity: 0.7; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.contact__form {
  margin: 40px auto 0;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}
.contact__form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.contact__form-row input { flex: 1 1 220px; }
.contact__form input[type="text"],
.contact__form input[type="email"],
.contact__form textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 14px 16px;
  border-radius: 10px;
  transition: border-color .25s var(--ease);
  resize: vertical;
}
.contact__form input[type="text"]:focus,
.contact__form input[type="email"]:focus,
.contact__form textarea:focus {
  outline: none;
  border-color: var(--gold-dim);
}
.contact__form input::placeholder,
.contact__form textarea::placeholder { color: var(--cream-dim); opacity: 0.7; }
.contact__form .btn { align-self: flex-start; border: none; cursor: pointer; }
.contact__honeypot { display: none; }
.contact__form-status {
  font-size: 0.85rem;
  color: var(--cream-dim);
  min-height: 1.2em;
}
.contact__form-status.is-success { color: var(--gold); }
.contact__form-status.is-error { color: #d3714c; }

@media (max-width: 640px) {
  .contact__form { text-align: center; }
  .contact__form .btn { align-self: center; }
}

/* ---------------- Footer ---------------- */
.footer {
  background: var(--black);
  padding: 26px clamp(20px, 8vw, 140px);
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--cream-dim);
}
.footer__logo { height: 22px; width: auto; }

@media (max-width: 560px) {
  .footer { flex-direction: column; gap: 10px; text-align: center; }
}

/* ---------------- Modal ---------------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(5,5,6,0.94);
  z-index: 8000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s var(--ease);
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__body {
  width: min(1000px, 90vw);
  aspect-ratio: 16/9;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.modal__body video { width: 100%; height: 100%; border-radius: inherit; background: var(--black); }
.modal__placeholder { text-align: center; color: var(--cream-dim); }
.modal__placeholder p:first-child { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--cream); margin-bottom: 10px; }
.modal__placeholder-sub { font-size: 0.75rem; }
.modal__close {
  position: absolute; top: 28px; right: clamp(20px, 5vw, 56px);
  background: none; border: none; color: var(--cream);
  font-size: 1.2rem; cursor: pointer;
}

/* ---------------- Reveal-on-scroll base state ----------------
   Elements are visible by default so the page still works with no JS /
   with GSAP blocked (ad-blocker, offline, corporate firewall). When GSAP
   loads successfully, js/main.js adds `.js-anim` to <html> and only THEN
   do these selectors start hidden, to be revealed by the scroll timeline. */
.js-anim .reveal { opacity: 0; transform: translateY(24px); }
.js-anim .film-card, .js-anim .concept-card, .js-anim .stat { opacity: 0; transform: translateY(30px); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}
