/* ---------- tokens ---------- */
:root {
  --bg: #0b1020;
  --bg-alt: #0e1530;
  --surface: #121936;
  --surface-2: #182046;
  --border: rgba(255, 255, 255, .09);
  --text: #e8ecf8;
  --muted: #9aa6c7;
  --accent: #818cf8;
  --accent-2: #2dd4bf;
  --on-accent: #0b1020;
  --grad: linear-gradient(90deg, #818cf8, #2dd4bf);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 16px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, Menlo, monospace;
}
:root[data-theme="light"] {
  --bg: #f6f8ff;
  --bg-alt: #edf1fb;
  --surface: #ffffff;
  --surface-2: #f1f4fc;
  --border: rgba(11, 16, 32, .12);
  --text: #0b1020;
  --muted: #475273;
  --accent: #4f46e5;
  --accent-2: #0f766e;
  --on-accent: #ffffff;
  --grad: linear-gradient(90deg, #4f46e5, #0f766e);
  --shadow: 0 10px 30px rgba(31, 41, 90, .12);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.12; margin: 0; letter-spacing: -.02em; }
p { margin: 0 0 1rem; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 10px; z-index: 100; font-weight: 600; transition: top .2s; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; border-radius: 8px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
       background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--border); }
.nav__in { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; font-weight: 700; flex: none; }
.brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: var(--on-accent); font-size: 13px; font-weight: 800; letter-spacing: .02em; }
nav { margin-left: auto; }
.nav__links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__links a { display: block; padding: 10px 14px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 15px; transition: color .2s, background .2s; }
.nav__links a:hover { color: var(--text); background: var(--surface); }
.theme { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: transform .2s var(--ease), border-color .2s; }
.theme:hover { border-color: var(--accent); transform: translateY(-1px); }
.i-sun { display: none; }
:root[data-theme="light"] .i-sun { display: block; }
:root[data-theme="light"] .i-moon { display: none; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(56px, 11vw, 120px) 0 56px; isolation: isolate;
        background: radial-gradient(900px 420px at 85% 30%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 70%),
                    radial-gradient(700px 400px at 0% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%); }
.hero__net { position: absolute; right: -40px; top: 8%; width: min(560px, 62vw); height: 78%; opacity: .55; z-index: -1; }
.hero__net svg { width: 100%; height: 100%; }
.hero__net .e { stroke: url(#ng); stroke-width: 1.2; opacity: .45; }
.hero__net .n { fill: var(--bg); stroke: url(#ng); stroke-width: 2; }
.hero__net .p { fill: var(--accent-2); animation: pulse 3.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
.eyebrow, .kicker { font: 500 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.5rem, 7vw, 4.75rem); font-weight: 800; max-width: 14ch; }
.lead { max-width: 56ch; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.2rem); margin: 22px 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
       color: var(--text); font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.btn--primary { background: var(--grad); color: var(--on-accent); border-color: transparent; }
.btn--primary:hover { border-color: transparent; filter: brightness(1.06); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 44px 0 0; max-width: 720px; }
.stats div { padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: color-mix(in srgb, var(--surface) 80%, transparent); }
.stats dt { font-size: 13px; color: var(--muted); order: 2; line-height: 1.3; }
.stats dd { margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stats div { display: flex; flex-direction: column; }

/* ---------- sections ---------- */
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section h2 { font-size: clamp(1.8rem, 4vw, 2.75rem); font-weight: 800; max-width: 22ch; }
.sub { color: var(--muted); max-width: 64ch; font-size: 1.08rem; margin-top: 16px; }

/* pawlytics */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 32px 0; font-size: 14px; }
.flow i { color: var(--muted); font-style: normal; }
.node { padding: 10px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-weight: 600; }
.node--stack { display: inline-flex; gap: 6px; padding: 6px; }
.node--stack b { padding: 4px 10px; border-radius: 8px; background: var(--surface-2); font-weight: 600; }
.node--accent { border-color: color-mix(in srgb, var(--accent-2) 55%, transparent); }
.models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.model { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: transform .25s var(--ease), border-color .25s; }
.model:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.model h3 { font-size: 1.1rem; }
.model__arch { color: var(--muted); font-size: 14px; margin: 6px 0 16px; min-height: 2.9em; }
.model__num { font-size: 3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.model__num small { font-size: 1.4rem; color: var(--muted); margin-left: 2px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-bottom: 16px; }
.bar span { display: block; height: 100%; width: var(--v); background: var(--grad); border-radius: 99px; transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease) .15s; }
.is-in .bar span, .bar.is-in span { transform: scaleX(1); }
.model__note { color: var(--muted); font-size: 14px; margin: 0; }
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: center; margin: 40px 0 32px; }
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.points li { position: relative; padding-left: 28px; color: var(--muted); }
.points li::before { content: ""; position: absolute; left: 0; top: .55em; width: 10px; height: 10px; border-radius: 50%; background: var(--grad); }
.points b { color: var(--text); }
.shot { margin: 0; }
.shot a { display: block; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.shot img { width: 100%; transition: transform .6s var(--ease); }
.shot a:hover img { transform: scale(1.02); }

/* projects */
.tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 32px 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 18px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: 600 14px var(--font); cursor: pointer; transition: all .2s; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--grad); color: var(--on-accent); border-color: transparent; }
.chip small { opacity: .75; margin-left: 6px; font-weight: 500; }
.search input { min-height: 44px; width: min(280px, 100%); padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 400 15px var(--font); }
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--accent); }
.count { color: var(--muted); font-size: 14px; margin: 8px 0 20px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden;
        transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: var(--shadow); }
.card__img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card__img img { transform: scale(1.04); }
.card__live { position: absolute; left: 12px; top: 12px; padding: 5px 10px; border-radius: 99px; font: 600 12px var(--font); background: var(--bg); color: var(--accent-2); border: 1px solid color-mix(in srgb, var(--accent-2) 50%, transparent); }
.card__body { display: flex; flex-direction: column; gap: 10px; padding: 20px; flex: 1; }
.card__cat { font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-2); }
.card h3 { font-size: 1.15rem; }
.card p { color: var(--muted); font-size: 15px; margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tags li { padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font: 500 12px var(--mono); }
.card__links { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.card__links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border); text-decoration: none; font-weight: 600; font-size: 14px; transition: border-color .2s, background .2s; }
.card__links a:hover { border-color: var(--accent); background: var(--surface-2); }
.card__links a.primary { background: var(--grad); color: var(--on-accent); border-color: transparent; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* about */
.about { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 6vw, 72px); align-items: start; }
.about p { color: var(--muted); }
.about h2 { margin-bottom: 20px; }
.skills { padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.skills h3 { font-size: 1.05rem; margin-bottom: 14px; }
.skills dl { margin: 0; display: grid; gap: 4px; }
.skills dt { font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-2); margin-top: 12px; }
.skills dd { margin: 0; color: var(--text); font-size: 15px; }

/* contact */
.contact { text-align: center; background: radial-gradient(700px 300px at 50% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%); }
.contact h2, .contact .sub { margin-inline: auto; }
.contact .cta { justify-content: center; margin-top: 28px; }
.foot { border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.foot__in { display: flex; justify-content: space-between; padding: 22px 0; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); }

/* motion */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.is-in { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .models { grid-template-columns: 1fr; }
  .model__arch { min-height: 0; }
  .split { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .brand__name { display: none; }
  .nav__links { gap: 0; }
  .nav__links a { padding: 10px 8px; font-size: 14px; }
  .nav__in { gap: 8px; }
  .hero__net { opacity: .3; }
  .tools { flex-direction: column; align-items: stretch; }
  .search input { width: 100%; }
}
@media (max-width: 480px) {
  .nav__links li:nth-child(3) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .bar span { transform: none; }
}
