/* ========================================
   Agency Agents — style.css
   Editorial simplicity. Glass & motion.
   ======================================== */

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

/* ── Light theme (default) ────────── */

:root {
  --bg: #fafaf8;
  --bg-warm: #f5f4f0;
  --surface: rgba(255, 255, 255, .55);
  --surface-solid: #fff;
  --text: #111;
  --text-secondary: #555;
  --text-tertiary: #707070;
  --accent: #1a1a1a;
  --border: rgba(0, 0, 0, .06);
  --border-strong: rgba(0, 0, 0, .1);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.03);
  --shadow-md: 0 4px 12px rgba(0,0,0,.05), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
  --shadow-glass: 0 8px 32px rgba(0,0,0,.06), inset 0 1px 0 rgba(255,255,255,.8);
  --orb-1: rgba(180, 160, 220, .18);
  --orb-2: rgba(140, 200, 210, .14);
  --orb-3: rgba(210, 180, 170, .12);
  --grain-opacity: .35;
  --code-bg: var(--surface-solid);
  --nav-bg: rgba(250, 250, 248, .72);
  --focus-ring: #111;
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Manrope', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
  --max-w: 680px;
  --max-w-wide: 1080px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ── Dark theme ───────────────────── */

[data-theme="dark"] {
  --bg: #0d0d0f;
  --bg-warm: #131316;
  --surface: rgba(255, 255, 255, .04);
  --surface-solid: #18181b;
  --text: #e8e8e6;
  --text-secondary: #999;
  --text-tertiary: #8a8a8a;
  --accent: #e8e8e6;
  --border: rgba(255, 255, 255, .06);
  --border-strong: rgba(255, 255, 255, .1);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.2), 0 1px 3px rgba(0,0,0,.15);
  --shadow-md: 0 4px 12px rgba(0,0,0,.25), 0 1px 4px rgba(0,0,0,.2);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.35), 0 4px 12px rgba(0,0,0,.2);
  --shadow-glass: 0 8px 32px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.04);
  --orb-1: rgba(120, 80, 180, .15);
  --orb-2: rgba(60, 140, 160, .12);
  --orb-3: rgba(160, 100, 80, .1);
  --grain-opacity: .2;
  --code-bg: #111113;
  --nav-bg: rgba(13, 13, 15, .75);
  --focus-ring: #e8e8e6;
}

/* ── Base ─────────────────────────── */

html {
  font-size: 16px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth }
}

body {
  font-family: var(--font);
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  letter-spacing: -0.1px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Explicit background for theme toggle repaints */
body.theme-light {
  background: #fafaf8;
}
body.theme-dark {
  background: #0d0d0f;
}

a {
  color: var(--text);
  text-decoration-color: var(--border-strong);
  text-underline-offset: .15em;
  text-decoration-thickness: 1px;
  transition: text-decoration-color .3s var(--ease), opacity .3s var(--ease);
}
a:hover {
  text-decoration-color: var(--text);
}

::selection {
  background: rgba(128,128,128,.15);
}

code {
  font-family: var(--mono);
  font-size: .88em;
}


/* ── Focus indicators ─────────────── */

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 3px;
}

.btn-solid:focus-visible,
.cta-links a:focus-visible,
.theme-toggle:focus-visible {
  outline-offset: 3px;
  border-radius: 999px;
}

:focus:not(:focus-visible) {
  outline: none;
}


/* ── Skip link ────────────────────── */

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 200;
  text-decoration: none;
}
.skip-link:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: auto;
  height: auto;
  padding: .75rem 1.5rem;
  background: var(--text);
  color: var(--bg);
  font-size: .9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  z-index: 200;
}


/* ── Background texture & orbs ────── */

.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg-grain {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
}

[data-theme="dark"] .bg-grain {
  mix-blend-mode: soft-light;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}

.bg-orb-1 {
  width: 600px;
  height: 600px;
  top: -10%;
  left: -5%;
  background: var(--orb-1);
  animation: drift-1 25s ease-in-out infinite alternate;
}

.bg-orb-2 {
  width: 500px;
  height: 500px;
  top: 40%;
  right: -10%;
  background: var(--orb-2);
  animation: drift-2 30s ease-in-out infinite alternate;
}

.bg-orb-3 {
  width: 450px;
  height: 450px;
  bottom: -5%;
  left: 30%;
  background: var(--orb-3);
  animation: drift-3 22s ease-in-out infinite alternate;
}

@keyframes drift-1 {
  0%   { transform: translate(0, 0) scale(1) }
  50%  { transform: translate(80px, 60px) scale(1.08) }
  100% { transform: translate(30px, 100px) scale(.95) }
}
@keyframes drift-2 {
  0%   { transform: translate(0, 0) scale(1) }
  50%  { transform: translate(-60px, -40px) scale(1.05) }
  100% { transform: translate(-90px, 30px) scale(.97) }
}
@keyframes drift-3 {
  0%   { transform: translate(0, 0) scale(1) }
  50%  { transform: translate(50px, -50px) scale(1.1) }
  100% { transform: translate(-30px, -70px) scale(1.02) }
}


/* ── Navigation ────────────────────── */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 1.25rem 2rem;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.nav-mark {
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: -.02em;
  text-decoration: none;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-size: .85rem;
  font-weight: 400;
  color: var(--text-tertiary);
  text-decoration: none;
  padding: .5rem .25rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color .3s var(--ease);
}
.nav-links a:hover {
  color: var(--text);
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-tertiary);
  cursor: pointer;
  transition:
    color .3s var(--ease),
    border-color .3s var(--ease),
    transform .3s var(--ease);
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-tertiary);
  transform: rotate(15deg);
}

/* Show sun in dark mode, moon in light mode */
.icon-sun  { display: none }
.icon-moon { display: block }
[data-theme="dark"] .icon-sun  { display: block }
[data-theme="dark"] .icon-moon { display: none }

/* Stars badge: show correct variant */
.stars-dark  { display: none }
.stars-light { display: inline }
[data-theme="dark"] .stars-dark  { display: inline }
[data-theme="dark"] .stars-light { display: none }


/* ── Hero ──────────────────────────── */

.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 8rem 2rem 4rem;
  text-align: left;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: .4em;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 2.2rem + 1.5vw, 3.25rem);
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: clamp(1rem, 1rem + .2vw, 1.125rem);
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 3rem;
}

.btn-solid {
  display: inline-flex;
  align-items: center;
  padding: .65rem 1.5rem;
  min-height: 44px;
  background: var(--text);
  color: var(--bg);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 999px;
  transition: transform .25s var(--ease), box-shadow .3s var(--ease);
}
.btn-solid:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--bg);
  text-decoration: none;
}

.btn-ghost {
  font-size: .875rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  padding: .65rem 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 1px solid var(--border-strong);
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text);
  text-decoration: none;
}

.hero-stars {
  text-decoration: none;
  vertical-align: middle;
}
.hero-stars img {
  height: 17px;
  vertical-align: middle;
  opacity: .7;
  transition: opacity .3s var(--ease);
}
.hero-stars:hover img { opacity: 1 }


/* ── Numbers ──────────────────────── */

.numbers {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.numbers-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
}

.number-item { text-align: center }

.number-value {
  display: block;
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -.04em;
  color: var(--text);
}

.number-label {
  font-size: .78rem;
  font-weight: 400;
  color: var(--text-tertiary);
  letter-spacing: .03em;
  text-transform: uppercase;
}

.number-divider {
  width: 1px;
  height: 2.5rem;
  background: var(--border-strong);
}


/* ── About ────────────────────────── */

.about {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2rem 5rem;
  border-top: 1px solid var(--border);
}

.prose h2 {
  font-size: clamp(1.4rem, 1.4rem + .5vw, 1.75rem);
  font-weight: 400;
  letter-spacing: -.02em;
  margin-bottom: 1.25rem;
}

.prose p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: clamp(1rem, 1rem + .15vw, 1.075rem);
}
.prose p:last-child { margin-bottom: 0 }


/* ── Divisions ────────────────────── */

.divisions {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 5rem 2rem;
}

.divisions h2 {
  font-size: clamp(1.4rem, 1.4rem + .5vw, 1.75rem);
  font-weight: 400;
  letter-spacing: -.02em;
  margin-bottom: .5rem;
}

.divisions-intro {
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
}

.division-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.div-card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition:
    box-shadow .4s var(--ease),
    border-color .3s var(--ease),
    background .3s var(--ease);
}

.div-card:hover {
  box-shadow: var(--shadow-glass);
  border-color: var(--border-strong);
}

.div-icon {
  display: block;
  width: 24px;
  height: 24px;
  margin-bottom: .75rem;
  color: var(--text-tertiary);
  stroke-width: 1.5;
}

.div-card h3 {
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: .2rem;
}

.div-card p {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--text-tertiary);
}


/* ── Quick Start ──────────────────── */

.start {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem;
  border-top: 1px solid var(--border);
}

.start h2 {
  font-size: clamp(1.4rem, 1.4rem + .5vw, 1.75rem);
  font-weight: 400;
  letter-spacing: -.02em;
  margin-bottom: 2rem;
}

.code-card {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: box-shadow .4s var(--ease);
}
.code-card:hover {
  box-shadow: var(--shadow-lg);
}

.code-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 1.25rem;
}
.code-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
  display: block;
}

.code-card pre {
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.8;
  color: var(--text);
  white-space: pre;
  overflow-x: auto;
}

.code-card code .code-comment {
  color: var(--text-tertiary);
}

.start-note {
  margin-top: 1.5rem;
  font-size: .9rem;
  color: var(--text-secondary);
}
.start-note code {
  padding: .15em .4em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .82em;
}


/* ── CTA ──────────────────────────── */

.cta {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem;
  border-top: 1px solid var(--border);
}

.cta h2 {
  font-size: clamp(1.4rem, 1.4rem + .5vw, 1.75rem);
  font-weight: 400;
  letter-spacing: -.02em;
  margin-bottom: .75rem;
}

.cta > p {
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 2rem;
}

.cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.cta-links a {
  display: inline-flex;
  align-items: center;
  padding: .55rem 1.25rem;
  min-height: 44px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  transition:
    background .3s var(--ease),
    border-color .3s var(--ease),
    box-shadow .3s var(--ease);
}
.cta-links a:hover {
  background: var(--surface);
  border-color: var(--text-tertiary);
  box-shadow: var(--shadow-sm);
}


/* ── Footer ───────────────────────── */

footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  border-top: 1px solid var(--border);
}

footer p {
  font-size: .8rem;
  color: var(--text-tertiary);
}

footer a {
  color: var(--text-tertiary);
}
footer a:hover {
  color: var(--text);
}


/* ── Responsive ───────────────────── */

@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem }
  .nav-links { gap: 1.25rem }
  .hero { padding: 5rem 1.5rem 3rem }
  .numbers { padding: 2rem 1.5rem 4rem }
  .numbers-list { gap: 2rem }
  .number-value { font-size: 1.3rem }
  .about,
  .start,
  .cta,
  .divisions,
  footer { padding-left: 1.5rem; padding-right: 1.5rem }
  .division-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) }
  .code-card { padding: 1.5rem }
  .bg-orb-1 { width: 350px; height: 350px }
  .bg-orb-2 { width: 300px; height: 300px }
  .bg-orb-3 { width: 280px; height: 280px }
}

@media (max-width: 480px) {
  .nav-links { gap: .75rem }
  .nav-links a { font-size: .8rem }
  .hero h1 { font-size: 1.85rem }
  .hero-actions { flex-direction: column; align-items: flex-start }
  .numbers-list { flex-direction: column; gap: 1.25rem }
  .number-divider { width: 3rem; height: 1px }
  .division-grid { grid-template-columns: 1fr 1fr; gap: .75rem }
  .div-card { padding: 1.15rem }
  .cta-links { flex-direction: column }
  .cta-links a { text-align: center; justify-content: center }
}


/* ── Motion (respects preference) ── */

@media (prefers-reduced-motion: no-preference) {
  .hero h1,
  .hero-sub,
  .hero-actions,
  .hero-stars {
    animation: rise .8s var(--ease) both;
  }
  .hero-sub     { animation-delay: .08s }
  .hero-actions { animation-delay: .16s }
  .hero-stars   { animation-delay: .24s }

  .div-card {
    animation: rise .6s var(--ease) both;
  }
  .div-card:nth-child(1)  { animation-delay: .05s }
  .div-card:nth-child(2)  { animation-delay: .1s }
  .div-card:nth-child(3)  { animation-delay: .15s }
  .div-card:nth-child(4)  { animation-delay: .2s }
  .div-card:nth-child(5)  { animation-delay: .25s }
  .div-card:nth-child(6)  { animation-delay: .3s }
  .div-card:nth-child(7)  { animation-delay: .35s }
  .div-card:nth-child(8)  { animation-delay: .4s }
  .div-card:nth-child(9)  { animation-delay: .45s }
  .div-card:nth-child(10) { animation-delay: .5s }
  .div-card:nth-child(11) { animation-delay: .55s }
  .div-card:nth-child(12) { animation-delay: .6s }
}

@media (prefers-reduced-motion: reduce) {
  .bg-orb { animation: none !important }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


