/* ============================================================
   WHALE DIGITAL — Base layer
   Light global defaults + a handful of brand utilities used by
   specimen cards and UI kits. Kept minimal to avoid surprising
   consuming projects.
   ============================================================ */

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  color: var(--text-body);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" 1, "cv01" 1;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-snug);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-xs);
}

/* ---- Brand utilities ---- */

/* Eyebrow / kicker label — mono, uppercase, with a small orange dot */
.wd-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
}
.wd-eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* Editorial serif-italic emphasis inside a headline */
.wd-em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}
.wd-em--accent { color: var(--accent); }
.wd-em--brand  { color: var(--brand-strong); }

.wd-container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* Subtle paper grain — adds the "invisible expensive" texture */
.wd-grain {
  position: relative;
}
.wd-grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* ---- Navbar sizing (brand nav: larger links + CTA) ---- */
nav > ul > li > a { font-size: 16.5px !important; }
nav > a:last-of-type { height: 50px !important; font-size: 16px !important; padding-inline: 28px !important; }

/* ---- Navbar glow-menu: radial glow behind the hovered item ---- */
nav > ul > li { position: relative; }
nav > ul > li > a { position: relative; z-index: 1; }
nav > ul > li::before {
  content: ""; position: absolute; inset: -8px -4px; border-radius: 999px;
  background: radial-gradient(circle at 50% 50%, rgba(16,114,168,0.5), rgba(240,97,28,0.24) 55%, transparent 75%);
  opacity: 0; filter: blur(10px); transition: opacity 0.4s var(--ease-out); pointer-events: none; z-index: 0;
}
nav > ul > li:hover::before { opacity: 1; }
nav > ul > li > a { transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out) !important; }
nav > ul > li > a:hover { transform: translateY(-1px); }

/* ---- Film grain — the "invisible expensive" texture (≤0.04, static) ---- */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 2000; pointer-events: none; opacity: 0.035;
  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='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Fixed mobile CTA — thumb-reachable at every scroll depth ---- */
.wd-mobile-cta { display: none; }
@media (max-width: 768px) {
  .wd-mobile-cta {
    position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 8000;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 52px; border-radius: 999px;
    background: var(--accent); color: #fff;
    font-family: var(--font-sans); font-weight: 700; font-size: 16px;
    box-shadow: 0 10px 30px -8px rgba(240,97,28,0.55);
  }
}

/* ---- Mobile pass: designed for 390px, not shrunk ---- */
.wd-nav-burger { display: none; }
@media (max-width: 900px) {
  /* Navbar: collapse links + CTA; logo + burger remain.
     CTA is the last direct-child <a> (brand is the first); its href is a
     mailto: proposal link, so target by position, not by "contact". The CTA
     still appears inside the opened mobile menu. */
  nav > ul { display: none !important; }
  nav > a:last-of-type { display: none !important; }
  .wd-nav-burger { display: flex !important; }
}
@media (max-width: 680px) {
  /* Hero: allow the headline to wrap, reserve height so the typewriter doesn't jump rows */
  .wd-hero-h1 { white-space: normal !important; font-size: clamp(1.85rem, 8vw, 2.5rem) !important; line-height: 1.15 !important; min-height: 2.35em; }
  .wd-hero-sub { white-space: normal !important; font-size: 1.05rem !important; }
  /* Forms: stack side-by-side name fields */
  .wd-form-2col { grid-template-columns: 1fr !important; }
  /* Give the fixed CTA breathing room at page end */
  footer { padding-bottom: 84px !important; }
}

/* ---- Elegant floating shapes (Services/About heroes) ---- */
.wd-eshape { opacity: 0; transform: translateY(-150px) rotate(calc(var(--rot) - 15deg)); animation: wd-eshape-in 2.4s cubic-bezier(0.23, 0.86, 0.39, 0.96) forwards; will-change: transform, opacity; }
@keyframes wd-eshape-in { 50% { opacity: 1; } 100% { opacity: 1; transform: translateY(0) rotate(var(--rot)); } }
.wd-eshape-bob { animation: wd-eshape-bob 12s ease-in-out infinite; }
@keyframes wd-eshape-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(15px); } }
@media (prefers-reduced-motion: reduce) {
  .wd-eshape { animation: none; opacity: 1; transform: rotate(var(--rot)); }
  .wd-eshape-bob { animation: none; }
}

/* ---- Header FX: drawing accent lines (Work/Blog heroes) ---- */
.wd-accent-lines .wd-hline, .wd-accent-lines .wd-vline { position: absolute; background: rgba(255,255,255,0.1); opacity: .75; will-change: transform, opacity; }
.wd-accent-lines .wd-hline { height: 1px; left: 0; right: 0; transform: scaleX(0); transform-origin: 50% 50%; animation: wd-drawX 800ms cubic-bezier(.22,.61,.36,1) forwards; }
.wd-accent-lines .wd-hline:nth-child(1) { top: 24%; animation-delay: 150ms; }
.wd-accent-lines .wd-hline:nth-child(2) { top: 52%; animation-delay: 280ms; }
.wd-accent-lines .wd-hline:nth-child(3) { top: 80%; animation-delay: 410ms; }
.wd-accent-lines .wd-vline { width: 1px; top: 0; bottom: 0; transform: scaleY(0); transform-origin: 50% 0%; animation: wd-drawY 900ms cubic-bezier(.22,.61,.36,1) forwards; }
.wd-accent-lines .wd-vline:nth-child(4) { left: 20%; animation-delay: 520ms; }
.wd-accent-lines .wd-vline:nth-child(5) { left: 50%; animation-delay: 640ms; }
.wd-accent-lines .wd-vline:nth-child(6) { left: 80%; animation-delay: 760ms; }
.wd-accent-lines .wd-hline::after, .wd-accent-lines .wd-vline::after {
  content: ""; position: absolute; inset: 0; opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(250,250,250,.25), transparent);
  animation: wd-shimmer 900ms ease-out forwards;
}
.wd-accent-lines .wd-hline:nth-child(1)::after { animation-delay: 150ms; }
.wd-accent-lines .wd-hline:nth-child(2)::after { animation-delay: 280ms; }
.wd-accent-lines .wd-hline:nth-child(3)::after { animation-delay: 410ms; }
.wd-accent-lines .wd-vline:nth-child(4)::after { animation-delay: 520ms; }
.wd-accent-lines .wd-vline:nth-child(5)::after { animation-delay: 640ms; }
.wd-accent-lines .wd-vline:nth-child(6)::after { animation-delay: 760ms; }
@keyframes wd-drawX { 0% { transform: scaleX(0); opacity: 0; } 60% { opacity: .9; } 100% { transform: scaleX(1); opacity: .75; } }
@keyframes wd-drawY { 0% { transform: scaleY(0); opacity: 0; } 60% { opacity: .9; } 100% { transform: scaleY(1); opacity: .75; } }
@keyframes wd-shimmer { 0% { opacity: 0; } 30% { opacity: .25; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .wd-accent-lines .wd-hline, .wd-accent-lines .wd-vline { animation: none; transform: none; }
  .wd-accent-lines .wd-hline::after, .wd-accent-lines .wd-vline::after { animation: none; }
}

/* ---- Marker swash: soft highlight that sweeps in under a key phrase ---- */
.wd-swash { position: relative; white-space: nowrap; }
.wd-swash::after {
  content: ""; position: absolute; left: -0.06em; right: -0.06em; bottom: 0.02em; height: 0.36em;
  background: rgba(240, 97, 28, 0.2); border-radius: 0.18em;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.9s var(--ease-out) 0.2s;
  z-index: -1;
}
.wd-swash.wd-in::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { .wd-swash::after { transform: scaleX(1); transition: none; } }

/* ---- Dark cards (growth / add-ons): lift + brighten on hover ---- */
.wd-dark-card { transition: transform var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.wd-dark-card:hover { transform: translateY(-4px); background: rgba(255,255,255,0.08) !important; border-color: rgba(255,255,255,0.28) !important; box-shadow: 0 22px 48px -22px rgba(0,0,0,0.65); }

/* ---- Motion: entrance + scroll reveal (whispers, reduced-motion safe) ---- */
@keyframes wd-rise { from { opacity: 0; transform: translateY(0.7em); } to { opacity: 1; transform: none; } }

.wd-word, .wd-hero-word { display: inline-block; }

@media (prefers-reduced-motion: no-preference) {
  /* hero: words + blocks rise in once the panel mounts (.wd-in toggled in JS).
     html.wd-boot is added by a tiny inline script right after first paint, so the
     prerendered hero reveals immediately without waiting for React hydration (LCP). */
  .wd-hero-word, .wd-hero-fade { opacity: 0; transform: translateY(0.7em); transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out); }
  .wd-in .wd-hero-word, .wd-in .wd-hero-fade,
  html.wd-boot .wd-hero-word, html.wd-boot .wd-hero-fade { opacity: 1; transform: none; }

  /* section headings: words rise in when scrolled into view */
  .wd-word { opacity: 0; transform: translateY(0.5em); transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out); }
  .wd-reveal-in .wd-word { opacity: 1; transform: none; }
}

