/* v8 — per-page palette, web features, channel blocks, lightbox polish, logo shimmer */

/* ─── Default + per-page palette ─── */
:root {
  --accent-1: #a78bfa;
  --accent-2: #c084fc;
  --mesh-1:   #6d28d9;
  --mesh-2:   #9333ea;
  --hue-base: 270;
}
html[data-page="ai"]         { --accent-1:#a78bfa; --accent-2:#c084fc; --mesh-1:#6d28d9; --mesh-2:#9333ea; --hue-base:270; }
html[data-page="marketing"]  { --accent-1:#fb923c; --accent-2:#f472b6; --mesh-1:#c2410c; --mesh-2:#be185d; --hue-base:25;  }
html[data-page="music"]      { --accent-1:#2dd4bf; --accent-2:#f472b6; --mesh-1:#0f766e; --mesh-2:#be185d; --hue-base:175; }
html[data-page="web"]        { --accent-1:#38bdf8; --accent-2:#67e8f9; --mesh-1:#0369a1; --mesh-2:#0e7490; --hue-base:200; }
html[data-page="about"]      { --accent-1:#fcd34d; --accent-2:#fb7185; --mesh-1:#b45309; --mesh-2:#be123c; --hue-base:35;  }
html[data-page="references"] { --accent-1:#818cf8; --accent-2:#fbbf24; --mesh-1:#4338ca; --mesh-2:#b45309; --hue-base:235; }
html[data-page="home"]       { --accent-1:#a78bfa; --accent-2:#c084fc; --mesh-1:#6d28d9; --mesh-2:#9333ea; --hue-base:270; }

/* Mesh blobs read palette + transition softly between pages */
.mesh-wrap .b1 { background: var(--mesh-1); transition: background 800ms ease-out; }
.mesh-wrap .b2 { background: var(--mesh-2); transition: background 800ms ease-out; }
.mesh-wrap .b3 { background: color-mix(in oklab, var(--mesh-1) 60%, #0a1a1e); transition: background 800ms ease-out; }
.mesh-wrap .b4 { background: color-mix(in oklab, var(--mesh-2) 50%, #140824); transition: background 800ms ease-out; }

/* Kicker / eyebrow picks up subtle accent tint */
.kicker, .sec-head .kicker {
  color: color-mix(in oklab, var(--accent-1) 22%, var(--ink-mute)) !important;
  transition: color 400ms ease-out;
}

/* ─── Logo shimmer (replaces rotation; defined in v6 — overridden here) ─── */
.logo .star-wrap { transform: none !important; animation: none !important; }
.logo:hover .star-wrap { animation: logoBreathe 700ms cubic-bezier(0.16,1,0.3,1); }
@keyframes logoBreathe {
  0%   { transform: scale(1);    filter: drop-shadow(0 0 0 transparent); }
  50%  { transform: scale(1.08); filter: drop-shadow(0 0 8px var(--accent-1)) drop-shadow(0 0 14px var(--accent-2)); }
  100% { transform: scale(1);    filter: drop-shadow(0 0 0 transparent); }
}
.logo .star { background-size: 300% 100%; }
.logo:hover .star { animation: logoSheen 700ms cubic-bezier(0.16,1,0.3,1); }
@keyframes logoSheen { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@media (prefers-reduced-motion: reduce) {
  .logo:hover .star-wrap, .logo:hover .star { animation: none !important; }
}

/* ─── About — mount-stagger reveal (replaces scroll-gated) ─── */
.about-mount-reveal {
  opacity: 0; transform: translateY(20px);
  animation: aboutCardIn 600ms cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes aboutCardIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .about-mount-reveal { animation: none; opacity: 1; transform: none; }
}

/* ─── Web design — feature cards (2×2) ─── */
.web-features {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
}
.web-feat {
  padding: 30px 30px 32px; border-radius: 18px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
  transition: transform 360ms var(--ease-out-expo), border-color 360ms var(--ease-out-expo);
}
.web-feat:hover { transform: translateY(-4px); }
.web-feat .n {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.16em;
  color: var(--ink-faint);
}
.web-feat .eyebrow { color: color-mix(in oklab, var(--accent-1) 30%, var(--ink-mute)); margin-top: 2px; }
.web-feat h3 {
  font-family: var(--f-display); font-weight: 300;
  font-size: clamp(22px, 2.4vw, 28px);
  letter-spacing: -0.015em; line-height: 1.18;
  color: var(--ink); margin: 6px 0 4px; max-width: 22ch;
}
.web-feat p {
  font-size: 14.5px; line-height: 1.6; color: var(--ink-dim);
  margin: 0; max-width: 50ch;
}
@media (max-width: 760px) {
  .web-features { grid-template-columns: 1fr; gap: 20px; }
  .web-feat { padding: 24px 22px 26px; }
}

/* Diagonal staggered entrance for web feature cards */
.web-feat-stagger {
  opacity: 0;
  transform: translateY(20px);
  animation: webFeatIn 700ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes webFeatIn {
  to { opacity: 1; transform: translateY(0); }
}
.web-feat:hover {
  border-color: color-mix(in oklab, var(--accent-1) 50%, var(--glass-stroke)) !important;
}
@media (prefers-reduced-motion: reduce) {
  .web-feat-stagger { opacity: 1; transform: none; animation: none; }
}

/* ─── References — channel blocks ─── */
.ch-block {
  border-radius: 24px;
  padding: clamp(22px, 3vw, 36px);
  display: grid; gap: clamp(20px, 2.4vw, 28px);
}
.ch-large { max-width: 1200px; margin: 0 auto; }
.ch-small { max-width: 720px;  margin: 0 auto; }

.ch-head { display: flex; align-items: center; gap: 18px; }
.ch-head-txt { display: grid; gap: 6px; min-width: 0; }
.ch-name {
  font-family: var(--f-display); font-weight: 300;
  font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.02em; line-height: 1.05;
  color: var(--ink); margin: 0;
}
.ch-name-sm { font-size: clamp(22px, 2.4vw, 28px); }
.ch-headline { color: color-mix(in oklab, var(--accent-1) 30%, var(--ink-mute)); }
.ch-headline-sm { font-size: 11px; }

.ch-stats { display: grid; gap: 12px; }
.ch-stats-3 { grid-template-columns: repeat(3, 1fr); }
.ch-stats-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 700px) {
  .ch-stats-3 { grid-template-columns: 1fr; }
  .ch-stats-2 { grid-template-columns: 1fr; }
}
.ch-stat {
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  display: grid; gap: 6px;
}
.ch-stat-l { color: var(--ink-mute); }
.ch-stat-v {
  font-family: var(--f-display); font-weight: 300;
  font-size: clamp(22px, 2.6vw, 32px); letter-spacing: -0.02em; line-height: 1; color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.ch-gallery { display: grid; gap: 12px; }
.ch-gallery-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ch-gallery-2   { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) {
  .ch-gallery-row { grid-template-columns: 1fr 1fr; }
  .ch-gallery-2   { grid-template-columns: 1fr; }
}

/* Image slot (placeholder + filled) */
.img-slot {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: #0a0814;
  transition: transform 360ms var(--ease-out-expo), filter 360ms var(--ease-out-expo);
}
.img-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-slot:hover { transform: scale(1.012); filter: brightness(1.06); }
.img-slot.ph .img-slot-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(80% 60% at 25% 20%, color-mix(in oklab, var(--accent-1) 35%, transparent), transparent 60%),
    radial-gradient(70% 60% at 75% 80%, color-mix(in oklab, var(--accent-2) 30%, transparent), transparent 60%),
    linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  animation: imgSlotPulse 3.6s ease-in-out infinite;
}
@keyframes imgSlotPulse {
  0%, 100% { opacity: .85; }
  50%      { opacity: 1; }
}
.img-slot.ph .img-slot-label {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.16em;
  color: rgba(244,239,233,.5);
  text-transform: uppercase;
}
@media (prefers-reduced-motion: reduce) {
  .img-slot.ph .img-slot-bg { animation: none; }
}

/* ─── Lightbox polish (overrides v6) ─── */
.lb-backdrop {
  background:
    radial-gradient(circle at 50% 50%, rgba(7,7,12,.70), rgba(7,7,12,.95) 80%),
    rgba(7,7,12,.85) !important;
  backdrop-filter: blur(32px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(32px) saturate(140%) !important;
  /* Prevents iOS pull-to-refresh and elastic scroll bleeding from inside the lightbox */
  overscroll-behavior: contain;
}
.lb-card {
  padding: 32px !important;
  border: 1px solid color-mix(in oklab, var(--accent-1) 18%, var(--glass-border)) !important;
  animation: lbPopV8 420ms cubic-bezier(0.16,1,0.3,1) !important;
  /* Allow vertical pan (scroll content if needed) but capture horizontal swipes for navigation */
  touch-action: pan-y;
}
.lb-card::before {
  content: ''; position: absolute; top: 0; left: 18px; right: 18px; height: 1px;
  background: linear-gradient(90deg, transparent,
    color-mix(in oklab, var(--accent-1) 60%, white) 30%,
    color-mix(in oklab, var(--accent-2) 60%, white) 70%,
    transparent);
  opacity: .3; pointer-events: none;
}
@keyframes lbPopV8 {
  from { opacity: 0; transform: scale(.94) translateY(28px); }
  to   { opacity: 1; transform: none; }
}
.lb-card.lb-pulse {
  animation: lbPulse 400ms cubic-bezier(0.16,1,0.3,1);
}
@keyframes lbPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.005); }
}
.lb-close, .lb-nav {
  width: 44px !important; height: 44px !important;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  transition: background 200ms var(--ease-ui), border-color 200ms var(--ease-ui), transform 280ms var(--ease-out-expo) !important;
}
.lb-prev:hover { transform: translateY(-50%) translateX(-2px) !important; }
.lb-next:hover { transform: translateY(-50%) translateX(2px) !important; }
@media (max-width: 880px) {
  .lb-card { padding: 18px !important; }
  .lb-close, .lb-nav { width: 40px !important; height: 40px !important; }
}

/* ─── Iridescent vars hook into accents (so glass borders adopt page color) ─── */
.glass-hover:hover {
  border-color: color-mix(in oklab, var(--accent-1) 35%, rgba(255,255,255,.2)) !important;
}

/* Form — chips wrap a touch tighter at small widths.
   Bumped padding so chips meet ~36px touch target on mobile (WCAG 2.2 AA-friendly). */
@media (max-width: 540px) {
  .chip-group { gap: 8px; }
  .chip { padding: 10px 14px; font-size: 11px; min-height: 36px; }
}


/* ─── Contact form — profile card (compact horizontal layout) ─── */
.contact-profile {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px 24px;
  border-radius: 18px;
  opacity: 0;
  transform: translateY(16px);
  animation: contactProfileIn 600ms cubic-bezier(0.16, 1, 0.3, 1) 280ms forwards;
}
@keyframes contactProfileIn {
  to { opacity: 1; transform: translateY(0); }
}
.contact-profile-photo {
  flex: 0 0 auto;
  width: 104px; height: 104px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  opacity: 0;
  transform: scale(0.95);
  animation: contactPhotoIn 600ms cubic-bezier(0.16, 1, 0.3, 1) 360ms forwards;
}
@keyframes contactPhotoIn {
  to { opacity: 1; transform: scale(1); }
}
/* Force the inner avatar SVG/img to fill the parent at any responsive size.
   Without this, the JS-injected size={104} stays fixed and overflows the
   smaller mobile wrapper (84×84), getting clipped. */
.contact-profile-photo .circ-wrap,
.contact-profile-photo .circ-img {
  width: 100% !important;
  height: 100% !important;
}
.contact-profile-text {
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.contact-profile-name {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(22px, 2.4vw, 26px);
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--ink);
}
.contact-profile-title {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--accent-1) 25%, var(--ink-mute));
  line-height: 1.5;
}
@media (max-width: 540px) {
  .contact-profile { gap: 16px; padding: 18px 18px; }
  .contact-profile-photo { width: 84px; height: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  .contact-profile, .contact-profile-photo { opacity: 1; transform: none; animation: none; }
}

/* ─── v9 additions: performance hints + accessibility ─── */

/* GPU compositor hints for elements that animate constantly.
   Targeted only — broad will-change usage hurts more than it helps. */
.cursor-dot, .cursor-ring {
  will-change: transform;
}
.pillar-word {
  will-change: width;
}

/* Form field error visual: subtle accent ring instead of just border color shift */
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: #ff6b8a !important;
  box-shadow: 0 0 0 3px rgba(255, 107, 138, 0.12);
}

/* Consent checkbox error state: precise .err selector (was substring [class*="err"]) */
.consent.err input[type="checkbox"] {
  border-color: #ff6b8a;
  box-shadow: 0 0 0 2px rgba(255, 107, 138, 0.18);
}

/* Footer cookie revoke button — styled to look identical to adjacent <a> links */
.foot-link-btn {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 200ms var(--ease-ui), text-decoration-color 200ms var(--ease-ui);
}
.foot-link-btn:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--accent-1) 40%, transparent);
}
.foot-link-btn:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--accent-1) 70%, transparent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ─── v13 additions: form error messages + cookie banner animations + disabled states ─── */

/* Field error message (sits below an invalid input/textarea/checkbox).
   role="alert" on the element ensures screen readers announce it immediately.
   The "!" pseudo-element uses content / '' syntax for empty alt-text, so screen
   readers don't read "exclamation mark" before the actual error. */
.field-error {
  margin-top: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #ff8aa3;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: fieldErrIn 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.field-error::before {
  content: '!' / '';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 107, 138, 0.15);
  color: #ff8aa3;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}
@keyframes fieldErrIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .field-error { animation: none; }
}

/* Wrapper around consent + its error so error sits below, not inline with checkbox */
.consent-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Cookie banner state machine animations.
   States set by JS: 'showing' → 'visible' → (action) → 'hiding' → unmount */
.cookie-banner {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 380ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 480ms cubic-bezier(0.16, 1, 0.3, 1);
}
.cookie-banner.visible {
  opacity: 1;
  transform: none;
}
.cookie-banner.hiding {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .cookie-banner {
    transition: opacity 120ms ease;
    transform: none !important;
  }
}

/* Disabled state for chips (ChipGroup `disabled` prop).
   Visual: dim + non-interactive cursor, but preserve the layout. */
.chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Disabled state for custom dropdown trigger */
.dd-trigger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Disabled state for native form controls (inputs/textareas) */
.field input:disabled,
.field textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Consent checkbox disabled state */
.consent input[type="checkbox"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.consent input[type="checkbox"]:disabled + span {
  opacity: 0.6;
}

/* ─── v14 additions: skip-to-main, ::selection, scroll-behavior, btn spinner ─── */

/* Skip-to-main link: standard a11y pattern.
   Hidden above viewport until keyboard-focused (first Tab on the page).
   Slides down with a subtle transition. Uses light background for max contrast against
   the dark site, since this needs to be unmistakably a system control, not site decor. */
.skip-to-main {
  position: fixed;
  top: 0;
  left: 0;
  background: #ffffff;
  color: #0a0814;
  padding: 12px 20px;
  font-family: var(--f-mono, ui-monospace, monospace);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 0 0 10px 0;
  z-index: 100000;
  transform: translateY(-110%);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.skip-to-main:focus {
  transform: translateY(0);
  outline: 2px solid var(--accent-1, #a78bfa);
  outline-offset: -4px;
}
@media (prefers-reduced-motion: reduce) {
  .skip-to-main { transition: none; }
}

/* Brand-themed text selection. Default browser blue clashes with the violet palette. */
::selection {
  background: color-mix(in oklab, var(--accent-1) 50%, transparent);
  color: #ffffff;
}
::-moz-selection {
  background: color-mix(in oklab, var(--accent-1) 50%, transparent);
  color: #ffffff;
}

/* Defensive backup: if the base CSS sets html { scroll-behavior: smooth },
   override it for users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Inline SVG spinner inside the submit button when the form is sending */
.btn-spin {
  animation: btnSpin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
@keyframes btnSpin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .btn-spin { animation: none; }
}

/* ─── v15 fix: About page profile photo responsive sizing ─── */
/* Same bug pattern as .contact-profile-photo: the .profile-photo-frame and
   .profile-photo-inner shrink to 140×140 at mobile (max-width: 760px in v6 CSS),
   but CircularPlaceholder is rendered with hardcoded size={180}, so the inner
   SVG/img stays 180px and gets clipped by the parent's overflow:hidden.
   Force the inner element to fill its parent at any responsive size. */
.profile-photo-inner .circ-wrap,
.profile-photo-inner .circ-img {
  width: 100% !important;
  height: 100% !important;
}
