/* =========================================================================
   shivam's lab · private note for Chris · WOW edition
   ========================================================================= */

:root {
  --paper: #f4efe5;
  --paper-deep: #ece5d5;
  --ink: #141310;
  --ink-soft: #34302a;
  --muted: #7a7063;
  --rule: #c8bfab;
  --signal: #e85a1a;
  --signal-deep: #b8430e;
  --signal-glow: rgba(232, 90, 26, 0.35);
  --sepia: #8a7855;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  --max: 1240px;
  --narrow: 680px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.62;
  position: relative;
  overflow-x: hidden;
}

/* =========================================================================
   ambient background orbs
   ========================================================================= */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ambient__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.3;
  will-change: transform;
}
.ambient__orb--1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--signal) 0%, transparent 70%);
  top: -200px; right: -100px;
  animation: orbFloat1 20s ease-in-out infinite;
}
.ambient__orb--2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #c4956a 0%, transparent 70%);
  top: 40%; left: -200px;
  animation: orbFloat2 25s ease-in-out infinite;
}
.ambient__orb--3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--signal) 0%, transparent 70%);
  bottom: 10%; right: -150px;
  opacity: 0.15;
  animation: orbFloat3 18s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-80px, 60px) scale(1.1); }
  66% { transform: translate(40px, -30px) scale(0.95); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(100px, -50px) scale(1.15); }
}
@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-60px, -80px); }
}

/* Grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.2;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' seed='7'/><feColorMatrix type='matrix' values='0 0 0 0 0.08  0 0 0 0 0.06  0 0 0 0 0.04  0 0 0 0.35 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Signal line SVG */
.signal-line {
  position: fixed;
  top: 50%;
  left: 0;
  width: 100%;
  height: 200px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.5s ease;
}
.signal-line.visible {
  opacity: 1;
}
.signal-line__path {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: signalDraw 4s ease forwards;
  animation-play-state: paused;
}
.signal-line.visible .signal-line__path {
  animation-play-state: running;
}
@keyframes signalDraw {
  to { stroke-dashoffset: 0; }
}

::selection {
  background: var(--signal);
  color: var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 180ms ease, color 180ms ease;
}
a:hover {
  color: var(--signal-deep);
  border-color: var(--signal);
}

/* =========================================================================
   masthead
   ========================================================================= */
.masthead {
  position: relative;
  z-index: 10;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--rule);
}
.masthead__mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 18px;
  letter-spacing: 0.01em;
}
.pulse {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 12px var(--signal-glow), 0 0 40px var(--signal-glow);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 12px var(--signal-glow), 0 0 0 0 var(--signal-glow); }
  70% { box-shadow: 0 0 12px var(--signal-glow), 0 0 0 14px transparent; }
  100% { box-shadow: 0 0 12px var(--signal-glow), 0 0 0 0 transparent; }
}
.masthead__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: lowercase;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dot { color: var(--rule); }

/* =========================================================================
   hero
   ========================================================================= */
.hero {
  position: relative;
  z-index: 5;
  max-width: var(--max);
  margin: 0 auto;
  padding: 160px 40px 120px;
}

/* Mouse-following gradient glow */
.hero__glow {
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--signal-glow) 0%, transparent 65%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: -1;
  filter: blur(40px);
}
.hero:hover .hero__glow {
  opacity: 1;
}

/* Hero text line-by-line animation */
.anim-line {
  opacity: 0;
  transform: translateY(40px);
  filter: blur(8px);
}
.anim-line.entered {
  animation: lineReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes lineReveal {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal-deep);
  margin: 0 0 28px;
  display: inline-block;
  padding-left: 14px;
  position: relative;
}
.eyebrow::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 1px;
  background: var(--signal);
  box-shadow: 0 0 8px var(--signal-glow);
}

.hero__title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 30, "WONK" 0;
  font-weight: 350;
  font-size: clamp(48px, 7.5vw, 112px);
  line-height: 0.94;
  letter-spacing: -0.03em;
  margin: 0 0 48px;
  max-width: 14ch;
  color: var(--ink);
}
.hero__title span {
  display: block;
}
.hero__title em {
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 400;
  color: var(--signal);
  text-shadow: 0 0 80px var(--signal-glow);
}

.hero__sub {
  font-family: var(--font-display);
  font-weight: 350;
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.5;
  max-width: 48ch;
  color: var(--ink-soft);
  margin: 0 0 48px;
}

.hero__arrow {
  color: var(--muted);
  margin-bottom: 48px;
  animation: bobArrow 2.5s ease-in-out infinite;
}
@keyframes bobArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 36px;
  max-width: 820px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}
.toc a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  color: var(--ink-soft);
  border: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: all 300ms ease;
}
.toc a:hover {
  color: var(--signal);
  border-color: var(--signal);
  text-shadow: 0 0 20px var(--signal-glow);
}

/* =========================================================================
   sections
   ========================================================================= */
.section {
  position: relative;
  z-index: 5;
  max-width: var(--max);
  margin: 0 auto;
  padding: 100px 40px;
}
.section::before {
  content: "";
  position: absolute;
  top: 0; left: 40px; right: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule) 20%, var(--rule) 80%, transparent);
}
.section--narrow {
  max-width: calc(var(--narrow) + 80px);
}

.section h2 {
  font-family: var(--font-display);
  font-weight: 380;
  font-variation-settings: "SOFT" 30, "WONK" 0;
  font-size: clamp(32px, 3.8vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  color: var(--ink);
  max-width: 22ch;
}
.section h3 {
  font-family: var(--font-display);
  font-weight: 440;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.008em;
  margin: 0 0 10px;
  color: var(--ink);
}
.section p {
  font-size: 18px;
  line-height: 1.68;
  color: var(--ink-soft);
  margin: 0 0 22px;
  max-width: 62ch;
}
.lede {
  font-family: var(--font-display);
  font-size: clamp(20px, 1.7vw, 24px) !important;
  line-height: 1.45 !important;
  font-weight: 380;
  color: var(--ink) !important;
  margin-bottom: 28px !important;
  max-width: 40ch !important;
}
.vigilnova-brand {
  color: var(--signal);
  font-weight: 600;
  text-shadow: 0 0 30px var(--signal-glow);
}

.section__head--wide {
  max-width: 780px;
  margin-bottom: 80px;
}

/* Pull quote with animated bar */
.pull {
  position: relative;
  margin: 56px 0;
  padding: 36px 42px;
  border-left: none;
  background: linear-gradient(135deg, var(--paper-deep) 0%, rgba(232,90,26,0.04) 100%);
  border-radius: 0 12px 12px 0;
  font-family: var(--font-display);
  font-weight: 380;
  font-style: italic;
  font-variation-settings: "SOFT" 80, "WONK" 1;
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1.4;
  color: var(--ink);
  max-width: none;
}
.pull__bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--signal);
  box-shadow: 0 0 16px var(--signal-glow), 0 0 40px var(--signal-glow);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.pull.visible .pull__bar {
  transform: scaleY(1);
}

.aside {
  font-family: var(--font-mono);
  font-size: 13px !important;
  line-height: 1.7 !important;
  color: var(--muted) !important;
  border-top: 1px dashed var(--rule);
  padding-top: 24px;
  margin-top: 64px !important;
  max-width: 68ch !important;
}

/* =========================================================================
   phases (the proposal)
   ========================================================================= */
.phase {
  padding: 60px 0;
  border-top: 1px solid var(--rule);
}
.phase:last-of-type {
  border-bottom: 1px solid var(--rule);
}
.phase__header {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 16px;
}
.phase__number {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--signal-deep);
  text-shadow: 0 0 20px var(--signal-glow);
  white-space: nowrap;
  padding: 4px 12px;
  border: 1px solid rgba(232, 90, 26, 0.25);
  border-radius: 4px;
  background: rgba(232, 90, 26, 0.05);
}
.phase h3 {
  font-family: var(--font-display);
  font-weight: 440;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.phase > p {
  font-size: 18px;
  line-height: 1.68;
  color: var(--ink-soft);
  margin: 0 0 40px;
  max-width: 62ch;
}
.phase__shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.phase__shots .shot { margin: 0; }

@media (max-width: 820px) {
  .phase__shots { grid-template-columns: 1fr; gap: 40px; }
  .phase__header { flex-direction: column; gap: 8px; }
}

/* =========================================================================
   rollout list (pilot guardrails)
   ========================================================================= */
.rollout {
  list-style: none;
  padding: 0;
  margin: 48px 0 0;
  counter-reset: rollout;
  display: grid;
  gap: 24px;
}
.rollout li {
  counter-increment: rollout;
  position: relative;
  padding: 28px 32px 28px 72px;
  background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(232,90,26,0.03) 100%);
  border: 1px solid var(--rule);
  border-radius: 10px;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 400ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 400ms ease;
}
.rollout li:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 90, 26, 0.3);
  box-shadow: 0 16px 40px -20px rgba(232, 90, 26, 0.2),
              0 0 0 1px rgba(232, 90, 26, 0.1);
}
.rollout li::before {
  content: counter(rollout, decimal-leading-zero);
  position: absolute;
  left: 24px;
  top: 30px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--signal);
  letter-spacing: 0.08em;
  font-weight: 500;
  text-shadow: 0 0 16px var(--signal-glow);
}
.rollout li::after {
  content: "";
  position: absolute;
  left: 24px;
  top: 50px;
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, var(--signal), transparent);
  opacity: 0.5;
}
.rollout h3 {
  font-family: var(--font-display);
  font-weight: 440;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.008em;
  margin: 0 0 8px;
  color: var(--ink);
}
.rollout p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
  max-width: 62ch;
}

@media (max-width: 820px) {
  .rollout li { padding: 24px 20px 24px 20px; }
  .rollout li::before { position: static; display: block; margin-bottom: 8px; }
  .rollout li::after { display: none; }
}

/* =========================================================================
   scope list
   ========================================================================= */
.scope {
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  counter-reset: scope;
}
.scope li {
  counter-increment: scope;
  padding: 32px 0 32px 80px;
  border-top: 1px solid var(--rule);
  position: relative;
}
.scope li:last-child {
  border-bottom: 1px solid var(--rule);
}
.scope li::before {
  content: counter(scope, decimal-leading-zero);
  position: absolute;
  left: 0; top: 34px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--signal-deep);
  letter-spacing: 0.06em;
  text-shadow: 0 0 20px var(--signal-glow);
}

/* =========================================================================
   screenshot cards with 3D tilt + glow
   ========================================================================= */
.shot {
  margin: 80px 0;
  max-width: none;
  perspective: 1200px;
}

.shot__card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a1a;
  padding: 8px;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
  box-shadow:
    0 2px 0 rgba(0,0,0,0.08),
    0 20px 40px -20px rgba(20, 19, 16, 0.25),
    0 0 0 1px rgba(255,255,255,0.06) inset;
}
.shot__card:hover {
  box-shadow:
    0 2px 0 rgba(0,0,0,0.08),
    0 40px 80px -20px rgba(20, 19, 16, 0.35),
    0 0 0 1px rgba(255,255,255,0.1) inset,
    0 0 60px -10px var(--signal-glow);
}

.shot__glow {
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), var(--signal-glow) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}
.shot__card:hover .shot__glow {
  opacity: 1;
}

.shot__card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  position: relative;
  z-index: 1;
}

.shot figcaption {
  font-family: var(--font-display);
  font-style: italic;
  font-variation-settings: "SOFT" 80, "WONK" 0;
  font-weight: 380;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-soft);
  padding: 20px 8px 0;
  max-width: 72ch;
}
.figcaption__number {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal-deep);
  margin-right: 14px;
  text-shadow: 0 0 12px var(--signal-glow);
}

.shot--hero {
  margin: 64px -40px 100px;
  padding: 0 40px;
}
.shot--wide {
  margin: 100px -40px;
  padding: 0 40px;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin: 80px 0;
}
.two-col .shot { margin: 0; }

/* =========================================================================
   reveal animations
   ========================================================================= */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  filter: blur(4px);
  transition:
    opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Screenshot reveal: scale up from slightly smaller */
.reveal-shot {
  opacity: 0;
  transform: translateY(60px) scale(0.95);
  transition:
    opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-shot.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* =========================================================================
   signoff
   ========================================================================= */
.signoff {
  font-family: var(--font-display);
  font-size: 28px !important;
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  color: var(--ink) !important;
  margin-top: 56px !important;
  display: flex;
  align-items: center;
  gap: 18px;
}
.signoff__line {
  width: 40px; height: 2px;
  background: var(--signal);
  box-shadow: 0 0 12px var(--signal-glow);
  display: inline-block;
}

/* =========================================================================
   footer
   ========================================================================= */
.footer {
  position: relative;
  z-index: 5;
  max-width: var(--max);
  margin: 120px auto 0;
  padding: 48px 40px 72px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
}
.footer__lead {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--muted);
  margin: 0;
  max-width: 48ch;
}
.footer__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}
.footer__meta p { margin: 0 0 4px; }

/* =========================================================================
   responsive
   ========================================================================= */
@media (max-width: 820px) {
  .masthead { padding: 20px 24px; }
  .hero { padding: 100px 24px 70px; }
  .section { padding: 72px 24px; }
  .section::before { left: 24px; right: 24px; }
  .pull { padding: 24px 28px; }
  .shot--hero, .shot--wide { margin-left: -24px; margin-right: -24px; padding: 0 24px; }
  .two-col { grid-template-columns: 1fr; gap: 48px; }
  .scope li { padding-left: 52px; }
  .footer { padding: 40px 24px 56px; }
  .footer__meta { text-align: left; }
  .toc { gap: 14px 24px; }
  .hero__glow { display: none; }
  .ambient__orb { filter: blur(80px); opacity: 0.15; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
  .ambient__orb { animation: none; }
  .hero__arrow { animation: none; }
  html { scroll-behavior: auto; }
  .anim-line { opacity: 1; transform: none; filter: none; }
  .reveal, .reveal-shot { opacity: 1; transform: none; filter: none; transition: none; }
}
