/* ============ Tokens ============ */
:root {
  --bg: #0b0f14;
  --bg-2: #10161d;
  --surface: #141b23;
  --surface-2: #1a232d;
  --line: rgba(148, 170, 196, 0.16);
  --line-strong: rgba(148, 170, 196, 0.32);
  --text: #dfe6ee;
  --text-dim: #a9b4c2;
  --muted: #7d8a9a;
  --accent: #6cb6ff;
  --accent-2: #3d8fe0;
  --green: #3fb950;
  --amber: #d6a23a;
  --red: #e5534b;
  --code-key: #e39a6b;
  --code-str: #b5d38a;
  --code-fn: #79c0ff;
  --code-com: #6b7889;
  --code-num: #d2a8ff;

  --f-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;
  --nav-h: 68px;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 16px/1.65 var(--f-body);
  color: var(--text);
  background-color: var(--bg);
  /* brushed-metal texture from the mockup */
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px),
    radial-gradient(1200px 600px at 75% -10%, rgba(108,182,255,0.07), transparent 60%);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
pre { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 14px; background: var(--accent); color: #04121f; border-radius: 6px; }
.skip:focus { left: 8px; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--f-mono); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #03111f; box-shadow: 0 8px 28px -10px rgba(108,182,255,.7); }
.btn-primary:hover { background: #8cc6ff; }
.btn-ghost { border-color: var(--line-strong); background: rgba(255,255,255,0.02); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-small { min-height: 40px; font-size: 14px; background: var(--surface-2); border-color: var(--line-strong); width: 100%; }
.btn-small:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }

/* ============ Nav ============ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background-color .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(11, 15, 20, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.nav-inner { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-family: var(--f-mono); font-weight: 500; font-size: 18px; letter-spacing: .04em; display: flex; }
.brand-mark { color: var(--text); }
.brand-cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav-links { display: flex; gap: clamp(18px, 3vw, 36px); }
.nav-links a {
  font-family: var(--f-display); font-weight: 600; font-size: 19px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-dim); position: relative; padding: 6px 0; transition: color .2s;
}
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-links a.active::after { transform: scaleX(1); }
.nav-tools { display: flex; align-items: center; gap: 8px; }
.icon-link, .lang-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--text-dim); transition: color .2s, background-color .2s; }
.icon-link svg { width: 20px; height: 20px; }
.icon-link:hover, .lang-btn:hover { color: var(--accent); background: rgba(108,182,255,.08); }
.lang-btn { background: none; border: 1px solid var(--line-strong); font: 600 12px var(--f-mono); cursor: pointer; }
.menu-btn { display: none; width: 40px; height: 40px; background: none; border: 0; cursor: pointer; position: relative; }
.menu-btn span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--text); transition: transform .25s ease; }
.menu-btn span:first-child { top: 15px; }
.menu-btn span:last-child { top: 23px; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
.mobile-menu { display: grid; padding: 8px var(--gutter) 20px; background: rgba(11,15,20,.96); border-bottom: 1px solid var(--line); }
.mobile-menu[hidden] { display: none; }
.mobile-menu a { font-family: var(--f-display); font-size: 24px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* ============ Hero ============ */
.hero { position: relative; min-height: max(640px, min(100svh, 980px)); padding: calc(var(--nav-h) + 40px) 0 0; display: flex; flex-direction: column; overflow: hidden; isolation: isolate; }
.circuits { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.circuits path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.circuit-base path { stroke: rgba(108,182,255,.13); stroke-width: 1.5; }
.circuit-nodes circle { fill: var(--bg); stroke: rgba(108,182,255,.45); stroke-width: 1.5; }
.circuit-glow path { stroke: var(--accent); stroke-width: 2; filter: drop-shadow(0 0 6px rgba(108,182,255,.9)); }

.hero-inner { max-width: var(--max); width: 100%; margin: 0 auto; padding: 0 var(--gutter); flex: 1; display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; gap: clamp(24px, 4vw, 60px); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 500 13px var(--f-mono); color: var(--text-dim); padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.02); margin-bottom: 26px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(63,185,80,.6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(63,185,80,0); } 100% { box-shadow: 0 0 0 0 rgba(63,185,80,0); } }
.hero-title { font-family: var(--f-display); font-weight: 600; text-transform: uppercase; font-size: clamp(38px, 4.4vw, 64px); line-height: 1.02; letter-spacing: .005em; }
.hero-title .ln { display: block; opacity: 0; transform: translateY(24px); animation: rise .8s cubic-bezier(.2,.7,.2,1) forwards; }
.hero-title .ln-1 { color: #f1f5f9; }
.hero-title .ln-2 { color: var(--text-dim); animation-delay: .12s; }
.hero-title .ln-3 { color: var(--text-dim); animation-delay: .24s; }
@keyframes rise { to { opacity: 1; transform: none; } }
.tagline { margin-top: 14px; font-family: var(--f-display); font-weight: 500; text-transform: uppercase; font-size: clamp(20px, 2.2vw, 28px); letter-spacing: .04em; color: var(--muted); }
.hero-lead { margin-top: 22px; max-width: 52ch; color: var(--text-dim); font-size: 17px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.code-card, .float-code {
  font: 400 13.5px/1.6 var(--f-mono);
  background: linear-gradient(180deg, rgba(26,35,45,.88), rgba(16,22,29,.88));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.06);
  white-space: pre; overflow: hidden; color: var(--text-dim);
}
.code-card--hero { margin-top: 34px; width: max-content; max-width: 100%; }

.hero-visual { position: relative; height: min(640px, 72vh); min-height: 440px; display: grid; place-items: center; }
.mosaic { position: relative; width: min(100%, 460px); aspect-ratio: 4 / 5; }
.tile {
  position: absolute; border-radius: 6px; overflow: hidden;
  background-repeat: no-repeat;
  border: 1px solid rgba(200, 220, 240, .28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), inset 0 0 18px rgba(255,255,255,.06), 0 10px 26px -12px rgba(0,0,0,.8);
  opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.85);
  transition: opacity .7s ease, transform 1s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--delay);
}
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.14), transparent 40%, rgba(8,14,22,.25)); pointer-events: none; }
.mosaic.ready .tile { opacity: 1; transform: translate(var(--ox), var(--oy)); }
.tile.glass { background-image: none !important; background: rgba(120,150,180,.06); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.mosaic::after { content: ""; position: absolute; inset: -2px; background: linear-gradient(0deg, var(--bg) 0%, transparent 18%); pointer-events: none; }

.float-code { position: absolute; font-size: 12px; padding: 10px 14px; animation: float 7s ease-in-out infinite; z-index: 2; }
.fc-1 { top: 6%; right: -2%; }
.fc-2 { left: -4%; top: 44%; animation-delay: -2s; }
.fc-3 { right: 0; bottom: 12%; animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-10px); } }

.stats { max-width: var(--max); width: calc(100% - 2 * var(--gutter)); margin: 30px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: rgba(16,22,29,.75); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.stats li { padding: 22px 24px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; border-right: 1px solid var(--line); }
.stats li:last-child { border-right: 0; }
.stats strong { font: 600 34px/1 var(--f-display); color: #f1f5f9; }
.stats .plus { font: 600 26px/1 var(--f-display); color: var(--accent); margin-left: -6px; }
.stats span:not(.plus) { width: 100%; font-size: 13.5px; color: var(--muted); }

/* ============ Code highlighting ============ */
.hl .k { color: var(--code-key); }
.hl .s { color: var(--code-str); }
.hl .f { color: var(--code-fn); }
.hl .c { color: var(--code-com); font-style: italic; }
.hl .n { color: var(--code-num); }
.hl .t { color: #7ee0c3; }

/* ============ Sections ============ */
.section { padding: clamp(72px, 10vw, 120px) 0; position: relative; }
.section-head { margin-bottom: 44px; max-width: 720px; }
.section-head--center { text-align: center; margin-inline: auto; margin-bottom: 28px; }
.kicker { font: 500 13px var(--f-mono); color: var(--accent); margin-bottom: 10px; }
.section h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(32px, 4.2vw, 50px); letter-spacing: .01em; color: #eef2f6; }
.section-sub { margin-top: 14px; color: var(--text-dim); font-size: 17px; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font: 500 12px var(--f-mono); color: var(--text-dim); padding: 4px 10px; border-radius: 999px; background: rgba(108,182,255,.07); border: 1px solid rgba(108,182,255,.18); }

/* Services */
.services { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-top: 1px solid var(--line); }
.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.service { padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; transition: border-color .25s, transform .25s; }
.service:hover { border-color: rgba(108,182,255,.45); transform: translateY(-4px); }
.service:nth-child(2) { transition-delay: .08s; }
.service:nth-child(3) { transition-delay: .16s; }
.service:nth-child(4) { transition-delay: .24s; }
.service-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: rgba(108,182,255,.1); color: var(--accent); }
.service-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.service h3 { font-family: var(--f-display); font-size: 24px; font-weight: 600; letter-spacing: .01em; }
.service p { color: var(--text-dim); font-size: 15px; flex: 1; }

/* Showcase: proyectos en producción */
.showcase { border-top: 1px solid var(--line); }
.show-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.show-grid .wcard:nth-child(even) { transition-delay: .1s; }
.wcard { border-radius: calc(var(--radius) + 4px); background: var(--surface); border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; transition: border-color .3s, opacity .8s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.wcard:hover { border-color: color-mix(in srgb, var(--c) 55%, transparent); transform: translateY(-4px); }
.devices {
  position: relative; padding: 28px 13% 34px 28px;
  background:
    radial-gradient(70% 80% at 70% 100%, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%),
    linear-gradient(180deg, var(--surface-2), #0d1319);
  border-bottom: 1px solid var(--line);
}
.browser { border-radius: 10px; overflow: hidden; border: 1px solid var(--line-strong); background: #0d1319; box-shadow: var(--shadow); }
.browser-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.browser-bar .url { flex: 1; min-width: 0; font: 11.5px var(--f-mono); color: var(--muted); background: #0d1319; border-radius: 6px; padding: 3px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #fff; }
.screen img { position: absolute; top: 0; left: 0; width: 100%; height: auto; transform: translateY(0); transition: transform var(--dur, 6s) cubic-bezier(.45,.05,.4,1); will-change: transform; }
.wcard:hover .screen img, .wcard:focus-within .screen img { transform: translateY(var(--dist, 0)); transition-duration: var(--dur, 6s); }
.phone {
  position: absolute; right: 22px; bottom: 18px; width: 23%; aspect-ratio: 390 / 844;
  border-radius: 18px; overflow: hidden; background: #000;
  border: 5px solid #05080b; outline: 1px solid var(--line-strong);
  box-shadow: 0 24px 40px -14px rgba(0,0,0,.85);
  transition: transform .45s cubic-bezier(.2,.7,.2,1);
}
.phone::before { content: ""; position: absolute; z-index: 1; top: 5px; left: 50%; width: 32%; height: 9px; transform: translateX(-50%); border-radius: 999px; background: #05080b; }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.wcard:hover .phone { transform: translateY(-8px) rotate(-2deg); }
.wcard-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.wcard-cat { font: 500 12px var(--f-mono); color: var(--c); text-transform: uppercase; letter-spacing: .08em; filter: brightness(1.25); }
.wcard-body h3 { font-family: var(--f-display); font-weight: 600; font-size: 28px; letter-spacing: .01em; }
.wcard-body > p:not(.wcard-cat) { color: var(--text-dim); font-size: 15px; flex: 1; }
.live-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-strong); font-weight: 600; font-size: 14px; transition: border-color .2s, color .2s, background-color .2s; }
.live-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.live-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(108,182,255,.06); }

/* Skills */
.skills { border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
.skill-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.skill { padding: 22px 24px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 10px; align-content: start; transition: border-color .25s; }
.skill:hover { border-color: rgba(108,182,255,.45); }
.skill:nth-child(3n+2) { transition-delay: .08s; }
.skill:nth-child(3n) { transition-delay: .16s; }
.skill-path { font: 500 12.5px var(--f-mono); color: var(--accent); }
.skill h3 { font-family: var(--f-display); font-weight: 600; font-size: 24px; letter-spacing: .01em; }

/* Work + carousel */
.work-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.carousel { position: relative; }
.car-track {
  display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 10px calc(50% - min(380px, 82vw) / 2) 18px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.car-track::-webkit-scrollbar { display: none; }
.pcard {
  flex: 0 0 min(380px, 82vw); scroll-snap-align: center;
  border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; transition: transform .4s ease, border-color .3s, opacity .4s;
  transform: scale(.94); opacity: .55;
}
.pcard.active { transform: none; opacity: 1; border-color: rgba(108,182,255,.55); box-shadow: 0 24px 60px -24px rgba(108,182,255,.35); }
.pcard-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); font: 12px var(--f-mono); color: var(--muted); }
.pcard-dots { display: flex; gap: 5px; }
.pcard-dots i { width: 9px; height: 9px; border-radius: 50%; background: #3a4552; }
.pcard-dots i:first-child { background: #e5534b; } .pcard-dots i:nth-child(2) { background: #d6a23a; } .pcard-dots i:last-child { background: #3fb950; }
.pcard-file { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-code { font: 12px/1.75 var(--f-mono); padding: 10px 0; background: #0d1319; color: var(--text-dim); overflow: hidden; white-space: pre; min-height: 190px; }
.pcard-code .line { display: block; padding: 0 14px 0 0; }
.pcard-code .ln-no { display: inline-block; width: 34px; text-align: right; padding-right: 12px; color: #48535f; user-select: none; }
.pcard-code .line.add { background: rgba(63,185,80,.14); box-shadow: inset 3px 0 0 var(--green); }
.pcard-code .line.del { background: rgba(229,83,75,.14); box-shadow: inset 3px 0 0 var(--red); }
.pcard-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pcard-body h3 { font-size: 18px; font-weight: 600; font-family: var(--f-body); line-height: 1.3; }
.pcard-body p { font-size: 14.5px; color: var(--text-dim); flex: 1; }
.pcard-actions { display: flex; gap: 8px; margin-top: 4px; }
.tag-btn { font: 500 13px var(--f-mono); padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text); transition: border-color .2s, color .2s; }
.tag-btn:hover { border-color: var(--accent); color: var(--accent); }

.car-btn { position: absolute; top: 40%; z-index: 3; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(26,35,45,.92); color: var(--text); cursor: pointer; display: grid; place-items: center; transition: background-color .2s, border-color .2s; }
.car-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.car-btn:hover { border-color: var(--accent); color: var(--accent); }
.car-btn:disabled { opacity: .35; cursor: default; }
.car-prev { left: 6px; } .car-next { right: 6px; }
.car-dots { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.car-dots button { width: 8px; height: 8px; border-radius: 999px; border: 0; padding: 0; background: #3a4552; cursor: pointer; transition: width .3s, background-color .3s; }
.car-dots button[aria-selected="true"] { width: 24px; background: var(--accent); }

/* Lab / SEO insights */
.lab { position: sticky; top: calc(var(--nav-h) + 16px); background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.lab-head h2 { font-size: 30px; }
.lab-head p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.metric { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; background: rgba(13,19,25,.7); }
.metric-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 600; font-size: 15px; }
.metric-top strong { font: 600 20px var(--f-display); letter-spacing: .02em; }
.ok { color: var(--green); } .warn { color: var(--amber); } .bad { color: var(--red); }
.spark { width: 100%; height: 64px; margin-top: 8px; overflow: visible; }
.spark-axis { display: flex; justify-content: space-between; font: 10.5px var(--f-mono); color: var(--muted); margin-top: 4px; }
.bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; height: 104px; margin-top: 10px; align-items: end; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar i { width: 100%; border-radius: 4px 4px 2px 2px; background: var(--green); height: 0; transition: height 1s cubic-bezier(.2,.7,.2,1); min-height: 4px; }
.bar i.warn { background: var(--amber); } .bar i.bad { background: var(--red); } .bar i.na { background: #2a333d; }
.bar span { font: 10.5px var(--f-mono); color: var(--muted); text-align: center; line-height: 1.25; }
.bar b { font: 500 10px var(--f-mono); color: var(--text-dim); }
.checks { margin-top: 10px; display: grid; gap: 6px; font-size: 13px; color: var(--text-dim); }
.checks li { display: flex; gap: 8px; align-items: flex-start; }
.checks li::before { content: "✓"; color: var(--green); font-weight: 700; }
.checks li.fail::before { content: "✕"; color: var(--red); }

/* Case studies: cascading fold */
.cases { background: linear-gradient(180deg, var(--bg), var(--bg-2)); border-top: 1px solid var(--line); }
.case-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.case { perspective: 1200px; display: flex; flex-direction: column; }
.case:target .fold-head { border-color: var(--accent); }
.fold-panel {
  background: var(--surface); border: 1px solid var(--line); padding: 18px 20px;
  transform-origin: top center; transform: rotateX(-92deg); opacity: 0;
  transition: transform .7s cubic-bezier(.3,.8,.3,1), opacity .5s ease;
  backface-visibility: hidden;
}
.fold-panel + .fold-panel { border-top: 0; }
.fold-panel:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.fold-panel:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.case.open .fold-panel { transform: none; opacity: 1; }
.case.open .fold-panel:nth-child(2) { transition-delay: .18s; }
.case.open .fold-panel:nth-child(3) { transition-delay: .36s; }
.case.open .fold-panel:nth-child(4) { transition-delay: .54s; }
.fold-head { display: flex; gap: 14px; align-items: flex-start; background: var(--surface-2); }
.case-num { font: 600 34px/1 var(--f-display); color: var(--accent); }
.fold-head h3 { font-family: var(--f-display); font-weight: 600; font-size: 24px; }
.case-meta { font: 12px var(--f-mono); color: var(--muted); margin-top: 6px; }
.fold-panel h4 { font: 500 12px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.fold-panel p { font-size: 15px; color: var(--text-dim); }
.fold-result { background: linear-gradient(180deg, rgba(63,185,80,.08), var(--surface)); flex: 1; }
.fold-result h4 { color: var(--green); }

/* Bio */
.bio-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.bio-intro > p:not(.kicker) { color: var(--text-dim); margin-top: 18px; font-size: 16.5px; }
.bio-intro h2 { max-width: 16ch; }
.bio-actions { margin-top: 26px; }
.certs { margin-top: 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.certs li { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); display: grid; gap: 4px; }
.certs strong { font-size: 14.5px; }
.certs span { font-size: 12.5px; color: var(--muted); }
.timeline { position: relative; padding-left: 28px; display: grid; gap: 28px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, var(--accent), rgba(108,182,255,.05)); }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -28px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.tl-date { font: 12.5px var(--f-mono); color: var(--accent); }
.timeline h3 { font-size: 18px; font-weight: 600; margin-top: 4px; line-height: 1.35; }
.timeline p { color: var(--text-dim); font-size: 15px; margin-top: 6px; }

/* Contact */
.contact { border-top: 1px solid var(--line); background: radial-gradient(800px 400px at 20% 0%, rgba(108,182,255,.08), transparent 70%), var(--bg-2); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
.contact-copy > p { color: var(--text-dim); margin-top: 16px; font-size: 17px; max-width: 46ch; }
.process { margin-top: 30px; display: grid; gap: 16px; }
.process li { display: flex; gap: 14px; }
.process li > span { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 600 13px var(--f-mono); color: var(--accent); border: 1px solid rgba(108,182,255,.4); }
.process strong { font-size: 16px; }
.process p { font-size: 14.5px; color: var(--muted); }
.channels { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.channel { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line-strong); font-weight: 500; font-size: 14.5px; transition: border-color .2s, color .2s; }
.channel svg { width: 18px; height: 18px; }
.channel:hover { border-color: var(--accent); color: var(--accent); }

.form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); display: grid; gap: 16px; box-shadow: var(--shadow); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text-dim); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: #0d1319; color: var(--text); font-size: 15px; font-weight: 400; transition: border-color .2s, box-shadow .2s;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,182,255,.18); }
.field .invalid { border-color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { font-size: 14px; min-height: 1.4em; color: var(--text-dim); }
.form-status.ok { color: var(--green); } .form-status.bad { color: var(--red); }

.footer { border-top: 1px solid var(--line); padding: 26px 0; color: var(--muted); font-size: 13.5px; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ============ Responsive ============ */
@media (max-width: 1080px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .lab { position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lab-head, .lab .btn { grid-column: 1 / -1; }
  .case-list { grid-template-columns: 1fr; max-width: 680px; }
}
@media (max-width: 880px) {
  .nav-links, .nav-tools .icon-link { display: none; }
  .menu-btn { display: block; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; height: auto; min-height: 0; }
  .mosaic { width: min(78vw, 340px); }
  .fc-1 { right: 0; top: 2%; } .fc-2 { left: 0; } .fc-3 { display: none; }
  .code-card--hero { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats li:nth-child(2) { border-right: 0; }
  .stats li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .bio-grid, .contact-grid, .show-grid { grid-template-columns: 1fr; }
  .lab { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .service-grid, .field-row, .certs, .skill-grid { grid-template-columns: 1fr; }
  .devices { padding: 18px 16% 24px 16px; }
  .phone { right: 12px; bottom: 12px; border-width: 4px; border-radius: 14px; }
  .float-code { font-size: 10.5px; padding: 8px 10px; }
  .fc-2 { display: none; }
  .car-btn { display: none; }
  .stats li { padding: 16px; }
  .stats strong { font-size: 28px; }
  .hero-cta .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
  .car-track { scroll-behavior: auto; }
}
