/* LeetApps — one-page site */
:root {
  --bg: #07070d;
  --bg-2: #0c0c16;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --text: #eef0ff;
  --muted: #9ba1c0;
  --violet: #8b5cff;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --lime: #b6ff3c;
  --pink: #ff4fd8;
  --grad: linear-gradient(100deg, #a78bfa 0%, #6d8bff 40%, #22d3ee 75%, #b6ff3c 110%);
  --radius: 22px;
  --wrap: 1200px;
  --font-display: "Space Grotesk", "Inter", var(--font-cjk), system-ui, sans-serif;
  --font-body: "Inter", var(--font-cjk), system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-cjk: "Noto Sans";
  color-scheme: dark;
}
html[lang="ko"] { --font-cjk: "Noto Sans KR"; }
html[lang="zh"] { --font-cjk: "Noto Sans SC"; }
html[lang="ja"] { --font-cjk: "Noto Sans JP"; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[lang="ko"] body { word-break: keep-all; }
html[lang="zh"] body, html[lang="ja"] body { line-break: strict; overflow-wrap: anywhere; }
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
.mono { font-family: var(--font-mono); }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }

/* Background layers */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; }
.noise {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 24px; border-radius: 999px;
  font: 600 15px/1 var(--font-body); border: 1px solid transparent; cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
  white-space: nowrap;
}
.btn svg { transition: transform .25s ease; }
.btn:hover svg { transform: translateX(3px); }
.btn-primary {
  color: #0a0a12;
  background: linear-gradient(100deg, #c4b5fd, #7dd3fc 60%, #d9ff8a);
  box-shadow: 0 10px 40px -10px rgba(139, 92, 255, .7), inset 0 1px 0 rgba(255,255,255,.6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 50px -10px rgba(34, 211, 238, .7), inset 0 1px 0 rgba(255,255,255,.6); }
.btn-ghost { color: var(--text); border-color: var(--line-2); background: rgba(255,255,255,.03); backdrop-filter: blur(10px); }
.btn-ghost:hover { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.07); }
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-block { width: 100%; }

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(7, 7, 13, .72); backdrop-filter: blur(18px) saturate(140%); border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 500 21px/1 var(--font-display); letter-spacing: -.03em; }
.brand b { font-weight: 700; }
.nav-links { display: flex; gap: 6px; margin-left: auto; }
.nav-links a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 15px; transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.lang { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  font: 600 13px/1 var(--font-mono); cursor: pointer; transition: border-color .2s, background .2s;
}
.lang-btn:hover, .lang.open .lang-btn { border-color: var(--line-2); background: var(--surface-2); }
.lang .chev { transition: transform .2s; opacity: .7; }
.lang.open .chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 180px; margin: 0; padding: 6px; list-style: none;
  background: rgba(16, 16, 28, .96); backdrop-filter: blur(20px); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.8);
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.lang.open .lang-menu { opacity: 1; transform: none; pointer-events: auto; }
.lang-menu button {
  display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 10px 12px; border: 0; border-radius: 10px;
  background: none; color: var(--muted); font: 500 14px/1.2 var(--font-body); text-align: left; cursor: pointer;
}
.lang-menu button:hover { background: var(--surface-2); color: var(--text); }
.lang-menu button[aria-selected="true"] { color: var(--text); }
.lang-menu button[aria-selected="true"]::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }

.burger { display: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; position: relative; }
.burger span { position: absolute; left: 12px; right: 12px; height: 1.6px; background: var(--text); transition: transform .25s, top .25s; }
.burger span:first-child { top: 15px; } .burger span:last-child { top: 23px; }
.nav.menu-open .burger span:first-child { top: 19px; transform: rotate(45deg); }
.nav.menu-open .burger span:last-child { top: 19px; transform: rotate(-45deg); }

/* Hero */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 120px 0 90px; }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: #d6d9f5; font-size: 13px; font-weight: 500;
  backdrop-filter: blur(10px);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(182,255,60,.15), 0 0 14px var(--lime); }
h1 { margin: 26px 0 22px; font-size: clamp(42px, 6.4vw, 84px); line-height: 1.0; font-weight: 700; letter-spacing: -.045em; }
h1 span { display: block; }
html[lang="ko"] h1, html[lang="zh"] h1, html[lang="ja"] h1 { line-height: 1.18; letter-spacing: -.02em; font-size: clamp(34px, 5vw, 66px); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: shine 8s ease-in-out infinite alternate; }
@keyframes shine { to { background-position: 100% 0; } }
.lead { max-width: 560px; font-size: clamp(17px, 1.5vw, 19px); color: #b9bedb; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 38px 0 0; list-style: none; color: var(--muted); font-size: 14px; }
.chips li { display: inline-flex; align-items: center; gap: 8px; }
.chips .ico { font-size: 8px; color: var(--cyan); }

.hero-visual { position: relative; height: 560px; perspective: 1200px; }
.orb {
  position: absolute; inset: 8% 4%; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(139,92,255,.55), transparent 60%), radial-gradient(circle at 70% 65%, rgba(34,211,238,.4), transparent 55%);
  filter: blur(40px); animation: breathe 7s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.08); opacity: .8; } }
.device {
  position: absolute; left: 50%; top: 50%; width: 360px; max-width: 92%;
  transform: translate(-50%, -50%) rotateY(-14deg) rotateX(6deg);
  border-radius: 28px; padding: 14px;
  background: linear-gradient(160deg, rgba(40,40,70,.9), rgba(14,14,26,.95));
  border: 1px solid var(--line-2);
  box-shadow: 0 60px 120px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.04) inset, 0 1px 0 rgba(255,255,255,.18) inset;
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.device-top { display: flex; align-items: center; gap: 6px; padding: 4px 6px 12px; }
.device-top span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.18); }
.device-top span:first-child { background: #ff5f57; } .device-top span:nth-child(2) { background: #febc2e; } .device-top span:nth-child(3) { background: #28c840; }
.device-top em { margin-left: auto; font-style: normal; font: 500 11px/1 var(--font-mono); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.chat { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 18px; background: rgba(5,5,12,.7); border: 1px solid var(--line); }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 13px; line-height: 1.45; }
.msg.me { align-self: flex-end; background: linear-gradient(120deg, var(--violet), var(--blue)); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { background: rgba(255,255,255,.06); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: #dfe2fb; }
.ai-head { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 4px; }
.ai-head img { border-radius: 5px; }
.game { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.game canvas { width: 100%; height: auto; image-rendering: pixelated; }
.game-hud { position: absolute; left: 8px; right: 8px; top: 7px; display: flex; justify-content: space-between; font: 600 10px/1 var(--font-mono); color: #fff; text-shadow: 0 1px 0 #000; letter-spacing: .03em; }
.typing { display: flex; gap: 4px; padding: 6px 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

.glass { background: rgba(18, 18, 32, .7); backdrop-filter: blur(16px); border: 1px solid var(--line-2); box-shadow: 0 20px 50px -20px rgba(0,0,0,.8); }
.float { position: absolute; border-radius: 16px; padding: 12px 16px; animation: bob 6s ease-in-out infinite; }
.f-score { top: 7%; right: 0; display: flex; flex-direction: column; gap: 2px; }
.f-score b { font-size: 22px; background: linear-gradient(90deg, var(--lime), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.f-model { bottom: 9%; left: -2%; display: flex; align-items: center; gap: 10px; animation-delay: -2s; }
.f-pad { bottom: 22%; right: 2%; padding: 12px; border-radius: 18px; animation-delay: -4s; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(182,255,60,.6); animation: ping 2s infinite; }
@keyframes ping { to { box-shadow: 0 0 0 10px rgba(182,255,60,0); } }
@keyframes bob { 50% { transform: translateY(-12px); } }

.scroll-hint { position: absolute; left: 50%; bottom: 26px; width: 24px; height: 38px; margin-left: -12px; border: 1.5px solid var(--line-2); border-radius: 12px; }
.scroll-hint span { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--text); animation: wheel 1.8s infinite; }
@keyframes wheel { to { transform: translateY(12px); opacity: 0; } }

/* Marquee */
.marquee { padding: 26px 0 30px; border-block: 1px solid var(--line); background: rgba(255,255,255,.015); }
.marquee-label { text-align: center; font: 500 12px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.marquee-track { display: flex; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-row { display: flex; flex-shrink: 0; gap: 56px; padding-right: 56px; animation: scroll 40s linear infinite; }
.marquee-row span { font: 600 22px/1 var(--font-display); color: rgba(238,240,255,.42); white-space: nowrap; letter-spacing: -.02em; }
@keyframes scroll { to { transform: translateX(-100%); } }

/* Sections */
.section { padding: 130px 0; scroll-margin-top: 40px; }
.section-head { max-width: 720px; margin-bottom: 56px; }
.kicker { display: inline-block; font: 500 12px/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); margin-bottom: 18px; }
h2 { font-size: clamp(34px, 4.6vw, 58px); line-height: 1.05; font-weight: 700; letter-spacing: -.035em; margin-bottom: 16px; }
html[lang="ko"] h2, html[lang="zh"] h2, html[lang="ja"] h2 { line-height: 1.25; letter-spacing: -.01em; }
.section-head .muted { font-size: 18px; }

/* Bento */
.bento { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  position: relative; overflow: hidden; padding: 30px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  border: 1px solid var(--line);
  transition: border-color .3s, transform .3s;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(139,92,255,.16), transparent 45%);
}
.card:hover { border-color: var(--line-2); }
.card:hover::before { opacity: 1; }
.card h3 { font-size: 24px; margin: 14px 0 10px; }
.card p { color: var(--muted); font-size: 15.5px; }
.card-xl { padding: 0; display: flex; flex-direction: column; }
.card-xl .card-body { padding: 26px 30px 32px; }
.card-art { position: relative; height: 230px; overflow: hidden; border-bottom: 1px solid var(--line); }
.card-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 22px; color: #dfe2fb; }
.tag { white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font: 600 11px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.tag-violet { color: #c4b5fd; background: rgba(139,92,255,.14); border: 1px solid rgba(139,92,255,.3); }
.tag-lime { color: var(--lime); background: rgba(182,255,60,.1); border: 1px solid rgba(182,255,60,.25); }
.tag-cyan { color: var(--cyan); background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.25); }
.tag-pink { color: #ff9be9; background: rgba(255,79,216,.1); border: 1px solid rgba(255,79,216,.25); }

/* Card art: AI network */
.art-ai { background: radial-gradient(ellipse at 50% 120%, rgba(139,92,255,.45), transparent 60%), linear-gradient(180deg, #0e0b22, #0a0a15); }
.art-ai::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 28px 28px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.nodes i { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 6px rgba(139,92,255,.25), 0 0 30px 6px rgba(139,92,255,.8); animation: float-n 6s ease-in-out infinite; z-index: 1; }
.nodes i:nth-child(1) { left: 14%; top: 30%; }
.nodes i:nth-child(2) { left: 32%; top: 62%; animation-delay: -1s; background: var(--cyan); box-shadow: 0 0 0 6px rgba(34,211,238,.2), 0 0 30px 6px rgba(34,211,238,.7); }
.nodes i:nth-child(3) { left: 48%; top: 26%; width: 22px; height: 22px; animation-delay: -2s; }
.nodes i:nth-child(4) { left: 62%; top: 58%; animation-delay: -3s; }
.nodes i:nth-child(5) { left: 78%; top: 34%; animation-delay: -4s; background: var(--cyan); box-shadow: 0 0 0 6px rgba(34,211,238,.2), 0 0 30px 6px rgba(34,211,238,.7); }
.nodes i:nth-child(6) { left: 88%; top: 70%; animation-delay: -5s; width: 9px; height: 9px; }
.nodes i:nth-child(7) { left: 22%; top: 82%; width: 8px; height: 8px; animation-delay: -2.5s; }
@keyframes float-n { 50% { transform: translateY(-10px); } }
.nodes::before { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cg stroke='%23a78bfa' stroke-opacity='.45' stroke-width='.35' fill='none'%3E%3Cpath d='M17 33 L35 65 L51 30 L65 61 L81 37 L91 73'/%3E%3Cpath d='M17 33 L51 30 L81 37'/%3E%3Cpath d='M35 65 L65 61'/%3E%3Cpath d='M25 85 L35 65'/%3E%3C/g%3E%3C/svg%3E") center/100% 100% no-repeat; }

/* Card art: game */
.art-game { background: linear-gradient(180deg, #1a0b2e 0%, #2b0f45 55%, #0b1530 100%); }
.pixels {
  position: absolute; inset: 0;
  background:
    radial-gradient(2px 2px at 20% 30%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 70% 20%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 40% 60%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 85% 55%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 55% 40%, #b6ff3c 50%, transparent 51%);
  background-size: 300px 230px; animation: stars 18s linear infinite;
}
@keyframes stars { to { background-position: -300px 0; } }
.art-game::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 64px;
  background: repeating-linear-gradient(90deg, #6d28d9 0 24px, #7c3aed 24px 48px);
  clip-path: polygon(0 40%, 8% 40%, 8% 10%, 20% 10%, 20% 55%, 34% 55%, 34% 25%, 46% 25%, 46% 60%, 60% 60%, 60% 0, 72% 0, 72% 45%, 86% 45%, 86% 20%, 100% 20%, 100% 100%, 0 100%);
  box-shadow: inset 0 4px 0 rgba(182,255,60,.8);
}
.ship {
  position: absolute; left: 22%; top: 38%; width: 60px; height: 40px; z-index: 1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' shape-rendering='crispEdges'%3E%3Cpath fill='%23b6ff3c' d='M0 3h2v2H0z'/%3E%3Cpath fill='%2322d3ee' d='M2 2h6v4H2z'/%3E%3Cpath fill='%23fff' d='M8 3h2v2H8zM4 1h2v1H4zM4 6h2v1H4z'/%3E%3Cpath fill='%238b5cff' d='M10 3.5h2v1h-2z'/%3E%3C/svg%3E") center/contain no-repeat;
  filter: drop-shadow(0 0 12px rgba(34,211,238,.8)); animation: fly 5s ease-in-out infinite;
}
@keyframes fly { 50% { transform: translate(120px, -22px); } }

/* Work */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.work { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); transition: transform .4s cubic-bezier(.2,.8,.2,1), border-color .3s; }
.work:hover { transform: translateY(-6px); border-color: var(--line-2); }
.work-art { position: relative; height: 330px; overflow: hidden; }
.work-meta { padding: 24px 26px 28px; }
.work-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.work h3 { font-size: 24px; }
.work p { color: var(--muted); font-size: 15px; }

/* Work: Flerkin parallax scene (layers + 24-frame run cycle from the game's assets) */
.work-wide { grid-column: span 2; }
.w-flerkin { background: #0d2a2c; isolation: isolate; }
.px { position: absolute; left: 0; right: 0; background-repeat: repeat-x; background-size: auto 100%; animation: px-scroll linear infinite; }
.px-far { top: -8%; bottom: -8%; background-image: url("../work/flerkin/far_forest.webp"); animation-duration: 90s; }
.px-mid { bottom: 18%; height: 70%; background-image: url("../work/flerkin/mid_trees.webp"); background-size: auto 100%; animation-duration: 40s; opacity: .95; }
.px-vine { top: -6%; height: 60%; background-image: url("../work/flerkin/vine_curtain.webp"); background-size: auto 100%; background-position: 0 0; animation-duration: 26s; opacity: .85; }
.px-under { bottom: -4%; height: 42%; background-image: url("../work/flerkin/understory_band.webp"); background-size: auto 100%; animation-duration: 9s; z-index: 2; }
/* --dist is one tile width, set by main.js so the loop is seamless */
@keyframes px-scroll { to { background-position-x: var(--dist, -1200px); } }
.w-flerkin::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(ellipse at 30% 10%, rgba(255,230,160,.18), transparent 55%), linear-gradient(180deg, transparent 60%, rgba(5,12,14,.55)); }
.flerkin-run {
  position: absolute; left: 38%; bottom: 9%; z-index: 1; width: 112px; height: 121px;
  background: url("../work/flerkin/run.webp") 0 0 / 2688px 121px no-repeat;
  animation: run-cycle .85s steps(24) infinite, run-bob 3.4s ease-in-out infinite;
  filter: drop-shadow(0 8px 6px rgba(0,0,0,.45));
}
@keyframes run-cycle { to { background-position-x: -2688px; } }
@keyframes run-bob { 50% { transform: translateX(26px); } }
.fireflies i { position: absolute; z-index: 3; width: 4px; height: 4px; border-radius: 50%; background: #e9ff9a; box-shadow: 0 0 10px 3px rgba(220,255,120,.7); animation: firefly 7s ease-in-out infinite; }
.fireflies i:nth-child(1) { left: 12%; top: 40%; }
.fireflies i:nth-child(2) { left: 26%; top: 22%; animation-delay: -2s; }
.fireflies i:nth-child(3) { left: 58%; top: 34%; animation-delay: -4s; }
.fireflies i:nth-child(4) { left: 72%; top: 52%; animation-delay: -1s; }
.fireflies i:nth-child(5) { left: 86%; top: 26%; animation-delay: -5s; }
.fireflies i:nth-child(6) { left: 46%; top: 60%; animation-delay: -3s; }
@keyframes firefly { 0%, 100% { transform: translate(0, 0); opacity: .2; } 30% { opacity: 1; } 50% { transform: translate(14px, -18px); opacity: .9; } 80% { opacity: .3; } }

/* Sprite-sheet animator: one horizontal strip, frame size and count set inline */
.sprite { position: absolute; width: var(--fw); height: var(--fh); background-repeat: no-repeat; background-size: calc(var(--fw) * var(--n)) 100%;
  animation: sprite-play var(--dur) steps(var(--n)) infinite; }
.sprite.flip { transform: scaleX(-1); }
@keyframes sprite-play { from { background-position: 0 0; } to { background-position: calc(var(--fw) * var(--n) * -1) 0; } }

/* Work: Marañito Online — 3D model over a crossfading gameplay slideshow */
.w-online { background: #0e1a12; }
/* Shared gameplay slideshow: main.js moves .on every few seconds; each slide slowly zooms while shown */
.slides img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.03); transition: opacity 1.2s ease; filter: saturate(1.08); }
.slides img.on { opacity: 1; animation: ken-burns 7s linear forwards; }
.slides img.was { animation: ken-burns 7s linear forwards; }
@keyframes ken-burns { from { transform: scale(1.03); } to { transform: scale(1.13) translateX(-1.5%); } }
.w-shots::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.char-stage { position: absolute; z-index: 2; right: 3%; bottom: 4%; display: flex; align-items: flex-end; gap: 2px; }
.char-stage::before { content: ""; position: absolute; left: -10%; right: -10%; bottom: -6px; height: 34px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(139,92,255,.55), transparent 70%); filter: blur(3px); }
.char-stage .sprite { position: relative; filter: drop-shadow(0 6px 5px rgba(0,0,0,.55)); }
.w-online::after { background: linear-gradient(90deg, rgba(7,7,13,.15) 30%, rgba(7,7,13,.75) 75%), linear-gradient(0deg, rgba(7,7,13,.55), transparent 40%); }
.online-stage { position: absolute; z-index: 2; right: 2%; top: 0; bottom: 0; width: 42%; }
.online-stage::before { content: ""; position: absolute; left: 15%; right: 15%; bottom: 8%; height: 18%; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(139,92,255,.55), transparent 70%); filter: blur(4px); }
model-viewer { width: 100%; height: 100%; background: transparent; --poster-color: transparent; --progress-bar-color: var(--violet); }
.drag-hint { position: absolute; right: 14px; top: 14px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.6); white-space: nowrap; }
.badge3d { position: absolute; z-index: 2; left: 16px; top: 16px; padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(120deg, var(--violet), var(--blue)); box-shadow: 0 6px 20px rgba(139,92,255,.5); }

/* Work: Marañito Saga and Wilds — shade the right side so the characters read */
.w-saga::after, .w-wilds::after { background: linear-gradient(90deg, transparent 45%, rgba(7,7,13,.55)), linear-gradient(0deg, rgba(7,7,13,.5), transparent 35%); }
.wf-mara { animation: sprite-play var(--dur) steps(var(--n)) infinite, mara-glow 4s ease-in-out infinite; }
@keyframes mara-glow { 0%, 70%, 100% { filter: drop-shadow(0 6px 5px rgba(0,0,0,.55)); } 80% { filter: drop-shadow(0 0 14px #ffe66d) drop-shadow(0 0 26px #b6ff3c); } }

/* Work: Sociedad M&D site scrolling inside a browser frame */
.w-smyd { background: radial-gradient(circle at 50% 120%, rgba(34,197,94,.35), transparent 60%), linear-gradient(160deg, #0c1a2e, #08080f); }
.w-plants { background: radial-gradient(circle at 30% 120%, rgba(182,255,60,.28), transparent 60%), linear-gradient(160deg, #0f2418, #08080f); }
.w-site { display: flex; align-items: flex-end; justify-content: center; padding: 30px 24px 0; }
.browser { width: 100%; height: 100%; border-radius: 12px 12px 0 0; overflow: hidden; background: #fff; box-shadow: 0 30px 60px -10px rgba(0,0,0,.7); border: 1px solid rgba(255,255,255,.18); border-bottom: 0; display: flex; flex-direction: column; transition: transform .5s; }
.work:hover .browser { transform: translateY(-6px); }
.browser-bar { display: flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; background: #1b1b2a; flex-shrink: 0; }
.browser-bar span { width: 8px; height: 8px; border-radius: 50%; background: #ff5f57; }
.browser-bar span:nth-child(2) { background: #febc2e; } .browser-bar span:nth-child(3) { background: #28c840; }
.browser-bar em { margin-left: 10px; padding: 2px 10px; border-radius: 6px; background: rgba(255,255,255,.08); font-style: normal; font-size: 10px; color: var(--muted); }
.browser-view { position: relative; flex: 1; overflow: hidden; }
.browser-view img { display: block; width: 100%; height: auto; animation: site-scroll 26s ease-in-out infinite alternate; }
@keyframes site-scroll { 0%, 8% { transform: translateY(0); } 92%, 100% { transform: translateY(calc(-100% + 240px)); } }

.ai-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 5px 10px; border-radius: 999px; font-size: 11px; letter-spacing: .04em;
  color: #d8ccff; background: rgba(139,92,255,.12); border: 1px solid rgba(139,92,255,.32); }
.ai-chip::before { content: "✦"; color: var(--cyan); }
.status { white-space: nowrap; }
.work-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.status { display: inline-flex; align-items: center; gap: 7px; font: 500 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: rgba(238,240,255,.6); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #febc2e; box-shadow: 0 0 8px #febc2e; }
.status.live::before { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.stack { font-size: 11px; color: rgba(238,240,255,.45); }
.visit { font-size: 14px; font-weight: 600; color: var(--cyan); }
.visit:hover { text-decoration: underline; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: s; position: relative; }
.steps::before { content: ""; position: absolute; left: 0; right: 0; top: 23px; height: 1px; background: linear-gradient(90deg, transparent, var(--line-2) 10%, var(--line-2) 90%, transparent); }
.step { position: relative; padding-top: 70px; }
.num { position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; font-size: 13px; background: var(--bg); border: 1px solid var(--line-2); color: var(--text); box-shadow: 0 0 0 6px var(--bg); }
.step:nth-child(1) .num { border-color: rgba(139,92,255,.6); color: #c4b5fd; }
.step:nth-child(2) .num { border-color: rgba(59,130,246,.6); color: #93c5fd; }
.step:nth-child(3) .num { border-color: rgba(34,211,238,.6); color: var(--cyan); }
.step:nth-child(4) .num { border-color: rgba(182,255,60,.6); color: var(--lime); }
.step h3 { font-size: 22px; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 15px; }

/* CTA */
.cta { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; gap: 56px; padding: 64px; border-radius: 32px; border: 1px solid var(--line-2); background: linear-gradient(160deg, rgba(30,22,64,.8), rgba(9,9,18,.9)); }
.cta-glow { position: absolute; width: 600px; height: 600px; right: -200px; top: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(34,211,238,.28), transparent 60%); pointer-events: none; }
.cta-copy { position: relative; }
.cta-copy .muted { font-size: 18px; max-width: 440px; }
.mail { display: inline-block; margin-top: 30px; font-size: 18px; padding-bottom: 4px; border-bottom: 1px solid rgba(182,255,60,.5); color: var(--lime); }
.mail:hover { border-bottom-color: var(--lime); }
.form { position: relative; display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; color: #c9cdea; }
.form input, .form textarea {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(0,0,0,.35);
  color: var(--text); font: 400 15px/1.4 var(--font-body); outline: none; transition: border-color .2s, box-shadow .2s; resize: vertical;
}
.form input:focus, .form textarea:focus { border-color: rgba(139,92,255,.8); box-shadow: 0 0 0 4px rgba(139,92,255,.18); }
.form .invalid { border-color: #ff6b8a; }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form button[disabled] { opacity: .6; cursor: progress; }
.form-status { margin: 0; padding: 12px 14px; border-radius: 12px; font-size: 14px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); }
.form-status.ok { border-color: rgba(182,255,60,.45); background: rgba(182,255,60,.08); color: #e4ffb8; }
.form-status.err { border-color: rgba(255,107,138,.5); background: rgba(255,107,138,.08); color: #ffc2cf; }

/* Footer */
.footer { padding: 40px 0 50px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-inner .brand { font-size: 18px; }
.footer-inner p:last-child { margin-left: auto; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.js-off .reveal { opacity: 1; transform: none; }

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

/* Responsive */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-visual { height: 520px; max-width: 560px; width: 100%; margin-inline: auto; }
  .work-grid { grid-template-columns: 1fr; }
  .work-wide { grid-column: auto; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .steps::before { display: none; }
  .cta { grid-template-columns: 1fr; padding: 48px; gap: 36px; }
}
@media (max-width: 860px) {
  .nav-links {
    position: fixed; left: 16px; right: 16px; top: 80px; flex-direction: column; gap: 2px; padding: 10px;
    background: rgba(14,14,26,.97); border: 1px solid var(--line-2); border-radius: 20px; backdrop-filter: blur(20px);
    opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .2s, transform .2s;
  }
  .nav-links a { padding: 14px 16px; font-size: 17px; }
  .nav.menu-open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .nav-actions { margin-left: auto; }
  .burger { display: block; }
  .hide-sm { display: none; }
}
@media (max-width: 680px) {
  .hero { padding-top: 110px; }
  .hero-visual { height: 470px; }
  .device { width: 300px; }
  .f-score { right: 0; top: 0; padding: 10px 12px; } .f-score b { font-size: 18px; } .f-model { left: 0; bottom: 4%; } .f-pad { right: 0; bottom: 18%; }
  .bento, .work-grid, .steps { grid-template-columns: 1fr; }
  .work-art { height: 280px; }
  .online-stage { width: 55%; }
  .char-stage { transform: scale(.72); transform-origin: bottom right; }
  .flerkin-run { transform-origin: bottom left; scale: .8; }
  .section { padding: 90px 0; }
  .card { padding: 24px; }
  .card-xl .card-body { padding: 22px 24px 26px; }
  .cta { padding: 30px 22px; border-radius: 24px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer-inner p:last-child { margin-left: 0; }
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
