/**
 * AIAN DESIGN SYSTEM V3.5 — AWARD-CRAFT LAYER
 * Aesthetic Synthesis: Swiss Modular Geometry · Luminous Porcelain Packaging ·
 * Procedural 3D · Choreographed Spring Physics · Editorial Data Journalism
 *
 * Self-hosted 100% local asset (Zero external CDN — Strict CSP Safe).
 * Palette: 100% Executive Sapphire (#0B1F4B -> #1E40AF -> #1D4ED8 -> #2563EB -> #60A5FA)
 *          + Executive Amber (#B45309 / #D97706) + Cool Porcelain Slate (#FFFFFF / #F8FAFC).
 */

/* ==========================================================================
   1. LOCAL SELF-HOSTED VARIABLE TYPEFOUNDRY (Typewolf / Typographica Triad)
   ========================================================================== */

@font-face {
  font-family: "Sora";
  src: url("../fonts/sora-variable.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-variable.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-italic-variable.woff2") format("woff2");
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display-sans: "Sora", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --aian-scroll-progress: 0;
}

.aian-editorial-italic {
  font-family: "Source Serif 4", Georgia, serif;
  font-style: italic;
  font-weight: 420;
  letter-spacing: -0.018em;
  color: var(--aian-blue-800, #1e40af);
}

[data-theme="console"] .aian-editorial-italic {
  color: var(--aian-blue-300, #93c5fd);
}

.aian-kinetic-display {
  font-family: var(--font-display-sans);
  font-weight: 620;
  line-height: 1.06;
  letter-spacing: -0.034em;
  text-wrap: balance;
  color: var(--text-primary, #0f172a);
}

.aian-numeric-lock {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1, "zero" 1;
}

/* ==========================================================================
   2. AWWWARDS TOP SCROLL PROGRESS BAR (`#aian-scroll-bar`)
   ========================================================================== */

#aian-scroll-bar {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  inline-size: 100%;
  block-size: 2.5px;
  z-index: 9999;
  pointer-events: none;
  background: linear-gradient(90deg, #0b1f4b 0%, #1d4ed8 52%, #60a5fa 100%);
  transform-origin: 0 50%;
  transform: scaleX(var(--aian-scroll-progress, 0));
  box-shadow: 0 1px 6px rgba(37, 99, 235, 0.28);
  will-change: transform;
}

/* ==========================================================================
   3. REACTBITS SPOTLIGHT CARD & REFRACTIVE SURFACE (`.aian-spotlight`)
   ========================================================================== */

.aian-spotlight,
[data-spotlight] {
  position: relative;
  isolation: isolate;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    var(--shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.05));
  transition:
    border-color 240ms var(--ease-spring),
    box-shadow 300ms var(--ease-spring),
    transform 300ms var(--ease-spring);
}

.aian-spotlight::before,
[data-spotlight]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  background: radial-gradient(
    480px circle at var(--spot-x, 50%) var(--spot-y, 0%),
    rgba(37, 99, 235, 0.075),
    rgba(96, 165, 250, 0.025) 42%,
    transparent 72%
  );
  transition: opacity 260ms var(--ease-spring);
}

.aian-spotlight:hover::before,
[data-spotlight]:hover::before {
  opacity: 1;
}

.aian-spotlight > *,
[data-spotlight] > * {
  position: relative;
  z-index: 1;
}

[data-theme="console"] .aian-spotlight,
[data-theme="console"] [data-spotlight] {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 28px -10px rgba(2, 6, 23, 0.55);
}

[data-theme="console"] .aian-spotlight::before,
[data-theme="console"] [data-spotlight]::before {
  background: radial-gradient(
    480px circle at var(--spot-x, 50%) var(--spot-y, 0%),
    rgba(96, 165, 250, 0.13),
    rgba(59, 130, 246, 0.04) 44%,
    transparent 74%
  );
}

/* ==========================================================================
   4. UIVERSE TACTILE MICRO-INTERACTIONS, SONAR BEACONS & FRAMER SPRING PILLS
   ========================================================================== */

.aian-btn-primary,
.aian-btn-specular {
  position: relative;
  overflow: hidden;
  transform: translate3d(var(--mag-x, 0px), var(--mag-y, 0px), 0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 2px 6px rgba(29, 78, 216, 0.22),
    0 10px 22px -8px rgba(29, 78, 216, 0.34);
  transition:
    background-color 180ms var(--ease-spring),
    box-shadow 240ms var(--ease-spring),
    transform 220ms var(--ease-spring);
}

.aian-btn-primary::after,
.aian-btn-specular::after {
  content: "";
  position: absolute;
  inset-block: -20%;
  inset-inline-start: -130%;
  inline-size: 65%;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.26) 48%,
    transparent 100%
  );
  transform: skewX(-18deg);
  transition: inset-inline-start 560ms var(--ease-expo-out);
}

.aian-btn-primary:hover::after,
.aian-btn-specular:hover::after {
  inset-inline-start: 145%;
}

.aian-btn-primary svg,
.aian-btn-specular svg,
.aian-btn-arrow {
  transition: transform 220ms var(--ease-spring);
}

.aian-btn-primary:hover svg,
.aian-btn-specular:hover svg,
.aian-btn:hover .aian-btn-arrow {
  transform: translateX(4px);
}

.aian-btn:active,
.aian-btn-primary:active,
.aian-btn-specular:active {
  transform: scale(0.98) !important;
}

/* Concentric Sonar Beacon (`.aian-sonar` & `.aian-sonar-amber`) */
.aian-sonar,
.aian-sonar-amber {
  position: relative;
  display: inline-flex;
  inline-size: 0.5625rem;
  block-size: 0.5625rem;
  border-radius: 9999px;
  background-color: #2563eb;
  flex-shrink: 0;
}

.aian-sonar-amber {
  background-color: #d97706;
}

.aian-sonar::before,
.aian-sonar::after,
.aian-sonar-amber::before,
.aian-sonar-amber::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 1.5px solid currentColor;
  color: #3b82f6;
  pointer-events: none;
  animation: aianSonarPulse 2.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.aian-sonar-amber::before,
.aian-sonar-amber::after {
  color: #d97706;
}

.aian-sonar::after,
.aian-sonar-amber::after {
  animation-delay: 1.1s;
}

@keyframes aianSonarPulse {
  0% {
    transform: scale(1);
    opacity: 0.72;
  }
  80%,
  100% {
    transform: scale(2.65);
    opacity: 0;
  }
}

/* Framer Spring Pills & Asymmetric Bento Grid */
.aian-spring-pill,
.aian-studio-tab,
[role="tab"] {
  transition:
    color 220ms var(--ease-spring),
    background-color 220ms var(--ease-spring),
    border-color 220ms var(--ease-spring),
    box-shadow 220ms var(--ease-spring),
    transform 220ms var(--ease-spring);
}

.aian-spring-pill:active {
  transform: scale(0.97);
}

@media (max-width: 1140px) {
  .aian-studio-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    overflow-x: visible !important;
    min-inline-size: 0 !important;
    padding: 0.5rem !important;
    gap: 0.35rem !important;
  }

  .aian-studio-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal !important;
    line-height: 1.22;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
  }
}

@media (max-width: 580px) {
  .aian-studio-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.aian-bento-asymmetric {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--space-5, 1.25rem);
}

@media (max-width: 900px) {
  .aian-bento-asymmetric {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   5. THE DIELINE DIGITAL PACKAGING — EXECUTIVE ASSET DOSSIER & CREDENTIAL
   ========================================================================== */

.aian-credential-pack {
  position: relative;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 #ffffff,
    inset 0 0 0 4px #ffffff,
    inset 0 0 0 5px rgba(203, 213, 225, 0.45),
    0 12px 32px -10px rgba(15, 23, 42, 0.08),
    0 2px 6px rgba(15, 23, 42, 0.04);
  padding: var(--space-6, 1.5rem);
}

.aian-credential-pack[data-featured="true"] {
  border-color: #93c5fd;
  box-shadow:
    inset 0 1px 0 #ffffff,
    inset 0 0 0 4px #ffffff,
    inset 0 0 0 5px rgba(59, 130, 246, 0.28),
    0 20px 44px -12px rgba(29, 78, 216, 0.14),
    0 4px 10px rgba(15, 23, 42, 0.05);
}

.aian-foil-stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.72rem;
  border-radius: 9999px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  background-color: #1d4ed8;
  background-image: linear-gradient(135deg, #0b1f4b 0%, #1e40af 45%, #2563eb 68%, #1d4ed8 100%);
  border: 1px solid rgba(147, 197, 253, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 2px 8px rgba(29, 78, 216, 0.22);
}

.aian-foil-stamp[data-tone="amber"] {
  background-color: #92400e;
  background-image: linear-gradient(135deg, #92400e 0%, #b45309 52%, #d97706 100%);
  border-color: rgba(253, 230, 138, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 2px 8px rgba(180, 83, 9, 0.2);
}

.aian-perforated-divider {
  position: relative;
  margin-block: var(--space-5, 1.25rem);
  border: 0;
  border-block-start: 1.5px dashed #cbd5e1;
  block-size: 0;
}

.aian-perforated-divider::before,
.aian-perforated-divider::after {
  content: "";
  position: absolute;
  inset-block-start: -7px;
  inline-size: 13px;
  block-size: 13px;
  border-radius: 9999px;
  background-color: var(--bg-canvas, #f8fafc);
  border: 1px solid #cbd5e1;
}

.aian-perforated-divider::before {
  inset-inline-start: -22px;
}

.aian-perforated-divider::after {
  inset-inline-end: -22px;
}

.aian-tilt-3d,
[data-tilt] {
  transform: perspective(1100px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transform-style: preserve-3d;
  transition: transform 260ms var(--ease-spring), box-shadow 260ms var(--ease-spring);
  will-change: transform;
}

/* ==========================================================================
   6. REACTBITS ANIMATED SVG BEAMS & DUOTONE ARCHITECTURAL ICONS
   ========================================================================== */

.aian-beam-rail {
  stroke: #cbd5e1;
  stroke-width: 1.75;
  fill: none;
}

.aian-beam-path {
  fill: none;
  stroke: #2563eb;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 28 164;
  stroke-dashoffset: 192;
  animation: aianBeamFlow 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.aian-beam-path-amber {
  stroke: #d97706;
}

@keyframes aianBeamFlow {
  0% {
    stroke-dashoffset: 192;
    opacity: 0.25;
  }
  20%,
  80% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0.2;
  }
}

.aian-duotone-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 2.5rem;
  block-size: 2.5rem;
  border-radius: 10px;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
}

.aian-duotone-badge svg {
  inline-size: 1.25rem;
  block-size: 1.25rem;
}

/* ==========================================================================
   7. PROCEDURAL 3D STAGE & PUDDING PAYBACK INFOGRAPHIC CONTAINERS
   ========================================================================== */

.aian-maestro-3d-stage {
  position: relative;
  inline-size: 100%;
  min-block-size: 320px;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 42%, #ffffff 0%, #f8fafc 64%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
}

.aian-maestro-3d-stage:active {
  cursor: grabbing;
}

[data-theme="console"] .aian-maestro-3d-stage {
  background: radial-gradient(circle at 50% 42%, #152033 0%, #0f172a 65%, #0b1120 100%);
  border-color: rgba(148, 163, 184, 0.2);
}

.aian-pudding-wrap {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem 1.125rem;
  box-shadow: inset 0 1px 0 #ffffff, 0 2px 8px rgba(15, 23, 42, 0.03);
}

[data-theme="console"] .aian-pudding-wrap {
  background-color: #0f172a;
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.aian-pudding-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding-block-end: 0.65rem;
  margin-block-end: 0.65rem;
  border-block-end: 1px solid #f1f5f9;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums lining-nums;
  color: #334155;
}

[data-theme="console"] .aian-pudding-readout {
  border-block-end-color: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

/* ==========================================================================
   8. HEADLESS-SAFE RAZOR-SHARP SCROLL REVEAL (Zero Blur · Zero Mid-Scroll Fade)
   ========================================================================== */

.aian-reveal,
[data-reveal] {
  opacity: 1;
  transform: none;
  filter: none !important;
}

html.aian-motion-ready:not(.aian-webdriver) .aian-reveal.is-pending,
html.aian-motion-ready:not(.aian-webdriver) [data-reveal].is-pending {
  opacity: 0.96;
  transform: translateY(8px);
  filter: none !important;
}

html.aian-motion-ready:not(.aian-webdriver) .aian-reveal.is-revealed,
html.aian-motion-ready:not(.aian-webdriver) [data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
  filter: none !important;
  transition:
    opacity 180ms var(--ease-expo-out),
    transform 220ms var(--ease-expo-out);
}

@media (prefers-reduced-motion: reduce) {
  #aian-scroll-bar {
    transition: none !important;
  }

  .aian-sonar::before,
  .aian-sonar::after,
  .aian-sonar-amber::before,
  .aian-sonar-amber::after,
  .aian-beam-path {
    animation: none !important;
  }

  .aian-reveal,
  [data-reveal],
  .aian-reveal.is-pending,
  [data-reveal].is-pending {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }

  .aian-tilt-3d,
  [data-tilt],
  .aian-btn-primary,
  .aian-btn-specular {
    transform: none !important;
  }
}

html.aian-webdriver .aian-reveal,
html.aian-webdriver [data-reveal],
html.aian-webdriver .aian-reveal.is-pending,
html.aian-webdriver [data-reveal].is-pending {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  transition: none !important;
}
