/* =======================================================================================
   Auto In-vitro — Styles
   Adapted from autoinvitro.css with additions for SPA routing, team grid, projects grid.
   Preserves original SVG logo animation and dark theme.
   ======================================================================================= */

/* =========================================
   01) DESIGN TOKENS & GLOBAL RESETS
   ========================================= */
:root {
  --bg: #0b0d12;
  --surface: #121620;
  --surface-2: #1a2030;
  --text: #eef2f7e7;
  --muted: #a8b3c7;
  --accent: #f186c1;
  --accent2: #e018c5e4;
  --link: #7cc4ff;
  --header: #c9c9c9b7;

  --loader-text-color: #f6e9fe;
  --loader-dot-color:  #f02d98;
  --loader-bg:         #100319;

  --radius: 12px;
  --shadow: 0 10px 30px rgba(0,0,0,.25);

  --banner-height: 64px;
  --content-max: 1100px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

html {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.5;
}

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, #0b0d12 0%, #0d111a 100%);
  line-height: 1.6;
}

svg { display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =========================================
   02) LAYOUT UTILITIES
   ========================================= */
.max-w {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
}
.skip-link:focus {
  left: 16px; top: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 1000;
}

/* =========================================
   03) HEADER (FIXED TOP BANNER + NAV)
   ========================================= */
.top-banner {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--banner-height);
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding-inline: clamp(12px, 3vw, 24px);
  background: rgba(10,14,22,.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand {
  display: inline-flex;
  align-items: center;
}

.logo-svg { height: 40px; max-width: 20vw; width: auto; display: block; color: var(--text); }

.hamburger {
  width: 44px; height: 44px;
  border: 0;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2);
  cursor: pointer;
}
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text);
  margin: 3px 0;
  transition: transform .25s ease, opacity .25s ease;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.nav-drawer {
  position: fixed;
  top: var(--banner-height);
  left: 0; right: 0;
  transform: translateY(-120%);
  transition: transform .25s ease;
  background: rgba(13,17,26,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 16px 24px;
  z-index: 95;
}
.nav-drawer.open { transform: translateY(0); }

.nav-drawer ul {
  list-style: none;
  margin: 0; padding: 0;
  display: grid; gap: 8px;
}
.nav-drawer a {
  display: block;
  padding: 10px 8px;
  border-radius: 8px;
}
.nav-drawer a[aria-current="page"] {
  background: rgba(91,209,185,.12);
}

/* =========================================
   04) HERO (VIDEO BACKGROUND + HEADLINE)
   ========================================= */
.hero {
  position: relative;
  overflow: hidden;
  margin-top: var(--banner-height);
  min-height: clamp(380px, 55vh, 720px);
  display: grid;
  align-content: end;
}
.video-wrap { position: absolute; inset: 0; z-index: 0; }
.hero video {
  width: 100%; height: 100%;
  object-fit: cover; opacity: .2;
  display: block;
}
.video-scrim {
  position: absolute; inset: 0;
  background: radial-gradient(120% 70% at 50% 10%, rgba(0,0,0,0) 0, rgba(0,0,0,.35) 60%, rgba(0,0,0,.55) 100%);
}
.hero-content {
  position: relative; z-index: 1;
  padding: clamp(28px, 6vw, 64px) 0;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--muted);
  font-size: .85rem;
  margin: 0 0 8px;
}
.hero h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3.8vw, 3rem);
  line-height: 1.2;
  max-width: 22ch;
}
.hero .hero-highlight {
  color: #ff5bb5;
  font-weight: 700;
}
.lede {
  color: var(--muted);
  font-size: 1.05rem;
  margin-top: 12px;
  max-width: 40ch;
}

/* =========================================
   05) PAGE LAYOUT, CARDS, GRIDS, MEDIA
   ========================================= */
.page { padding-block: clamp(24px, 5vw, 48px); }
.section { margin-bottom: clamp(24px, 5vw, 56px); }
.section h1 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin: 5px 5px 12px;
  padding-left: 3vw;
  color: var(--header);
}
.section h2 {
  font-size: clamp(1.25rem, 2.1vw, 1.6rem);
  margin: 5px 5px 12px;
}

.landing { /* section used for static content pages */ }

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(14px) scale(.98);
  filter: blur(2px);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity .5s ease, transform .5s ease, filter .5s ease;
}

/* Cards */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Grid */
.grid { display: grid; gap: clamp(12px, 2.3vw, 24px); }
.grid-fit-250 { grid-template-columns: repeat(auto-fit, minmax(250px,1fr)); }

/* Media blocks (text + image side by side) */
.media {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 420px);
  gap: clamp(12px, 2.2vw, 28px);
  align-items: start;
}
.media img, .media video {
  width: 100%; height: auto;
  border-radius: 12px;
  display: block;
  border: 1px solid rgba(255,255,255,.06);
}

/* =========================================
   06) COMPONENTS (BADGES, FORMS, EXPAND)
   ========================================= */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 100px;
  font-size: .8rem;
  color: var(--muted);
}

form { display: grid; gap: 12px; }
input, textarea, select, button { font: inherit; color: var(--text); }
input, textarea {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 10px 12px;
}
textarea { min-height: 120px; resize: vertical; }

.expand-toggle {
  background: rgba(255,255,255,.06);
  color: var(--link);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
}
.expand-toggle:hover {
  background: rgba(255,255,255,.1);
}

/* CTA buttons */
.cta-row { display: flex; gap: .75rem; margin-top: 1.25rem; flex-wrap: wrap; }
.button {
  appearance: none;
  display: inline-block;
  border: none;
  padding: .8rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .01em;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  box-shadow: var(--shadow);
}
.button.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #0b0d10;
}
.button.ghost {
  background: rgba(255,255,255,0.05);
}

/* =========================================
   07) FOOTER
   ========================================= */
.site-footer {
  background: #0a0e17;
  border-top: 1px solid rgba(255,255,255,.08);
}
.footer-grid {
  display: grid; gap: 18px;
  padding-block: clamp(20px, 4vw, 36px);
  grid-template-columns: 2fr 1fr 2fr;
}
.footer-heading {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.footer-links {
  list-style: none;
  padding: 0; margin: 0;
  display: grid; gap: 8px;
}
.legal {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 10px 0;
  text-align: center;
  color: var(--muted);
}

/* =========================================
   08) Z-INDEX / STICKY SAFETY
   ========================================= */
.top-banner { z-index: 100; }
.nav-drawer { z-index: 95; top: var(--banner-height); }
.hero { margin-top: var(--banner-height); }
main, .page, .max-w, .container, section { overflow: visible; transform: none; }

/* =========================================
   09) RESPONSIVE BREAKPOINTS
   ========================================= */
@media (max-width: 900px) {
  .media { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* =========================================
   10) REDUCED MOTION
   ========================================= */
@media (prefers-reduced-motion: reduce) {
  .hero video { display: none; }
  .reveal { opacity: 1; transform: none; filter: none; }
}

/* =========================================
   11) SVG LOGO ANIMATION (Auto In-vitro)
   ========================================= */
.top-banner .logo-animated {
  height: 40px;
  width: auto;
  display: block;
}
.top-banner .logo-animated text {
  font-size: 80px;
  letter-spacing: -2px;
  stroke-width: 1;
}

.logo-ai .A-outline {
  fill: transparent;
  stroke: var(--loader-text-color, #f6e9fe);
  stroke-width: 1.2;
  opacity: .55;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  pointer-events: none;
  animation: none !important;
  mix-blend-mode: normal;
}
.logo-ai .A-outline.dot,
.logo-ai .A-outline.text-body { animation: none !important; }

.logo-animated { height: 40px; width: auto; display: block; }
svg text { font-size: 80px; letter-spacing: -2px; stroke-width: 1; }
svg text.text-body {
  stroke: #f6e9fe;
  animation: 10s animate-stroke ease-in-out infinite;
}
svg text.dot {
  fill: var(--loader-dot-color);
  stroke: var(--loader-dot-color);
  animation: 10s animate-dot ease-in-out infinite;
}

@keyframes animate-stroke {
  0%,20%,85%,100% { fill:transparent; stroke:#f6e9fe; stroke-width:1; stroke-dasharray:0 32%; stroke-dashoffset:25; }
  45% { fill:transparent; stroke:#f6e9fe; stroke-width:3; stroke-dasharray:50% 0; stroke-dashoffset:0; }
  55%,80% { fill:#f6e9fe; stroke:20; stroke-width:0; stroke-dasharray:32 0%; stroke-dashoffset:-25%; }
}
@keyframes animate-dot {
  0%,20%,80%,100% { fill:var(--loader-dot-color); opacity:0; }
  60%,70% { fill:var(--loader-dot-color); opacity:1; }
}

.logo-ai .outline {
  fill: transparent;
  stroke: var(--loader-text-color, #f6e9fe);
  stroke-width: 1.2;
  opacity: .55;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  pointer-events: none;
  animation: none !important;
}

.logo-ai {
  --i-x:   60px;
  --shift: 150px;
  --dur:   10s;
  --ease:  cubic-bezier(.25,.8,.25,1);
  --moveI: 20%;
}

.logo-ai .layout .AUTO,
.logo-ai .layout .IN,
.logo-ai .layout .RIGHT,
.logo-ai .layout .I-left,
.logo-ai .layout .I-right,
.logo-ai .reveal-auto,
.logo-ai .reveal-in {
  transform-box: fill-box;
  transform-origin: left center;
}

.logo-ai .RIGHT {
  transform: translateX(var(--i-x));
  animation: ai-move-right var(--dur) var(--ease) infinite both;
}
@keyframes ai-move-right {
  0%,  8%  { transform: translateX(var(--i-x)); }
  15%, 70% { transform: translateX(calc(var(--i-x) + var(--shift))); }
  100%     { transform: translateX(var(--i-x)); }
}

.logo-ai .reveal-auto {
  transform: scaleX(0);
  animation: ai-reveal-auto var(--dur) var(--ease) infinite both;
}
@keyframes ai-reveal-auto {
  0%,14%  { transform: scaleX(0); }
  50%,70% { transform: scaleX(1); }
  80%,100%{ transform: scaleX(0); }
}

.logo-ai .reveal-in {
  transform: scaleX(0);
  animation: ai-reveal-in var(--dur) var(--ease) infinite both;
}
@keyframes ai-reveal-in {
  0%,14%   { transform: scaleX(0); }
  50%,70%  { transform: scaleX(1); }
  80%,100% { transform: scaleX(0); }
}

.logo-ai .I-left  { animation: ai-i-left-fade var(--dur) linear infinite both; }
.logo-ai .I-right { animation: ai-i-right-fade var(--dur) linear infinite both; }

@keyframes ai-i-left-fade {
  0%      { opacity: 1; }
  9%, 94% { opacity: 0; }
  100%    { opacity: 1; }
}
@keyframes ai-i-right-fade {
  0%,  6%  { opacity: 0; }
  18%, 50% { opacity: 1; }
  100%     { opacity: 0; }
}

.logo-ai .dot { animation: ai-dot var(--dur) var(--ease) infinite both; }
@keyframes ai-dot {
  0%,45%   { opacity: 0; }
  50%,65%  { opacity: 1; }
  79%,100% { opacity: 0; }
}
