/* app.css — GriffinMind Labs */

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

:root {
  /* Palette — refined cool dark with signature accent */
  --bg-0: #07090c;
  --bg-1: #0a0d11;
  --bg-2: #0e1218;
  --bg-3: #141921;
  --surface: rgba(255, 255, 255, 0.025);
  --surface-2: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #eef2f5;
  --text-dim: #a8b4c0;
  --text-muted: #5f6d7c;

  /* Accent — set by JS from tweak */
  --accent: #7cc4e8;
  --accent-2: #b79dff;

  --font-sans: "Geist", "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-serif: "Instrument Serif", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

/* Grainy background overlay — held at body level so it covers everything */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.25 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.4'/></svg>");
  opacity: 0.35;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}

::selection { background: color-mix(in oklab, var(--accent) 40%, transparent); color: #fff; }
:focus-visible { outline: 2px dashed var(--accent); outline-offset: 3px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 5px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Logo mark ───────────────────────────────────────────────────── */
.logo-mark-wrap { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; }
.logo-mark-img { width: 100%; height: 100%; object-fit: contain; display: block; position: relative; z-index: 1; }
.logo-mark-glow {
  position: absolute; inset: -25%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--accent) 60%, transparent) 0%, transparent 65%);
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}

/* ── Common bits ─────────────────────────────────────────────────── */
.container { max-width: 1240px; margin-inline: auto; padding-inline: clamp(1.25rem, 3vw, 2rem); position: relative; z-index: 2; }
.section { padding-block: clamp(5rem, 10vw, 9rem); position: relative; }
.section-head { margin-bottom: clamp(3rem, 6vw, 5rem); max-width: 880px; }
.section-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(2.25rem, 5vw, 4rem);
  letter-spacing: -0.035em;
  line-height: 1.04;
  color: var(--text);
}
.section-title--center { text-align: center; margin-inline: auto; }
.section-title--serif { font-family: var(--font-serif); font-weight: 400; font-style: italic; font-size: 1.08em; letter-spacing: -0.01em; color: color-mix(in oklab, var(--accent) 70%, var(--text) 30%); }
.prose { max-width: 60ch; text-wrap: pretty; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 1.5rem;
}
/* Lift eyebrow contrast over the neural background */
.hero--neural .eyebrow {
  color: #cdd6e0;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7), 0 0 24px rgba(0, 0, 0, 0.5);
}
.eyebrow--centered { margin-inline: auto; display: flex; justify-content: center; }
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }

/* ── Nav ─────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: clamp(1rem, 2vw, 1.5rem) clamp(1.25rem, 3vw, 2rem);
  transition: padding 0.35s var(--ease), background 0.35s var(--ease);
}
.nav--scrolled { padding-block: 0.75rem; background: color-mix(in oklab, var(--bg-0) 82%, transparent); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 1240px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }

.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: inherit; }
.brand-name { font-family: var(--font-sans); font-weight: 600; font-size: 1rem; letter-spacing: -0.015em; color: var(--text); }
.brand-name span + span { margin-left: 0.35em; }
.brand-accent { color: var(--accent); }
.brand-accent--serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.nav-links { list-style: none; display: flex; gap: 0.25rem; align-items: center; }
@media (max-width: 820px) { .nav-links { display: none; } }
.nav-links a {
  display: inline-flex; align-items: center; gap: 0.5rem;
  position: relative;
  padding: 0.5rem 0.9rem;
  font-size: 0.88rem; font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }
.nav-dot { position: absolute; inset: 0; background: var(--surface-2); border-radius: 999px; z-index: -1; border: 1px solid var(--border); }
.nav-dot-slot { position: absolute; inset: 0; pointer-events: none; }

.nav-cta {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 0.55rem 0.55rem 1rem;
  font-size: 0.88rem; font-weight: 500;
  color: var(--text); text-decoration: none;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.nav-cta:hover { background: var(--surface-2); border-color: var(--accent); }
.nav-cta svg { background: var(--accent); color: var(--bg-0); border-radius: 50%; padding: 4px; width: 26px; height: 26px; transition: transform 0.25s var(--ease); }
.nav-cta:hover svg { transform: translateX(3px); }
@media (max-width: 600px) { .nav-cta span { display: none; } .nav-cta { padding: 0.55rem; } }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.95rem 1.4rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 999px;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
  cursor: pointer;
  will-change: transform;
}
.btn svg { display: block; }
.btn > span { display: inline-flex; align-items: center; gap: 0.55rem; }
.btn-primary {
  background: var(--accent);
  color: var(--bg-0);
  border: 1px solid transparent;
}
.btn-primary:hover { background: color-mix(in oklab, var(--accent) 85%, white); }
.btn-primary .btn-glow {
  position: absolute; inset: -6px;
  border-radius: inherit;
  background: var(--accent);
  filter: blur(22px);
  opacity: 0.35;
  z-index: 0;
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: transparent; }

.cta-row { display: flex; gap: 0.85rem; flex-wrap: wrap; }
.cta-row--center { justify-content: center; }

/* ── Hero base ───────────────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  position: relative;
  display: grid;
  place-items: center;
  padding-block: 8rem 4rem;
  overflow: hidden;
}

.display {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.92;
  font-size: clamp(3.5rem, 11vw, 9.5rem);
}
.display-row { display: block; perspective: 600px; }
.display-row--serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: color-mix(in oklab, var(--accent) 75%, var(--text) 25%);
  font-size: 1.1em;
  line-height: 0.9;
}
.display-row--lab { display: inline-flex; align-items: center; gap: 0.4em; color: var(--text); }
.display-caret { display: inline-block; width: 0.08em; height: 0.8em; background: var(--accent); vertical-align: -0.08em; box-shadow: 0 0 24px var(--accent); }
.display--compact { font-size: clamp(2.8rem, 6.8vw, 5.2rem); line-height: 1; }
.display--cinema { font-size: clamp(2.8rem, 7vw, 6rem); text-align: center; line-height: 1.02; }

.hero-kinetic-inner { text-align: left; padding-inline: clamp(1.25rem, 4vw, 3rem); max-width: 1320px; width: 100%; margin-inline: auto; }
.hero-lede { font-size: clamp(1.05rem, 1.25vw, 1.2rem); color: var(--text-dim); margin: 2rem 0 2.25rem; line-height: 1.6; }
.hero-lede--center { margin-inline: auto; text-align: center; }
/* Lift lede contrast over the neural background */
.hero--neural .hero-lede { color: #d8dfe7; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7), 0 0 28px rgba(0, 0, 0, 0.45); }

.hero-scroll {
  position: absolute;
  bottom: 2.5rem; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted);
}
.hero-scroll i { display: inline-block; width: 1px; height: 24px; background: currentColor; }

/* Hero — Split */
.hero--split { padding-top: 9rem; }
.hero-split-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; max-width: 1320px; margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 3rem); width: 100%; }
@media (max-width: 900px) { .hero-split-grid { grid-template-columns: 1fr; } .hero-split-visual { height: 400px; } }
.hero-split-copy .display { font-size: clamp(2.6rem, 6vw, 4.8rem); }
.hero-split-visual { aspect-ratio: 1 / 1; max-height: 560px; position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: var(--bg-1); }

/* Hero — Cinematic */
.hero--cinematic { text-align: center; }
.hero-cinema-inner { max-width: 1200px; margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 3rem); position: relative; z-index: 2; }
.hero-cinema-marquee { position: absolute; bottom: 0; left: 0; right: 0; padding-block: 2rem; border-top: 1px solid var(--border); background: color-mix(in oklab, var(--bg-0) 60%, transparent); backdrop-filter: blur(12px); }

/* ── Aurora backdrop ─────────────────────────────────────────────── */
.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.aurora-blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55; mix-blend-mode: screen; }
.aurora-a { width: 55vw; height: 55vw; background: var(--accent); top: -10%; left: -10%; opacity: 0.35; }
.aurora-b { width: 45vw; height: 45vw; background: var(--accent-2); bottom: -20%; right: -15%; opacity: 0.28; }
.aurora-c { width: 40vw; height: 40vw; background: color-mix(in oklab, var(--accent) 50%, var(--accent-2)); top: 30%; left: 40%; opacity: 0.2; }
.aurora-grain { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 0%, var(--bg-0) 85%); }

/* ── Mesh visual (split hero) ────────────────────────────────────── */
.mesh-wrap { position: absolute; inset: 0; }
.mesh-svg { width: 100%; height: 100%; display: block; }
.mesh-overlay { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 30%, var(--bg-1) 85%); pointer-events: none; }

/* ── Services ────────────────────────────────────────────────────── */
.section--services { background: var(--bg-1); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (max-width: 960px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .services-grid { grid-template-columns: 1fr; } }

.service-card {
  position: relative;
  background: var(--bg-1);
  padding: 2rem 2rem 2.5rem;
  min-height: 280px;
  display: flex; flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  cursor: default;
}
.service-card-bg {
  position: absolute; inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), color-mix(in oklab, var(--accent) 10%, transparent), transparent 50%);
  opacity: 0; transition: opacity 0.3s var(--ease);
  pointer-events: none; z-index: -1;
}
.service-card:hover .service-card-bg { opacity: 1; }
.service-card-num {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted);
  letter-spacing: 0.12em;
  margin-bottom: 2rem;
}
.service-card-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  color: var(--accent);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.service-card h3 { font-family: var(--font-sans); font-size: 1.25rem; font-weight: 500; letter-spacing: -0.015em; margin-bottom: 0.55rem; }
.service-card p { color: var(--text-dim); font-size: 0.95rem; line-height: 1.6; }
.service-card-arrow {
  position: absolute; top: 2rem; right: 2rem;
  color: var(--text-muted);
  opacity: 0; transform: translate(-4px, 4px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.service-card:hover .service-card-arrow { opacity: 1; transform: translate(0, 0); color: var(--accent); }

/* ── Expertise / tech chips ──────────────────────────────────────── */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
@media (max-width: 860px) { .tech-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .tech-grid { grid-template-columns: 1fr; } }
.tech-chip {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.tech-chip:hover { border-color: var(--accent); background: var(--surface-2); }
.tech-chip-num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.1em; }
.tech-chip-label { font-family: var(--font-sans); font-size: 1rem; font-weight: 500; color: var(--text); }

/* ── Specializations list ────────────────────────────────────────── */
.section--specs { background: var(--bg-1); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.spec-list { border-top: 1px solid var(--border); }
.spec-row {
  display: grid;
  grid-template-columns: 80px 1.2fr 2fr 40px;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: start;
  padding: clamp(1.5rem, 3vw, 2.25rem) 0.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.25s var(--ease);
  cursor: default;
}
.spec-row:hover { background: color-mix(in oklab, var(--accent) 3%, transparent); }
.spec-row:hover .spec-row-n { color: var(--accent); }
.spec-row:hover .spec-row-arrow { color: var(--accent); transform: translateX(6px); }
.spec-row-n { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-muted); letter-spacing: 0.1em; padding-top: 0.4rem; transition: color 0.25s var(--ease); }
.spec-row-title h3 { font-family: var(--font-sans); font-size: clamp(1.25rem, 2vw, 1.55rem); font-weight: 500; letter-spacing: -0.02em; }
.spec-row-body p { color: var(--text-dim); font-size: 1rem; max-width: 52ch; }
.spec-row-arrow { color: var(--text-muted); padding-top: 0.3rem; transition: color 0.25s var(--ease), transform 0.25s var(--ease); }
@media (max-width: 800px) {
  .spec-row { grid-template-columns: 60px 1fr; grid-template-rows: auto auto; }
  .spec-row-arrow { display: none; }
  .spec-row-body { grid-column: 2; }
}

/* ── Contact ─────────────────────────────────────────────────────── */
.section--contact { position: relative; overflow: hidden; padding-block: clamp(6rem, 12vw, 10rem); }
.contact-inner { text-align: center; max-width: 780px; }
.contact-lede { margin: 1.25rem auto 2.5rem; color: var(--text-dim); font-size: 1.05rem; }
.contact-info { display: flex; flex-direction: column; gap: 0.75rem; margin: 0 auto 2.5rem; max-width: 520px; }
.contact-item {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
  font-size: 0.98rem;
}
.contact-item:hover:not(.contact-item--static) { border-color: var(--accent); background: var(--surface-2); }
.contact-item > svg:last-child { margin-left: auto; color: var(--text-muted); transition: color 0.25s var(--ease), transform 0.25s var(--ease); }
.contact-item:hover > svg:last-child { color: var(--accent); transform: translateX(3px); }
.contact-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--bg-1); border: 1px solid var(--border); color: var(--accent); flex-shrink: 0; }
.contact-ico svg { display: block; }

/* ── Footer ──────────────────────────────────────────────────────── */
.footer { background: var(--bg-0); border-top: 1px solid var(--border); padding-block: 2rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; color: var(--text-muted); font-size: 0.85rem; }
.footer-brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text-dim); }
.footer-meta { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.footer-sep { opacity: 0.4; }

/* ── Marquee ─────────────────────────────────────────────────────── */
.marquee { overflow: hidden; width: 100%; }
.marquee-track { display: inline-flex; gap: 3rem; white-space: nowrap; }
.marquee-item { font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.marquee-item::after { content: "◆"; margin-left: 3rem; color: var(--accent); opacity: 0.5; }

/* ── Mobile fixes (iPhone-class viewports) ──────────────────────── */
@media (max-width: 600px) {
  /* 1) Nav: don't squish or hide on scroll. Keep it readable, drop transparency. */
  .nav {
    padding: 0.7rem 1rem;
  }
  .nav--scrolled {
    padding-block: 0.6rem;
    background: color-mix(in oklab, var(--bg-0) 92%, transparent);
  }
  .nav-inner {
    gap: 0.75rem;
  }
  .brand-name {
    font-size: 0.92rem;
  }
  .nav-cta {
    padding: 0.5rem;
    flex-shrink: 0;
  }
  .nav-cta svg {
    width: 24px; height: 24px;
  }
}

/* Prefer-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
