:root {
  --bg: #0b0c0e;
  --panel: #131417;
  --panel-2: #1b1c20;
  --line: #24252a;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #71717a;
  --accent: #7c8cff;
  --dot: 244 244 245;      /* rgb for canvas dots */
  --dot-hot: 124 140 255;  /* accent dots near cursor */
  --btn-light-bg: #ffffff;
  --btn-light-fg: #0b0c0e;
  --max: 1080px;
  --radius: 20px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fafafa;
  --panel: #ffffff;
  --panel-2: #f1f1f3;
  --line: #e4e4e7;
  --text: #0b0c0e;
  --muted: #52525b;
  --faint: #8a8a93;
  --accent: #4f5bd5;
  --dot: 11 12 14;
  --dot-hot: 79 91 213;
  --btn-light-bg: #0b0c0e;
  --btn-light-fg: #ffffff;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.6 "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* NAV */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px clamp(16px, 4vw, 48px);
  background: linear-gradient(var(--bg), color-mix(in srgb, var(--bg) 0%, transparent));
}
.brand { display: flex; flex-direction: column; line-height: 1.3; letter-spacing: .02em; }
.brand strong { font-weight: 600; font-size: 16px; }
.brand span { color: var(--muted); font-size: 14px; font-weight: 500; }
.nav nav { display: flex; align-items: center; gap: 26px; font-size: 14px; color: var(--muted); }
.nav nav a:hover { color: var(--text); }
.theme-toggle {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); cursor: pointer;
}

/* HERO */
.hero {
  position: relative; min-height: 100svh; display: grid; place-items: center;
  padding: 120px 16px 80px; overflow: hidden; text-align: center;
}
.dots {
  position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, #000 30%, transparent 100%);
          mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, #000 30%, transparent 100%);
}
.hero-inner { position: relative; max-width: 760px; pointer-events: none; }
.hero-inner a { pointer-events: auto; }
.hero::after { /* soft halo behind text for legibility */
  content: ""; position: absolute; left: 50%; top: 50%; width: min(720px, 90vw); height: 340px;
  transform: translate(-50%, -50%); background: radial-gradient(closest-side, var(--bg), transparent);
  opacity: .85; pointer-events: none;
}
.hero-inner { z-index: 1; }
.status {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--muted); margin-bottom: 26px;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgb(74 222 128 / .6); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgb(74 222 128 / 0); } 100% { box-shadow: 0 0 0 0 rgb(74 222 128 / 0); } }
h1 { font-size: clamp(44px, 8vw, 88px); line-height: 1.02; font-weight: 600; letter-spacing: -0.04em; }
.sub { margin: 24px auto 0; max-width: 560px; font-size: clamp(16px, 2vw, 19px); color: var(--muted); }
.actions { display: flex; justify-content: center; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.btn { padding: 13px 26px; border-radius: 10px; font-weight: 500; font-size: 16px; transition: transform .2s, opacity .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-light { background: var(--btn-light-bg); color: var(--btn-light-fg); }
.btn-dark { background: var(--panel-2); border: 1px solid var(--line); }
.hint { position: absolute; bottom: 28px; left: 0; right: 0; z-index: 1; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
@media (hover: none) { .hint { display: none; } }

/* SECTIONS */
main { overflow-x: clip; }
.section { scroll-margin-top: 72px; max-width: var(--max); margin: 0 auto; padding: 96px clamp(16px, 4vw, 32px); }
.label { font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 32px; }
.two-col { display: grid; grid-template-columns: 200px 1fr; gap: 32px; border-top: 1px solid var(--line); }
.two-col .label { margin: 6px 0 0; }
h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }

/* WORK CARDS */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: calc(var(--radius) + 8px);
  padding: clamp(12px, 3vw, 28px); margin-bottom: 28px;
}
.frame {
  border-radius: var(--radius); background: var(--panel-2); aspect-ratio: 16 / 8;
  overflow: hidden; position: relative; display: grid; place-items: center;
  background-image: radial-gradient(rgb(var(--dot) / .12) 1px, transparent 1px);
  background-size: 18px 18px;
}
.card-body { padding: 24px 8px 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 40px; }
.card-body .meta { grid-column: 1 / -1; font-size: 13px; color: var(--faint); }
.card-body h3 { font-size: clamp(22px, 3vw, 28px); letter-spacing: -0.02em; line-height: 1.2; }
.card-body > p:not(.meta) { color: var(--muted); }
.card-body .tags { grid-column: 1 / -1; margin-top: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.tags li { font-size: 13px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); padding: 4px 12px; border-radius: 99px; }

/* card art */
.art { width: 78%; height: 70%; position: relative; }
.art-rig svg { width: 100%; height: 100%; overflow: visible; }
.art-rig .grid { stroke: rgb(var(--dot) / .1); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.art-rig .line { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-dasharray: 900; stroke-dashoffset: 900; }
.art-rig .l1 { stroke: var(--accent); }
.art-rig .l2 { stroke: rgb(var(--dot) / .3); }
.card.in .art-rig .line { animation: draw 2.2s ease forwards; }
.art-rig .ping { fill: var(--accent); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.art-rig .chips { position: absolute; left: 0; bottom: -6px; display: flex; gap: 8px; flex-wrap: wrap; }
.art-rig .chips span { font-size: 12px; background: var(--panel); border: 1px solid var(--line); padding: 4px 10px; border-radius: 8px; color: var(--muted); }
.art-rig .chips .ok { color: #4ade80; }

.art-funnel { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.art-funnel .bar { width: 0; height: 40px; border-radius: 10px; background: rgb(var(--dot) / .08); border: 1px solid var(--line); display: flex; align-items: center; padding: 0 14px; font-size: 13px; color: var(--muted); white-space: nowrap; transition: width 1.2s cubic-bezier(.2,.7,.2,1); }
.card.in .art-funnel .bar { width: var(--w); }
.art-funnel .bar:nth-child(2) { transition-delay: .1s; } .art-funnel .bar:nth-child(3) { transition-delay: .2s; } .art-funnel .bar:nth-child(4) { transition-delay: .3s; }
.art-funnel .hl { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: var(--accent); color: var(--text); }

.art-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-content: center; }
.art-tiles span { aspect-ratio: 2 / 3; border-radius: 8px; background: rgb(var(--dot) / .07); border: 1px solid var(--line); }
.art-tiles .on { background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent)); border-color: transparent; }

/* ABOUT */
.lead { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.25; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 20px; }
.two-col p:not(.lead):not(.co) { color: var(--muted); margin-bottom: 14px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.facts dt { font-size: 13px; color: var(--faint); }
.facts dd { font-weight: 500; margin-top: 2px; }

/* EXPERIENCE */
.jobs { list-style: none; }
.jobs li { display: flex; justify-content: space-between; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.jobs li:first-child { padding-top: 0; }
.jobs li:last-child { border-bottom: 0; }
.jobs .co { font-size: 14px; color: var(--text); opacity: .75; margin: 2px 0 6px; }
.jobs p:not(.co) { margin: 0 !important; font-size: 15px; }
.jobs .when { flex: none; font-size: 14px; color: var(--faint); white-space: nowrap; }

/* SKILLS */
.skills { display: grid; gap: 24px; }
.skills h3 { font-size: 14px; color: var(--muted); font-weight: 500; margin-bottom: 10px; }

/* CONTACT */
.contact { text-align: center; padding-block: 120px; border-top: 1px solid var(--line); }
.contact h2 { font-size: clamp(30px, 5vw, 52px); line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; max-width: 760px; margin: 0 auto; }
.mail { display: inline-block; margin-top: 32px; font-size: clamp(18px, 2.6vw, 24px); padding-bottom: 4px; border-bottom: 2px solid var(--accent); }
.links { display: flex; justify-content: center; gap: 24px; margin-top: 28px; color: var(--muted); flex-wrap: wrap; }
.links a:hover { color: var(--text); }

.footer { max-width: var(--max); margin: 0 auto; padding: 28px clamp(16px, 4vw, 32px) 40px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--faint); border-top: 1px solid var(--line); }

/* REVEAL */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .pulse { animation: none; }
  .art-rig .line { stroke-dashoffset: 0; animation: none !important; }
  .art-funnel .bar { width: var(--w); transition: none; }
}

/* RESPONSIVE */
@media (max-width: 760px) {
  .nav nav a { display: none; }
  .two-col { grid-template-columns: 1fr; gap: 8px; }
  .card-body { grid-template-columns: 1fr; padding-inline: 4px; }
  .frame { aspect-ratio: 4 / 3; }
  .art { width: 86%; }
  .art-tiles { grid-template-columns: repeat(4, 1fr); }
  .art-tiles span:nth-child(n+9) { display: none; }
  .facts { grid-template-columns: 1fr 1fr; }
  .jobs li { flex-direction: column; gap: 4px; }
  .jobs .when { order: -1; }
  .section { padding-block: 72px; }
}
