/* =========================================================
   Gajraj Singh Shekhawat · portfolio
   Fonts: Geist (UI/body), Instrument Serif italic (accents), Geist Mono (labels)
   ========================================================= */

@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geist-mono.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --bg: #09090b;
  --bg-alt: #0d0d10;
  --surface: #121216;
  --surface-2: #18181d;
  --border: #24242b;
  --border-strong: #33333c;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #7a7a85;
  --accent: #ff8a3d;
  --accent-2: #ffc857;
  --accent-3: #ff5d8f;
  --accent-ink: #1a0b02;
  --accent-soft: rgba(255, 138, 61, 0.12);
  --ok: #4ade80;
  --grad: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 100%);
  --blob-1: rgba(255, 122, 40, 0.30);
  --blob-2: rgba(255, 200, 87, 0.18);
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
  --radius: 20px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #faf8f5; --bg-alt: #f3f0ea; --surface: #ffffff; --surface-2: #f6f3ee;
  --border: #e6e1d8; --border-strong: #d6cfc3;
  --text: #18181b; --muted: #52525b; --faint: #71717a;
  --accent: #c2410c; --accent-2: #b45309; --accent-3: #be185d; --accent-ink: #ffffff; --accent-soft: rgba(194, 65, 12, 0.08);
  --ok: #15803d;
  --blob-1: rgba(255, 138, 61, 0.22); --blob-2: rgba(255, 200, 87, 0.28);
  --shadow: 0 30px 60px -36px rgba(60, 40, 10, 0.28);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #faf8f5; --bg-alt: #f3f0ea; --surface: #ffffff; --surface-2: #f6f3ee;
    --border: #e6e1d8; --border-strong: #d6cfc3;
    --text: #18181b; --muted: #52525b; --faint: #71717a;
    --accent: #c2410c; --accent-2: #b45309; --accent-3: #be185d; --accent-ink: #ffffff; --accent-soft: rgba(194, 65, 12, 0.08);
    --ok: #15803d;
    --blob-1: rgba(255, 138, 61, 0.22); --blob-2: rgba(255, 200, 87, 0.28);
    --shadow: 0 30px 60px -36px rgba(60, 40, 10, 0.28);
    color-scheme: light;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color .4s ease, color .4s ease;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
h1 em, h2 em {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: 0.06em;
}
code { font-family: var(--mono); font-size: .85em; padding: .12em .4em; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.mono { font-family: var(--mono); }
.skip { position: absolute; left: -999px; top: 10px; z-index: 200; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.skip:focus { left: 10px; }

/* Scroll progress */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 120; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; background: var(--grad); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 20px; border-radius: 999px; font: 500 15px/1 var(--font); letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap; border: 1px solid transparent; cursor: pointer;
  transition: transform .25s var(--ease), background-color .25s, border-color .25s, box-shadow .25s, color .25s;
}
.btn--lg { padding: 16px 26px; font-size: 16px; }
.btn--sm { padding: 9px 16px; font-size: 14px; }
.btn--primary { background: var(--grad); color: var(--accent-ink); font-weight: 600; box-shadow: 0 10px 30px -12px var(--accent); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px var(--accent); }
.btn--ghost { background: color-mix(in srgb, var(--surface) 70%, transparent); border-color: var(--border-strong); backdrop-filter: blur(6px); }
.btn--ghost:hover { border-color: var(--accent); transform: translateY(-2px); }
.btn--link { padding-inline: 6px; color: var(--muted); }
.btn--link:hover { color: var(--text); }
.btn__arrow { transition: transform .3s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ---------- Chips / tags / eyebrow ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.chips li { font: 400 12.5px/1 var(--mono); padding: 7px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.tag { font: 500 12px/1 var(--mono); letter-spacing: .02em; padding: 7px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); text-transform: uppercase; }
.tag--accent { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 500 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.eyebrow span { color: var(--accent); }
.eyebrow::after { content: ""; width: 36px; height: 1px; background: var(--border-strong); }
.eyebrow--center { justify-content: center; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s, background-color .3s;
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.02em; }
.brand__mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad); color: var(--accent-ink); font: 400 24px/1 var(--serif); font-style: italic; padding-bottom: 2px;
  transition: transform .4s var(--ease);
}
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.05); }
.nav__links { display: flex; align-items: center; gap: 6px; }
.nav__links a[data-nav] { position: relative; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 500; transition: color .2s, background-color .2s; }
.nav__links a[data-nav]:hover { color: var(--text); }
.nav__links a[data-nav].is-active { color: var(--text); background: var(--surface-2); }
.nav__links .btn { margin-left: 8px; }
.nav__tools { display: flex; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid var(--border); border-radius: 12px; color: var(--text);
  transition: border-color .2s, transform .3s var(--ease);
}
.icon-btn:hover { border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
#themeToggle:hover svg { transform: rotate(25deg); transition: transform .4s var(--ease); }
.i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: none; }
:root[data-theme="light"] .i-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .i-sun { display: none; }
  :root:not([data-theme="dark"]) .i-moon { display: block; }
}
.nav__burger { display: none; }
.nav__burger path { transition: transform .3s var(--ease); transform-origin: 12px 12px; }
.nav__burger[aria-expanded="true"] .l1 { transform: translateY(4px) rotate(45deg); }
.nav__burger[aria-expanded="true"] .l2 { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 88px 0 0; isolation: isolate; }
.hero__bg { position: absolute; inset: -70px 0 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; }
.blob--1 { width: 560px; height: 560px; right: -120px; top: -120px; background: var(--blob-1); animation: float1 18s ease-in-out infinite alternate; }
.blob--2 { width: 460px; height: 460px; left: -160px; top: 260px; background: var(--blob-2); animation: float2 22s ease-in-out infinite alternate; }
@keyframes float1 { to { transform: translate3d(-120px, 90px, 0) scale(1.15); } }
@keyframes float2 { to { transform: translate3d(140px, -60px, 0) scale(.9); } }
.grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 10%, transparent 75%);
  opacity: .5;
}
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, .75fr); gap: 64px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; font: 400 13px/1 var(--mono);
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--muted); margin-bottom: 28px; backdrop-filter: blur(6px);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: ping 2.2s var(--ease) infinite; }
@keyframes ping { 70%, 100% { box-shadow: 0 0 0 8px transparent; } }

.hero h1 { display: flex; flex-direction: column; gap: 18px; }
.hero__name {
  font: 500 15px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.hero__tag { display: block; font-size: clamp(40px, 6.4vw, 82px); font-weight: 600; letter-spacing: -0.045em; line-height: 1.02; }
.hero__tag .w { display: inline; }
.hero__tag em { font-size: 1.08em; line-height: .9; }
.lead { margin-top: 28px; font-size: clamp(17px, 1.5vw, 19px); color: var(--muted); max-width: 58ch; line-height: 1.65; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 36px; }

/* Photo with spinning gradient ring */
.hero__photo { position: relative; justify-self: center; width: min(340px, 100%); }
.photo-ring { position: relative; border-radius: 32px; padding: 2px; overflow: hidden; box-shadow: var(--shadow); }
.photo-ring::before {
  content: ""; position: absolute; inset: -60%; z-index: 0;
  background: conic-gradient(from 0deg, transparent 0 55%, var(--accent) 70%, var(--accent-2) 80%, transparent 92%);
  animation: spin 6s linear infinite;
}
.photo-ring picture { position: relative; z-index: 1; display: block; border-radius: 30px; overflow: hidden; background: var(--surface); }
.photo-ring img { width: 100%; aspect-ratio: 429 / 520; object-fit: cover; object-position: top; transition: transform .8s var(--ease); }
.hero__photo:hover img { transform: scale(1.04); }
@keyframes spin { to { transform: rotate(1turn); } }
.float-card {
  position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 2px; line-height: 1.2;
  padding: 12px 16px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(10px);
  animation: bob 6s ease-in-out infinite;
}
.float-card strong { font-size: 24px; letter-spacing: -0.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.float-card span { font-size: 13px; color: var(--muted); }
.float-card .mono { color: var(--ok); font-size: 12px; }
.float-card--a { left: -36px; bottom: 36px; }
.float-card--b { right: -28px; top: 28px; animation-delay: -3s; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 88px 0 0; border: 1px solid var(--border); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 60%, transparent); backdrop-filter: blur(6px); }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; padding: 26px 26px 24px; border-left: 1px solid var(--border); }
.stat:first-child { border-left: 0; }
.stat dd { margin: 0; font-size: clamp(32px, 3.4vw, 44px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat dt { color: var(--muted); font-size: 14px; line-height: 1.45; }

/* Marquee */
.marquee { margin-top: 72px; padding: 22px 0; border-block: 1px solid var(--border); overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee__track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee ul { display: flex; gap: 48px; padding: 0 24px; margin: 0; list-style: none; }
.marquee li { font: 400 15px/1 var(--mono); color: var(--faint); white-space: nowrap; display: flex; align-items: center; gap: 48px; }
.marquee li::after { content: "✦"; color: var(--accent); font-size: 11px; opacity: .7; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: 128px 0; position: relative; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section__head { max-width: 760px; margin-bottom: 56px; }
.section__head h2 { font-size: clamp(34px, 4.8vw, 60px); letter-spacing: -0.04em; }
.section__head h2 em { font-size: 1.06em; }
.section__sub { margin-top: 18px; color: var(--muted); font-size: clamp(16px, 1.4vw, 18.5px); max-width: 60ch; }

/* ---------- Cards (shared spotlight) ---------- */
.spot { position: relative; overflow: hidden; }
.spot::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%);
}
.spot:hover::before { opacity: 1; }
.spot > * { position: relative; }

/* ---------- Case studies ---------- */
.case {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; display: flex; flex-direction: column; gap: 14px;
  transition: border-color .35s, transform .45s var(--ease), box-shadow .45s;
}
.case:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); transform: translateY(-4px); box-shadow: var(--shadow); }
.case h3 { font-size: 22px; letter-spacing: -0.025em; line-height: 1.2; }
.case p { color: var(--muted); font-size: 16px; }
.case__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.case__org { font-size: 13.5px; color: var(--faint); }
.case__link { margin-top: auto; padding-top: 6px; color: var(--accent); font-weight: 500; font-size: 15px; text-decoration: none; display: inline-flex; gap: 6px; width: fit-content; }
.case__link span { transition: transform .3s var(--ease); }
.case__link:hover span { transform: translate(3px, -3px); }
.case .chips { margin-top: 4px; }

.case--featured {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 40px; padding: 48px; margin-bottom: 20px;
  background: radial-gradient(800px 400px at 100% 0%, var(--accent-soft), transparent 60%), var(--surface);
}
.case__body { display: flex; flex-direction: column; gap: 16px; }
.case--featured h3 { font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -0.035em; line-height: 1.12; }
.case--featured .case__body > p { font-size: 17px; }
.case__points { margin: 6px 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.case__points li { position: relative; padding-left: 26px; color: var(--muted); font-size: 15.5px; }
.case__points li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-family: var(--mono); }

/* Little phone mock-ups */
.case__visual { position: relative; display: grid; place-items: center; min-height: 360px; }
.phone {
  position: relative; z-index: 2; width: 200px; padding: 18px 14px; border-radius: 28px;
  background: var(--bg); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px; transform: rotate(-4deg) translateX(-30px);
  transition: transform .6s var(--ease);
}
.phone--back { position: absolute; z-index: 1; transform: rotate(6deg) translateX(70px) translateY(20px); opacity: .9; }
.case--featured:hover .phone { transform: rotate(-2deg) translateX(-40px) translateY(-6px); }
.case--featured:hover .phone--back { transform: rotate(9deg) translateX(84px) translateY(18px); }
.phone__bar { width: 50px; height: 5px; border-radius: 9px; background: var(--border-strong); margin: 0 auto 6px; }
.phone__row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.phone__row span { width: 60px; height: 8px; border-radius: 4px; background: var(--border-strong); }
.phone__row b { font-size: 15px; letter-spacing: -0.02em; }
.phone__item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.phone__item i { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); opacity: .85; flex: none; }
.phone__item span { flex: 1; height: 7px; border-radius: 4px; background: var(--border-strong); }
.phone__item em { font: 500 11px var(--mono); font-style: normal; color: var(--muted); }
.phone__btn { margin-top: 4px; text-align: center; padding: 9px; border-radius: 12px; background: var(--grad); color: var(--accent-ink); font-size: 12.5px; font-weight: 600; }
.phone__status { display: flex; }
.phone__status .ok { font: 500 11px/1 var(--mono); padding: 6px 9px; border-radius: 999px; color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }

.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.service { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: border-color .35s, transform .45s var(--ease); }
.service:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); transform: translateY(-4px); }
.service__icon { width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: var(--accent-soft); stroke: var(--accent); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 22px; transition: transform .45s var(--ease); }
.service:hover .service__icon { transform: rotate(-8deg) scale(1.08); }
.service h3 { font-size: 19px; letter-spacing: -0.02em; margin-bottom: 10px; }
.service p { color: var(--muted); font-size: 15.5px; }

.process { list-style: none; padding: 0; margin: 56px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; counter-reset: s; }
.process li { position: relative; padding-top: 22px; border-top: 1px solid var(--border-strong); }
.process li::before { content: ""; position: absolute; top: -1px; left: 0; height: 1px; width: 0; background: var(--grad); transition: width 1.2s var(--ease) .2s; }
.process li.is-in::before { width: 100%; }
.process__n { font: 500 13px/1 var(--mono); color: var(--accent); }
.process strong { display: block; font-size: 20px; letter-spacing: -0.02em; margin: 10px 0 6px; font-weight: 600; }
.process p { color: var(--muted); font-size: 15px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline > li { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 40px; padding: 36px 0; border-top: 1px solid var(--border); position: relative; }
.timeline > li:last-child { border-bottom: 1px solid var(--border); }
.timeline__when { font: 400 14px/1.5 var(--mono); color: var(--faint); padding-top: 4px; }
.timeline > li:first-child .timeline__when { color: var(--accent); }
.timeline h3 { font-size: clamp(20px, 2vw, 24px); letter-spacing: -0.025em; }
.timeline h3 span { color: var(--muted); font-weight: 500; }
.timeline__where { color: var(--faint); font-size: 15px; margin-top: 6px; }
.timeline ul { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.timeline ul li { position: relative; padding-left: 22px; color: var(--muted); font-size: 16px; }
.timeline ul li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.timeline > li::after { content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 0; background: var(--grad); transition: width 1s var(--ease); }
.timeline > li.is-in::after { width: 120px; }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.skill { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; transition: border-color .35s; }
.skill:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.skill h3 { font-size: 17px; letter-spacing: -0.02em; margin-bottom: 16px; }
.skill .chips li { color: var(--text); font-size: 13px; }

/* ---------- Contact ---------- */
.contact { padding: 112px 0 24px; }
.hide-sm { display: inline; }
.contact__card {
  position: relative; overflow: hidden; text-align: center; padding: 96px 32px; border-radius: 32px;
  border: 1px solid var(--border); background: var(--surface);
}
.contact__glow { position: absolute; inset: -40% -10% auto; height: 120%; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, var(--blob-1), transparent), radial-gradient(closest-side at 70% 60%, var(--blob-2), transparent);
  filter: blur(30px); animation: float1 16s ease-in-out infinite alternate; }
.contact__card > * { position: relative; z-index: 1; }
.contact__card h2 { font-size: clamp(36px, 5.6vw, 72px); letter-spacing: -0.045em; max-width: 16ch; margin-inline: auto; }
.contact__card .section__sub { margin-inline: auto; max-width: 48ch; }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 40px; }
.contact__mail { margin-top: 24px; font-family: var(--mono); font-size: 14px; }
.contact__mail a { color: var(--muted); text-decoration: none; }
.contact__mail a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer { padding: 72px 0 36px; overflow: hidden; }
.footer__word {
  font-size: clamp(36px, 9vw, 150px); font-weight: 600; letter-spacing: -0.06em; line-height: .9; white-space: nowrap;
  background: linear-gradient(180deg, var(--border-strong), transparent 95%); -webkit-background-clip: text; background-clip: text; color: transparent;
  user-select: none; margin-bottom: 36px;
}
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px 32px; flex-wrap: wrap; color: var(--faint); font-size: 14px; border-top: 1px solid var(--border); padding-top: 28px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0; padding: 0; }
.footer__links a { color: var(--muted); text-decoration: none; transition: color .2s; }
.footer__links a:hover { color: var(--accent); }

/* ---------- Motion: load + scroll reveal ---------- */
.js .load { opacity: 0; transform: translateY(18px); filter: blur(6px); animation: rise .9s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 70ms + 80ms); }
.js .hero__tag .w.load { display: inline-block; }
@keyframes rise { to { opacity: 1; transform: none; filter: blur(0); } }
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease), border-color .35s, box-shadow .45s; transition-delay: calc(var(--d, 0) * 90ms); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .case.reveal.is-in:hover, .js .service.reveal.is-in:hover { transform: translateY(-4px); transition-delay: 0s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .load, .js .reveal { opacity: 1; transform: none; filter: none; }
  .marquee__track { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero__grid { gap: 40px; }
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case--featured { grid-template-columns: 1fr; }
  .case__visual { min-height: 300px; }
  .float-card--a { left: -16px; }
  .float-card--b { right: -12px; }
}
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .nav__burger { display: grid; }
  .nav__links {
    position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 12px 20px 24px;
    opacity: 0; transform: translateY(-10px); pointer-events: none; visibility: hidden;
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s .3s;
  }
  .nav__links.open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
  .nav__links a[data-nav] { padding: 14px 12px; font-size: 18px; border-radius: 12px; }
  .nav__links .btn { margin: 12px 0 0; padding: 15px; font-size: 16px; }
  .hero { padding-top: 48px; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__photo { order: -1; width: 220px; justify-self: start; }
  .float-card--a { left: auto; right: -150px; bottom: 20px; }
  .float-card--b { display: none; }
  .cases { grid-template-columns: 1fr; }
  .case, .case--featured { padding: 28px; }
  .timeline > li { grid-template-columns: 1fr; gap: 10px; padding: 28px 0; }
  .section { padding: 96px 0; }
  .section__head { margin-bottom: 40px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .services, .process, .skills { grid-template-columns: 1fr; }
  .brand__name { display: none; }
  .hero__photo { width: 132px; }
  .photo-ring, .photo-ring picture { border-radius: 24px; }
  .float-card--a { right: -150px; bottom: 50%; transform: translateY(50%); animation: none; }
  .hide-sm { display: none; }
  .pill { margin-bottom: 22px; }
  .hero h1 { gap: 14px; }
  .hero__name { font-size: 13px; }
  .stats { margin-top: 64px; }
  .stat { padding: 20px 18px; }
  .hero__cta .btn--lg { flex: 1 1 auto; }
  .hero__cta .btn--link { width: 100%; }
  .case__visual { min-height: 280px; transform: scale(.88); }
  .contact__card { padding: 64px 20px; border-radius: 24px; }
  .contact__actions .btn { width: 100%; }
  .section { padding: 80px 0; }
}

/* Large & ultra-wide screens */
@media (min-width: 1600px) {
  body { font-size: 18px; }
  .wrap { width: min(1400px, 100% - 80px); }
  .hero { padding-top: 120px; }
  .hero__photo { width: 400px; }
  .section { padding: 160px 0; }
  .case h3 { font-size: 24px; }
  .case p, .service p { font-size: 17px; }
}
@media (min-width: 2200px) {
  html { font-size: 112.5%; }
  body { font-size: 20px; }
  .wrap { width: min(1680px, 100% - 120px); }
  .hero__tag { font-size: 104px; }
  .hero__photo { width: 470px; }
  .section__head { max-width: 960px; }
  .section__head h2 { font-size: 76px; }
}

@media print {
  .nav, .progress, .hero__bg, .marquee, .footer__word { display: none !important; }
  .js .reveal, .js .load { opacity: 1 !important; transform: none !important; filter: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- FAQ ---------- */
.faq__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; align-items: start; }
.faq__item { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; transition: border-color .3s, background-color .3s; }
.faq__item:hover, .faq__item[open] { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.faq__item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary h3 { font-size: 17px; letter-spacing: -0.015em; line-height: 1.35; font-weight: 600; }
.faq__icon { position: relative; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); transition: transform .35s var(--ease), background-color .3s; }
.faq__icon::before, .faq__icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.5px; background: var(--text); transform: translate(-50%, -50%); }
.faq__icon::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .35s var(--ease); }
.faq__item[open] .faq__icon { background: var(--accent-soft); transform: rotate(180deg); }
.faq__item[open] .faq__icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq__item p { padding: 0 22px 22px; color: var(--muted); font-size: 15.5px; }
.faq__item[open] p { animation: faqIn .4s var(--ease); }
@keyframes faqIn { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 820px) { .faq__list { grid-template-columns: 1fr; } }

/* Timeline: client projects inside a role */
.timeline__proj { margin-top: 18px; padding-left: 16px; border-left: 1px solid var(--border-strong); }
.timeline__proj ul { margin-top: 8px; }
.timeline__client { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 16.5px; }
.timeline__client strong { font-weight: 600; letter-spacing: -0.01em; }
.timeline__client span { font: 400 13px/1.4 var(--mono); color: var(--faint); }

.brand__avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; transition: transform .4s var(--ease); }
.brand:hover .brand__avatar { transform: rotate(-8deg) scale(1.06); }

/* =========================================================
   Motion pack: shimmer, terminal, badge, cursor, form, to-top
   ========================================================= */

/* Living gradient on highlighted words */
h1 em, h2 em, .float-card strong {
  background-image: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 30%, var(--accent-3) 55%, var(--accent) 80%, var(--accent-2) 100%);
  background-size: 250% 100%;
  animation: shimmer 7s ease-in-out infinite alternate;
}
@keyframes shimmer { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

/* Third glow + mouse parallax in the hero */
.hero__bg { --px: 0; --py: 0; }
.blob--1 { translate: calc(var(--px) * 40px) calc(var(--py) * 30px); }
.blob--2 { translate: calc(var(--px) * -50px) calc(var(--py) * -24px); }
.blob--3 { width: 380px; height: 380px; left: 38%; top: 120px; background: color-mix(in srgb, var(--accent-3) 22%, transparent); animation: float2 26s ease-in-out infinite alternate-reverse; translate: calc(var(--px) * 70px) calc(var(--py) * 50px); }

/* Terminal typing line */
.term {
  margin-top: 22px; height: 44px; display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 75%, transparent);
  font: 400 14px/1 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; backdrop-filter: blur(6px);
}
.term__prompt { color: var(--ok); }
.term__q { color: var(--faint); }
.term__text { color: var(--text); }
.term__caret { width: 8px; height: 18px; margin-left: 1px; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Rotating badge on the photo */
.badge {
  position: absolute; z-index: 3; right: -42px; top: -30px; width: 116px; height: 116px; border-radius: 50%;
  display: grid; place-items: center; text-decoration: none; color: var(--text);
  background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px); box-shadow: var(--shadow);
}
.badge__ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 16s linear infinite; }
.badge__ring text { font: 500 10px var(--mono); fill: currentColor; }
.badge__core { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--grad); color: var(--accent-ink); font-size: 18px; font-weight: 700; transition: transform .5s var(--ease); }
.badge:hover .badge__ring { animation-duration: 5s; }
.badge:hover .badge__core { transform: rotate(45deg) scale(1.08); }

/* Button shine sweep */
.btn--primary { overflow: hidden; isolation: isolate; }
.btn--primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .8s var(--ease);
}
.btn--primary:hover::after { transform: translateX(120%); }
.magnetic { transition: transform .35s var(--ease); will-change: transform; }

/* Brand avatar ring */
.brand__avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent); }

/* Custom cursor (desktop mouse only; enabled by JS) */
.cursor { display: none; }
.has-cursor .cursor { display: block; }
.has-cursor, .has-cursor a, .has-cursor button, .has-cursor label, .has-cursor summary { cursor: none; }
.has-cursor input, .has-cursor textarea { cursor: text; }
.cursor__dot, .cursor__ring { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; border-radius: 50%; will-change: transform; }
.cursor__dot { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; background: var(--accent); }
.cursor__ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1.5px solid color-mix(in srgb, var(--accent) 70%, transparent);
  transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background-color .3s, border-color .3s, opacity .3s;
}
.cursor.is-link .cursor__ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: transparent; }
.cursor.is-text .cursor__ring { opacity: 0; }
.cursor.is-down .cursor__ring { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
.cursor.is-hidden { opacity: 0; }

/* Back to top with progress ring */
.totop {
  position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; text-decoration: none; color: var(--text); font-size: 18px;
  background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--border); backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none; transition: opacity .4s, transform .4s var(--ease);
}
.totop.show { opacity: 1; transform: none; pointer-events: auto; }
.totop svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.totop circle { fill: none; stroke-width: 2.5; }
.totop__track { stroke: var(--border); }
.totop__bar { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 132; stroke-dashoffset: calc(132 - 132 * var(--p, 0)); }
.totop:hover { transform: translateY(-3px); }

/* Contact: split layout + form */
.contact__card { text-align: left; padding: 72px 64px; }
.contact__card h2 { margin-inline: 0; max-width: 14ch; font-size: clamp(34px, 4.6vw, 60px); }
.contact__card .section__sub { margin-inline: 0; }
.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: start; }
.quick { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 10px; }
.quick a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 40%, transparent); text-decoration: none; transition: border-color .3s, transform .35s var(--ease); }
.quick a:hover { border-color: var(--accent); transform: translateX(4px); }
.quick__k { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.quick__v { font-weight: 500; overflow-wrap: anywhere; text-align: right; }

.form { display: grid; gap: 16px; padding: 28px; border-radius: 22px; border: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(8px); }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; padding: 26px 16px 10px; border-radius: 14px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: 400 16px/1.5 var(--font); resize: vertical; outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.field textarea { min-height: 128px; }
.field label {
  position: absolute; left: 17px; top: 18px; color: var(--faint); font-size: 16px; pointer-events: none;
  transform-origin: 0 0; transition: transform .25s var(--ease), color .25s;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { transform: translateY(-11px) scale(.76); color: var(--accent); }
.field.invalid input, .field.invalid textarea { border-color: #ef4444; }
.chipset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chipset legend { width: 100%; margin-bottom: 10px; font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.chipset label { position: relative; }
.chipset input { position: absolute; opacity: 0; inset: 0; }
.chipset span { display: inline-block; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 14px; color: var(--muted); transition: all .25s var(--ease); }
.chipset label:hover span { border-color: var(--accent); color: var(--text); }
.chipset input:checked + span { background: var(--grad); border-color: transparent; color: var(--accent-ink); font-weight: 600; transform: scale(1.04); }
.chipset input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__submit { justify-self: start; }
.form__submit[disabled] { opacity: .75; pointer-events: none; }
.form.is-sending .form__submit .btn__arrow { animation: spin 0.9s linear infinite; }
.form__status { min-height: 1.4em; font-size: 15px; color: var(--muted); }
.form__status.ok { color: var(--ok); }
.form__status.err { color: #ef4444; }
.form.is-sent .field, .form.is-sent .chipset { opacity: .55; }

@media (max-width: 960px) {
  .contact__grid { grid-template-columns: 1fr; gap: 36px; }
  .contact__card { padding: 56px 32px; }
}
@media (max-width: 560px) {
  .contact__card { padding: 44px 18px; }
  .form { padding: 18px; }
  .form__submit { width: 100%; }
  .term { font-size: 12.5px; height: 40px; padding: 0 12px; }
  .badge { width: 92px; height: 92px; right: auto; left: 152px; top: -12px; }
  .float-card--a { bottom: 0; transform: none; }
  .badge__ring text { font-size: 10px; }
  .badge__core { width: 34px; height: 34px; font-size: 15px; }
  .totop { right: 14px; bottom: 14px; width: 46px; height: 46px; }
}
@media (max-width: 820px) and (min-width: 561px) {
  .badge { right: auto; left: 190px; top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  h1 em, h2 em, .float-card strong { animation: none; }
  .badge__ring { animation: none; }
}

/* ---------- Service landing pages ---------- */
.hero--page { padding: 72px 0 88px; }
.crumbs { font: 400 13px var(--mono); color: var(--faint); margin-bottom: 22px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.page-title { font-size: clamp(38px, 5.6vw, 72px); letter-spacing: -0.045em; line-height: 1.04; max-width: 18ch; }
.page-title em { font-size: 1.06em; }
.services--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.page-chips { margin-top: 28px; }
.page-chips li { font-size: 13px; color: var(--text); }
.section__sub a { color: var(--accent); text-decoration: none; }
.cta-band { text-align: center; padding: 72px 28px; border-radius: 28px; border: 1px solid var(--border); background: radial-gradient(600px 260px at 50% 0%, var(--accent-soft), transparent 70%), var(--surface); }
.cta-band h2 { font-size: clamp(32px, 4.6vw, 56px); letter-spacing: -0.04em; }
.cta-band .section__sub { margin-inline: auto; }
.cta-band .hero__cta { justify-content: center; }
.other-services, .footer__services { margin-top: 48px; }
.footer__label { font: 500 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.other-services ul, .footer__services ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.other-services a, .footer__services a { display: inline-block; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--muted); font-size: 14.5px; transition: border-color .25s, color .25s; }
.other-services a:hover, .footer__services a:hover { border-color: var(--accent); color: var(--text); }
.footer__services { margin: 0 0 32px; }
.footer__inner a { color: var(--muted); }
@media (max-width: 820px) { .services--2 { grid-template-columns: 1fr; } }

.services__more { margin-top: 28px; color: var(--muted); }
.services__more a { color: var(--accent); text-decoration: none; font-weight: 500; }
.service .case__link { display: inline-flex; margin-top: 14px; }

/* ---------- Chat assistant ---------- */
.chat-launch {
  position: fixed; right: 22px; bottom: 22px; z-index: 110; display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px 12px 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--grad); color: var(--accent-ink); font: 600 15px var(--font); box-shadow: 0 14px 34px -12px var(--accent);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.chat-launch::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); animation: ping 2.4s var(--ease) infinite; pointer-events: none; }
.chat-launch:hover { transform: translateY(-2px); }
.chat-launch__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.14); }
.chat-launch__icon svg { width: 16px; height: 16px; fill: currentColor; }
.chat-launch.is-open .chat-launch__text { display: none; }
.chat-launch.is-open { padding-right: 12px; }
.chat-launch.is-open::before { animation: none; }
.totop { bottom: 88px; }

.chat-nudge {
  position: fixed; right: 22px; bottom: 86px; z-index: 109; max-width: 290px; display: flex; gap: 10px; align-items: center; text-align: left;
  padding: 12px 14px; border-radius: 16px 16px 4px 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: 400 14px/1.4 var(--font); box-shadow: var(--shadow); cursor: pointer;
  opacity: 0; transform: translateY(10px) scale(.96); pointer-events: none; transition: opacity .4s, transform .4s var(--ease);
}
.chat-nudge img { border-radius: 50%; flex: none; }
.chat-nudge.show { opacity: 1; transform: none; pointer-events: auto; }
.chat-open .totop, .nudge-open .totop { opacity: 0 !important; pointer-events: none !important; }

.chat {
  position: fixed; right: 22px; bottom: 88px; z-index: 111; width: min(380px, calc(100vw - 28px)); height: min(600px, calc(100dvh - 120px));
  display: flex; flex-direction: column; border-radius: 22px; border: 1px solid var(--border-strong); background: var(--bg); box-shadow: 0 30px 80px -20px rgba(0,0,0,.55);
  overflow: hidden; opacity: 0; transform: translateY(16px) scale(.97); transform-origin: bottom right; transition: opacity .25s, transform .3s var(--ease);
}
.chat.open { opacity: 1; transform: none; }
.chat__head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.chat__head img { border-radius: 50%; box-shadow: 0 0 0 2px var(--accent); }
.chat__head div { flex: 1; min-width: 0; }
.chat__name { font-weight: 600; letter-spacing: -0.01em; }
.chat__status { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.chat__status .dot { width: 7px; height: 7px; }
.chat__close { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; }
.chat__log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; animation: msgIn .3s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.msg--bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg--me { align-self: flex-end; background: var(--grad); color: var(--accent-ink); border-bottom-right-radius: 4px; font-weight: 500; }
.msg--typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.msg--typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blinkDot 1s infinite; }
.msg--typing i:nth-child(2) { animation-delay: .15s; } .msg--typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blinkDot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
.msg--card { display: grid; gap: 4px; font-size: 13.5px; }
.msg--card b { color: var(--muted); font-weight: 500; }
.chat__input { padding: 12px; border-top: 1px solid var(--border); background: var(--surface); display: grid; gap: 8px; }
.chat__input:empty { display: none; }
.chat__form { display: flex; gap: 8px; align-items: flex-end; }
.chat__field { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: 400 15px/1.4 var(--font); resize: none; outline: none; }
.chat__field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat__send { flex: none; width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--grad); color: var(--accent-ink); cursor: pointer; display: grid; place-items: center; }
.chat__send svg { width: 18px; height: 18px; fill: currentColor; }
.chat__skip { justify-self: end; border: 0; background: none; color: var(--muted); font: 500 13px var(--font); cursor: pointer; text-decoration: underline; }
.chat__opts { display: flex; flex-wrap: wrap; gap: 8px; }
.chat__opt { padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: 500 14px var(--font); cursor: pointer; text-decoration: none; transition: border-color .2s, transform .2s var(--ease); }
.chat__opt:hover { border-color: var(--accent); transform: translateY(-1px); }
.chat__opt--primary { background: var(--grad); color: var(--accent-ink); border-color: transparent; }
@media (max-width: 560px) {
  .chat-launch { right: 14px; bottom: 14px; padding: 10px; }
  .chat-launch__text { display: none; }
  .chat-nudge { right: 14px; bottom: 74px; max-width: calc(100vw - 28px); }
  .chat { right: 8px; left: 8px; bottom: 74px; width: auto; height: calc(100dvh - 92px); }
  .totop { right: 14px; bottom: 74px; }
}
