/* =========================================================
   TOKENS
   ========================================================= */
:root {
  --bg: #0a0b10;
  --bg-alt: #0d0f15;
  --surface: #12141b;
  --surface-2: #181b24;
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.12);
  --text: #eceef4;
  --muted: #9aa1b0;
  --faint: #6b7282;
  --accent: #6d8dff;
  --accent-2: #5ee6ff;
  --accent-soft: rgba(109, 141, 255, 0.12);
  --ok: #34d399;

  --font: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --radius: 16px;
  --radius-lg: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 40px -24px rgba(0, 0, 0, 0.7);
  --glass: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018));
  --glass-hover: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(16px) saturate(150%);
  color-scheme: dark;
}

/* =========================================================
   BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40vw 40vw at 90% 10%, rgba(109, 141, 255, 0.10), transparent 60%),
    radial-gradient(35vw 35vw at 0% 70%, rgba(94, 230, 255, 0.06), transparent 60%),
    radial-gradient(30vw 30vw at 60% 110%, rgba(139, 123, 255, 0.08), transparent 60%);
}
main, .footer { position: relative; z-index: 1; }
::selection { background: var(--accent); color: #fff; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.container { width: min(1180px, 100% - 40px); margin-inline: auto; }
.skip { position: fixed; left: -999px; top: 12px; z-index: 100; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 10px; }
.skip:focus { left: 16px; }

/* =========================================================
   BUTTONS & SMALL PARTS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 12px; font-weight: 500; font-size: 15px;
  border: 1px solid transparent; transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 8px 24px -10px rgba(109, 141, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.btn--primary:hover { background: #7e9bff; }
.btn--primary svg { transition: transform 0.2s var(--ease); }
.btn--primary:hover svg { transform: translateX(3px); }
.btn--ghost { background: var(--surface); border-color: var(--border-2); color: var(--text); }
.btn--ghost:hover { border-color: rgba(255, 255, 255, 0.25); background: var(--surface-2); }
.btn--sm { height: 38px; padding: 0 16px; font-size: 14px; border-radius: 10px; }

.kicker { font: 500 13px var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px;
  font: 500 12px var(--font); color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(109, 141, 255, 0.2);
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 13px; line-height: 1; padding: 7px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); color: #c9cedb; }
.tags--sm li { font-size: 12px; padding: 5px 8px; }

.card, .case, .skill, .contact, .filters, .float-card, .tl {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 20px 40px -28px rgba(0, 0, 0, 0.8);
}
.card { border-radius: var(--radius); transition: border-color 0.25s, transform 0.25s var(--ease), background 0.25s; }
.card:hover { border-color: rgba(255, 255, 255, 0.18); transform: translateY(-3px); background: var(--glass-hover); }

/* spotlight that follows the pointer (vars set in main.js) */
.card, .case, .skill, .contact { position: relative; isolation: isolate; }
.card::before, .case::before, .skill::before, .contact::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(109, 141, 255, 0.16), transparent 45%);
  opacity: 0; transition: opacity 0.35s;
}
.card:hover::before, .case:hover::before, .skill:hover::before, .contact:hover::before { opacity: 1; }

/* =========================================================
   3D SCROLL COMPANION
   ========================================================= */
#blob {
  --x: 100vw; --y: 50vh; --s: 0.6; --o: 0;
  position: fixed; left: 0; top: 0; z-index: 0; pointer-events: none;
  width: min(80vmin, 760px); height: min(80vmin, 760px);
  transform: translate3d(calc(var(--x) - 50%), calc(var(--y) - 50%), 0) scale(var(--s));
  opacity: 0;
  transition: transform 1.6s var(--ease), opacity 0.8s ease;
  will-change: transform, opacity;
}
#blob.is-on { opacity: var(--o); }

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 72px;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.nav--scrolled {
  background: rgba(10, 11, 16, 0.82);
  -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px);
  border-bottom-color: var(--border);
}
.nav__inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand__mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font: 600 14px var(--font); color: #fff; letter-spacing: 0;
  background: linear-gradient(135deg, var(--accent), #8b7bff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.brand__text { display: grid; line-height: 1.2; }
.brand__text strong { font-weight: 600; font-size: 15px; }
.brand__text small { font-size: 12px; color: var(--muted); }
.nav__links { display: flex; gap: 4px; }
.nav__links a { position: relative; padding: 8px 14px; border-radius: 8px; font-size: 14px; color: var(--muted); transition: color 0.2s, background 0.2s; }
.nav__links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.burger { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border-2); position: relative; }
.burger span { position: absolute; left: 12px; right: 12px; height: 1.5px; background: var(--text); transition: transform 0.3s var(--ease), opacity 0.2s; }
.burger span:nth-child(1) { top: 14px; }
.burger span:nth-child(2) { top: 20px; }
.burger span:nth-child(3) { top: 26px; }
.menu-open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-open .burger span:nth-child(2) { opacity: 0; }
.menu-open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
.hero { position: relative; padding: 140px 0 72px; overflow: hidden; isolation: isolate; }
.hero::before { /* faint grid, fades out from the centre */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 60% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 60% 40%, #000 20%, transparent 75%);
}
.hero::after { /* soft colour wash */
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 900px; height: 700px; right: -200px; top: -120px;
  background: radial-gradient(closest-side, rgba(109, 141, 255, 0.16), transparent);
}
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 48px; align-items: center; }

.status {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px;
  font-size: 13px; color: #c9cedb; background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.22);
  margin-bottom: 22px;
}
.status__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); position: relative; }
.status__dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--ok); opacity: 0; animation: ping 2.4s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.8; } 100% { transform: scale(1.8); opacity: 0; } }
.hero__eyebrow { font: 500 14px var(--mono); color: var(--muted); margin-bottom: 14px; }
.hero__title { font-size: clamp(38px, 5vw, 64px); line-height: 1.06; letter-spacing: -0.04em; font-weight: 600; margin-bottom: 22px; max-width: 16ch; }
.accent { background: linear-gradient(95deg, var(--accent) 10%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__lead { font-size: 18px; color: var(--muted); max-width: 52ch; margin-bottom: 32px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 48px; }

.hero__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--border); padding-top: 24px; }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; padding-right: 16px; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--border); }
.stat dd { font-size: clamp(24px, 2.4vw, 30px); font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat dt { font-size: 13px; color: var(--muted); line-height: 1.35; }

.hero__visual { position: relative; aspect-ratio: 1; width: 100%; max-width: 580px; justify-self: end; }
#globe { display: block; width: 100%; height: 100%; }
.globe-fallback { display: none; }
.no-webgl .globe-fallback {
  display: block; position: absolute; inset: 14%; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(109, 141, 255, 0.35), transparent 55%),
    radial-gradient(circle, rgba(159, 179, 255, 0.5) 1px, transparent 1.5px) 0 0 / 14px 14px,
    #0c0e16;
  box-shadow: 0 0 80px rgba(109, 141, 255, 0.25), inset -20px -30px 60px rgba(0, 0, 0, 0.6);
}
.no-webgl #globe { display: none; }

.float-card {
  position: absolute; display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px;
  border-radius: 14px;
  animation: float 7s ease-in-out infinite;
}
.float-card div { display: grid; line-height: 1.3; }
.float-card strong { font-size: 14px; font-weight: 600; }
.float-card small { font-size: 12px; color: var(--muted); }
.float-card__icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; color: var(--accent); background: var(--accent-soft); }
.float-card__icon--ok { color: var(--ok); background: rgba(52, 211, 153, 0.12); }
.float-card--a { left: -4%; bottom: 14%; }
.float-card--b { right: -2%; top: 12%; animation-delay: -3.5s; }
@keyframes float { 50% { transform: translateY(-10px); } }

/* Hero entrance */
.js .hero__copy > * { opacity: 0; transform: translateY(14px); animation: rise 0.8s var(--ease) forwards; }
.js .hero__copy > :nth-child(2) { animation-delay: 0.06s; }
.js .hero__copy > :nth-child(3) { animation-delay: 0.12s; }
.js .hero__copy > :nth-child(4) { animation-delay: 0.2s; }
.js .hero__copy > :nth-child(5) { animation-delay: 0.28s; }
.js .hero__copy > :nth-child(6) { animation-delay: 0.36s; }
.js .hero__visual { opacity: 0; animation: fade 1.4s ease 0.2s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }

/* =========================================================
   SOURCES STRIP
   ========================================================= */
.strip { border-block: 1px solid var(--border); padding: 26px 0; background: rgba(13, 15, 21, 0.6); }
.strip__label { text-align: center; font: 500 12px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }
.strip__viewport { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.strip__track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.strip__track span { font-size: 15px; font-weight: 500; color: #7d8494; padding: 0 28px; white-space: nowrap; position: relative; }
.strip__track span::after { content: ""; position: absolute; right: -2px; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: #3a3f4c; }
.strip__viewport:hover .strip__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* =========================================================
   SECTIONS
   ========================================================= */
.section { padding: clamp(80px, 10vw, 120px) 0; }
.section--alt { background: rgba(13, 15, 21, 0.45); border-block: 1px solid var(--border); }
.section__head { max-width: 680px; margin-bottom: 48px; }
.section h2 { font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -0.035em; line-height: 1.1; }
.section__lead { color: var(--muted); font-size: 17px; margin-top: 14px; max-width: 60ch; }

/* Reveal (only when JS is on) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease) var(--d, 0ms), transform 0.7s var(--ease) var(--d, 0ms), border-color 0.25s, background 0.25s; }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .card.reveal.is-in:hover { transform: translateY(-3px); transition-delay: 0ms; }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.service { padding: 28px; }
.service__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(109, 141, 255, 0.18); margin-bottom: 20px; }
.service h3 { font-size: 18px; margin-bottom: 8px; }
.service p { color: var(--muted); font-size: 15px; }

/* ---------- Case studies ---------- */
.cases { display: grid; gap: 20px; }
.case {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  border-radius: var(--radius-lg); overflow: hidden;
}
.case__main { padding: clamp(28px, 3.4vw, 44px); }
.case__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.case__num { font: 500 13px var(--mono); color: var(--faint); }
.case__client { font-size: 13px; color: var(--muted); }
.case__client::before { content: "·"; margin-right: 10px; color: var(--faint); }
.case h3 { font-size: clamp(22px, 2.3vw, 28px); letter-spacing: -0.03em; margin-bottom: 12px; }
.case__summary { color: var(--muted); font-size: 16px; margin-bottom: 22px; max-width: 62ch; }
.checklist { display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; font-size: 15px; color: #d3d7e1; }
.checklist svg { flex: none; margin-top: 4px; color: var(--accent); }
.case__side {
  padding: clamp(28px, 3.4vw, 44px); border-left: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.02);
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
}
.metrics { display: grid; }
.metrics > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 14px 0; border-bottom: 1px solid var(--border); }
.metrics > div:first-child { padding-top: 0; }
.metrics dd { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.metrics dt { font-size: 13px; color: var(--muted); }
.case__label { font: 500 12px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }

/* ---------- More projects ---------- */
.more { margin-top: 72px; }
.more__head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.more__head h3 { font-size: 22px; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; }
.filters button { height: 34px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; color: var(--muted); transition: color 0.2s, background 0.2s; }
.filters button span { font: 12px var(--mono); color: var(--faint); margin-left: 2px; }
.filters button:hover { color: var(--text); }
.filters button[aria-selected="true"] { background: rgba(255, 255, 255, 0.09); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-2); }
.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.project { padding: 24px; display: flex; flex-direction: column; gap: 10px; animation: rise 0.5s var(--ease) both; animation-delay: var(--d, 0ms); }
.js .project { opacity: 0; transform: translateY(10px); }
.project .badge { align-self: flex-start; }
.project h4 { font-size: 17px; margin-top: 4px; }
.project p { color: var(--muted); font-size: 14.5px; }
.project .tags { margin-top: auto; padding-top: 8px; }
.empty { color: var(--muted); grid-column: 1 / -1; }

/* ---------- Process ---------- */
.process { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; position: relative; }
.process::before { content: ""; position: absolute; left: 20px; right: 20px; top: 20px; height: 1px; background: linear-gradient(90deg, var(--accent), rgba(109, 141, 255, 0.05)); }
.step { position: relative; padding-right: 12px; }
.step__num {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  font: 500 13px var(--mono); color: var(--accent); background: var(--bg); border: 1px solid rgba(109, 141, 255, 0.35);
  margin-bottom: 20px;
}
.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 15px; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 88px); align-items: start; }
.about__intro h2 { margin-bottom: 22px; }
.about__body { display: grid; gap: 16px; color: var(--muted); font-size: 16.5px; }
.about__body p:first-child { color: #d3d7e1; }
.about__sub { font: 500 13px var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 20px; margin-top: 6px; }
.timeline { position: relative; display: grid; gap: 16px; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 28px; bottom: 28px; width: 1px; background: var(--border-2); }
.tl { position: relative; padding: 20px 22px; border-radius: var(--radius); }
.tl::before { content: ""; position: absolute; left: -28px; top: 26px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg-alt); border: 2px solid var(--accent); }
.tl:first-child::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl__period { font: 500 13px var(--mono); color: var(--faint); margin-bottom: 6px; }
.tl h4 { font-size: 18px; }
.tl__org { color: var(--accent); font-size: 14px; margin: 2px 0 12px; }
.tl ul { display: grid; gap: 6px; }
.tl li { position: relative; padding-left: 16px; color: var(--muted); font-size: 15px; }
.tl li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 5px; height: 5px; border-radius: 50%; background: #3d4352; }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.skill { padding: 24px; border-radius: var(--radius); transition: border-color 0.25s; }
.skill:hover { border-color: rgba(255, 255, 255, 0.18); }
.skill h3 { font-size: 16px; margin-bottom: 14px; }

/* ---------- Contact ---------- */
.contact {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px);
  padding: clamp(28px, 4vw, 56px); border-radius: 24px;
  background:
    radial-gradient(600px 300px at 0% 0%, rgba(109, 141, 255, 0.16), transparent 70%),
    var(--glass);
}
.contact__list { display: grid; gap: 4px; margin-top: 28px; }
.contact__list li, .contact__list a { display: flex; align-items: center; gap: 12px; color: #c9cedb; font-size: 15px; min-width: 0; }
.contact__list span:last-child { overflow-wrap: anywhere; }
.contact__list li { padding: 6px 0; }
.contact__list a:hover { color: var(--text); }
.contact__icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); flex: none; }
.form { display: grid; gap: 16px; align-content: start; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form label { display: grid; gap: 8px; font-size: 13.5px; font-weight: 500; color: #c9cedb; }
.form input, .form textarea {
  font: 400 15px var(--font); color: var(--text); background: rgba(8, 9, 14, 0.55); border: 1px solid var(--border-2);
  border-radius: 10px; padding: 12px 14px; resize: vertical; transition: border-color 0.2s, box-shadow 0.2s; width: 100%;
}
.form input::placeholder, .form textarea::placeholder { color: #555c6b; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form .btn { justify-self: start; }
.form select {
  font: 400 15px var(--font); color: var(--text); background: rgba(8, 9, 14, 0.55); border: 1px solid var(--border-2);
  border-radius: 10px; padding: 12px 14px; width: 100%; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa1b0' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}
.form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form select option { background: #12141b; color: var(--text); }
.form__opt { color: var(--faint); font-weight: 400; }
.form__trap { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form .btn:disabled { opacity: 0.7; cursor: progress; }
.form__status { font-size: 14px; min-height: 0; }
.form__status:empty { display: none; }
.form__status--error { color: #fca5a5; padding: 10px 12px; border-radius: 10px; background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.25); }
.form__status--error a { color: #fff; text-decoration: underline; }
.contact__side { position: relative; min-width: 0; }
.form-done { display: grid; justify-items: start; gap: 12px; padding: 28px; border-radius: 16px; background: rgba(52, 211, 153, 0.06); border: 1px solid rgba(52, 211, 153, 0.25); animation: rise 0.5s var(--ease) both; }
.form-done[hidden] { display: none; }
.form-done__icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; color: #0a0b10; background: var(--ok); }
.form-done h3 { font-size: 22px; letter-spacing: -0.02em; }
.form-done p { color: var(--muted); }
.form-done b { color: var(--text); overflow-wrap: anywhere; }
.form__note { font-size: 12.5px; color: var(--faint); }

/* =========================================================
   SAMPLE OUTPUTS
   ========================================================= */
.case__output { grid-column: 1 / -1; border-top: 1px solid var(--glass-border); padding: clamp(24px, 3vw, 36px) clamp(28px, 3.4vw, 44px); background: rgba(0, 0, 0, 0.12); min-width: 0; }
.case__output-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.case__output-head .case__label { margin-bottom: 4px; }
.case__deliv { color: var(--muted); font-size: 14.5px; }
.case__output-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.case__preview { display: grid; gap: 16px; min-width: 0; }
.case__preview > *, .modal__body > *, #modalTable { min-width: 0; max-width: 100%; }
.case__preview--split { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); align-items: start; }

.otable {
  overflow: auto; max-height: 420px; border-radius: 12px; border: 1px solid var(--glass-border);
  background: rgba(6, 7, 11, 0.55); scrollbar-width: thin; scrollbar-color: #2b3040 transparent;
}
.otable table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 13px; }
.otable th {
  position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 600; white-space: nowrap;
  padding: 10px 14px; background: #1f2a44; color: #eef1ff; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.otable td {
  padding: 9px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); color: #c9cedb;
  white-space: nowrap; max-width: 300px; overflow: hidden; text-overflow: ellipsis;
}
.otable tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.018); }
.otable tbody tr:hover td { background: rgba(109, 141, 255, 0.07); color: var(--text); }

.tg { display: flex; gap: 10px; align-items: flex-end; }
.tg__avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #2aabee, #229ed9); }
.tg__bubble { position: relative; padding: 10px 14px 22px; border-radius: 14px 14px 14px 4px; background: #1e2c3a; border: 1px solid rgba(255, 255, 255, 0.06); font-size: 13.5px; line-height: 1.55; min-width: 0; }
.tg__from { font-weight: 600; color: #6ab3f3; font-size: 13px; margin-bottom: 2px; }
.tg__text { color: #e6ebf2; overflow-wrap: anywhere; }
.tg__time { position: absolute; right: 12px; bottom: 6px; font-size: 11px; color: #7f96ab; }

.code {
  margin: 0; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--glass-border); background: rgba(6, 7, 11, 0.7);
  font: 12.5px/1.65 var(--mono); color: #c9d4ff; overflow: auto; max-height: 420px; white-space: pre;
}

/* project cards */
.project__actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--glass-border); }
.link-btn { font-size: 14px; font-weight: 500; color: var(--accent); padding: 4px 0; transition: color 0.2s; }
.link-btn:hover { color: #9fb3ff; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.2s, border-color 0.2s;
}
.chip-btn:hover { background: rgba(109, 141, 255, 0.16); border-color: rgba(109, 141, 255, 0.4); }

/* modal */
html:has(.modal[open]) { overflow: hidden; }
.modal {
  width: min(1040px, calc(100% - 32px)); max-height: min(86vh, 860px); padding: 0; border-radius: 20px;
  border: 1px solid var(--border-2); background: rgba(16, 18, 25, 0.97); color: var(--text);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
}
.modal[open] { animation: modalIn 0.35s var(--ease); }
.modal::backdrop { background: rgba(4, 5, 9, 0.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.modal__inner { display: flex; flex-direction: column; max-height: inherit; }
.modal__head { display: flex; justify-content: space-between; gap: 16px; padding: 24px 28px 18px; border-bottom: 1px solid var(--border); }
.modal__head .kicker { margin-bottom: 8px; }
.modal__head h3 { font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -0.03em; }
.modal__deliv { color: var(--muted); font-size: 14.5px; margin-top: 6px; }
.modal__close { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--border-2); color: var(--muted); transition: color 0.2s, border-color 0.2s; }
.modal__close:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.3); }
.modal__body { padding: 20px 28px; overflow: auto; display: grid; gap: 14px; min-height: 0; }
.modal__label { font: 500 12px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; }
.modal__body .tg { max-width: 460px; }
.modal__foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 28px 22px; border-top: 1px solid var(--border); }
.modal__note { font-size: 12.5px; color: var(--faint); max-width: 60ch; }
.mtabs { display: flex; gap: 4px; flex-wrap: wrap; }
.mtabs button { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; color: var(--muted); border: 1px solid transparent; }
.mtabs button span { font: 11px var(--mono); color: var(--faint); margin-left: 2px; }
.mtabs button:hover { color: var(--text); }
.mtabs button[aria-selected="true"] { color: var(--text); background: rgba(255, 255, 255, 0.07); border-color: var(--border-2); }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { border-top: 1px solid var(--border); padding: 32px 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer__name { font-weight: 600; }
.footer__role, .footer__copy { font-size: 13.5px; color: var(--muted); }
.footer__top { font-size: 13.5px; color: var(--muted); }
.footer__top:hover { color: var(--text); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1080px) {
  .services, .projects, .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
  .process::before { display: none; }
}

@media (max-width: 900px) {
  .nav__links {
    position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; gap: 0;
    padding: 8px 20px 20px; background: rgba(10, 11, 16, 0.98); border-bottom: 1px solid var(--border);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity 0.2s, transform 0.25s var(--ease), visibility 0s 0.25s;
  }
  .menu-open .nav__links { opacity: 1; transform: none; visibility: visible; transition: opacity 0.2s, transform 0.25s var(--ease); }
  .menu-open .nav { background: rgba(10, 11, 16, 0.98); }
  .nav__links a { padding: 14px 4px; font-size: 16px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .nav__links a.is-active::after { display: none; }
  .burger { display: block; }

  .hero { padding-top: 104px; }
  .hero__grid { grid-template-columns: 1fr; gap: 16px; }
  .hero__visual { order: -1; max-width: 420px; justify-self: center; margin-bottom: -24px; }
  .hero__title { max-width: 18ch; }
  .case { grid-template-columns: 1fr; }
  .case__side { border-left: 0; border-top: 1px solid var(--border); }
  .case__preview--split { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .metrics > div { border-bottom: 0; padding: 0; }
  .about, .contact { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .container { width: calc(100% - 32px); }
  .nav__cta { display: none; }
  .brand__text small { display: none; }
  .hero__lead { font-size: 16.5px; }
  .hero__cta .btn { flex: 1 1 auto; }
  .hero__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .hero__visual { max-width: 340px; }
  .float-card { animation: none; padding: 8px 12px 8px 8px; }
  .float-card small { display: none; }
  .float-card--a { left: -4%; bottom: 10%; }
  .float-card--b { right: -4%; top: 8%; }
  .services, .projects, .skills, .process { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; gap: 10px; }
  .metrics dd { font-size: 22px; }
  .form__row { grid-template-columns: 1fr; }
  .case__output-actions { width: 100%; }
  .case__output-actions .btn { flex: 1 1 auto; }
  .modal__head, .modal__body, .modal__foot { padding-left: 18px; padding-right: 18px; }
  .modal__foot .btn { width: 100%; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal, .js .hero__copy > *, .js .hero__visual, .js .project { opacity: 1; transform: none; }
}
