/* ============================================================
   PORTFOLIO — graphite design system
   Palette + type scale are research-backed (see README).
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  /* surfaces (graphite ramp) */
  --bg:             #121212;
  --bg-elevated:    #18181b;
  --bg-raised:      #1e1e21;
  --bg-subtle:      #27272a;
  --border:         #2e2e33;
  --border-strong:  #3f3f46;

  /* text */
  --text:           #e8e8e8;   /* 15.3:1 on --bg */
  --text-2:         #a1a1aa;   /* 7.3:1 */
  --text-3:         #71717a;   /* decorative only */

  /* accent — "agent green" */
  --accent:         #34d399;   /* 9.7:1 on --bg */
  --accent-bright:  #5eead4;
  --accent-dim:     rgba(52, 211, 153, 0.12);
  --accent-glow:    rgba(52, 211, 153, 0.07);
  --on-accent:      #0a0f0d;

  /* fonts */
  --f-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --f-body:    "Inter", system-ui, -apple-system, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  /* fluid type scale (Utopia: 16/1.2 @320 -> 18/1.25 @1240) */
  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.94rem);
  --step-0:  clamp(1.00rem, 0.96rem + 0.22vw, 1.13rem);
  --step-1:  clamp(1.20rem, 1.12rem + 0.39vw, 1.41rem);
  --step-2:  clamp(1.44rem, 1.31rem + 0.63vw, 1.76rem);
  --step-3:  clamp(1.73rem, 1.53rem + 0.98vw, 2.20rem);
  --step-4:  clamp(2.07rem, 1.79rem + 1.43vw, 2.75rem);
  --step-5:  clamp(2.49rem, 2.08rem + 2.03vw, 3.43rem);

  --container: 1100px;
  --radius: 12px;
  --radius-lg: 16px;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: var(--step-0);
  font-weight: 450;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); }
::selection { background: var(--accent); color: var(--on-accent); }

h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.15; color: #fff; }
h1 { font-size: var(--step-5); letter-spacing: -0.02em; }
h2 { font-size: var(--step-3); letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); }

.mono { font-family: var(--f-mono); }

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

/* ---------- ambient background ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 40%, transparent 100%);
}
.bg-noise {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- scroll progress ---------- */
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
  z-index: 90;
}
@supports (animation-timeline: scroll()) {
  .progress { animation: grow linear; animation-timeline: scroll(); }
  @keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ---------- boot overlay ---------- */
.boot {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center;
  background: var(--bg);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
html.js .boot { display: flex; }
.boot.done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-window {
  width: min(560px, 90vw);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
.boot-bar {
  display: flex; gap: 7px; padding: 12px 14px;
  background: var(--bg-elevated); border-bottom: 1px solid var(--border);
}
.boot-bar span {
  width: 11px; height: 11px; border-radius: 50%; background: var(--bg-subtle);
  transition: transform 0.18s ease-out, background 0.3s ease, box-shadow 0.3s ease;
}
/* macOS traffic lights everywhere */
.boot-bar span:nth-child(1) { background: #ff5f57; }
.boot-bar span:nth-child(2) { background: #febc2e; }
.boot-bar span:nth-child(3) { background: #28c840; }
.boot-bar span:hover { transform: scale(1.35); }
/* while a terminal is "working", its green light breathes */
.boot-bar.busy span:nth-child(3) {
  animation: dotpulse 1.1s ease-in-out infinite;
}
@keyframes dotpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(40, 200, 64, 0.55); }
  50% { box-shadow: 0 0 10px 2.5px rgba(40, 200, 64, 0.45); }
}

/* boot overlay: lights start OFF and switch on stage by stage */
.boot .boot-bar span { background: #3a3a3f; }
.boot .boot-bar span.on:nth-child(1) { background: #ff5f57; box-shadow: 0 0 9px rgba(255, 95, 87, 0.5); }
.boot .boot-bar span.on:nth-child(2) { background: #febc2e; box-shadow: 0 0 9px rgba(254, 188, 46, 0.5); }
.boot .boot-bar span.on:nth-child(3) { background: #28c840; box-shadow: 0 0 9px rgba(40, 200, 64, 0.55); }
.boot .boot-bar span.live { animation: dotpulse 1.1s ease-in-out infinite; }
.boot-body {
  font-family: var(--f-mono); font-size: 0.95rem; line-height: 1.9;
  padding: 22px 24px; min-height: 168px; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}
.boot-body .ok { color: var(--accent); }
.boot-cursor { display: inline-block; width: 0.55em; height: 1.1em;
  background: var(--accent-bright); vertical-align: -0.15em; }
.boot-skip {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  font-family: var(--f-mono); font-size: 0.78rem; color: var(--text-3);
}

/* blinking cursor (opacity only — compositor cheap) */
@keyframes blink { 50% { opacity: 0; } }
.blink { animation: blink 1s steps(1) infinite; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  background: rgba(18, 18, 18, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner {
  max-width: var(--container); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.nav-logo { font-family: var(--f-mono); font-size: 0.95rem; color: var(--text); font-weight: 600; }
.nav-logo b { color: var(--accent); font-weight: 600; }
.nav-links { display: flex; gap: 26px; align-items: center; list-style: none; }
.nav-links a { color: var(--text-2); font-size: 0.9rem; font-weight: 500; text-transform: capitalize; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active { color: var(--accent); }
.nav-cta {
  font-size: 0.85rem; font-weight: 600; color: var(--accent);
  border: 1px solid var(--border-strong); padding: 8px 16px; border-radius: 999px;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.nav-cta:hover { border-color: var(--accent); background: var(--accent-dim); }
.nav-burger { display: none; background: none; border: 0; color: var(--text);
  font-size: 1.5rem; cursor: pointer; padding: 4px 8px; }

/* ---------- layout: ONE spacing rhythm (96px mobile / 128px desktop) ----------
   Sections separate by hairline + eyebrow row, not by random gaps. */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
/* section.container beats .container's shorthand so the rhythm actually applies */
section.container { padding-top: 96px; padding-bottom: 96px; }
section { scroll-margin-top: 78px; }  /* land below the fixed navbar */
@media (min-width: 1024px) {
  section.container { padding-top: 128px; padding-bottom: 128px; }
}

/* eyebrow row: hairline above, mono index label */
main section:not(.hero) { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.section-label {
  font-family: var(--f-mono); font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-2); margin-bottom: 16px;
}
.section-label::before { content: "▸ "; color: var(--accent); }
.section-title { margin-bottom: 48px; max-width: 24ch; }

/* ---------- hero ---------- */
section.hero {
  min-height: 96vh; display: flex; flex-direction: column; justify-content: center;
  position: relative; padding-top: 110px; padding-bottom: 96px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 70% 45% at 65% -10%, var(--accent-glow), transparent 65%);
}
/* glyph texture: kept below 3:1 contrast (reads as texture, never content),
   masked away from the copy column so text never fights it */
#glyphs {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  mask-image: linear-gradient(100deg, transparent 30%, rgba(0,0,0,0.55) 52%, #000 72%);
  -webkit-mask-image: linear-gradient(100deg, transparent 30%, rgba(0,0,0,0.55) 52%, #000 72%);
}
@media (max-width: 1023px) {
  #glyphs {
    mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.4) 45%, transparent 72%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.4) 45%, transparent 72%);
  }
}

.hero-grid {
  display: grid; grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
@media (max-width: 1023px) { .hero-grid { grid-template-columns: 1fr; } }

/* status pill — the 2s pulse says "this person is live" */
.hero-pill {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--f-mono); font-size: 0.8rem; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; margin-bottom: 26px; background: rgba(24,24,27,0.7);
  width: fit-content;
}
.hero-pill i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.72); opacity: 0.5; }
}

/* live agent terminal card */
.hero-term {
  background: #161719; border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  transform-origin: center;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}
.hero-term:hover {
  transform: scale(1.05); border-color: rgba(52, 211, 153, 0.3);
  box-shadow: 0 44px 110px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(52, 211, 153, 0.2);
}
.hero-term .boot-bar { display: flex; align-items: center; }
.hero-term-body {
  font-family: var(--f-mono); font-size: 0.83rem; line-height: 2.05;
  padding: 20px 22px; height: 315px; overflow: hidden; color: var(--text-2);
}
.hero-term-body .hl-cmd { color: var(--text); }
.hero-term-body .hl-cmd::before { content: "$ "; color: var(--accent); }
.hero-term-body .hl-out { color: var(--text-2); padding-left: 16px; }
.hero-term-body .hl-out.ok { color: var(--accent); }
.hero-term-body .hl-cur::after {
  content: "▌"; color: var(--accent-bright);
  animation: blink 0.9s steps(1) infinite;
}
@media (max-width: 1023px) { .hero-term-body { height: 250px; } }

/* masked word-rise entrance.
   GSAP path: JS owns initial + animated states (no CSS transitions).
   Fallback path (html.no-gsap): CSS transitions do the same choreography. */
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: bottom; }
.hero h1 .wi { display: inline-block; }
html.no-gsap .hero h1 .wi { transform: translateY(112%);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
html.no-gsap .hero-sub, html.no-gsap .hero-ctas, html.no-gsap .hero-right,
html.no-gsap .metrics {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
html.no-gsap .hero-in .hero-sub { transition-delay: 0.45s; }
html.no-gsap .hero-in .hero-ctas { transition-delay: 0.6s; }
html.no-gsap .hero-in .hero-right { transition-delay: 0.7s; }
html.no-gsap .hero-in .metrics { transition-delay: 0.9s; }
html.no-gsap .hero-in .hero-sub, html.no-gsap .hero-in .hero-ctas,
html.no-gsap .hero-in .hero-right, html.no-gsap .hero-in .metrics { opacity: 1; transform: none; }
html.no-gsap .hero-in h1 .wi { transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.no-gsap .hero h1 .wi { transform: none; transition: none; }
  html.no-gsap .hero-sub, html.no-gsap .hero-ctas, html.no-gsap .hero-right,
  html.no-gsap .metrics { opacity: 1; transform: none; transition: none; }
}
.scr { color: var(--accent); opacity: 0.7; }
.metric b { font-variant-numeric: tabular-nums; }
.type-cursor { color: var(--accent-bright); font-weight: 300; margin-left: 2px; }
.hero h1 { max-width: 17ch; }
.hero h1 .typed-wrap { color: var(--accent); }
.hero h1 .typed-cursor { color: var(--accent-bright); font-weight: 300; }
.hero-sub {
  margin-top: 26px; max-width: 56ch; color: var(--text-2); font-size: var(--step-1);
  line-height: 1.6;
}
.hero-ctas { display: flex; gap: 12px; margin-top: 38px; flex-wrap: wrap; }
.hero-ctas .btn { justify-content: center; padding: 14px 20px; font-size: 0.94rem; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-body); font-weight: 600; font-size: 0.98rem;
  padding: 14px 26px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-bright); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
/* WhatsApp: deep brand green + near-black text (same contrast recipe as primary) */
.btn-wa { background: #16994a; color: #06130b; }
.btn-wa:hover { background: #1fb35a; color: #06130b; }

/* gradient headline words */
.hero h1 .wi.grad {
  background: linear-gradient(100deg, var(--accent) 10%, #22d3ee 90%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ---------- orbit rings + tech chips around the hero terminal ---------- */
.hero-right { position: relative; }
.orbit-wrap {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none; z-index: -1;
}
.orbit-ring {
  position: absolute; border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.07);
}
.orbit-ring-1 { width: 520px; height: 520px; }
.orbit-ring-2 { width: 680px; height: 680px; }
.orbit {
  position: absolute; width: 0; height: 0;
}
.orbit-1 { --orbit-r: 260px; animation: orbitspin 46s linear infinite; }
.orbit-2 { --orbit-r: 340px; animation: orbitspin 70s linear infinite reverse; }
.orbit-chip { position: absolute; top: 0; left: 0; }
.orbit-chip i {
  display: grid; place-items: center; font-style: normal;
  font-family: var(--f-mono); font-size: 0.68rem; color: var(--text-2);
  background: rgba(24, 24, 27, 0.9); border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 7px 10px; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  animation: orbitcounter 46s linear infinite;
}
.orbit-2 .orbit-chip i { animation: orbitcounter 70s linear infinite reverse; }
@keyframes orbitspin { to { transform: rotate(360deg); } }
@keyframes orbitcounter { to { transform: rotate(-360deg); } }
@media (max-width: 1023px) { .orbit-wrap { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .orbit, .orbit-chip i { animation: none; }
}


/* metrics — four live tiles with a sequential heartbeat */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-top: clamp(48px, 7vw, 76px);
}
.metric {
  padding: 22px 24px; background: #17181a;
  border: 1px solid var(--border); border-radius: 12px;
  transition: border-color 0.2s ease-out, background 0.2s ease-out, transform 0.2s ease-out;
}
.metric b {
  display: block; font-family: var(--f-mono); font-size: var(--step-2);
  color: var(--accent); font-weight: 600; line-height: 1.2;
}
.metric span { font-size: 0.85rem; color: var(--text-2); }
.metric:hover, .metric.beat {
  border-color: var(--border-strong); background: var(--bg-raised);
  transform: translateY(-2px);
}

/* ---------- skills ticker (in-flow, container width) ---------- */
.marquee-band { margin-top: 6px; margin-bottom: 6px; }
.marquee {
  position: relative; overflow: hidden;
  padding: 14px 0; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 12px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; width: max-content; will-change: transform;
  animation: marquee 34s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  display: inline-flex; align-items: center; gap: 28px;
  padding: 0 28px; font-family: var(--f-mono); font-size: 0.85rem;
  color: var(--text-2); white-space: nowrap;
}
.marquee-item::after { content: "◆"; color: var(--accent); font-size: 0.55rem; }
.marquee-item:hover { color: var(--text); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr;
  gap: clamp(32px, 5vw, 64px); align-items: center; }
.about-text p { color: var(--text-2); margin-bottom: 18px; }
.about-text p strong { color: var(--text); font-weight: 600; }
/* four fact rectangles, staggered reveal + hover lift */
.facts-grid { display: grid; gap: 14px; align-content: center; }
.fact-card {
  display: grid; gap: 5px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 22px;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}
.fact-card:hover {
  transform: translateY(-3px) translateX(3px);
  border-color: var(--accent); background: var(--bg-raised);
}
.fact-card:hover .fact-k { letter-spacing: 0.14em; }
.fact-k {
  font-family: var(--f-mono); font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent);
  transition: letter-spacing 0.25s ease;
}
.fact-v { color: var(--text); font-size: 0.95rem; }
.facts-grid.stagger > .fact-card { /* reuses global stagger delays */ }

/* ---------- services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 26px;
  position: relative;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.card::after { /* pre-rendered shadow, cross-faded via opacity (perf) */
  content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg);
  box-shadow: 0 18px 48px rgba(0,0,0,0.45); opacity: 0;
  transition: opacity 0.25s ease; pointer-events: none;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.card:hover::after { opacity: 1; }
/* top line: two green segments grow from the left & right edges to meet at center */
.card .card-top {
  position: absolute; top: -1px; left: 14px; right: 14px; height: 2px; z-index: 3;
  pointer-events: none;
}
.card .card-top::before,
.card .card-top::after {
  content: ""; position: absolute; top: 0; height: 100%; width: 50%;
  background: var(--accent); border-radius: 2px;
  transform: scaleX(0);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.card .card-top::before { left: 0; transform-origin: left; }
.card .card-top::after { right: 0; transform-origin: right; }
.card:hover .card-top::before,
.card:hover .card-top::after { transform: scaleX(1); }
.card-icon { font-size: 1.4rem; color: var(--accent); margin-bottom: 16px; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--text-2); font-size: 0.94rem; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--f-mono); font-size: 0.74rem; color: var(--text-2);
  border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px;
  background: var(--bg); white-space: nowrap;
}
.chip.accent { color: var(--accent); border-color: rgba(52, 211, 153, 0.3); background: var(--accent-dim); }

/* ---------- projects ---------- */
.project {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(24px, 4vw, 48px);
  align-items: center; padding: clamp(28px, 4vw, 44px);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-bottom: 22px;
  position: relative; perspective: 1200px;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
/* hover: slide left + soft dull glow on all four borders */
.project:hover {
  transform: translateX(-10px);
  border-color: rgba(52, 211, 153, 0.22);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.12), 0 0 34px rgba(52, 211, 153, 0.05);
}
.project:nth-child(even) .project-term { order: 2; }
.project-term {
  position: relative;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; font-family: var(--f-mono); font-size: 0.82rem;
  transform-origin: center;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}
/* hover: zoom the terminal toward the viewer (3D-ish) */
.project-term:hover {
  transform: scale(1.12) translateY(-6px); z-index: 8;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(52, 211, 153, 0.25);
}
.project-term .boot-bar { padding: 10px 12px; }
.project-term-body { padding: 16px 18px; line-height: 2; color: var(--text-2); min-height: 118px; }
.project-term-body .u { color: var(--text); }        /* user line */
.project-term-body .a { color: var(--accent); }      /* agent line */
.project h3 { font-size: var(--step-2); }
.project-sub { color: var(--text-3); font-size: 0.9rem; margin: 6px 0 14px; }
.project-desc { color: var(--text-2); font-size: 0.95rem; margin-bottom: 18px; }
.project-metric {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px;
  padding: 14px 18px; border-left: 2px solid var(--accent);
  background: var(--accent-dim); border-radius: 0 10px 10px 0;
}
.project-metric b { font-family: var(--f-mono); font-size: var(--step-2); color: var(--accent); font-weight: 600; }
.project-metric span { color: var(--text-2); font-size: 0.88rem; }
.project-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 0.86rem; margin-top: 14px;
}
.project-link::after { content: "↗"; }

/* ---------- agent chat demo (full-width, two-column) ---------- */
.chat-sub { color: var(--text-2); margin: -28px 0 40px; max-width: 62ch; }
.chat-window {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.chat-window .boot-bar { display: flex; align-items: center; }
.chat-body { display: grid; grid-template-columns: 1.55fr 1fr; }
.chat-log {
  padding: 30px; min-height: 360px; max-height: 460px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth;
  border-right: 1px solid var(--border);
}
.msg { max-width: 90%; padding: 12px 16px; border-radius: 14px; font-size: 0.95rem; line-height: 1.55; }
.msg-agent { align-self: flex-start; background: var(--bg-subtle); color: var(--text); border-bottom-left-radius: 4px; }
.msg-agent::before { content: "agent"; display: block; font-family: var(--f-mono);
  font-size: 0.68rem; color: var(--accent); margin-bottom: 4px; }
.msg-user { align-self: flex-end; background: var(--accent-dim);
  border: 1px solid rgba(52, 211, 153, 0.25); color: var(--text); border-bottom-right-radius: 4px; }

.chat-side { padding: 30px; background: var(--bg-raised); }
.chat-side-label {
  font-family: var(--f-mono); font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-2); margin-bottom: 16px;
}
.chat-side-label::before { content: "▸ "; color: var(--accent); }
.chat-chips { display: flex; flex-direction: column; gap: 10px; }
.chat-chip {
  font-family: var(--f-mono); font-size: 0.82rem; color: var(--text); text-align: left;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  padding: 12px 15px; border-radius: 10px; cursor: pointer; width: 100%;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.chat-chip::before { content: "› "; color: var(--accent); }
.chat-chip:hover:not(:disabled) {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-dim); transform: translateX(3px);
}
.chat-chip:disabled { opacity: 0.4; cursor: default; }
.chat-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; padding: 20px 30px;
  border-top: 1px solid var(--border); background: var(--bg-subtle);
}
.chat-cta p { font-size: 0.95rem; color: var(--text-2); }
.chat-cta-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.chat-cta-btns .btn { padding: 11px 20px; font-size: 0.9rem; }
@media (max-width: 860px) {
  .chat-body { grid-template-columns: 1fr; }
  .chat-log { border-right: 0; border-bottom: 1px solid var(--border); min-height: 300px; }
}

/* ---------- experience ---------- */
.timeline { position: relative; padding-left: 30px; }
.t-item {
  position: relative; padding: 10px 18px; margin-bottom: clamp(18px, 3vw, 32px);
  border-radius: 12px; border: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.t-item:last-child { margin-bottom: 0; }
.t-item::before {
  content: ""; position: absolute; left: -28px; top: 16px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.t-item:hover {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.07), transparent 72%);
  border-color: var(--border);
}
.t-item:hover::before {
  transform: scale(1.3);
  box-shadow: 0 0 0 4px var(--accent-dim), 0 0 12px 2px rgba(52, 211, 153, 0.5);
}
.t-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.t-period { font-family: var(--f-mono); font-size: 0.78rem; color: var(--text-3); }
.t-company { color: var(--accent); font-size: 0.95rem; font-weight: 500; margin: 2px 0 12px; }
.t-item ul { list-style: none; display: grid; gap: 8px; margin-bottom: 14px; }
.t-item li { color: var(--text-2); font-size: 0.95rem; padding-left: 18px; position: relative; }
.t-item li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); font-size: 0.8em; top: 3px; }

/* ---------- skills: system-module cards ---------- */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.skill-card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 26px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.skill-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.skill-card:first-child { grid-column: 1 / -1; } /* featured: Agents & LLM full width */
.skill-card-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  padding-bottom: 12px; border-bottom: 1px dashed var(--border);
}
.skill-idx {
  font-family: var(--f-mono); font-size: 0.72rem; color: var(--on-accent);
  background: var(--accent); border-radius: 6px; padding: 2px 7px; font-weight: 700;
}
.skill-path { font-family: var(--f-mono); font-size: 0.8rem; color: var(--text-2); }
.skill-card h3 { margin-bottom: 14px; font-size: var(--step-1); }
.skill-card .chips { gap: 9px; }
@media (max-width: 900px) { .skills-grid { grid-template-columns: 1fr; } }

/* ---------- testimonials: dog-ear cards in a horizontal scroller ---------- */
.quotes-grid {
  display: flex; gap: 22px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity; scroll-padding-left: 4px;
  padding: 28px 4px 12px; cursor: grab;
  -ms-overflow-style: none; scrollbar-width: none; /* Firefox/IE: no bar */
}
.quotes-grid::-webkit-scrollbar { display: none; }        /* Chrome/Safari: no bar */
.quotes-grid.dragging { cursor: grabbing; scroll-snap-type: none; }
.quotes-grid.dragging .tq-card { pointer-events: none; }
.tq-card {
  --notch: 36px;
  flex: 0 0 clamp(360px, 42vw, 500px); scroll-snap-align: start; min-height: 320px;
  position: relative; display: flex; flex-direction: column;
  background: var(--bg-elevated); border: 1px solid var(--border);
  padding: 40px 36px 32px;
  /* rounded on the 3 normal corners; only the top-right is a diagonal fold */
  border-radius: 14px 0 14px 14px;
  clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% 100%, 0 100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease, background 0.3s ease, filter 0.3s ease;
}
/* folded flap in the cut corner — muted grey at rest, emerald on hover */
.tq-fold {
  content: ""; position: absolute; top: -1px; right: -1px;
  width: calc(var(--notch) + 2px); height: calc(var(--notch) + 2px);
  background: #2e2e33;
  transition: background 0.3s ease;
}
.tq-card:hover {
  transform: translateY(-6px);
  border-color: rgba(52, 211, 153, 0.35); background: var(--bg-raised);
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 8px rgba(52, 211, 153, 0.14));
}
.tq-card:hover .tq-fold { background: linear-gradient(135deg, var(--accent), #0f766e); }

.tq-text {
  margin: 0; font-family: var(--f-display); font-weight: 400;
  font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.45rem); line-height: 1.55;
  color: rgba(255, 255, 255, 0.9);
}
.tq-prompt { font-family: var(--f-mono); color: rgba(52, 211, 153, 0.7); }
.quote-foot { display: flex; align-items: center; gap: 13px; margin-top: auto;
  padding-top: 24px; border-top: 1px solid var(--border); }
.quote-avatar {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 7px;
  display: grid; place-items: center; font-family: var(--f-mono);
  font-weight: 700; font-size: 0.74rem; color: var(--accent);
  background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.35);
}
.quote-name {
  font-family: var(--f-mono); font-weight: 500; font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.7); display: flex; align-items: center; gap: 6px;
}
.quote-name .verified { color: var(--accent); font-size: 0.78rem; }
.quote-meta { font-family: var(--f-mono); font-size: 0.72rem; color: var(--text-3); margin-top: 3px; }
.quotes-note { font-size: 0.82rem; color: var(--text-3); margin-top: 8px; font-family: var(--f-mono); }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(28px, 5vw, 56px); }
.form {
  display: grid; gap: 16px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(22px, 3vw, 32px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form:hover, .form:focus-within {
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.12), 0 0 30px rgba(52, 211, 153, 0.05);
}
#form-send { justify-self: start; width: auto; padding: 14px 34px; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-family: var(--f-mono); font-size: 0.76rem; color: var(--text-2); }
.field label b { color: var(--accent); font-weight: 400; }
.field input, .field textarea {
  background: var(--bg-subtle); border: 1px solid var(--border);
  color: var(--text); font-family: var(--f-body); font-size: 0.95rem;
  padding: 13px 15px; border-radius: 10px; width: 100%;
  transition: border-color 0.2s ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 130px; }
.form-status { font-family: var(--f-mono); font-size: 0.84rem; min-height: 1.4em; }
.form-status.ok { color: var(--accent); }
.form-status.err { color: #f87171; }
.hp { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

.contact-side { display: grid; gap: 14px; align-content: start; }
.contact-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  color: var(--text);
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
/* left accent bar grows up on hover */
.contact-card::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent); transform: scaleY(0); transform-origin: bottom;
  transition: transform 0.3s ease;
}
.contact-card:hover {
  border-color: var(--accent); transform: translateX(6px);
  background: var(--bg-raised); color: var(--text);
}
.contact-card:hover::after { transform: scaleY(1); }
.contact-card .ic {
  font-family: var(--f-mono); color: var(--accent); font-size: 1.1rem; width: 26px;
  text-align: center; transition: transform 0.3s ease;
}
.contact-card:hover .ic { transform: scale(1.22); }
.contact-card b { display: block; font-size: 0.92rem; font-weight: 600; }
.contact-card span { font-size: 0.82rem; color: var(--text-2); font-family: var(--f-mono); }
.contact-avail {
  font-family: var(--f-mono); font-size: 0.8rem; color: var(--accent);
  border: 1px dashed rgba(52, 211, 153, 0.4); border-radius: var(--radius);
  padding: 14px 18px; text-align: center; background: var(--accent-dim);
}

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); padding: 34px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  align-items: center; }
.footer-inner p { font-size: 0.84rem; color: var(--text-3); font-family: var(--f-mono); }
.footer-links { display: flex; gap: 12px; }
.footer-links a {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--text-2); background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.footer-links a svg { width: 18px; height: 18px; }
.footer-links a:hover {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-dim); transform: translateY(-2px);
}

/* ---------- floating action buttons (WhatsApp / Book call / Email) ---------- */
.fab-stack {
  position: fixed; right: 22px; bottom: 22px; z-index: 70;
  display: flex; flex-direction: column; gap: 12px; align-items: flex-end;
}
.fab {
  display: inline-flex; align-items: center; height: 52px; border-radius: 999px;
  cursor: pointer; overflow: hidden; padding: 0; border: 1px solid var(--border-strong);
  background: var(--bg-elevated); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.fab-icon { width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; }
.fab-icon svg { width: 23px; height: 23px; }
.fab-label {
  font-family: var(--f-body); font-weight: 600; font-size: 0.9rem; white-space: nowrap;
  max-width: 0; opacity: 0; padding-left: 0; overflow: hidden;
  transition: max-width 0.34s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease, padding 0.34s ease;
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); }
.fab:hover .fab-label { max-width: 170px; opacity: 1; padding-left: 18px; }
.fab:focus-visible .fab-label { max-width: 170px; opacity: 1; padding-left: 18px; }
/* WhatsApp — brand green */
.fab-wa { background: #25d366; border-color: #25d366; }
.fab-wa .fab-icon svg { fill: #0a0f0d; }
.fab-wa .fab-label { color: #0a0f0d; }
/* Book a call — emerald accent (primary action) */
.fab-call { background: var(--accent); border-color: var(--accent); }
.fab-call .fab-icon svg { stroke: var(--on-accent); }
.fab-call .fab-label { color: var(--on-accent); }
/* Email — muted brick red (visible, not loud) */
.fab-mail { background: #9c4038; border-color: #9c4038; }
.fab-mail .fab-icon svg { stroke: #f0dedb; }
.fab-mail .fab-label { color: #f0dedb; }
.fab-mail:hover { background: #b04a41; border-color: #b04a41; }
@media (prefers-reduced-motion: reduce) { .fab, .fab-label { transition: none; } }

/* ---------- spotlight cards (hover devices) ---------- */
.spot { position: relative; }
.spot .spot-glow {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  pointer-events: none; opacity: 0; transition: opacity 0.35s ease; z-index: 0;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%),
    rgba(52, 211, 153, 0.16), transparent 42%);
}
@media (hover: hover) and (pointer: fine) {
  .spot:hover .spot-glow { opacity: 1; }
}
.spot > *:not(.spot-glow):not(.card-top) { position: relative; z-index: 1; }

/* ---------- ghost index numeral (subtle, top-right of each section) ---------- */
section { position: relative; overflow: hidden; }
.ghost {
  position: absolute; top: 64px; right: 0; z-index: -1;
  font-family: var(--f-mono); font-weight: 700;
  font-size: clamp(4.5rem, 9vw, 8rem); line-height: 1;
  color: rgba(255, 255, 255, 0.035);
  pointer-events: none; user-select: none;
}

/* ---------- experience timeline draw ---------- */
.t-line {
  position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px;
  background: var(--border);
}
.t-line i {
  position: absolute; inset: 0; background: linear-gradient(var(--accent), var(--accent-bright));
  transform: scaleY(0); transform-origin: 0 0; display: block;
}
html.no-gsap .t-line i { transition: transform 1.4s ease-out; }

/* ---------- auto-typing terminal lines ---------- */
.project-term-body .tl { min-height: 1.65em; }
.project-term-body .tl.typing::after {
  content: "▌"; color: var(--accent-bright);
  animation: blink 0.9s steps(1) infinite;
}
.term-title {
  margin-left: auto; font-style: normal; font-family: var(--f-mono);
  font-size: 0.68rem; color: var(--text-3); align-self: center;
}
.project-term .boot-bar { display: flex; align-items: center; }

/* ---------- touch feel ---------- */
a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
  .btn:active, .card:active, .contact-card:active, .chat-chip:active { transform: scale(0.97); }
}

/* ---------- reveal system (opt-in motion) ---------- */
.reveal { opacity: 1; } /* motionless base = reduced-motion default */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(26px);
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
  .reveal.visible { opacity: 1; transform: none; }
  .stagger > .reveal:nth-child(2) { transition-delay: 0.07s; }
  .stagger > .reveal:nth-child(3) { transition-delay: 0.14s; }
  .stagger > .reveal:nth-child(4) { transition-delay: 0.21s; }
  .stagger > .reveal:nth-child(5) { transition-delay: 0.28s; }
  .stagger > .reveal:nth-child(6) { transition-delay: 0.35s; }
}
/* global reduced-motion safety net (0.01ms so *end events still fire) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* testing hook (?flat): collapse vh sizing for full-page captures */
html.flat section.hero { min-height: auto; }

/* ---------- noscript ---------- */
.noscript-box { max-width: 640px; margin: 15vh auto; padding: 32px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg); text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .services-grid { grid-template-columns: 1fr 1fr; }
  .quotes { grid-template-columns: 1fr; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .project { grid-template-columns: 1fr; }
  .project:nth-child(even) .project-term { order: 0; }
  .metrics { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .nav-links { position: fixed; inset: 57px 0 auto 0; background: rgba(18,18,18,0.97);
    backdrop-filter: blur(12px); flex-direction: column; gap: 0; padding: 10px 0 18px;
    border-bottom: 1px solid var(--border); display: none; }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; text-align: center; }
  .nav-links a { display: block; padding: 13px 0; font-size: 1rem; }
  .nav-burger { display: block; }
  .nav-cta { display: none; }
  .services-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero { padding-top: 96px; min-height: 88vh; }
}
