/* Labs8 — classy, modern, AI-era. Text and logo only. */

:root {
  --color-bg: #fafaf9;
  --color-bg-alt: #f4f4f3;
  --color-bg-elevated: #fff;
  --color-text: #0a0a0a;
  --color-text-muted: #3f3f3f;
  --color-text-soft: #737373;
  --color-accent: #0c4a6e;
  --color-accent-hover: #075985;
  --color-accent-subtle: rgba(12, 74, 110, 0.08);
  --color-accent-glow: rgba(12, 74, 110, 0.25);
  --color-gold: #9a7b4f;
  --color-gold-soft: rgba(154, 123, 79, 0.5);
  --color-border: #e5e5e4;
  --color-border-strong: #d4d4d3;
  --color-focus: #0c4a6e;
  --font-heading: "Syne", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
  --max-width: 42rem;
  --max-width-wide: 65rem;
  --space-unit: 1rem;
  --space-xs: calc(var(--space-unit) * 0.5);
  --space-s: calc(var(--space-unit) * 1.5);
  --space-m: calc(var(--space-unit) * 2.5);
  --space-l: calc(var(--space-unit) * 4);
  --space-xl: calc(var(--space-unit) * 6);
  --space-2xl: calc(var(--space-unit) * 9);
  --line-height-tight: 1.15;
  --line-height-body: 1.65;
  --line-height-loose: 1.8;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --transition: 0.2s ease;
}

@keyframes gradient-shift {
  0%, 100% { opacity: 1; transform: scale(1) translate(0, 0); }
  33% { opacity: 0.9; transform: scale(1.05) translate(2%, -1%); }
  66% { opacity: 0.95; transform: scale(0.98) translate(-1%, 2%); }
}

@keyframes gradient-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(3%, 3%) scale(1.1); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px var(--color-accent-glow); }
  50% { box-shadow: 0 0 32px var(--color-accent-glow); }
}

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Syne:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap");

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}

/* Ambient AI background: soft gradient orbs + subtle grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(12, 74, 110, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 80% 80%, rgba(12, 74, 110, 0.05) 0%, transparent 45%),
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(12, 74, 110, 0.03) 0%, transparent 40%),
    var(--color-bg);
}

@media (prefers-reduced-motion: no-preference) {
  body::before {
    animation: gradient-shift 18s ease-in-out infinite;
  }
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(12, 74, 110, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12, 74, 110, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* ----- Header ----- */
.site-header {
  padding: var(--space-m) var(--space-s);
  max-width: var(--max-width-wide);
  margin: 0 auto;
  border-bottom: 1px solid var(--color-border);
}

.logo {
  display: inline-block;
}

.logo img {
  height: 38px;
  width: auto;
}

@media (min-width: 640px) {
  .logo img {
    height: 44px;
  }
}

/* ----- Main ----- */
main {
  position: relative;
  padding-bottom: var(--space-2xl);
}

/* Faded lab illustration bleed toward bottom (image: assets/labs8-cover.png) */
main::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58vh;
  background-image:
    linear-gradient(to top, var(--color-bg) 0%, rgba(250, 250, 249, 0.92) 35%, transparent 65%),
    url("assets/labs8-cover.png");
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: -1;
  opacity: 0.42;
}

.section {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-s);
}

@media (prefers-reduced-motion: no-preference) {
  .hero,
  .section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .hero.is-visible,
  .section.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

.section--narrow {
  max-width: var(--max-width);
}

.section__label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-xs);
}

.section__title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-m);
  color: var(--color-text);
}

/* ----- Hero ----- */
.hero {
  text-align: center;
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.hero__title {
  text-align: center;
  font-family: var(--font-heading);
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-m);
}

.hero__title-word {
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-accent) 45%, var(--color-text-muted) 100%);
  background-size: 200% auto;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-fill-color: transparent;
}

.hero__suffix {
  -webkit-text-fill-color: var(--color-accent);
  text-fill-color: var(--color-accent);
  background: none;
  transition: opacity 0.35s ease;
}

.hero__suffix--change {
  opacity: 0;
}

@keyframes gradient-text {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero.is-visible .hero__title .hero__title-word {
    animation: gradient-text 8s ease-in-out infinite;
  }
}

.hero__subhead {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--color-text-muted);
  max-width: var(--max-width);
  margin: 0 auto var(--space-l);
  line-height: 1.4;
}

.hero__value {
  font-size: 1.1875rem;
  color: var(--color-text);
  max-width: var(--max-width);
  margin: 0 auto var(--space-xl);
  line-height: var(--line-height-loose);
}

/* Hero staggered reveal (delays set by JS) */
.hero .hero__title,
.hero .hero__subhead,
.hero .hero__value,
.hero .btn {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.hero.is-visible .hero__title,
.hero.is-visible .hero__subhead,
.hero.is-visible .hero__value,
.hero.is-visible .btn {
  opacity: 1;
  transform: translateY(0);
}

.hero.is-visible .hero__title { transition-delay: 0.1s; }
.hero.is-visible .hero__subhead { transition-delay: 0.25s; }
.hero.is-visible .hero__value { transition-delay: 0.4s; }
.hero.is-visible .btn { transition-delay: 0.55s; }

/* ----- Buttons ----- */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.btn--primary {
  background-color: var(--color-accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background-color: var(--color-accent-hover);
  text-decoration: none;
  box-shadow: var(--shadow-md), 0 0 24px var(--color-accent-glow);
}

@media (prefers-reduced-motion: no-preference) {
  .hero .btn--primary {
    animation: glow-pulse 3s ease-in-out infinite;
  }
  .hero .btn--primary:hover {
    animation: none;
  }
}

.btn--primary:active {
  transform: scale(0.98);
}

/* ----- What We Build ----- */
#what-we-build {
  background-color: var(--color-bg-alt);
}

.services {
  display: grid;
  gap: var(--space-m);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .services {
    grid-template-columns: repeat(2, 1fr);
  }
}

.service {
  position: relative;
  padding: var(--space-l);
  background-color: var(--color-bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  overflow: hidden;
}

.service::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, var(--color-accent-subtle) 100%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.service:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(12, 74, 110, 0.08);
  transform: translateY(-2px);
}

.service:hover::before {
  opacity: 1;
}

#what-we-build.is-visible .service:hover {
  transform: translateY(-2px);
}

/* Stagger service cards on scroll */
.service {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color var(--transition), box-shadow var(--transition);
}

#what-we-build.is-visible .service:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.1s; }
#what-we-build.is-visible .service:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.15s; }
#what-we-build.is-visible .service:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }
#what-we-build.is-visible .service:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 0.25s; }

.service__number {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-gold);
  margin-bottom: var(--space-s);
}

.service__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-s);
  color: var(--color-text);
}

.service__desc {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ----- How We Work ----- */
.prose {
  margin: 0;
}

.prose p {
  margin: 0 0 var(--space-s);
  font-size: 1.125rem;
  color: var(--color-text);
  line-height: var(--line-height-loose);
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose__emphasis {
  font-weight: 600;
  margin-top: var(--space-m);
  font-size: 1.1875rem;
}

/* ----- Who We Work With ----- */
.list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  color: var(--color-text);
}

.list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: var(--space-s);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-accent);
  opacity: 0.6;
}

.list li:last-child {
  margin-bottom: 0;
}

/* ----- Why Labs8 ----- */

/* ----- Contact ----- */
.section--contact {
  background-color: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-2xl);
}

.contact__intro {
  margin: 0 0 var(--space-l);
  max-width: var(--max-width);
  font-size: 1.125rem;
  color: var(--color-text);
  line-height: var(--line-height-loose);
}

.contact__cta {
  margin: 0;
}

.contact__cta .btn {
  text-decoration: none;
}

/* ----- Footer ----- */
.site-footer {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: var(--space-l) var(--space-s);
  border-top: 1px solid var(--color-border);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--color-text);
  font-weight: 500;
}

.site-footer a:hover {
  color: var(--color-accent);
}
