/* ==========================================================
   AVARA v8 — Extravagance layer
   Adds: grain overlay, custom cursor, fluid scroll reveals,
         page-transition fade, billboard "watermark" numerals,
         testimonial pull-quote, alternating work rows on home,
         pillar full-width rows, Cal.com modal scaffold.
   Layered on top of the v7 Studio Black system — does not
   override the brand toolkit's locked tokens.
   ========================================================== */

/* ---------- GLOBAL GRAIN OVERLAY (0.035 opacity) ---------- */

body {
  /* ss01: Inter's double-story 'a' alternate — reads less geometric/AI, more editorial */
  font-feature-settings: 'ss01', 'cv11';
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.95 0 0 0 0 0.85 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  opacity: 0.022;
  mix-blend-mode: overlay;
}
@media (prefers-reduced-motion: reduce) {
  body::after { opacity: 0.015; }
}

/* ---------- AVARA HERO + SECTION HEADLINES → FRAUNCES (editorial, established) ---------- */

.route-home .home-headline,
.route-home .cta-headline,
.route-home .pillars .headline,
.route-home .featured-work-v8 .section-header .headline,
.route-work .page-title,
.route-work .cta-headline,
.route-process .page-title,
.route-process .cta-headline,
.route-process .process-extravagant .process-content h2,
.route-about .page-title,
.route-about .cta-headline {
  font-family: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-feature-settings: 'ss01';
}
.route-home .home-headline { font-weight: 500; line-height: 0.98; }
.route-home .pillars .headline { font-weight: 500; }
.route-home .cta-headline,
.route-work .cta-headline,
.route-process .cta-headline { font-weight: 500; letter-spacing: -0.025em; }

/* Inside-page billboards keep the Fraunces feel */
.cta-headline .serif-italic,
.home-headline .serif-italic,
.page-title .serif-italic { font-family: 'Fraunces', serif; font-style: italic; font-weight: 400; }

/* Make sure interactive content sits above the grain */
.nav, main, footer, .modal { position: relative; z-index: 2; }

/* ---------- CUSTOM CURSOR (desktop only) ---------- */

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transition: opacity 200ms ease, transform 180ms var(--ease-out), border-color 180ms ease, background 180ms ease, width 180ms var(--ease-out), height 180ms var(--ease-out);
  will-change: transform;
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 8px;
  height: 8px;
  background: #EDE9DF;
  margin: -4px 0 0 -4px;
}
.cursor-ring {
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 1px solid rgba(237, 233, 223, 0.6);
  background: transparent;
  transform: translate(0, 0) scale(0.5);
  opacity: 0.7;
}
.cursor-ring.is-hover {
  transform: translate(0, 0) scale(1.1);
  border-color: var(--color-accent);
  opacity: 1;
}
.cursor-ring.is-hidden,
.cursor-dot.is-hidden { opacity: 0; }

@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor-dot, .cursor-ring { display: none !important; }
}
html.has-custom-cursor,
html.has-custom-cursor body,
html.has-custom-cursor a,
html.has-custom-cursor button { cursor: none; }
html.has-custom-cursor input,
html.has-custom-cursor textarea,
html.has-custom-cursor select { cursor: text; }

/* ---------- FLUID SCROLL REVEAL HOOKS ---------- */

.reveal-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
}
.reveal-up.is-in { opacity: 1; transform: translateY(0); }

.reveal-img {
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
}
.reveal-img.is-in { opacity: 1; transform: scale(1); }

.reveal-row {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.reveal-row.is-in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal-up, .reveal-img, .reveal-row { opacity: 1; transform: none; }
}

/* ---------- PAGE TRANSITION FADE ---------- */

main { animation: pageFadeIn 220ms var(--ease-out); }
.is-leaving main { opacity: 0; transition: opacity 200ms ease; }
@keyframes pageFadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { main { animation: none; } }

/* ---------- LIVE BADGE (used on Nocturne row) ---------- */

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ink);
  background: rgba(237, 233, 223, 0.02);
}
.badge-live::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 0 rgba(217, 96, 59, 0.6);
  animation: live-pulse 2.2s var(--ease-out) infinite;
  flex-shrink: 0;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(217, 96, 59, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(217, 96, 59, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 96, 59, 0); }
}
@media (prefers-reduced-motion: reduce) { .badge-live::before { animation: none; } }

/* ---------- HOMEPAGE: ALTERNATING FULL-BLEED WORK ROWS ---------- */

.featured-work-v8 { padding-block: clamp(120px, 16vw, 200px); }

.work-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(96px, 14vw, 192px);
}

.work-stack-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.work-stack-row:nth-child(even) { grid-template-columns: 1fr 1.4fr; }
.work-stack-row:nth-child(even) .work-stack-frame { order: 2; }
.work-stack-row:nth-child(even) .work-stack-meta { order: 1; }

@media (max-width: 880px) {
  .work-stack-row,
  .work-stack-row:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .work-stack-row:nth-child(even) .work-stack-frame { order: 0; }
  .work-stack-row:nth-child(even) .work-stack-meta { order: 1; }
}

.work-stack-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 11;
  background: var(--color-bg-elevated-2);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.6);
  transition: transform 520ms var(--ease-out), box-shadow 520ms var(--ease-out);
}
.work-stack-row:hover .work-stack-frame {
  transform: scale(1.02);
  box-shadow: 0 50px 100px -30px rgba(0,0,0,0.8), 0 0 0 1px var(--color-accent);
}

.work-stack-frame .bframe {
  position: absolute;
  inset: 0;
  border-radius: 0;
  border: none;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-elevated);
}
.work-stack-frame .feature-thumb {
  flex: 1;
  background-size: cover;
  background-position: center;
}
.feature-thumb-neoreach {
  background-color: #08090C;
  background-image:
    radial-gradient(circle at 18% 28%, rgba(34, 197, 94, 0.18), transparent 38%),
    radial-gradient(circle at 78% 72%, rgba(245, 158, 11, 0.14), transparent 42%),
    linear-gradient(180deg, #0A0C10 0%, #06070A 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}
/* SVG dot grid + small "dashboard" UI hint baked behind the thumb */
.feature-thumb-neoreach::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center;
  opacity: 0.7;
}

.work-stack-meta {
  position: relative;
  padding: clamp(24px, 4vw, 56px) 0;
}
.work-stack-watermark {
  font-family: var(--font-display);
  font-size: clamp(120px, 16vw, 220px);
  font-weight: 200;
  line-height: 0.85;
  color: #1A1A1A;
  letter-spacing: -0.05em;
  position: absolute;
  top: -24px;
  left: -8px;
  user-select: none;
  pointer-events: none;
  z-index: 0;
}
.work-stack-meta > * { position: relative; z-index: 1; }

.work-stack-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
  margin-bottom: var(--space-4);
  display: inline-block;
}
.work-stack-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.6vw, 72px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: var(--color-ink);
  margin-bottom: var(--space-6);
}
.work-stack-line {
  font-size: var(--text-body-lg);
  line-height: 1.6;
  color: var(--color-ink-muted);
  max-width: 48ch;
  margin-bottom: var(--space-6);
}
.work-stack-line em {
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--color-accent);
  font-weight: 500;
}
.work-stack-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  transition: gap 220ms var(--ease-out), border-color 220ms ease;
}
.work-stack-row:hover .work-stack-link {
  gap: 16px;
  border-bottom-color: var(--color-accent);
}

/* ---------- HOMEPAGE: PULLQUOTE TESTIMONIAL ---------- */

.pullquote-section {
  padding-block: clamp(120px, 18vw, 240px);
  text-align: center;
  position: relative;
}
.pullquote {
  max-width: 1080px;
  margin: 0 auto;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 4.6vw, 56px);
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--color-ink);
}
.pullquote-meta {
  margin-top: clamp(32px, 4vw, 56px);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-ink-muted);
}
.pullquote-pending {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: clamp(18px, 2.2vw, 28px);
  color: var(--color-ink-subtle);
  letter-spacing: -0.01em;
  line-height: 1.5;
  max-width: 720px;
  margin: 0 auto;
}

/* ---------- HOMEPAGE: STUDIO PILLARS (full-width ruled rows) ---------- */

.pillars {
  padding-block: clamp(120px, 16vw, 200px);
}
.pillars-list {
  border-top: 1px solid var(--color-border);
  margin-top: clamp(56px, 8vw, 96px);
}
.pillar-row {
  display: grid;
  grid-template-columns: 140px 1.2fr 2fr;
  gap: clamp(20px, 4vw, 64px);
  align-items: baseline;
  padding: clamp(40px, 6vw, 64px) 0;
  border-bottom: 1px solid var(--color-border);
}
@media (max-width: 720px) {
  .pillar-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 32px 0;
  }
}
.pillar-num {
  font-family: var(--font-mono);
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-accent);
}
.pillar-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--color-ink);
}
.pillar-body {
  font-size: var(--text-body-lg);
  line-height: 1.65;
  color: var(--color-ink-muted);
  max-width: 56ch;
}

/* ---------- /process/ extravagant rebuild ---------- */

.process-extravagant .process-step-v8 {
  position: relative;
  min-height: 88vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
  padding-block: clamp(80px, 12vw, 144px);
  border-top: 1px solid var(--color-border);
}
.process-extravagant .process-step-v8:first-child { border-top: none; }
@media (max-width: 880px) {
  .process-extravagant .process-step-v8 {
    grid-template-columns: 1fr;
    min-height: auto;
  }
}

.process-extravagant .process-watermark {
  position: absolute;
  top: clamp(40px, 8vw, 96px);
  left: clamp(-12px, -1vw, -32px);
  font-family: var(--font-display);
  font-size: clamp(140px, 22vw, 320px);
  font-weight: 100;
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: #161616;
  user-select: none;
  pointer-events: none;
  z-index: 0;
}

.process-extravagant .process-content {
  position: relative;
  z-index: 1;
}
.process-extravagant .process-content h2 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.6vw, 72px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: var(--color-ink);
  margin-bottom: var(--space-8);
}
.process-extravagant .process-content p {
  font-size: var(--text-body-lg);
  line-height: 1.7;
  color: var(--color-ink-muted);
  max-width: 48ch;
}
.process-extravagant .process-content p + p { margin-top: var(--space-6); }

.process-extravagant .process-aside {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.process-extravagant .process-aside-card {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(32px, 5vw, 64px);
  gap: var(--space-6);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,0.7);
  position: relative;
  overflow: hidden;
}
.process-extravagant .process-aside-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(217,96,59,0.08), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(217,96,59,0.05), transparent 55%);
  pointer-events: none;
}
.process-extravagant .process-aside-card > * { position: relative; z-index: 1; }
.process-extravagant .process-aside-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(217,96,59,0.12);
  border: 1px solid var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
}
.process-extravagant .process-aside-quote {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.4;
  color: var(--color-ink);
  text-align: center;
}
.process-extravagant .process-aside-attr {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--color-ink-muted);
  text-transform: uppercase;
}

/* ---------- HERO H1 LINE-BY-LINE STAGGER ---------- */

[data-line-stagger] .hl-line {
  display: block;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
[data-line-stagger].is-revealed .hl-line { opacity: 1; transform: translateY(0); }
[data-line-stagger].is-revealed .hl-line:nth-child(2) { transition-delay: 100ms; }
[data-line-stagger].is-revealed .hl-line:nth-child(3) { transition-delay: 200ms; }
[data-line-stagger].is-revealed .hl-line:nth-child(4) { transition-delay: 300ms; }
@media (prefers-reduced-motion: reduce) {
  [data-line-stagger] .hl-line { opacity: 1; transform: none; transition: none; }
}

/* ---------- HERO TYPING SUPPORT (after AVARA fade-in line) ---------- */
.hero-after-line {
  margin-top: var(--space-6);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}
.hero-after-line.is-in { opacity: 1; transform: translateY(0); }
