/* ===========================================================================
   Ravyn Intelligence — teaser. "From conversation to finished work."
   Warm-dark editorial + an agent-swarm visualization. Themeable.
   =========================================================================== */
:root {
  --ravyn-black: #0B0D10;
  --smoke: #A3A7AE;
  --fog: #E5E7EB;

  /* accent + aurora — Indigo (gold type, violet aurora) */
  --gold: #DBAF60;
  --gold-soft: #EFCD8C;
  --deep-gold: #A8842F;
  --orb-1: rgba(212,162,74,0.40);
  --orb-2: rgba(110,100,205,0.50);
  --orb-3: rgba(13,15,30,0.85);

  --display: "Instrument Serif", Georgia, serif;
  --display-italic: italic;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--ravyn-black); color: var(--fog);
  font-family: var(--sans); font-weight: 300; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
::selection { background: rgba(212,162,74,0.3); color: #fff; }

/* ---- aurora hero image (subtly drifting mist) ---------------------------- */
.hero-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  filter: brightness(0.82) saturate(1.05);
}
.hero-bg-layer {
  position: absolute; inset: 0; display: block;
  background: url("/img/hero_aurora.png") 50% 82% / cover no-repeat;
  will-change: transform;
}
/* base layer + a counter-drifting copy → the mist visibly churns,
   while the dark raven (screen-blended, near-still) holds. Pure GPU transforms. */
.hero-bg-a { animation: drift-a 34s ease-in-out infinite; }
.hero-bg-b { mix-blend-mode: screen; opacity: 0.32; animation: drift-b 46s ease-in-out infinite; }
@keyframes drift-a {
  0%, 100% { transform: scale(1.08) translate(0, 0); }
  50%      { transform: scale(1.14) translate(-3%, 2%); }
}
@keyframes drift-b {
  0%, 100% { transform: scale(1.12) translate(2.6%, -1.6%); }
  50%      { transform: scale(1.07) translate(-2.2%, 2.4%); }
}

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

body::after {
  content: ""; position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11,13,16,0.74) 0%, rgba(11,13,16,0.30) 46%, transparent 82%),
    linear-gradient(0deg, rgba(11,13,16,0.5) 0%, transparent 28%);
}

/* ---- stage --------------------------------------------------------------- */
.stage { position: relative; z-index: 3; min-height: 100svh; display: flex; flex-direction: column; padding: clamp(24px,4vw,44px) clamp(24px,6vw,80px); }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.brand {
  height: clamp(58px, 6.4vw, 88px); width: auto; display: block;
  filter: drop-shadow(0 3px 16px rgba(0,0,0,0.55));
}
.topbar-cta {
  font-family: var(--sans); appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fog);
  text-decoration: none; padding: 9px 18px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  border-radius: 999px; transition: all 0.3s var(--ease); white-space: nowrap;
}
.topbar-cta:hover { background: var(--gold); color: var(--ravyn-black); border-color: var(--gold); }
.topbar-nav { display: flex; align-items: center; gap: 14px; }
.topbar-link {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--fog); text-decoration: none; padding: 9px 6px; white-space: nowrap;
  opacity: 0.85; transition: opacity 0.3s var(--ease);
}
.topbar-link:hover { opacity: 1; }

/* ---- hero (two columns) -------------------------------------------------- */
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, 430px);
  gap: clamp(36px, 5vw, 84px);
  align-items: center;
  max-width: 1240px; width: 100%;
  padding: clamp(12px, 2.5vh, 36px) 0;
}
.hero-copy { min-width: 0; }

.eyebrow { font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold); margin: 0 0 18px; }
h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(40px, 5.6vw, 82px); line-height: 1.03; letter-spacing: 0.005em;
  margin: 0 0 20px; color: #fff;
}
h1 em { font-style: var(--display-italic); color: var(--gold); }

.sub { font-size: clamp(17px, 1.7vw, 21px); font-weight: 300; color: var(--fog); max-width: 32em; margin: 0 0 14px; line-height: 1.55; }

/* the cycling word lives on its own line and is the LAST element, so changing it
   never reflows the paragraph and never leaves a gap. */
.cycle-line {
  display: flex; align-items: center; gap: 9px;
  font-size: clamp(14px, 1.4vw, 17px); color: var(--smoke); letter-spacing: 0.01em;
  margin: 0 0 30px; white-space: nowrap;
}
.cycle-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 9px var(--gold); flex: none; animation: pulse 2.4s var(--ease) infinite; }
.cycle {
  font-family: var(--display); font-style: var(--display-italic); font-size: 1.3em; color: var(--gold);
  transition: opacity 0.34s var(--ease), transform 0.34s var(--ease);
}
.cycle.out { opacity: 0; transform: translateY(-7px); }

/* ---- primary CTA button -------------------------------------------------- */
.cta-main {
  display: inline-flex; align-items: center; gap: 14px;
  background: var(--gold); color: var(--ravyn-black);
  border: 1px solid var(--gold); border-radius: 999px;
  padding: 17px 32px; font-family: var(--sans); font-weight: 600;
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  cursor: pointer; transition: all 0.3s var(--ease); align-self: flex-start;
}
.cta-main:hover { background: var(--gold-soft); border-color: var(--gold-soft); transform: translateY(-1px); }
.cta-main .arrow { width: 24px; height: 24px; }

.arrow { width: 22px; height: 22px; border-radius: 50%; border: 1px solid currentColor; position: relative; flex: none; }
.arrow::before { content: ""; position: absolute; left: 46%; top: 50%; width: 6px; height: 6px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translate(-50%,-50%) rotate(-45deg); }

/* ---- access modal -------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5,6,9,0.66); backdrop-filter: blur(6px); animation: fade 0.3s var(--ease); }
.modal-card {
  position: relative; z-index: 1; width: 100%; max-width: 440px;
  background: rgba(17,19,28,0.94); border: 1px solid rgba(219,175,96,0.28);
  border-radius: 18px; padding: 36px 34px 30px;
  box-shadow: 0 40px 120px rgba(0,0,0,0.6);
  animation: pop 0.34s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-x { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--smoke); font-size: 28px; line-height: 1; cursor: pointer; padding: 4px; }
.modal-x:hover { color: var(--fog); }
.modal-eyebrow { font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold); margin: 0 0 10px; }
.modal-title { font-family: var(--display); font-weight: 400; font-size: 34px; color: #fff; margin: 0 0 8px; }
.modal-sub { color: var(--smoke); font-size: 14px; margin: 0 0 22px; line-height: 1.5; }

/* ---- form (inside the modal) -------------------------------------------- */
.access-form { display: flex; flex-direction: column; gap: 12px; }
.access-form input {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.16); border-radius: 10px;
  padding: 15px 16px; color: var(--fog); font-family: var(--sans); font-size: 16px; width: 100%;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.access-form input::placeholder { color: rgba(163,167,174,0.5); }
.access-form input:focus { outline: none; border-color: var(--gold); background: color-mix(in srgb, var(--gold) 7%, transparent); }
.submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; background: var(--gold); color: var(--ravyn-black);
  border: 1px solid var(--gold); border-radius: 10px; padding: 16px 24px; font-family: var(--sans); font-weight: 600;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; cursor: pointer; white-space: nowrap; transition: all 0.3s var(--ease);
}
.submit--full { width: 100%; }
.submit:hover:not(:disabled) { background: var(--gold-soft); border-color: var(--gold-soft); }
.submit:disabled { opacity: 0.55; cursor: default; }
.form-note { min-height: 20px; margin: 6px 0 0; font-size: 14px; color: var(--smoke); }
.form-note.ok { color: var(--gold-soft); }
.form-note.err { color: #e0857a; }
.access-form.sent input, .access-form.sent .submit { display: none; }
.modal-guarantee { margin: 10px 0 0; font-size: 12.5px; color: var(--smoke); line-height: 1.5; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 12px; }

/* ---- agent swarm visualization ------------------------------------------ */
.swarm {
  position: relative;
  border: 1px solid rgba(255,255,255,0.09); border-radius: 18px;
  background: rgba(13,15,22,0.18); backdrop-filter: blur(4px);
  padding: 26px 26px 22px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.22);
}
.swarm-cap { display: flex; align-items: center; gap: 10px; font-size: 12.5px; letter-spacing: 0.04em; color: var(--smoke); margin: 0; }
.swarm-cap--top { margin-bottom: 18px; }
.swarm-cap--out { justify-content: flex-end; margin-top: 18px; color: var(--gold-soft); }
.swarm-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); flex: none; }
.swarm-dot.out { animation: pulse 2.4s var(--ease) infinite; }

.swarm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: relative; }
.swarm-grid::before {
  content: ""; position: absolute; inset: -9px; border-radius: 14px;
  background: radial-gradient(60% 60% at 50% 50%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 70%);
  pointer-events: none;
}
.agent {
  position: relative; display: flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 13px; font-weight: 400; color: var(--fog);
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px; padding: 9px 12px;
}
.agent i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: none;
  box-shadow: 0 0 8px var(--gold); animation: pulse 2.4s var(--ease) infinite;
}
.agent:nth-child(1) i  { animation-delay: 0s; }
.agent:nth-child(2) i  { animation-delay: 0.2s; }
.agent:nth-child(3) i  { animation-delay: 0.4s; }
.agent:nth-child(4) i  { animation-delay: 0.6s; }
.agent:nth-child(5) i  { animation-delay: 0.8s; }
.agent:nth-child(6) i  { animation-delay: 1.0s; }
.agent:nth-child(7) i  { animation-delay: 1.2s; }
.agent:nth-child(8) i  { animation-delay: 1.4s; }
.agent:nth-child(9) i  { animation-delay: 1.6s; }
.agent:nth-child(10) i { animation-delay: 1.8s; }
.agent:nth-child(11) i { animation-delay: 2.0s; }
.agent:nth-child(12) i { animation-delay: 2.2s; }
@keyframes pulse { 0%,100% { opacity: 0.35; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.15); } }

.swarm-note { margin: 14px 2px 0; font-size: 12.5px; color: var(--smoke); line-height: 1.5; }

/* ---- footer -------------------------------------------------------------- */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: clamp(18px,3vh,30px); font-size: 12px; color: rgba(163,167,174,0.55); letter-spacing: 0.03em; }
.foot .dot { color: color-mix(in srgb, var(--gold) 55%, transparent); }
.foot-link { color: rgba(163,167,174,0.75); text-decoration: none; transition: color 0.3s var(--ease); }
.foot-link:hover { color: var(--fog); }

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

/* ---- responsive ---------------------------------------------------------- */
/* Desktop: lock to one screen, no scroll. */
@media (min-width: 921px) {
  html, body { overflow: hidden; }
  .stage { height: 100svh; }
}
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .swarm { max-width: 460px; }
}
@media (max-width: 620px) {
  .brand { height: 42px; }
}
/* static capture mode (?still=1) — freezes all motion so a headless screenshot can settle */
.no-motion *, .no-motion *::before, .no-motion *::after { animation: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-bg-a, .hero-bg-b, .grain, .agent i, .swarm-dot.out { animation: none; }
  .hero-bg-a { transform: scale(1.04); }
  .hero-bg-b { display: none; }
  .cycle { transition: none; }
  .agent i, .swarm-dot { opacity: 0.9; }
}
