/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #0a0a0a;
  --bg-2:      #141414;
  --card:      #17171a;
  --ink:       #fafafa;
  --mute:      #a3a3a3;
  --mute-2:    #6b6b6f;
  --accent:    #7c5cff;
  --accent-ink: #0a0a0a;
  --gradient-1: #7c5cff;
  --gradient-2: #ff3d81;
  --gradient-3: #3aa0ff;
  --gradient-4: #00e5c7;
  --line:      rgba(250,250,250,0.12);
  --line-soft: rgba(250,250,250,0.07);

  --mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:   cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.02; letter-spacing: -0.02em; font-weight: 800; }
ul { list-style: none; padding: 0; }
::selection { background: var(--accent); color: #fff; }

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

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg);
  border-radius: 8px; font-weight: 700; font-size: .85rem;
}
.skip-link:focus { top: 1rem; }

.container { width: min(1180px, 92vw); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--mute); margin-bottom: 1.2rem;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }

.kicker-num { color: var(--accent); font-weight: 700; }

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }

/* =============================================================
   4. Typography
   ============================================================= */
h1 { font-size: clamp(2.6rem, 9vw, 7.4rem); }
h2 { font-size: clamp(2rem, 5.2vw, 3.6rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); }

.section-head { max-width: 46ch; margin-bottom: clamp(2.4rem, 5vw, 4rem); }
.section-head h2 { margin-bottom: .9rem; }
.section-head p { color: var(--mute); font-size: 1.02rem; max-width: 48ch; }

/* Massive type hover-invert (signature support effect) */
.invert-word {
  display: inline-block;
  transition: color .25s var(--ease-out), background-color .25s var(--ease-out);
  padding-inline: .08em;
}
@media (hover: hover) and (pointer: fine) {
  .invert-word:hover { background: var(--ink); color: var(--bg); border-radius: .08em; }
}

/* =============================================================
   5. Components
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  padding: .95em 1.6em; border-radius: 999px; font-weight: 700;
  font-size: .92rem; letter-spacing: .01em;
  transition: transform .3s var(--ease-out), background-color .3s var(--ease-out), color .3s var(--ease-out);
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }

.pill {
  display: inline-flex; align-items: center; padding: .3em .8em;
  border: 1px solid var(--line); border-radius: 999px; font-size: .75rem; color: var(--mute);
}

/* Accordion (services list + FAQ) */
.accordion-row {
  border-top: 1px solid var(--line);
}
.accordion-row:last-child { border-bottom: 1px solid var(--line); }
.accordion-trigger {
  width: 100%; display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.4rem);
  padding: clamp(1.2rem, 3vw, 1.9rem) 0; text-align: left;
}
.accordion-trigger .kicker-num { font-size: .95rem; flex: none; width: 2.6ch; }
.accordion-trigger .row-title { flex: 1; font-size: clamp(1.15rem, 2.6vw, 1.7rem); font-weight: 700; }
.accordion-trigger .row-brief { display: none; }
.accordion-trigger .row-plus { flex: none; font-size: 1.4rem; color: var(--mute); transition: transform .35s var(--ease-out); }
.accordion-row.is-open .row-plus { transform: rotate(45deg); color: var(--accent); }

.accordion-panel {
  overflow: hidden; height: 0; transition: height .4s var(--ease-out);
}
.accordion-panel-inner { padding: 0 0 clamp(1.4rem, 3vw, 2rem) 0; max-width: 62ch; color: var(--mute); font-size: 1rem; line-height: 1.7; }

@media (min-width: 720px) {
  .accordion-trigger .row-brief {
    display: block; flex: 1; color: var(--mute-2); font-size: .95rem; max-width: 36ch;
  }
}

/* Stat blocks */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.6rem, 4vw, 3rem); }
@media (min-width: 720px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-value { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; color: var(--accent); display: flex; align-items: baseline; gap: .1em; }
.stat-label { color: var(--mute); font-size: .88rem; margin-top: .5rem; max-width: 22ch; }

/* Work cards (mosaic, minimal, duotone) */
.work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: clamp(1rem, 2.4vw, 1.6rem); }
.work-card { position: relative; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--card); }
.work-card img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.1) brightness(.8);
  transition: filter .5s var(--ease-out), transform .6s var(--ease-out);
}
.work-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10,10,10,.92) 100%);
}
.work-card:hover img { filter: grayscale(.15) contrast(1.05) brightness(.85) saturate(1.3); transform: scale(1.06); }
.work-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.2rem; z-index: 1; }
.work-meta .pill { margin-bottom: .6rem; background: rgba(10,10,10,.5); backdrop-filter: blur(6px); }
.work-meta h3 { font-size: 1.05rem; }

/* FAQ */
.faq-panel-inner { padding: 0 0 clamp(1.2rem, 3vw, 1.6rem) 0; max-width: 64ch; color: var(--mute); }
.faq-trigger .row-title { font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 700; }

/* Chat widget */
.chat-bubble {
  position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem);
  z-index: 60; width: 60px; height: 60px; border-radius: 50%;
  background: var(--ink); color: var(--bg); display: grid; place-items: center;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.6);
  transition: transform .3s var(--ease-bounce);
}
.chat-bubble:hover { transform: scale(1.06); }
.chat-bubble svg { width: 26px; height: 26px; }
.chat-bubble .chat-dot {
  position: absolute; top: 4px; right: 4px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
}

.chat-panel {
  position: fixed; right: clamp(.6rem, 3vw, 2rem); bottom: clamp(4.6rem, 12vw, 6.4rem);
  z-index: 60; width: min(370px, 92vw); max-height: min(560px, 72vh);
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 30px 70px -25px rgba(0,0,0,.7);
  opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none;
  transition: opacity .28s var(--ease-out), transform .28s var(--ease-out);
}
.chat-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }

.chat-head { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .7rem; }
.chat-head .dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--gradient-4); flex: none; }
.chat-head strong { font-size: .95rem; }
.chat-head span { display: block; font-size: .76rem; color: var(--mute); }
.chat-close { margin-left: auto; color: var(--mute); font-size: 1.2rem; padding: .2rem; }

.chat-body { flex: 1; overflow-y: auto; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .7rem; }
.chat-msg { max-width: 86%; padding: .65rem .9rem; border-radius: 14px; font-size: .88rem; line-height: 1.55; }
.chat-msg.from-bot { background: var(--bg-2); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg.from-user { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-suggested { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 1.1rem 1rem; }
.chat-suggested button {
  border: 1px solid var(--line); border-radius: 999px; padding: .4em .9em; font-size: .78rem; color: var(--mute);
  transition: border-color .2s, color .2s;
}
.chat-suggested button:hover { border-color: var(--accent); color: var(--ink); }

.chat-form { display: flex; gap: .5rem; padding: .9rem 1.1rem; border-top: 1px solid var(--line); }
.chat-form input {
  flex: 1; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px;
  padding: .7em 1em; color: var(--ink); font: inherit; font-size: .88rem;
}
.chat-form input:focus { outline: none; border-color: var(--accent); }
.chat-form button { background: var(--ink); color: var(--bg); border-radius: 50%; width: 38px; height: 38px; flex: none; display: grid; place-items: center; }
.chat-form button svg { width: 16px; height: 16px; }
.chat-typing { display: inline-flex; gap: 4px; padding: .5rem .2rem; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--mute); animation: typingBounce 1.1s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* Contact form */
.contact-form { display: grid; gap: 1rem; max-width: 560px; }
.field { display: grid; gap: .4rem; }
.field label { font-size: .8rem; color: var(--mute); }
.field input, .field textarea {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: .85em 1em; color: var(--ink); font: inherit; font-size: .95rem; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field-check { display: flex; align-items: flex-start; gap: .6rem; font-size: .82rem; color: var(--mute); }
.field-check input { margin-top: .2rem; }
.form-msg { font-size: .88rem; padding: .3rem 0; min-height: 1.4em; }
.form-msg.ok { color: var(--gradient-4); }
.form-msg.err { color: var(--gradient-2); }

/* =============================================================
   6. Sections
   ============================================================= */

/* --- nav --- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 1.1rem 0; transition: background-color .3s var(--ease-out), border-color .3s var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(10,10,10,.82); backdrop-filter: blur(14px); border-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; display: flex; align-items: center; gap: .5em; }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.nav-links { display: none; align-items: center; gap: 2rem; font-size: .88rem; color: var(--mute); }
.nav-links a { position: relative; transition: color .2s; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 1px; background: var(--ink);
  transition: right .3s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { right: 0; }
@media (min-width: 960px) { .nav-links { display: flex; } }
.nav-cta { display: none; }
@media (min-width: 720px) { .nav-cta { display: inline-flex; } }

/* --- hero --- */
.hero {
  position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding-top: 6rem; overflow: clip;
}
.hero-gradient {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle 620px at var(--mx, 30%) var(--my, 30%), color-mix(in srgb, var(--gradient-1) 55%, transparent) 0%, transparent 60%),
    radial-gradient(circle 780px at calc(var(--mx, 30%) + 22%) calc(var(--my, 30%) - 14%), color-mix(in srgb, var(--gradient-2) 45%, transparent) 0%, transparent 62%),
    radial-gradient(circle 900px at calc(100% - var(--mx, 30%)) calc(100% - var(--my, 30%)), color-mix(in srgb, var(--gradient-3) 40%, transparent) 0%, transparent 65%),
    var(--bg);
  filter: blur(50px) saturate(140%);
  transition: background .25s ease;
}
.hero-grain {
  position: absolute; inset: 0; z-index: -1; opacity: .05; mix-blend-mode: overlay; pointer-events: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="140" height="140"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2" stitchTiles="stitch"/></filter><rect width="100%25" height="100%25" filter="url(%23n)"/></svg>');
}
.hero-eyebrow { font-size: .82rem; }
.hero-title { max-width: 15ch; }
.hero-title .line { display: block; }
.hero-title em { font-style: normal; color: transparent; background: linear-gradient(100deg, var(--gradient-1), var(--gradient-3)); -webkit-background-clip: text; background-clip: text; }
.hero-sub { margin-top: 1.6rem; max-width: 48ch; color: var(--mute); font-size: clamp(1rem, 1.6vw, 1.18rem); }
.hero-actions { margin-top: 2.4rem; display: flex; flex-wrap: wrap; gap: 1rem; }
.hero-foot { margin-top: clamp(3rem, 8vw, 5rem); display: flex; flex-wrap: wrap; gap: 2rem; color: var(--mute-2); font-size: .8rem; }
.hero-foot strong { color: var(--mute); }

/* --- manifesto --- */
.manifesto { padding-block: clamp(5rem, 12vw, 8rem); border-top: 1px solid var(--line-soft); }
.manifesto p { font-size: clamp(1.3rem, 3vw, 2rem); line-height: 1.5; max-width: 34ch; letter-spacing: -.01em; }
.manifesto p em { font-style: normal; color: var(--accent); }

/* --- services --- */
.services { padding-block: clamp(5rem, 12vw, 8rem); }

/* --- stats --- */
.stats { padding-block: clamp(4rem, 10vw, 6rem); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: var(--bg-2); }

/* --- work --- */
.work { padding-block: clamp(5rem, 12vw, 8rem); }

/* --- process --- */
.process { padding-block: clamp(5rem, 12vw, 8rem); border-top: 1px solid var(--line-soft); }
.process-grid { display: grid; gap: clamp(2rem, 5vw, 3rem); }
@media (min-width: 860px) { .process-grid { grid-template-columns: repeat(3, 1fr); } }
.process-card .kicker-num { font-size: 1.5rem; display: block; margin-bottom: 1rem; }
.process-card h3 { margin-bottom: .7rem; }
.process-card p { color: var(--mute); font-size: .95rem; }

/* --- faq --- */
.faq { padding-block: clamp(5rem, 12vw, 8rem); border-top: 1px solid var(--line-soft); }

/* --- cta / contact --- */
.cta {
  position: relative; padding-block: clamp(5rem, 12vw, 8rem); border-top: 1px solid var(--line-soft);
  overflow: clip;
}
.cta-halo {
  position: absolute; inset: -30% 10% auto 10%; height: 60%;
  background: radial-gradient(45% 60% at 50% 50%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 75%);
  filter: blur(100px); pointer-events: none;
}
.cta-grid { display: grid; gap: clamp(2.4rem, 6vw, 4rem); }
@media (min-width: 960px) { .cta-grid { grid-template-columns: 1fr 1fr; } }
.cta-email { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; display: inline-block; position: relative; }
.cta-email::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.08em; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease-out); }
.cta-email:hover::after { transform: scaleX(1); }
.cta-meta { margin-top: 1.4rem; color: var(--mute); font-size: .92rem; max-width: 40ch; }

/* --- footer --- */
.footer { padding-block: clamp(2.4rem, 5vw, 3rem); border-top: 1px solid var(--line-soft); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; color: var(--mute-2); font-size: .82rem; }
.footer-links { display: flex; gap: 1.4rem; }
.footer-links a:hover { color: var(--ink); }

/* =============================================================
   7. Effects
   ============================================================= */
.is-ready .reveal { will-change: transform, opacity; }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {}
@media (min-width: 720px) {}
@media (min-width: 960px) {}
@media (min-width: 1280px) { .container { width: min(1180px, 88vw); } }

/* =============================================================
   9. Reduced-motion — only truly intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero-gradient { transition: none; }
}
