/* =========================================================
   Cavalier — AI Film Studio
   Tokens, base, header, hero, brief, marquee
   ========================================================= */

:root {
  --bg: #0a0a0a;
  --bg-2: #101010;
  --bone: #f2efe7;
  --bone-dim: #e3ded2;
  --ink: #0a0a0a;
  --muted: #9b978d;
  --muted-2: #6e6a62;
  --line: rgba(242, 239, 231, 0.12);
  --line-strong: rgba(242, 239, 231, 0.24);
  --accent: #ff5a36;
  --accent-soft: #ff8a6f;
  --green: #7ef0b2;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --container: 1440px;
  --gutter: clamp(20px, 3.6vw, 48px);
  --header-h: 78px;
  --r: 18px;
  --ease: cubic-bezier(0.22, 0.68, 0.16, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

html.is-locked,
body.is-locked { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

main { overflow-x: clip; }

img, video, svg { display: block; }
img { max-width: 100%; height: auto; }

h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input, select, textarea { font: inherit; }

::selection { background: var(--accent); color: var(--bone); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: min(100% - (var(--gutter) * 2), var(--container));
  margin-inline: auto;
}

.section { padding-block: clamp(80px, 10vw, 150px); }

.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;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--bone);
  color: var(--ink);
  font-size: 13px;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease);
}
.skip-link:focus { transform: none; }

/* ---------- Type ---------- */

.h2 {
  font-size: clamp(2.55rem, 5.5vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-weight: 500;
  text-wrap: balance;
}

.h2 em,
.cta__title em,
.manifesto blockquote em,
.brief-modal__body h2 em,
.brief-modal__success h2 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.012em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow .sep { color: var(--muted-2); }

.lede {
  max-width: 47ch;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.3vw, 1.2rem);
  line-height: 1.55;
  letter-spacing: -0.008em;
}

.muted { color: var(--muted); }

.mono {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-dot,
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.live-dot {
  box-shadow: 0 0 0 3px rgba(255, 90, 54, 0.16);
  animation: pulse 2.2s ease-in-out infinite;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background 0.35s var(--ease), color 0.35s var(--ease),
    border-color 0.35s var(--ease), transform 0.35s var(--ease);
}

.btn svg {
  width: 13px;
  height: 13px;
  flex: none;
  transition: transform 0.35s var(--ease);
}

.btn:hover svg { transform: translate(2px, -2px); }
.btn:active { transform: scale(0.98); }

.btn--bone { background: var(--bone); color: var(--ink); }
.btn--bone:hover { background: var(--accent); color: var(--bone); }

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--bone);
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn--ghost:hover { border-color: var(--bone); background: rgba(255, 255, 255, 0.09); }

.btn--outline { border-color: var(--line-strong); color: var(--bone); }
.btn--outline:hover { border-color: var(--bone); background: var(--bone); color: var(--ink); }

.btn--accent { background: var(--accent); color: #0b0b0b; font-weight: 600; }
.btn--accent:hover { background: var(--accent-soft); }

.btn--dark { background: var(--ink); color: var(--bone); }
.btn--dark:hover { background: var(--accent); color: #fff; }

.btn--sm { padding: 11px 17px; font-size: 12.5px; }
.btn--full { width: 100%; }

.play-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(242, 239, 231, 0.34);
  border-radius: 50%;
  flex: none;
}
.play-dot svg { width: 10px; height: 10px; margin-left: 1px; }

/* ---------- Grain + progress ---------- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: overlay;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 110;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.08s linear;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 80;
  transition: background 0.45s var(--ease), border-color 0.45s var(--ease);
}

.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: transparent;
  transition: background 0.45s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.site-header.is-scrolled::after { background: var(--line); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(100% - (var(--gutter) * 2), var(--container));
  height: var(--header-h);
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--bone);
}

.brand__mark { width: 27px; height: 27px; flex: none; }

.brand__word {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.012em;
  padding-top: 3px;
}

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

.nav a {
  position: relative;
  padding: 4px 0;
  color: rgba(242, 239, 231, 0.7);
  font-size: 13.5px;
  transition: color 0.3s var(--ease);
}

.nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}

.nav a:hover { color: var(--bone); }
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav a.is-active { color: var(--bone); }
.nav a.is-active::after { transform: scaleX(1); transform-origin: left; }

.header-actions { display: flex; align-items: center; gap: 18px; }

.header-link {
  color: rgba(242, 239, 231, 0.7);
  font-size: 13.5px;
  transition: color 0.3s var(--ease);
}
.header-link:hover { color: var(--bone); }

.menu-btn {
  position: relative;
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  flex: none;
}

.menu-btn span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.5px;
  background: var(--bone);
  transition: transform 0.35s var(--ease), top 0.35s var(--ease), bottom 0.35s var(--ease);
}
.menu-btn span:first-child { top: 17px; }
.menu-btn span:last-child { bottom: 17px; }

.menu-btn.is-close span:first-child { top: 21px; transform: rotate(45deg); }
.menu-btn.is-close span:last-child { bottom: 21px; transform: rotate(-45deg); }

/* ---------- Mobile menu ---------- */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  padding: 0 var(--gutter) 30px;
  background: var(--bg);
  visibility: hidden;
  transform: translateY(-100%);
  transition: transform 0.65s var(--ease), visibility 0.65s;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mobile-menu.is-open { visibility: visible; transform: none; }

.mobile-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  flex: none;
}

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  margin-top: 5vh;
}

.mobile-menu__nav a {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(2.25rem, 9vw, 3.6rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
  transition: color 0.3s var(--ease), padding-left 0.35s var(--ease);
}
.mobile-menu__nav a .mono {
  width: 26px;
  color: var(--muted-2);
  font-size: 9px;
}
.mobile-menu__nav a:hover { color: var(--accent); padding-left: 8px; }

.mobile-menu__foot {
  display: flex;
  flex-direction: column;
  gap: 26px;
  margin-top: auto;
  padding-top: 48px;
}
.mobile-menu__foot .btn { align-self: flex-start; }

.mobile-menu__meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.mobile-menu__meta .mono { color: var(--muted-2); font-size: 9px; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: calc(var(--header-h) + 28px);
  padding-bottom: 26px;
  overflow: hidden;
}

.hero__media,
.hero__scrim { position: absolute; inset: 0; }

.hero__media { z-index: 0; background: #0b0d10; }

.hero__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.94) contrast(1.03);
  animation: heroZoom 18s var(--ease) forwards;
}

.hero__scrim {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(10, 10, 10, 0.62) 0%, rgba(10, 10, 10, 0.08) 26%, rgba(10, 10, 10, 0.16) 52%, rgba(10, 10, 10, 0.94) 100%),
    linear-gradient(90deg, rgba(10, 10, 10, 0.72) 0%, rgba(10, 10, 10, 0.12) 56%, rgba(10, 10, 10, 0.05) 100%);
}

.hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: clamp(36px, 7vh, 80px);
}

.hero__content { max-width: 960px; padding-top: 12vh; }

.hero__eyebrow {
  margin-bottom: 24px;
  color: rgba(242, 239, 231, 0.74);
  letter-spacing: 0.16em;
}

.hero__title {
  font-size: clamp(3.5rem, 8.5vw, 8.1rem);
  font-weight: 500;
  line-height: 0.87;
  letter-spacing: -0.055em;
  text-wrap: balance;
  text-shadow: 0 12px 60px rgba(0, 0, 0, 0.35);
}

.hero__title em {
  display: inline-block;
  padding-right: 0.06em;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.hero__lede {
  margin-top: 26px;
  max-width: 460px;
  color: rgba(242, 239, 231, 0.73);
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  line-height: 1.58;
  letter-spacing: -0.008em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.hero__rail {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(242, 239, 231, 0.16);
}

.hero__now {
  display: flex;
  align-items: baseline;
  gap: 18px;
  min-width: 0;
}
.hero__now-label { color: rgba(242, 239, 231, 0.44); flex: none; }

.hero__now-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hero__now-title strong {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.hero__now-sub {
  color: rgba(242, 239, 231, 0.5);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero__facts {
  display: flex;
  gap: 18px;
  color: rgba(242, 239, 231, 0.48);
  white-space: nowrap;
}
.hero__facts span + span::before {
  content: "·";
  margin-right: 18px;
  color: rgba(242, 239, 231, 0.24);
}

.hero__scroll {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(242, 239, 231, 0.52);
  flex: none;
  transition: color 0.3s var(--ease);
}
.hero__scroll:hover { color: var(--bone); }

.scroll-line {
  position: relative;
  width: 58px;
  height: 1px;
  background: rgba(242, 239, 231, 0.24);
  overflow: hidden;
}
.scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-100%);
  animation: scrollLine 2.6s ease-in-out infinite;
}

/* ---------- Brief / composer ---------- */

.brief {
  position: relative;
  padding-top: clamp(70px, 8vw, 112px);
  padding-bottom: clamp(60px, 7vw, 100px);
}

.brief__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(40px, 6vw, 100px);
  align-items: end;
}

.brief__head .h2 {
  margin-top: 18px;
  font-size: clamp(2.4rem, 4.7vw, 4.35rem);
}

.brief__note {
  margin-top: 18px;
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.6;
}

.composer {
  padding: 10px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.022));
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.composer:focus-within {
  border-color: rgba(255, 90, 54, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 90, 54, 0.07), 0 30px 80px -40px rgba(0, 0, 0, 0.9);
}

.composer__row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 8px 13px 14px;
}

.composer__spark {
  color: var(--accent);
  font-size: 19px;
  line-height: 1;
  flex: none;
}

.composer__input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--bone);
  font-size: clamp(15px, 1.25vw, 16.5px);
  letter-spacing: -0.012em;
  outline: none;
}
.composer__input::placeholder { color: var(--muted-2); }

.composer__submit {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #0b0b0b;
  flex: none;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}
.composer__submit:hover { transform: scale(1.06); background: var(--accent-soft); }
.composer__submit svg { width: 19px; height: 19px; }

.composer__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 10px 4px 14px;
  border-top: 1px solid var(--line);
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.chip:hover {
  color: var(--bone);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
}

.composer__hint { color: var(--muted-2); flex: none; }

.brief__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 14px;
  padding-left: 4px;
  color: var(--muted-2);
}
.brief__foot span + span::before {
  content: "·";
  margin-right: 20px;
  color: var(--line-strong);
}

/* ---------- Marquee ---------- */

.marquee {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.014);
  overflow: hidden;
}

.marquee__track {
  display: flex;
  align-items: center;
  width: max-content;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.4rem, 2.35vw, 2.15rem);
  letter-spacing: -0.02em;
  color: rgba(242, 239, 231, 0.85);
  white-space: nowrap;
  animation: marquee 42s linear infinite;
}

.marquee:hover .marquee__track { animation-play-state: paused; }

.marquee__track span,
.marquee__track i {
  display: inline-block;
  margin-right: 36px;
}

.marquee__track i {
  color: var(--accent);
  font-style: normal;
  font-size: 13px;
  transform: translateY(-1px);
}

/* ---------- Shared section head ---------- */

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: end;
  margin-bottom: clamp(38px, 5vw, 64px);
}

.section-head__main .h2 { margin-top: 20px; }
.section-head__main .lede { margin-top: 22px; }

.section-head__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  padding-bottom: 5px;
  text-align: right;
  color: var(--muted);
}
.section-head__side .mono { color: var(--muted); }
.section-head__side .mono + .mono { color: var(--muted-2); }

/* ---------- Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0s);
}
.reveal.is-in { opacity: 1; transform: none; }

.rise {
  opacity: 0;
  transform: translateY(26px);
  animation: rise 1.1s var(--ease) forwards;
  animation-delay: var(--delay, 0.1s);
}
.rise--2 { --delay: 0.2s; }
.rise--3 { --delay: 0.3s; }
.rise--4 { --delay: 0.42s; }
.rise--5 { --delay: 0.55s; }

/* ---------- Keyframes ---------- */

@keyframes rise {
  to { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@keyframes scrollLine {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}
@keyframes heroZoom {
  from { transform: scale(1.08); }
  to { transform: scale(1.01); }
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes slowZoom {
  from { transform: scale(1.02); }
  to { transform: scale(1.1); }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
