:root {
  --ink: #0a0a0b;
  --ink-2: #111113;
  --paper: #f4f2ec;
  --paper-2: #ebe8e1;
  --hairline: #1e1e22;
  --muted: #6a6a74;
  --muted-2: #8a8a94;
  --accent: oklch(0.72 0.22 255);
  --accent-soft: oklch(0.72 0.22 255 / 0.15);
  --bg: var(--ink);
  --fg: var(--paper);
  --border: var(--hairline);
  --surface: #0f0f11;
  --surface-2: #15151a;
  --chip: rgba(255,255,255,0.045);
  --grid: rgba(255,255,255,0.05);

  --f-display: 'Space Grotesk', 'Helvetica Neue', sans-serif;
  --f-body:    'Space Grotesk', 'Helvetica Neue', sans-serif;
  --f-mono:    'Space Mono', ui-monospace, monospace;
}

html[data-theme="light"] {
  --bg: var(--paper);
  --fg: #0c0c0e;
  --border: #d6d2c8;
  --surface: #ebe8e1;
  --surface-2: #e0dcd2;
  --muted: #5a5a62;
  --muted-2: #7a7a82;
  --chip: rgba(0,0,0,0.04);
  --grid: rgba(0,0,0,0.06);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: none;
  transition: background 0.5s ease, color 0.5s ease;
  user-select: none;
}

.nav-name, 
.about-links, 
.cta-links, 
.cta-socials, 
footer a,
.alink,
.cta-social {
  user-select: text;
}

@media (pointer: coarse) { body { cursor: auto; } }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

.mono { font-family: var(--f-mono); }
.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.wrap { width: min(1400px, calc(100% - 48px)); margin: 0 auto; }

/* ─── Custom cursor ─── */
#cursor, #cursor-dot {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9998;
  mix-blend-mode: difference;
}
#cursor {
  width: 28px; height: 28px;
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 50%;
  transition: width 0.3s cubic-bezier(.19,1,.22,1), height 0.3s cubic-bezier(.19,1,.22,1);
}
#cursor.cursor-lg { width: 64px; height: 64px; }
#cursor-dot {
  width: 4px; height: 4px;
  background: #fff;
  border-radius: 50%;
  z-index: 9999;
}

/* ─── Nav ─── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  mix-blend-mode: difference;
  color: #fff;
}
.nav-left { display: flex; align-items: center; gap: 14px; }
.nav-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.35} }
.nav-name {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  gap: 28px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.nav-links a { opacity: 0.7; transition: opacity 0.2s; }
.nav-links a:hover { opacity: 1; }
.nav-right { display: flex; align-items: center; gap: 20px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
[data-theme-btn] { opacity: 0.7; }
[data-theme-btn]:hover { opacity: 1; }

/* ─── Hero ─── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 120px 32px 48px;
  overflow: hidden;
}
#hero-shader {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.hero-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 100px 100px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  width: min(1400px, calc(100% - 0px));
  margin: 0 auto;
}
.hero-tag {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  flex-wrap: wrap;
}
.hero-tag span { display: inline-flex; align-items: center; gap: 8px; }
.hero-tag span::before { content: ''; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }

.hero-title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(64px, 12vw, 220px);
  line-height: 0.88;
  letter-spacing: -0.04em;
  color: var(--fg);
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .w { display: inline-block; overflow: hidden; vertical-align: bottom; }
.hero-title .wi { display: inline-block; transform: translateY(110%); transition: transform 1.2s cubic-bezier(.19,1,.22,1); }
.hero-title.in .wi { transform: translateY(0); }
.hero-title .w:nth-child(1) .wi { transition-delay: 0.1s; }
.hero-title .w:nth-child(2) .wi { transition-delay: 0.2s; }
.hero-title .w:nth-child(3) .wi { transition-delay: 0.3s; }
.hero-title .w:nth-child(4) .wi { transition-delay: 0.4s; }
.hero-title .accent { color: var(--accent); font-style: italic; font-weight: 400; }

.hero-foot {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 24px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  align-items: end;
}
.hero-foot h4 {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 400;
}
.hero-foot p { font-size: 15px; line-height: 1.4; max-width: 260px; }
.hero-scroll-hint {
  text-align: right;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-scroll-hint .arrow {
  display: block;
  width: 1px;
  height: 40px;
  background: var(--muted);
  margin: 8px auto 0;
  animation: scroll-arrow 2s ease-in-out infinite;
}
@keyframes scroll-arrow {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ─── Section shell ─── */
.section {
  position: relative;
  padding: 160px 32px;
  border-top: 1px solid var(--border);
}
.section-head {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 48px;
  margin-bottom: 80px;
  align-items: start;
}
.section-num {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.section h2 {
  font-family: var(--f-display);
  font-size: clamp(40px, 7vw, 112px);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.03em;
  max-width: 14ch;
}
.section h2 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.section-sub {
  margin-top: 28px;
  max-width: 52ch;
  color: var(--muted-2);
  font-size: 17px;
  line-height: 1.55;
}

[data-reveal] { opacity: 0; transform: translateY(40px); transition: opacity 1s ease, transform 1s cubic-bezier(.19,1,.22,1); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-delay="1"] { transition-delay: 0.1s; }
[data-reveal][data-delay="2"] { transition-delay: 0.2s; }
[data-reveal][data-delay="3"] { transition-delay: 0.3s; }

/* ─── Services (pinned) ─── */
.pinned {
  position: relative;
  height: 400vh;
}
.pinned-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px;
}
.pinned-track {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border);
}
.pinned-track::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: calc(var(--p, 0) * 100%);
  background: var(--accent);
}
.pinned-grid {
  width: min(1400px, calc(100% - 0px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  align-items: center;
}
.pinned-label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 40px;
}
.pinned-steps {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}
.pinned-step {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  align-items: baseline;
  opacity: 0.25;
  transition: opacity 0.5s ease, padding 0.5s ease;
}
.pinned-step.active { opacity: 1; padding: 40px 0; }
.pinned-step .num {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.16em;
}
.pinned-step h3 {
  font-family: var(--f-display);
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 12px;
}
.pinned-step.active h3 { color: var(--fg); }
.pinned-step p { color: var(--muted-2); max-width: 48ch; line-height: 1.5; font-size: 16px; }

/* ─── Horizontal case studies ─── */
.hscroll {
  position: relative;
  height: 280vh;
}
.hscroll-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hscroll-head {
  position: absolute;
  top: 100px;
  left: 32px;
  right: 32px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  z-index: 2;
}
.hscroll-head h2 {
  font-family: var(--f-display);
  font-size: clamp(32px, 5vw, 72px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 0.9;
}
.hscroll-track {
  display: flex;
  gap: 24px;
  padding: 60px 32px;
  will-change: transform;
}
.case-card {
  flex: 0 0 min(640px, 80vw);
  aspect-ratio: 4/5;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease;
  transform-style: preserve-3d;
  display: flex;
  flex-direction: column;
}
.case-card .card-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: background 0.2s ease;
  mix-blend-mode: screen;
}
.case-visual {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.case-meta {
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: baseline;
}
.case-meta h3 {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.case-meta .case-year {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.case-meta p {
  grid-column: 1 / -1;
  color: var(--muted-2);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 4px;
}
.case-tags {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.case-tag {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
}
.case-index {
  position: absolute;
  top: 20px; left: 24px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  z-index: 2;
}

/* ─── Demos section ─── */
.demos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 40px;
}
.demo-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.demo-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.demo-head .dh-title { color: var(--fg); }
.demo-head .dots { display: flex; gap: 6px; }
.demo-head .dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); opacity: 0.4; }
.demo-body { flex: 1; padding: 24px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }

/* Scraper */
.scraper-url {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--accent);
  min-height: 20px;
}
.scraper-status {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.scraper-status[data-state="busy"]::before { content:'●  '; color: #e6b800; }
.scraper-status[data-state="ok"]::before { content:'●  '; color: #4ade80; }
.scraper-counter {
  font-family: var(--f-display);
  font-size: 48px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
  margin-top: 4px;
}
.scraper-counter-label {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-top: 4px;
}
.scraper-rows {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  font-family: var(--f-mono);
  font-size: 12px;
  overflow: hidden;
}
.scraper-row {
  display: grid;
  grid-template-columns: 1.5fr 2.2fr 1fr 0.9fr;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  gap: 12px;
  animation: slide-in 0.35s cubic-bezier(.19,1,.22,1);
}
@keyframes slide-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.sr-src { color: var(--muted); }
.sr-name { color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-price { color: var(--accent); text-align: right; }
.sr-stock { color: #4ade80; text-align: right; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.sr-stock.low { color: #f97316; }

/* Agent terminal */
.term-out {
  flex: 1;
  font-family: var(--f-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.term-line { display: flex; gap: 8px; }
.term-prefix { color: var(--muted); flex-shrink: 0; white-space: pre; }
.term-user .term-text { color: var(--fg); }
.term-user .term-prefix { color: var(--accent); }
.term-agent .term-text { color: var(--muted-2); }
.term-result .term-text { color: var(--fg); }
.term-result .term-prefix { color: var(--accent); }
.term-done .term-text { color: #4ade80; }
.term-done .term-prefix { color: #4ade80; }
.term-text::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 13px;
  background: var(--accent);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 0.9s step-end infinite;
}
.term-line:not(:last-child) .term-text::after { display: none; }
@keyframes blink { 50% { opacity: 0; } }

/* Telegram chat UI */
.tg-stream {
  display: flex; flex-direction: column; gap: 6px;
  overflow-y: auto; max-height: 380px; padding: 4px 2px; scroll-behavior: smooth;
  scrollbar-width: none;
}
.tg-stream::-webkit-scrollbar { display: none; }
.tg-row {
  display: flex; align-items: flex-end; gap: 8px;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(.19,1,.22,1);
}
.tg-row.tg-in { opacity: 1; transform: none; }
.tg-row-user { flex-direction: row-reverse; }
.tg-av { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: var(--f-mono); font-size: 11px; font-weight: 700; }
.tg-av-bot { background: #2AABEE; }
.tg-av-user { background: var(--accent); color: #fff; font-size: 12px; }
.tg-bubble { max-width: 72%; padding: 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.4; position: relative; }
.tg-bot { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; color: var(--fg); }
.tg-user { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.tg-time { display: block; font-family: var(--f-mono); font-size: 9px; margin-top: 4px; opacity: 0.5; text-align: right; }
.tg-typing { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; border-bottom-left-radius: 4px; padding: 12px 16px; display: flex; gap: 4px; align-items: center; }
.tg-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: tg-bounce 1.2s ease-in-out infinite; }
.tg-typing span:nth-child(2) { animation-delay: 0.2s; }
.tg-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tg-bounce { 0%,60%,100%{ transform: translateY(0); } 30%{ transform: translateY(-5px); } }

/* RAG */
.rag-graph {
  flex: 1;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 12px 24px;
  align-items: center;
}
.rag-node {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  transition: all 0.35s ease;
}
.rag-node.rag-hot {
  border-color: var(--accent);
  color: var(--fg);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 0 24px var(--accent-soft);
}
.rag-line {
  height: 1px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.rag-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}
.rag-line.rag-flow::after { transform: translateX(0); }

.rag-q, .rag-a {
  grid-column: 1 / -1;
  font-family: var(--f-mono);
  font-size: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 4px;
}
.rag-q { color: var(--fg); }
.rag-q::before { content: 'query › '; color: var(--muted); }
.rag-a { color: var(--muted-2); transition: color 0.3s ease; }
.rag-a.ready { color: #4ade80; }
.rag-a::before { content: 'answer › '; color: var(--muted); }

/* ─── Stack ─── */
.stack-marquee {
  margin: 80px -32px 0;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
}
.stack-marquee-track {
  display: inline-flex;
  gap: 48px;
  animation: marquee 40s linear infinite;
  font-family: var(--f-display);
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.stack-marquee-track span:nth-child(3n+2) { color: var(--accent); font-style: italic; font-weight: 400; }
.stack-marquee-track span:nth-child(5n) { color: var(--muted-2); }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.stack-grid {
  margin-top: 60px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.stack-cell {
  background: var(--bg);
  padding: 28px 24px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background 0.2s ease;
}
.stack-cell:hover { background: var(--surface); }
.stack-cell h4 { font-family: var(--f-display); font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.stack-cell p { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ─── Stats ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.stat-cell {
  background: var(--bg);
  padding: 56px 32px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat-value {
  font-family: var(--f-display);
  font-size: clamp(56px, 8vw, 128px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--fg);
}
.stat-value em { color: var(--accent); font-style: italic; font-weight: 400; }
.stat-label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 24ch;
  line-height: 1.5;
}

/* ─── CTA ─── */
.cta {
  padding: 200px 32px;
  text-align: center;
  border-top: 1px solid var(--border);
}
.cta h2 {
  font-family: var(--f-display);
  font-size: clamp(48px, 10vw, 180px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.9;
  max-width: 18ch;
  margin: 0 auto;
}
.cta h2 em { color: var(--accent); font-style: italic; font-weight: 400; }
.cta-mail {
  display: inline-block;
  margin-top: 48px;
  font-family: var(--f-mono);
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 18px 32px;
  border: 1px solid currentColor;
  border-radius: 999px;
  transition: background 0.3s, color 0.3s;
}
.cta-mail:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── Footer ─── */
footer {
  padding: 48px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  flex-wrap: wrap;
}
footer a:hover { color: var(--accent); }

/* ─── Tweaks panel ─── */
#tweaks-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  width: 240px;
  display: none;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}
#tweaks-panel.on { display: block; }
#tweaks-panel h5 {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 400;
}
.tweaks-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-family: var(--f-mono);
  font-size: 12px;
}
.tweaks-row button {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tweaks-row button:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Case visuals (Thematic animations) ─── */
.case-visual {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}

.cv-grid {
  width: 100%; height: 100%;
  background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px), linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}

/* Case 01: Scraper/Price Engine - Static bottom bars with limited height */
.cv-scraper { 
  width: 100%; height: 100%; 
  display: flex; align-items: flex-end; justify-content: center; 
  gap: 12px; padding-bottom: 20px;
}
.cv-scraper-bar { 
  width: 18px; background: var(--accent); border-radius: 4px 4px 0 0; 
  animation: scraper-bar-v3 2.5s ease-in-out infinite; 
  transform-origin: bottom; 
  box-shadow: 0 0 15px var(--accent-soft);
}
@keyframes scraper-bar-v3 { 
  0%, 100% { transform: scaleY(0.3); opacity: 0.6; } 
  50% { transform: scaleY(0.6); opacity: 1; } /* Reduced max height */
}

/* Case 02: Telegram Ops - Larger, orbiting messages */
.cv-tg { position: relative; width: 200px; height: 200px; }
.cv-tg-radar { position: absolute; inset: 0; border: 2px solid var(--accent); border-radius: 50%; opacity: 0; animation: tg-radar-v2 3s ease-out infinite; }
@keyframes tg-radar-v2 { 0% { transform: scale(0.3); opacity: 0.8; } 100% { transform: scale(1.2); opacity: 0; } }
.cv-tg-icon { 
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); 
  width: 64px; height: 64px; background: #2AABEE; border-radius: 50%; 
  display: flex; align-items: center; justify-content: center; 
  box-shadow: 0 0 40px rgba(42,171,238,0.5); z-index: 3;
}
.cv-tg-orbit {
  position: absolute; inset: 0; border: 1px dashed var(--border); border-radius: 50%;
  animation: spin 15s linear infinite;
}
.cv-tg-msg {
  position: absolute; width: 12px; height: 12px; background: #fff; border-radius: 4px;
  animation: tg-msg-fly 3s infinite;
}
@keyframes tg-msg-fly {
  0% { transform: scale(0) translate(0,0); opacity: 0; }
  50% { transform: scale(1) translate(-60px, -40px); opacity: 1; }
  100% { transform: scale(0.5) translate(-100px, -80px); opacity: 0; }
}

/* Case 03: RAG Assistant - Information retrieval visualization */
.cv-rag { position: relative; width: 220px; height: 200px; }
.cv-rag-doc { 
  position: absolute; width: 30px; height: 40px; background: var(--surface-2); 
  border: 1px solid var(--border); border-radius: 4px; 
  display: flex; flex-direction: column; gap: 4px; padding: 6px;
}
.cv-rag-doc span { height: 2px; background: var(--border); width: 100%; }
.cv-rag-doc.highlight { border-color: var(--accent); box-shadow: 0 0 15px var(--accent-soft); }
.cv-rag-doc.highlight span { background: var(--accent); }
.cv-rag-core {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 50px; height: 50px; background: var(--accent); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 30px var(--accent-soft); z-index: 2;
  animation: pulse 2s ease-in-out infinite;
}
.cv-rag-path {
  position: absolute; height: 1px; background: linear-gradient(to right, transparent, var(--accent), transparent);
  transform-origin: left center; width: 100px; opacity: 0; animation: rag-path-glow 3s infinite;
}
@keyframes rag-path-glow { 0%, 100% { opacity: 0; } 50% { opacity: 0.5; } }

/* Case 04: Analytics Agent - Reverted */
.cv-chart { width: 80%; height: 60%; position: relative; }
.cv-chart-svg { width: 100%; height: 100%; overflow: visible; }
.cv-chart-path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-dasharray: 400; stroke-dashoffset: 400; animation: chart-draw 4s ease-out forwards infinite; filter: drop-shadow(0 0 8px var(--accent)); }
@keyframes chart-draw { to { stroke-dashoffset: 0; } }
.cv-chart-fill { fill: var(--accent-soft); opacity: 0.2; }

/* Case 05: Content Pipeline - Reverted */
.cv-pipe { width: 100%; height: 40px; position: relative; display: flex; align-items: center; }
.cv-pipe-track { width: 100%; height: 2px; background: var(--border); position: relative; }
.cv-pipe-item { position: absolute; width: 30px; height: 30px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 14px; animation: pipe-move 4s linear infinite; }
@keyframes pipe-move { from { left: -40px; } to { left: 100%; } }

/* ─── About Strip ─── */
.about-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 56px 32px;
}
.about-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 56px;
  align-items: center;
}
.about-photo {
  width: 140px; height: 140px; border-radius: 50%;
  object-fit: cover; object-position: center top;
  filter: grayscale(15%) contrast(1.05);
  display: block; border: 1px solid var(--border);
}
.about-avail {
  position: relative; margin: -14px auto 0;
  width: fit-content; z-index: 2;
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 10px; font-family: var(--f-mono); font-size: 9px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2);
  white-space: nowrap; display: flex; align-items: center; gap: 5px;
}
.alink {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 9px 16px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted-2); transition: border-color 0.2s, color 0.2s;
}
.alink:hover { border-color: var(--accent); color: var(--fg); }

/* ─── Globe Loader ─── */
.globe-loader-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.globe-loader-wrap:hover {
  transform: scale(1.15);
  filter: drop-shadow(0 0 15px var(--accent-soft));
}
.globe-loader {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.globe-loader-wrap:hover .globe-loader { transform: scale(1.2) rotate(10deg); }
.globe-whirl {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1px solid var(--fg);
  border-radius: 40% 60% 65% 35% / 40% 45% 55% 60%;
  animation: globe-whirl-anim 4s linear infinite;
  opacity: 0.15;
  transition: opacity 0.4s ease;
}
.globe-loader-wrap:hover .globe-whirl { opacity: 0.4; }
.globe-whirl:nth-child(2) {
  animation-duration: 6s;
  animation-direction: reverse;
  border-radius: 35% 65% 50% 50% / 50% 50% 65% 35%;
  opacity: 0.1;
}
@keyframes globe-whirl-anim {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}
.globe-sphere {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}
.globe-map {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 500'%3E%3Cpath fill='%238a8a94' d='M210,120l10,5l5,-15l15,5l-5,15l15,5l-10,15l5,20l15,5l-15,15l5,20l-20,5l-10,15l-15,-10l-15,5l-10,-15l-15,5l-5,-15l-15,-5l10,-15l-5,-20l15,-5l-5,-15l15,-5z M450,250l15,5l10,20l-10,25l-20,10l-15,-15l-5,-25l10,-15l15,-5z M650,150l20,10l15,30l-10,40l-30,15l-25,-25l-5,-40l15,-25l20,5z M180,380l15,10l10,25l-10,30l-25,10l-20,-15l-5,-35l15,-20l20,5z M850,320l15,10l10,25l-10,35l-30,15l-25,-25l-5,-40l20,-20l25,5z M500,80l20,10l10,25l-15,30l-25,10l-20,-15l-5,-35l15,-20l20,5z'/%3E%3C/svg%3E");
  background-size: 50% 100%;
  background-repeat: repeat-x;
  animation: globe-rotate-map 6s linear infinite;
}
@keyframes globe-rotate-map {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.globe-sphere::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, transparent 40%, rgba(0,0,0,0.1) 100%);
  pointer-events: none;
}
[data-theme="dark"] .globe-map { filter: invert(1) brightness(0.8) contrast(1.2); }

/* ─── VS Code style block ─── */
.code-snippet {
  margin: 60px auto 0;
  width: 100%;
  max-width: 600px;
  background: #1e1e1e;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  text-align: left;
}
.code-header { background: #323233; padding: 10px 16px; display: flex; align-items: center; gap: 8px; }
.code-dots { display: flex; gap: 6px; }
.code-dot { width: 12px; height: 12px; border-radius: 50%; }
.code-dot.red { background: #ff5f56; }
.code-dot.yellow { background: #ffbd2e; }
.code-dot.green { background: #27c93f; }
.code-tab { margin-left: 12px; background: #1e1e1e; padding: 6px 12px; border-radius: 4px 4px 0 0; font-size: 12px; color: #969696; display: flex; align-items: center; gap: 6px; }
.code-body { padding: 20px; color: #d4d4d4; line-height: 1.6; }
.c-kw { color: #569cd6; } .c-fn { color: #dcdcaa; } .c-str { color: #ce9178; } .c-var { color: #9cdcfe; }

/* ─── CTA social links ─── */
.cta-links { margin-top: 56px; display: flex; flex-direction: column; align-items: center; gap: 32px; }
.cta-socials { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.cta-social {
  display: flex; align-items: center; gap: 14px; padding: 16px 24px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  transition: border-color 0.2s, transform 0.2s; min-width: 180px;
}
.cta-social:hover { border-color: var(--accent); transform: translateY(-2px); }
.cs-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cs-label { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cs-handle { font-family: var(--f-display); font-size: 16px; font-weight: 500; color: var(--fg); margin-top: 2px; }

/* ─── Responsive ─── */
@media (max-width: 960px) {
  .nav { padding: 16px 24px; }
  .nav-links { display: none; }
  .about-inner { grid-template-columns: 1fr; gap: 32px; }
  .about-photo-wrap { margin: 0 auto; width: fit-content; }
  .about-text { text-align: center; }
  .about-links { justify-content: center; }
  .about-rate { text-align: center; border-top: 1px solid var(--border); padding-top: 32px; }
  .hero-foot { grid-template-columns: 1fr 1fr; gap: 32px; }
  .section { padding: 100px 24px; }
  .section-head { grid-template-columns: 1fr; gap: 24px; }
  .pinned-grid { grid-template-columns: 1fr; gap: 48px; }
  .demos-grid { grid-template-columns: 1fr; }
  .stats-grid, .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .case-card { flex: 0 0 85vw; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .hero-title { font-size: clamp(48px, 15vw, 80px); }
  .hero-foot { grid-template-columns: 1fr; text-align: center; }
  .hero-foot p { max-width: none; }
  .hero-scroll-hint { text-align: center; margin-top: 32px; }
  .stats-grid, .stack-grid { grid-template-columns: 1fr; }
  .cta h2 { font-size: 40px; }
  .cta-socials { flex-direction: column; width: 100%; }
  .cta-social { min-width: 0; width: 100%; }
  .code-snippet { font-size: 12px; }
  .code-body { padding: 12px; }
  footer { flex-direction: column; text-align: center; align-items: center; gap: 32px; }
}
