/* ==========================================================================
   ValleyPilot AI
   ========================================================================== */

:root {
  --bg: #07080a;
  --bg-2: #0d0f13;
  --fg: #f3f0ea;
  --muted: #8d8a85;
  --line: rgba(243, 240, 234, 0.12);
  --amber: #ffb35c;
  --coral: #ff5e3a;
  --violet: #8b6bff;
  --grad: linear-gradient(100deg, var(--amber), var(--coral) 50%, var(--violet));
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --pad: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }

a { color: inherit; text-decoration: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--coral); color: var(--bg); }

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

/* ---------- Grain ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5%, 3%); }
  40% { transform: translate(3%, -6%); }
  60% { transform: translate(-7%, -2%); }
  80% { transform: translate(6%, 5%); }
}

/* ---------- Cursor ---------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 99; pointer-events: none;
  mix-blend-mode: difference; display: none;
}
.cursor span {
  display: block; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: #fff;
  transition: transform .4s var(--ease);
}
.cursor.is-hover span { transform: scale(4.5); }
@media (hover: hover) and (pointer: fine) { .cursor { display: block; } }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  display: grid; place-items: center; align-content: center; gap: 28px;
  transition: transform 1.1s var(--ease) .1s;
}
.loader__inner { font-size: clamp(40px, 8vw, 96px); font-weight: 600; letter-spacing: -0.04em; overflow: hidden; display: flex; gap: .2em; }
.loader__word { display: inline-block; transform: translateY(110%); animation: rise .9s var(--ease) forwards; }
.loader__word--serif { font-family: var(--serif); font-style: italic; font-weight: 400; animation-delay: .12s;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .1em; }
.loader__bar { width: min(240px, 50vw); height: 1px; background: var(--line); overflow: hidden; }
.loader__bar span { display: block; height: 100%; background: var(--grad); transform-origin: left; animation: load 1.2s var(--ease) forwards; transform: scaleX(0); }
.loader.is-done { transform: translateY(-100%); }
@keyframes rise { to { transform: translateY(0); } }
@keyframes load { to { transform: scaleX(1); } }

/* ---------- Nav ---------- */
.nav {
  position: fixed; z-index: 50; left: 0; right: 0;
  top: env(safe-area-inset-top, 0px);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px var(--pad);
  transition: transform .5s var(--ease), background .4s, backdrop-filter .4s;
}
.nav.is-scrolled {
  background: rgba(7, 8, 10, .55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav.is-hidden { transform: translateY(-110%); }
.nav__logo { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; font-size: 18px; }
.nav__logo em { margin-left: 3px; font-size: 1.1em; color: var(--amber); }
.nav__links { display: flex; gap: 36px; font-size: 14px; color: var(--muted); }
.nav__links a { position: relative; transition: color .3s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease);
}
.nav__links a:hover { color: var(--fg); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__toggle { display: none; }

.mobile-menu {
  position: fixed; inset: 0; z-index: 45; background: var(--bg);
  display: flex; flex-direction: column; justify-content: center; gap: 12px;
  padding: 0 var(--pad);
}
[hidden] { display: none !important; }
.mobile-menu a { font-size: clamp(36px, 10vw, 56px); font-weight: 500; letter-spacing: -0.03em; }

@media (max-width: 860px) {
  .nav__links, .nav > .btn { display: none; }
  .nav__toggle {
    display: grid; gap: 6px; width: 44px; height: 44px; place-content: center;
    background: none; border: 1px solid var(--line); border-radius: 50%; cursor: pointer;
  }
  .nav__toggle span { display: block; width: 18px; height: 1.5px; background: var(--fg); transition: transform .4s var(--ease); }
  .nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
}

/* ---------- Buttons ---------- */
.btn {
  --h: 52px;
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  height: var(--h); padding: 0 26px; border-radius: 999px;
  font: 500 15px/1 var(--sans); letter-spacing: -0.01em;
  border: 1px solid var(--line); background: transparent; color: var(--fg);
  cursor: pointer; overflow: hidden; isolation: isolate;
  transition: border-color .3s, color .4s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--fg); transform: translateY(101%); transition: transform .5s var(--ease);
}
.btn:hover::before { transform: translateY(0); }
.btn:hover { color: var(--bg); border-color: var(--fg); }
.btn svg { transition: transform .5s var(--ease); }
.btn:hover svg { transform: translate(2px, -2px) rotate(45deg); }
.btn--small { --h: 42px; padding: 0 18px; font-size: 14px; }
.btn--primary { background: var(--grad); border: 0; color: #140a05; font-weight: 600; }
.btn--primary::before { background: var(--fg); }
.btn--ghost { color: var(--fg); }

/* ---------- Typography ---------- */
.label { font-size: 13px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 0 28px; }
.h2 {
  font-size: clamp(38px, 6vw, 88px); line-height: .98; letter-spacing: -0.045em; font-weight: 500;
  margin: 0; max-width: 16ch;
}
.h2 em, .hero__title em, .cta__title em {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .06em;
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin: 0 0 28px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.02); backdrop-filter: blur(6px); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 0 rgba(255,94,58,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255,94,58,0); } 100% { box-shadow: 0 0 0 0 rgba(255,94,58,0); } }

section { position: relative; padding: clamp(96px, 14vw, 180px) var(--pad); }
.section-head { display: grid; gap: 0; margin-bottom: clamp(48px, 7vw, 96px); }

/* Line mask reveal */
.line { display: block; overflow: hidden; padding-bottom: .06em; }
.line__inner { display: inline-block; transform: translateY(105%); transition: transform 1.2s var(--ease); }
.is-ready .hero .line__inner,
.line.is-in .line__inner { transform: translateY(0); }
.hero .line:nth-child(2) .line__inner { transition-delay: .1s; }
.cta .line:nth-child(2) .line__inner { transition-delay: .1s; }

/* Generic reveal */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh; padding-top: 140px; padding-bottom: 72px;
  display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__glow {
  position: absolute; left: 50%; top: 38%; width: 70vw; height: 40vw; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255,94,58,.28), rgba(139,107,255,.12) 55%, transparent);
  filter: blur(40px); pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 40%; pointer-events: none;
  background: linear-gradient(to top, var(--bg), transparent);
}
.hero__content { position: relative; z-index: 2; max-width: 1200px; }
.hero__title {
  font-size: clamp(56px, 12.5vw, 200px); line-height: .9; letter-spacing: -0.055em; font-weight: 500; margin: 0 0 32px;
}
.hero__sub { max-width: 520px; color: #c9c5bd; font-size: clamp(16px, 1.4vw, 19px); margin: 0 0 36px; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__meta {
  position: absolute; z-index: 2; right: var(--pad); bottom: 72px;
  display: flex; align-items: center; gap: 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted);
  writing-mode: vertical-rl;
}
.hero__scroll { width: 1px; height: 64px; background: var(--line); position: relative; overflow: hidden; }
.hero__scroll i { position: absolute; left: 0; top: -40%; width: 100%; height: 40%; background: var(--fg); animation: scrolly 2s var(--ease) infinite; }
@keyframes scrolly { to { top: 100%; } }
@media (max-width: 860px) { .hero__meta { display: none; } }

.is-ready .hero .reveal { opacity: 1; transform: none; }
.hero .reveal:nth-of-type(1) { transition-delay: .05s; }
.hero__sub.reveal { transition-delay: .3s; }
.hero__ctas.reveal { transition-delay: .42s; }

/* ---------- Marquee ---------- */
.marquee {
  padding: 28px 0; border-block: 1px solid var(--line); overflow: hidden;
  background: var(--bg);
}
.marquee__track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group { display: flex; align-items: center; gap: 36px; padding-right: 36px; }
.marquee span { font-size: clamp(28px, 4vw, 56px); font-weight: 500; letter-spacing: -0.03em; white-space: nowrap; }
.marquee span:nth-of-type(even) { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--muted); }
.marquee i { font-style: normal; color: var(--coral); font-size: 20px; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee__track { animation: none; } }

/* ---------- Manifesto ---------- */
.manifesto { max-width: 1400px; }
.manifesto__text {
  font-size: clamp(28px, 4.4vw, 68px); line-height: 1.1; letter-spacing: -0.035em; font-weight: 500; margin: 0;
}
.manifesto__text .w { opacity: .14; transition: opacity .3s linear; }
.manifesto__text .w.is-lit { opacity: 1; }

/* ---------- Services ---------- */
.services__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 860px) { .services__grid { grid-template-columns: 1fr; } }
.card {
  --mx: 50%; --my: 50%;
  position: relative; padding: clamp(28px, 3.4vw, 48px); border-radius: 28px;
  background: var(--bg-2); border: 1px solid var(--line); overflow: hidden;
  min-height: 380px; display: flex; flex-direction: column;
  transform-style: preserve-3d; will-change: transform;
  transition: border-color .4s, transform .6s var(--ease), opacity 1.1s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(500px circle at var(--mx) var(--my), rgba(255,122,74,.16), transparent 40%);
}
.card:hover { border-color: rgba(243,240,234,.24); }
.card:hover::before { opacity: 1; }
.card__num { position: absolute; top: clamp(28px, 3.4vw, 48px); right: clamp(28px, 3.4vw, 48px); font-size: 13px; color: var(--muted); }
.card__icon { width: 56px; height: 56px; margin-bottom: auto; }
.card__icon svg { width: 100%; height: 100%; fill: none; stroke: var(--amber); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: clamp(26px, 2.6vw, 38px); letter-spacing: -0.035em; font-weight: 500; margin: 56px 0 12px; }
.card p { color: #b3afa7; margin: 0 0 24px; max-width: 46ch; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: 12.5px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: #c9c5bd; }

/* ---------- Process (horizontal) ---------- */
.process { padding: 0; height: 400vh; }
.process__sticky {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: clamp(32px, 5vh, 64px);
  padding: 96px var(--pad) 48px;
}
.process__head { display: grid; }
.process__progress { margin-top: 32px; width: min(360px, 60%); height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.process__progress span { display: block; height: 100%; background: var(--grad); transform-origin: left; transform: scaleX(0); }
.process__track { display: flex; gap: 20px; will-change: transform; }
.step {
  flex: 0 0 clamp(300px, 36vw, 520px); min-height: clamp(280px, 40vh, 380px);
  padding: clamp(28px, 3vw, 44px); border-radius: 28px; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255,255,255,.04), rgba(255,255,255,0));
  display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.step__num {
  font-family: var(--serif); font-style: italic; font-size: clamp(80px, 9vw, 140px); line-height: .8;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: auto;
}
.step h3 { font-size: clamp(28px, 3vw, 44px); letter-spacing: -0.04em; font-weight: 500; margin: 32px 0 10px; }
.step p { color: #b3afa7; margin: 0; max-width: 38ch; }
.step__time { position: absolute; top: clamp(28px, 3vw, 44px); right: clamp(28px, 3vw, 44px); font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }

@media (max-width: 860px), (prefers-reduced-motion: reduce) {
  .process { height: auto; padding: clamp(96px, 14vw, 180px) var(--pad); }
  .process__sticky { position: static; height: auto; padding: 0; overflow: visible; }
  .process__track { flex-direction: column; transform: none !important; }
  .step { flex-basis: auto; min-height: 260px; }
  .process__progress { display: none; }
}

/* ---------- Before / After ---------- */
.shift__table { border-top: 1px solid var(--line); }
.shift__row {
  display: grid; grid-template-columns: 1fr 64px 1fr; align-items: center; gap: 16px;
  padding: 28px 0; border-bottom: 1px solid var(--line);
  font-size: clamp(17px, 1.6vw, 24px); letter-spacing: -0.02em;
}
.shift__row > span:first-child { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255,94,58,.6); text-decoration-thickness: 1px; }
.shift__row i { font-style: normal; color: var(--coral); text-align: center; }
.shift__row--head { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); padding: 16px 0; }
.shift__row--head > span:first-child { text-decoration: none; }
@media (max-width: 640px) {
  .shift__row { grid-template-columns: 1fr; gap: 6px; }
  .shift__row i { display: none; }
  .shift__row--head { display: none; }
}

/* ---------- Industries ---------- */
.industries__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ind {
  position: relative; display: grid; grid-template-columns: 60px 1fr auto; align-items: baseline; gap: 16px;
  padding: clamp(20px, 2.6vw, 36px) 0; border-bottom: 1px solid var(--line); overflow: hidden; isolation: isolate;
}
.ind::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grad);
  transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--ease);
}
.ind__n { font-size: 13px; color: var(--muted); transition: color .4s; }
.ind__name { font-size: clamp(28px, 4.6vw, 72px); letter-spacing: -0.045em; font-weight: 500; line-height: 1; transition: transform .6s var(--ease), color .4s; }
.ind__desc { color: var(--muted); font-size: 14px; text-align: right; transition: color .4s; }
@media (hover: hover) {
  .ind:hover::before { transform: scaleY(1); }
  .ind:hover .ind__name { transform: translateX(20px); color: #140a05; }
  .ind:hover .ind__n, .ind:hover .ind__desc { color: #140a05; }
}
@media (max-width: 640px) {
  .ind { grid-template-columns: 36px 1fr; }
  .ind__desc { grid-column: 2; text-align: left; }
}

/* ---------- Principles ---------- */
.principles {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 64px);
  padding-top: 0;
}
.principle { border-top: 1px solid var(--line); padding-top: 24px; }
.principle__k { display: block; font-family: var(--serif); font-style: italic; font-size: clamp(32px, 3.4vw, 48px); line-height: 1; margin-bottom: 14px; }
.principle p { color: #b3afa7; margin: 0; max-width: 34ch; }
.principle:nth-child(2) { transition-delay: .1s; }
.principle:nth-child(3) { transition-delay: .2s; }
@media (max-width: 860px) { .principles { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq__list { border-top: 1px solid var(--line); max-width: 1100px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 28px 0; font-size: clamp(20px, 2.2vw, 30px); letter-spacing: -0.03em; font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.plus { flex: 0 0 auto; position: relative; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; transition: transform .5s var(--ease), background .3s; }
.plus::before, .plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; background: var(--fg); transform: translate(-50%, -50%); }
.plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq details[open] .plus { transform: rotate(45deg); background: rgba(255,255,255,.06); }
.faq details p { margin: 0 0 28px; color: #b3afa7; max-width: 64ch; font-size: 17px; }

/* ---------- CTA ---------- */
.cta { text-align: center; overflow: hidden; display: flex; flex-direction: column; align-items: center; padding-block: clamp(120px, 18vw, 240px); }
.cta__orb {
  position: absolute; left: 50%; top: 50%; width: min(900px, 120vw); aspect-ratio: 1; transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg, var(--amber), var(--coral), var(--violet), var(--amber));
  border-radius: 50%; filter: blur(120px); opacity: .28; animation: spin 18s linear infinite; pointer-events: none;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.cta > *:not(.cta__orb) { position: relative; }
.cta__title { font-size: clamp(56px, 11vw, 180px); line-height: .9; letter-spacing: -0.055em; font-weight: 500; margin: 0 0 28px; }
.cta__sub { max-width: 520px; color: #c9c5bd; font-size: clamp(16px, 1.4vw, 19px); margin: 0 0 40px; }
.cta__form {
  display: flex; gap: 8px; width: min(560px, 100%); padding: 6px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(7,8,10,.6); backdrop-filter: blur(10px);
}
.cta__form input {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--fg);
  font: 400 16px var(--sans); padding: 0 20px;
}
.cta__form input::placeholder { color: var(--muted); }
.cta__form:focus-within { border-color: rgba(243,240,234,.35); }
.cta__note { min-height: 1.5em; margin: 16px 0 0; color: var(--muted); font-size: 14px; }
@media (max-width: 520px) {
  .cta__form { flex-direction: column; border-radius: 24px; }
  .cta__form input { height: 52px; }
  .cta__form .btn { justify-content: center; }
}

/* ---------- Footer ---------- */
.footer { padding: 0 var(--pad) calc(28px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); overflow: hidden; }
.footer__big {
  font-size: clamp(64px, 19vw, 340px); line-height: .8; letter-spacing: -0.065em; font-weight: 600;
  margin: clamp(40px, 6vw, 80px) 0 clamp(16px, 3vw, 36px); padding-bottom: .12em; white-space: nowrap;
  background: linear-gradient(to bottom, var(--fg) 30%, rgba(243,240,234,.05));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.footer__row a:hover { color: var(--fg); }

/* Focus */
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
