/* Theme tokens */
:root {
  --copper: #C17F45;
  --teal: #3EC9A7;
  --radius-chip: 3px;
}
html[data-theme="dark"] {
  --bg: #10171A;
  --surface: #161F22;
  --surface-2: #1D282B;
  --text: #E7ECE9;
  --muted: #93A3A0;
  --border: #28353A;
  --border-strong: #3A4A4F;
  --cursor-accent: var(--teal);
  --cursor-glow-1: 14%;
  --cursor-glow-2: 5%;
}
html[data-theme="light"] {
  --bg: #F6F3EC;
  --surface: #FFFFFF;
  --surface-2: #F0EBDF;
  --text: #24271F;
  --muted: #6E7468;
  --border: #E2DBC9;
  --border-strong: #CBC1A7;
  --copper: #AD5A28;
  --teal: #0C8A73;
  --cursor-accent: #0C8A73;
  --cursor-glow-1: 42%;
  --cursor-glow-2: 20%;
}

/* Reset / base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.55;
  transition: background .25s ease, color .25s ease;
}
body.loading { overflow: hidden; }
a { color: inherit; }
img { max-width: 100%; height: auto; }
::selection { background: var(--copper); color: #10171A; }

.mono { font-family: 'JetBrains Mono', monospace; }
.wrap { width: 100%; max-width: 1600px; margin: 0 auto; padding: 0 5vw; }

#about, #skills, #projects, #contact {
  scroll-margin-top: var(--header-h, 72px);
}

/* Background effects */

/* Aurora background (unused) */
.aurora-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora-blob { position: absolute; border-radius: 50%; filter: blur(90px); will-change: transform; }
html[data-theme="dark"] .aurora-blob { opacity: .35; }
html[data-theme="light"] .aurora-blob { opacity: .22; }
.aurora-1 {
  top: -14%; left: -10%;
  width: 46vw; height: 46vw; max-width: 640px; max-height: 640px;
  background: radial-gradient(circle, var(--copper) 0%, transparent 70%);
  animation: aurora-drift-1 26s ease-in-out infinite alternate;
}
.aurora-2 {
  top: 28%; right: -12%;
  width: 40vw; height: 40vw; max-width: 560px; max-height: 560px;
  background: radial-gradient(circle, var(--teal) 0%, transparent 70%);
  animation: aurora-drift-2 32s ease-in-out infinite alternate;
}
.aurora-3 {
  bottom: -16%; left: 22%;
  width: 36vw; height: 36vw; max-width: 480px; max-height: 480px;
  background: radial-gradient(circle, var(--copper) 0%, transparent 70%);
  animation: aurora-drift-3 22s ease-in-out infinite alternate;
}
@keyframes aurora-drift-1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(6vw, 8vh) scale(1.15); } }
@keyframes aurora-drift-2 { from { transform: translate(0, 0) scale(1); } to { transform: translate(-7vw, -6vh) scale(1.1); } }
@keyframes aurora-drift-3 { from { transform: translate(0, 0) scale(1); } to { transform: translate(5vw, -7vh) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .aurora-blob { animation: none; } }
@media (max-width: 820px) { .aurora-blob { filter: blur(55px); } }

/* Dot grid background (unused) */
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle, var(--border-strong) 1.4px, transparent 1.4px);
  background-size: 30px 30px;
  animation: grid-drift 50s linear infinite;
}
html[data-theme="dark"] .bg-grid { opacity: .4; }
html[data-theme="light"] .bg-grid { opacity: .55; }
@keyframes grid-drift { from { background-position: 0 0; } to { background-position: 120px 90px; } }
@media (prefers-reduced-motion: reduce) { .bg-grid { animation: none; } }

/* Shooting stars */
.bg-stars { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.shooting-star {
  position: absolute;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--teal));
  border-radius: 2px;
  filter: drop-shadow(0 0 5px var(--teal));
  opacity: 0;
  transform-origin: left center;
  animation: shoot linear infinite;
}
@keyframes shoot {
  0%   { transform: rotate(var(--ang)) translateX(0); opacity: 0; }
  4%   { opacity: 1; }
  22%  { opacity: 1; }
  32%  { transform: rotate(var(--ang)) translateX(var(--dist)); opacity: 0; }
  100% { transform: rotate(var(--ang)) translateX(var(--dist)); opacity: 0; }
}
/* Group 1 */
.s1  { top: 8%;  left: 70%; width: 110px; --ang: 150deg; --dist: 660px; animation-duration: 5.5s; animation-delay: 0s;   }
.s2  { top: 18%; left: 30%; width: 90px;  --ang: 160deg; --dist: 600px; animation-duration: 7s;   animation-delay: 1.4s; }
.s3  { top: 4%;  left: 90%; width: 130px; --ang: 145deg; --dist: 740px; animation-duration: 6.2s; animation-delay: 2.8s; }
.s4  { top: 35%; left: 55%; width: 80px;  --ang: 155deg; --dist: 560px; animation-duration: 8s;   animation-delay: 0.6s; }
.s5  { top: 12%; left: 15%; width: 100px; --ang: 165deg; --dist: 620px; animation-duration: 6.8s; animation-delay: 4s;   }
.s6  { top: 45%; left: 80%; width: 95px;  --ang: 150deg; --dist: 580px; animation-duration: 9s;   animation-delay: 2s;   }
.s7  { top: 2%;  left: 50%; width: 115px; --ang: 140deg; --dist: 680px; animation-duration: 5s;   animation-delay: 5.2s; }
.s8  { top: 25%; left: 5%;  width: 85px;  --ang: 158deg; --dist: 590px; animation-duration: 7.5s; animation-delay: 3.4s; }
.s9  { top: 55%; left: 20%; width: 105px; --ang: 152deg; --dist: 630px; animation-duration: 6.4s; animation-delay: 0.9s; }
.s10 { top: 60%; left: 65%; width: 90px;  --ang: 162deg; --dist: 580px; animation-duration: 8.4s; animation-delay: 5.6s; }
.s11 { top: 15%; left: 45%; width: 120px; --ang: 144deg; --dist: 700px; animation-duration: 5.8s; animation-delay: 2.2s; }
.s12 { top: 70%; left: 10%; width: 95px;  --ang: 156deg; --dist: 610px; animation-duration: 7.1s; animation-delay: 4.6s; }
.s13 { top: 38%; left: 88%; width: 100px; --ang: 148deg; --dist: 640px; animation-duration: 6.6s; animation-delay: 1.1s; }
.s14 { top: 5%;  left: 22%; width: 80px;  --ang: 163deg; --dist: 570px; animation-duration: 9.2s; animation-delay: 3.8s; }
.s15 { top: 48%; left: 38%; width: 115px; --ang: 146deg; --dist: 680px; animation-duration: 5.2s; animation-delay: 6.4s; }
.s16 { top: 80%; left: 50%; width: 90px;  --ang: 157deg; --dist: 590px; animation-duration: 7.8s; animation-delay: 2.6s; }
.s17 { top: 30%; left: 75%; width: 105px; --ang: 150deg; --dist: 650px; animation-duration: 6.9s; animation-delay: 0.3s; }
.s18 { top: 65%; left: 92%; width: 95px;  --ang: 161deg; --dist: 600px; animation-duration: 8.7s; animation-delay: 4.2s; }
/* Group 2 */
.s19 { top: 2%;  left: 60%; width: 100px; --ang: 35deg; --dist: 620px; animation-duration: 6.3s; animation-delay: 0.5s; }
.s20 { top: 8%;  left: 75%; width: 90px;  --ang: 28deg; --dist: 580px; animation-duration: 7.4s; animation-delay: 2.1s; }
.s21 { top: 0%;  left: 85%; width: 120px; --ang: 40deg; --dist: 660px; animation-duration: 5.6s; animation-delay: 4.3s; }
.s22 { top: 15%; left: 65%; width: 95px;  --ang: 32deg; --dist: 600px; animation-duration: 8.1s; animation-delay: 1.6s; }
.s23 { top: 5%;  left: 92%; width: 105px; --ang: 45deg; --dist: 640px; animation-duration: 6.9s; animation-delay: 3.2s; }
.s24 { top: 20%; left: 58%; width: 85px;  --ang: 26deg; --dist: 560px; animation-duration: 9.4s; animation-delay: 5.4s; }
.s25 { top: 10%; left: 70%; width: 110px; --ang: 38deg; --dist: 630px; animation-duration: 5.9s; animation-delay: 0.9s; }
.s26 { top: 0%;  left: 95%; width: 90px;  --ang: 42deg; --dist: 600px; animation-duration: 7.7s; animation-delay: 2.8s; }
.s27 { top: 25%; left: 80%; width: 100px; --ang: 30deg; --dist: 580px; animation-duration: 6.5s; animation-delay: 4.8s; }
.s28 { top: 12%; left: 55%; width: 115px; --ang: 36deg; --dist: 650px; animation-duration: 8.6s; animation-delay: 1.2s; }
@media (prefers-reduced-motion: reduce) { .shooting-star { animation: none; opacity: 0; } }
@media (max-width: 820px) {
  .shooting-star { --ang: 155deg; --dist: 340px; width: 100px; }
}

/* Header / nav */
header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1600px; margin: 0 auto; padding: 16px 5vw;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 15px; letter-spacing: .02em;
  text-decoration: none; color: var(--text);
}
.logo .bracket { color: var(--copper); }
.navlinks { display: flex; align-items: center; gap: 28px; }
.navlinks a {
  font-size: 14px; text-decoration: none; color: var(--muted);
  padding-bottom: 3px; border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.navlinks a:hover { color: var(--text); }
.navlinks a.active { color: var(--copper); border-bottom-color: var(--copper); }
.navright { display: flex; align-items: center; gap: 18px; }
.themebtn {
  position: relative; flex-shrink: 0;
  width: 44px; height: 24px; border-radius: 20px; padding: 0;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  cursor: pointer;
}
.themebtn .knob {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--copper);
  transition: transform .2s ease, background .2s ease;
}
html[data-theme="light"] .themebtn .knob { transform: translateX(20px); background: var(--teal); }
.themebtn .knob svg { display: none; width: 11px; height: 11px; color: #10171A; }
html[data-theme="dark"] .themebtn .knob .icon-moon { display: block; }
html[data-theme="light"] .themebtn .knob .icon-sun { display: block; }
.navtoggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; }

/* Hero */

/* Scroll transition intro */
.hero-scroll {
  position: relative;
  height: 170vh;
}
.hero {
  position: sticky; top: var(--header-h, 0px);
  min-height: calc(100svh - var(--header-h, 0px));
  width: 100%;
  padding: 56px 0;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center;
}
.intro-center {
  position: fixed; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
  pointer-events: none;
  will-change: opacity, transform;
}
.intro-center .role { justify-content: center; margin: 0 auto; width: fit-content; }
.intro-center .role::before { display: none; }
.hero-heading { opacity: 0; will-change: opacity; }
.reveal-item { opacity: 0; transform: translateY(18px); will-change: transform, opacity; }
@media (prefers-reduced-motion: reduce) {
  .hero-scroll { height: auto; }
  .hero { position: relative; top: 0; }
  .intro-center { display: none; }
  .hero-heading { opacity: 1 !important; }
  .reveal-item { opacity: 1 !important; transform: none !important; }
}

/* Scroll reveal */
.scroll-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
  will-change: opacity, transform;
}
.scroll-reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

.prompt-line {
  margin-bottom: 18px;
  font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--teal);
}
.prompt-line .caret {
  display: inline-block; width: 8px; height: 16px; margin-left: 2px; vertical-align: -2px;
  background: var(--teal);
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Name typing effect */
.name {
  margin: 0 0 14px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.01em;
}
.name .tc { color: var(--text); }
.name .tc.tc-hide { opacity: 0; }
.name .tc.tc-active { color: var(--teal); }
@media (prefers-reduced-motion: reduce) {
  .name .tc { opacity: 1 !important; color: var(--text) !important; }
}

.role {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 20px;
  font-family: 'JetBrains Mono', monospace; font-size: 19px; font-weight: 600; color: var(--copper);
}
.role::before {
  content: ""; display: inline-block; flex-shrink: 0;
  width: 22px; height: 2px; background: var(--copper);
}

.bio { max-width: 52ch; margin: 0 0 30px; color: var(--muted); font-size: 16px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 26px; }

.btn {
  display: inline-block;
  padding: 12px 22px; border: 1px solid transparent; border-radius: var(--radius-chip);
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14px;
  text-decoration: none; cursor: pointer;
  transition: transform .12s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-solid { background: var(--copper); color: #10171A; }
.btn-solid:hover { opacity: .9; }

.btn-outline {
  position: relative; overflow: hidden;
  border-color: var(--border-strong); color: var(--text);
  transition: color .5s ease, border-color .5s ease, transform .12s ease;
}
.btn-outline::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; z-index: -2;
  width: 0%; background: var(--teal);
  transition: width .7s cubic-bezier(.61, .06, .33, 1.15);
}
.btn-outline::after {
  content: ""; position: absolute; top: -8px; bottom: -8px; left: -20px; z-index: -1;
  width: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='40'%3E%3Cpath d='M10 0 C16 5,4 15,10 20 C16 25,4 35,10 40 L20 40 L20 0 Z' fill='%233EC9A7'/%3E%3C/svg%3E");
  background-repeat: repeat-y;
  background-size: 20px 40px;
  transition: left .8s cubic-bezier(.61, .06, .33, 1.15);
  animation: wave-ripple 1.3s linear infinite;
}
@keyframes wave-ripple { from { background-position-y: 0; } to { background-position-y: -40px; } }
.btn-outline:hover { border-color: var(--teal); color: #10171A; }
.btn-outline:hover::before { width: 100%; }
.btn-outline:hover::after { left: calc(100% - 10px); }
@media (prefers-reduced-motion: reduce) {
  .btn-outline::before, .btn-outline::after { transition: none; }
}

.social-row { display: flex; gap: 14px; }
.social-row a {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 1px solid var(--border); border-radius: var(--radius-chip);
  text-decoration: none; color: var(--muted);
  transition: .15s ease;
}
.social-row a:hover { color: var(--copper); border-color: var(--copper); }

.photo-frame {
  position: relative;
  max-width: 400px; margin: 0 auto;
  padding: 10px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--surface);
}
.photo-tilt { perspective: 700px; }
.photo-tilt img { transform-style: preserve-3d; will-change: transform; }
.photo-frame::before {
  content: ""; position: absolute; inset: -1px; border-radius: 6px; pointer-events: none;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--cursor-accent) 35%, transparent),
    0 0 32px -6px color-mix(in srgb, var(--cursor-accent) 45%, transparent);
  transition: box-shadow .3s ease;
}
.photo-frame img {
  display: block; width: 100%; border-radius: 3px;
  aspect-ratio: 4 / 5; object-fit: cover;
  filter: grayscale(.12);
}
.photo-tag {
  display: flex; justify-content: space-between; margin-top: 10px; padding: 0 2px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted);
}
.photo-tag span:first-child { color: var(--teal); }

/* Sections (shared) */
section { padding: 64px 0; border-top: 1px solid var(--border); }
.section-head { margin-bottom: 34px; }
.section-num {
  margin: 0 0 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--copper);
}
h2 { margin: 0; font-size: 26px; font-weight: 700; }

/* About */
#skills { padding: 96px 0; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.about-text p { max-width: 60ch; color: var(--muted); }

.sysinfo {
  overflow: hidden;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface);
  font-family: 'JetBrains Mono', monospace; font-size: 13.5px;
}
.sysinfo-titlebar {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.sysinfo-dots { display: flex; gap: 6px; }
.sysinfo-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.sysinfo-dots span:nth-child(1) { background: #E0785A; }
.sysinfo-dots span:nth-child(2) { background: #E0C15A; }
.sysinfo-dots span:nth-child(3) { background: var(--teal); }
.sysinfo-filename { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.sysinfo-body { padding: 18px 24px 22px; }
.sysinfo .row { display: flex; flex-wrap: wrap; gap: 14px; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.sysinfo .row:last-child { border-bottom: none; }
.sysinfo .k { min-width: 88px; color: var(--muted); }
.sysinfo .v { color: var(--text); }
.sysinfo-caret {
  display: inline-block; width: 7px; height: 14px; margin-left: 6px; vertical-align: -2px;
  background: var(--teal);
  animation: blink 1.1s step-end infinite;
}
@media (prefers-reduced-motion: reduce) { .sysinfo-caret { animation: none; } }

/* Education timeline */
.edu-timeline { display: flex; align-items: flex-start; gap: 8px; margin: 28px 0 6px; }
.edu-item { position: relative; flex: 1; padding-top: 26px; }
.edu-dot {
  position: absolute; top: 0; left: 0; z-index: 1;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--copper);
}
.edu-item::before {
  content: ""; position: absolute; top: 5px; left: 6px; right: -6px; height: 2px;
  background: var(--border-strong);
}
.edu-item:last-child::before { display: none; }
.edu-level {
  margin: 0 0 4px;
  font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--teal);
}
.edu-school { max-width: 20ch; margin: 0; font-size: 13.5px; color: var(--text); }
@media (max-width: 820px) {
  .edu-timeline { flex-direction: column; gap: 0; }
  .edu-item { padding-top: 0; padding-left: 26px; padding-bottom: 22px; }
  .edu-item::before { top: 6px; bottom: -16px; left: 5px; right: auto; width: 2px; height: auto; }
  .edu-item:last-child { padding-bottom: 0; }
  .edu-item:last-child::before { display: none; }
  .edu-dot { top: 2px; left: 0; }
  .edu-school { max-width: none; }
}

/* Skills marquee */
.skills-marquee {
  position: relative; width: 100%; overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 64px, #000 calc(100% - 64px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 64px, #000 calc(100% - 64px), transparent 100%);
}
.skills-track { display: flex; width: max-content; gap: 18px; animation: scroll-left 26s linear infinite; }
.skills-marquee:hover .skills-track { animation-play-state: paused; }
@keyframes scroll-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.skill-card {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  min-width: 168px; padding: 14px 20px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.skill-card:hover {
  transform: translateY(-4px) scale(1.04);
  border-color: var(--copper);
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .4);
  background: var(--surface-2);
}
.skill-card img { flex-shrink: 0; width: 26px; height: 26px; object-fit: contain; transition: transform .2s ease; }
.skill-card:hover img { transform: scale(1.1) rotate(-4deg); }
.skill-card span { font-family: 'JetBrains Mono', monospace; font-size: 13.5px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .skills-track { animation: none; }
  .skill-card:hover { transform: none; }
}

/* Skill tooltip */
.skill-tooltip {
  position: fixed; top: 0; left: 0; z-index: 10000;
  max-width: 230px;
  padding: 12px 15px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface);
  font-family: 'Inter', sans-serif; font-size: 12.5px; line-height: 1.5; color: var(--muted);
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .45);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  transition: opacity .15s ease, transform .15s ease;
}
.skill-tooltip.visible { opacity: 1; transform: translate(-50%, calc(-100% - 6px)); }
.skill-tooltip strong {
  display: block; margin-bottom: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--copper);
}
.skill-tooltip::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--border-strong);
}

/* Projects */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.proj-card {
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  padding: 26px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.proj-card:hover {
  border-color: var(--copper);
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -14px rgba(0, 0, 0, .45);
  background: var(--surface-2);
}
.card-demo-badge {
  position: absolute; top: 16px; right: 16px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 20px;
  background: var(--teal); color: #10171A;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  text-decoration: none;
  opacity: 0; transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 2;
}
.proj-card:hover .card-demo-badge,
.proj-card:focus-within .card-demo-badge {
  opacity: 1; transform: translateY(0);
  pointer-events: auto;
}
.card-demo-badge:hover { opacity: .85; }
.card-demo-badge svg { width: 11px; height: 11px; }
.proj-icon { width: 46px; height: 46px; }
.proj-card h3 { margin: 0; font-size: 17px; }
.proj-card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.tag {
  padding: 4px 9px; border: 1px solid var(--border); border-radius: 20px;
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--teal);
}
.seemore-btn {
  align-self: flex-start; margin-top: 4px;
  padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 5px;
  background: none; color: var(--text); cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px; font-weight: 500;
  transition: .15s ease;
}
.seemore-btn:hover { border-color: var(--copper); color: var(--copper); }

/* Project thumbnail */
.proj-thumb {
  border: 1px solid var(--border-strong); border-radius: 8px;
  overflow: hidden; background: var(--bg);
  height: 150px; display: flex; flex-direction: column;
}
.proj-thumb .pt-titlebar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 5px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.proj-thumb .pt-dot { width: 8px; height: 8px; border-radius: 50%; }
.proj-thumb .pt-dot.r { background: #D9645A; }
.proj-thumb .pt-dot.y { background: #D9A94E; }
.proj-thumb .pt-dot.g { background: #4EA97F; }
.proj-thumb .pt-name { font-size: 10.5px; color: var(--muted); margin-left: 4px; }
.proj-thumb .pt-body {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 14px; font-size: 11px; line-height: 1.9; overflow: hidden;
}
.proj-thumb .pt-accent { color: var(--teal); }
.proj-thumb .pt-muted { color: var(--muted); }
.proj-thumb .pt-warn { color: var(--copper); }

/* Cursor preview */
.card-preview {
  position: fixed; top: 0; left: 0; width: 230px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  overflow: hidden; opacity: 0; transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none; z-index: 500;
  box-shadow: 0 16px 34px rgba(0,0,0,.35);
}
.card-preview.show { opacity: 1; transform: translateY(0); }
.card-preview .cp-titlebar {
  display: flex; align-items: center; gap: 5px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.card-preview .cp-dot { width: 8px; height: 8px; border-radius: 50%; }
.card-preview .cp-dot.r { background: #D9645A; }
.card-preview .cp-dot.y { background: #D9A94E; }
.card-preview .cp-dot.g { background: #4EA97F; }
.card-preview .cp-name { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); margin-left: 4px; }
.card-preview .cp-body { padding: 13px 14px; font-size: 10.5px; line-height: 1.85; min-height: 78px; }
.card-preview .cp-accent { color: var(--teal); }
.card-preview .cp-muted { color: var(--muted); }
.card-preview .cp-row { border-top: 1px solid var(--border); padding: 9px 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.card-preview .cp-chip {
  flex: 1; min-width: 62px; text-align: center; border: 1px solid var(--border-strong);
  border-radius: 5px; padding: 5px 0; font-size: 9px; color: var(--text);
}
@media (hover: none) {
  .card-preview { display: none; }
}

/* Project modal */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 100;
  align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .55);
}
.modal-overlay.open { display: flex; }
.modal-panel {
  position: relative;
  width: 100%; max-width: 520px; max-height: 85vh; overflow-y: auto;
  padding: 32px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface);
}
.modal-close {
  position: absolute; top: 18px; right: 18px;
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 6px;
  background: none; color: var(--muted); cursor: pointer; font-size: 15px;
}
.modal-close:hover { border-color: var(--copper); color: var(--copper); }
.modal-icon { width: 44px; height: 44px; margin-bottom: 16px; }
#modalIcon .proj-thumb { width: 100%; max-width: 320px; margin: 0 auto 16px; }
.modal-panel h3 { margin: 0 0 4px; font-size: 19px; }
.modal-label {
  margin: 22px 0 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--copper);
}
.modal-label:first-of-type { margin-top: 20px; }
.modal-panel p { margin: 0; color: var(--muted); font-size: 14.5px; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.modal-howto { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.modal-howto li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.modal-howto .step-num {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--teal);
}
.modal-howto code {
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--copper);
  background: var(--surface-2); padding: 1px 6px; border-radius: 4px;
}
.modal-demo-link { display: none; margin-top: 22px; text-align: center; }

/* Contact */
.contact-panel {
  display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 30px;
  padding: 40px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface);
}
.contact-panel h2 { margin-bottom: 10px; }
.contact-panel p { max-width: 44ch; margin: 0; color: var(--muted); }
.contact-links { display: flex; flex-direction: column; gap: 12px; }
.contact-links a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px;
  text-decoration: none; color: var(--text); font-size: 14.5px;
  transition: .15s ease;
}
.contact-links a:hover { border-color: var(--copper); color: var(--copper); }

.contact-form {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; gap: 16px;
  margin-top: 8px; padding-top: 28px; border-top: 1px solid var(--border);
}
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--muted); }
.form-row input, .form-row textarea {
  padding: 11px 14px; border: 1px solid var(--border); border-radius: 6px; resize: vertical;
  background: var(--surface-2); color: var(--text);
  font-family: 'Inter', sans-serif; font-size: 14.5px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none; border-color: var(--copper);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--copper) 18%, transparent);
}
.contact-form .btn { align-self: flex-start; font: inherit; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14px; }
.form-status { margin: 0; min-height: 18px; font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.form-status.ok { color: var(--teal); }
.form-status.err { color: #E0785A; }

footer {
  padding: 28px 0 40px; text-align: center;
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--muted);
}

/* Responsive */
@media (max-width: 900px) {
  .wrap { padding: 0 24px; }
  .nav { padding: 16px 24px; }
}

@media (max-width: 820px) {
  .hero-scroll { height: auto; }
  .hero { position: relative; top: 0; min-height: auto; grid-template-columns: 1fr; padding: 40px 0 48px; gap: 36px; }
  .hero .photo-frame { max-width: 280px; order: -1; }
  .intro-center { display: none; }
  .hero-heading { opacity: 1; }
  .reveal-item { opacity: 1; transform: none; }

  .about-grid { grid-template-columns: 1fr; }
  .contact-panel { grid-template-columns: 1fr; padding: 28px; }

  .navlinks {
    position: absolute; top: 64px; left: 0; right: 0;
    max-height: 0; overflow: hidden; opacity: 0; pointer-events: none;
    display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 0 24px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    transform: translateY(-6px);
    transition: max-height .35s ease, opacity .25s ease, transform .25s ease, padding .35s ease, gap .35s ease;
  }
  .navlinks.open { max-height: 320px; opacity: 1; pointer-events: auto; transform: none; padding: 18px 24px; gap: 16px; }
  .navlinks a { opacity: 0; transform: translateY(-6px); transition: opacity .3s ease, transform .3s ease, color .15s ease; }
  .navlinks.open a { opacity: 1; transform: none; }
  .navlinks.open a:nth-child(1) { transition-delay: .05s; }
  .navlinks.open a:nth-child(2) { transition-delay: .1s; }
  .navlinks.open a:nth-child(3) { transition-delay: .15s; }
  .navlinks.open a:nth-child(4) { transition-delay: .2s; }
  @media (prefers-reduced-motion: reduce) { .navlinks, .navlinks a { transition: none; } }
  .navtoggle { display: block; }

  .sysinfo .row { flex-direction: column; flex-wrap: nowrap; gap: 3px; }
  .sysinfo .k { min-width: 0; font-size: 12px; }
}

@media (max-width: 420px) {
  .wrap { padding: 0 18px; }
  .nav { padding: 14px 18px; }
  .contact-panel { padding: 22px; }
}

/* Custom cursor */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  *, *::before, *::after { cursor: none !important; }
}
.cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 9999;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cursor-accent);
  pointer-events: none; transform: translate(-50%, -50%);
}
.cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9998;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--cursor-accent);
  pointer-events: none; transform: translate(-50%, -50%);
  transition: width .2s ease, height .2s ease, background .2s ease, border-color .2s ease;
}
.cursor-ring.hovering {
  width: 50px; height: 50px;
  border-color: var(--copper);
  background: color-mix(in srgb, var(--copper) 10%, transparent);
}
html[data-theme="light"] .cursor-ring { border-width: 2px; box-shadow: 0 1px 3px color-mix(in srgb, var(--cursor-accent) 35%, transparent); }
html[data-theme="light"] .cursor-ring.hovering { box-shadow: 0 1px 4px color-mix(in srgb, var(--copper) 40%, transparent); }
.cursor-glow {
  position: fixed; top: 0; left: 0; z-index: 9997;
  width: 600px; height: 600px; border-radius: 50%;
  pointer-events: none; transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    color-mix(in srgb, var(--cursor-accent) var(--cursor-glow-1), transparent) 0%,
    color-mix(in srgb, var(--cursor-accent) var(--cursor-glow-2), transparent) 45%,
    transparent 75%);
  filter: blur(20px);
  transition: opacity .3s ease;
}
@media (max-width: 900px) {
  .cursor-dot, .cursor-ring, .cursor-glow { display: none; }
  body { cursor: auto; }
}

/* Loading screen */
.loader-screen {
  position: fixed; inset: 0; z-index: 20000;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  transition: opacity .5s ease, visibility .5s ease, backdrop-filter .5s ease;
}
.loader-screen.hidden {
  opacity: 0; visibility: hidden; pointer-events: none;
  backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0);
}
.loader-content { text-align: center; }
.loader-name {
  margin-bottom: 22px;
  font-weight: 800; font-size: clamp(28px, 5vw, 42px); letter-spacing: -.01em; color: var(--text);
}
.loader-name .bracket { color: var(--copper); }
.loader-bar {
  width: 220px; height: 3px; margin: 0 auto; border-radius: 3px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border);
}
.loader-bar-fill { width: 0%; height: 100%; background: var(--teal); transition: width .25s ease; }
.loader-status { margin-top: 14px; font-size: 12.5px; color: var(--muted); }