:root {
  --bg: #040b1c;
  --glass: rgba(14, 30, 64, .55);
  --glass-2: rgba(20, 42, 88, .65);
  --border: rgba(96, 140, 255, .2);
  --border-hi: rgba(96, 165, 255, .55);
  --text: #eaf1ff;
  --muted: #9db3da;
  --blue: #3b82ff;
  --blue-dark: #1d4ed8;
  --cyan: #38d4ff;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* no text selection and no dragging text, links or images out of the page */
body, body * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
img, a { -webkit-user-drag: none; user-drag: none; }
/* clicks on pictures go to whatever is behind them, so there is no image menu to open */
img { pointer-events: none; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: var(--blue); color: #fff; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 720px; }

/* ---------- background ---------- */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora::after { /* vignette */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 35%, rgba(2, 6, 16, .75) 100%);
}
.aurora i {
  position: absolute; border-radius: 50%; opacity: .55;
  will-change: transform;
}
.aurora i:nth-child(1) { width: 56vmax; height: 56vmax; left: -14vmax; top: -18vmax; background: radial-gradient(circle, #1d4ed8 0%, rgba(29,78,216,0) 68%); animation: drift1 26s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { width: 46vmax; height: 46vmax; right: -12vmax; top: 18vh;     background: radial-gradient(circle, #0891b2 0%, rgba(8,145,178,0) 68%); opacity: .4; animation: drift2 32s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { width: 50vmax; height: 50vmax; left: 22vw; bottom: -30vmax;  background: radial-gradient(circle, #4338ca 0%, rgba(67,56,202,0) 68%); opacity: .45; animation: drift3 38s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(14vmax, 10vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-12vmax, -8vmax) scale(.9); } }
@keyframes drift3 { to { transform: translate(-10vmax, -12vmax) scale(1.2); } }

.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 30;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: 0 0 12px var(--blue);
}

main, footer, .top { position: relative; z-index: 2; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(4, 11, 28, .6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.top-in { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.logo { font-size: 17px; display: inline-flex; align-items: center; gap: 10px; }
.logo-img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border-hi); }
.logo b { font-weight: 800; letter-spacing: -.02em; }
.logo span { color: var(--muted); }
nav { display: flex; gap: 6px; font-size: 14.5px; }
nav a { color: var(--muted); padding: 6px 12px; border-radius: 999px; transition: color .15s, background .15s; }
nav a:hover { color: var(--text); }
nav a.on { color: #fff; background: rgba(59, 130, 255, .22); }
.burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger i { display: block; width: 22px; height: 2px; margin: 5px 0; background: var(--text); transition: transform .2s, opacity .2s; }
.burger[aria-expanded="true"] i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] i:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */
.pfp {
  display: block; width: 132px; height: 132px; margin: 0 0 26px; border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(125, 176, 255, .85);
  box-shadow: 0 0 0 6px rgba(59, 130, 255, .18), 0 0 46px rgba(59, 130, 255, .55);
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-6px); } }
.hero { padding: 110px 0 90px; }
.now {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px;
  padding: 6px 14px; border-radius: 999px; font-size: 13.5px; color: var(--muted);
  background: var(--glass); border: 1px solid var(--border);
}
.now i { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
h1 { margin: 0; font-size: clamp(40px, 7.4vw, 76px); line-height: 1.04; font-weight: 800; letter-spacing: -.035em; }
.grad {
  background: linear-gradient(100deg, #7db0ff 10%, var(--cyan) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.role { margin: 14px 0 0; font-size: clamp(20px, 3.2vw, 30px); font-weight: 500; color: var(--muted); }
.role b { color: var(--text); font-weight: 600; }
.caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 3px; vertical-align: -.15em; background: var(--cyan); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lede { max-width: 540px; margin: 20px 0 0; font-size: 18px; color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn {
  display: inline-block; padding: 12px 24px; border-radius: 10px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow: 0 6px 24px rgba(37, 99, 235, .45);
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(59, 130, 255, .6); }
.btn.ghost { background: var(--glass); border: 1px solid var(--border); box-shadow: none; }
.btn.ghost:hover { border-color: var(--border-hi); }

.stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 56px 0 0; padding: 0; }
.stat {
  min-width: 130px; padding: 14px 20px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--border);
}
.stat dd { margin: 0; font-size: 34px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.stat dt { order: 2; font-size: 13px; color: var(--muted); }
.stat { display: flex; flex-direction: column; }

/* ---------- sections ---------- */
.sec { padding: 72px 0; }
.sec.alt {
  background: rgba(3, 9, 24, .55);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
h2 { margin: 0 0 26px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 14px; }
h2::before { content: ""; width: 5px; height: 26px; border-radius: 3px; background: linear-gradient(var(--cyan), var(--blue)); }
#bio p { margin: 0 0 16px; color: var(--muted); font-size: 17px; }
#bio p:first-child { color: var(--text); font-size: 19px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { padding: 8px 16px; border-radius: 999px; background: var(--glass); border: 1px solid var(--border); font-size: 14.5px; transition: border-color .15s, transform .15s; }
.chip:hover { border-color: var(--border-hi); transform: translateY(-2px); }

/* ---------- projects ---------- */
.bar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-bottom: 28px; }
.bar-r { display: flex; gap: 10px; flex-wrap: wrap; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  font: inherit; font-size: 14px; color: var(--muted); background: var(--glass);
  border: 1px solid var(--border); padding: 7px 15px; border-radius: 999px; cursor: pointer;
  transition: all .15s;
}
.tab:hover { color: var(--text); border-color: var(--border-hi); }
.tab[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 18px rgba(59, 130, 255, .5); }
#q, #sort {
  font: inherit; font-size: 14px; padding: 8px 13px; color: var(--text);
  background: var(--glass); border: 1px solid var(--border); border-radius: 10px; outline: none;
}
#q { width: 200px; }
#q:focus, #sort:focus { border-color: var(--border-hi); }
#sort option { background: #0b1a38; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.grid.feat { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; cursor: pointer; overflow: hidden;
  background: var(--glass); border: 1px solid var(--border); border-radius: 14px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  outline: none;
}
.card::before { /* cursor spotlight */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(80, 150, 255, .22), transparent 70%);
}
.card:hover, .card:focus-visible { transform: translateY(-4px); border-color: var(--border-hi); box-shadow: 0 14px 40px rgba(20, 70, 200, .35); }
.card:hover::before { opacity: 1; }
.thumb {
  position: relative; height: 112px; display: flex; align-items: center; justify-content: center;
  font-size: 38px; font-weight: 800; color: rgba(255, 255, 255, .92); letter-spacing: -.02em;
  background: linear-gradient(135deg, #1d4ed8, #3b82ff);
}
.feat .thumb { height: 160px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.mod    { background: linear-gradient(135deg, #1e40af, #3b82ff); }
.thumb.plugin { background: linear-gradient(135deg, #0e7490, #22d3ee); }
.thumb.roblox { background: linear-gradient(135deg, #3730a3, #818cf8); }
.thumb.unity  { background: linear-gradient(135deg, #1e293b, #64748b); }
.thumb.web    { background: linear-gradient(135deg, #0369a1, #38bdf8); }
.badge {
  position: absolute; top: 10px; right: 10px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: #fff; background: rgba(4, 11, 28, .7); border: 1px solid var(--border);
}
.star { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #f5b73d; color: #1a1202; }
.body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.plat { margin: 2px 0 10px; font-size: 13px; color: #7db0ff; }
.card p { margin: 0 0 14px; font-size: 14.5px; color: var(--muted); flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: rgba(59, 130, 255, .18); color: #bcd2ff; }
.more { margin-top: 14px; font-size: 13.5px; font-weight: 600; color: #7db0ff; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ---------- modal ---------- */
dialog {
  width: min(680px, calc(100vw - 28px)); max-height: calc(100vh - 40px); padding: 0; overflow: auto;
  color: var(--text); background: #0a1730; border: 1px solid var(--border-hi); border-radius: 16px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65), 0 0 60px rgba(59, 130, 255, .25);
}
dialog::backdrop { background: rgba(2, 6, 16, .72); backdrop-filter: blur(5px); }
dialog[open] { animation: pop .22s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.m-img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.m-top { height: 120px; display: flex; align-items: center; justify-content: center; font-size: 46px; font-weight: 800; }
.m-body { padding: 22px 26px 28px; }
.m-body h3 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.m-meta { margin: 4px 0 16px; color: #7db0ff; font-size: 14px; }
.m-desc { margin: 0 0 18px; color: var(--muted); white-space: pre-line; }
.m-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.m-x {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border); background: rgba(4, 11, 28, .75); color: #fff; font-size: 18px; cursor: pointer;
}
.m-x:hover { border-color: var(--border-hi); }

/* ---------- contact / footer ---------- */
.links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.links a { display: inline-block; padding: 11px 22px; border-radius: 10px; background: var(--glass); border: 1px solid var(--border); font-weight: 500; transition: all .15s; }
.links a:hover { background: var(--blue); border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(59, 130, 255, .4); }
footer { border-top: 1px solid var(--border); padding: 24px 0; font-size: 14px; color: var(--muted); background: rgba(3, 8, 20, .6); }
.foot { display: flex; justify-content: center; gap: 16px; }
.foot a:hover { color: var(--text); }
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 25; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--border-hi); background: rgba(10, 23, 48, .85); color: #fff; font-size: 20px; cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}
.to-top:hover { background: var(--blue); }
.load-err { position: relative; z-index: 3; margin: 40px auto; max-width: 420px; padding: 14px 20px; border: 1px solid var(--border-hi); border-radius: 10px; background: var(--glass-2); text-align: center; }

/* ---------- scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .burger { display: block; }
  nav {
    position: absolute; top: 62px; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 22px 16px;
    background: rgba(4, 11, 28, .96); border-bottom: 1px solid var(--border);
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: all .2s;
  }
  nav.open { transform: none; opacity: 1; pointer-events: auto; }
  nav a { padding: 12px 6px; border-radius: 0; }
  .hero { padding: 64px 0 56px; }
  .pfp { width: 104px; height: 104px; }
  .sec { padding: 52px 0; }
  #q, .bar-r, #sort { width: 100%; }
  .grid, .grid.feat { grid-template-columns: 1fr; }
  .stat { min-width: 0; flex: 1 1 130px; }
}

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

/* ---------- about page ---------- */
.about-hero { padding: 90px 0 30px; }
.about-grid { display: flex; align-items: center; gap: 34px; flex-wrap: wrap; }
.about-grid .pfp { margin: 0; flex: none; }
.about-hero h1 { font-size: clamp(38px, 6.5vw, 66px); }
.make-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.make {
  padding: 18px 20px; border-radius: 14px; font-weight: 600; font-size: 17px;
  background: var(--glass); border: 1px solid var(--border);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.make:hover { transform: translateY(-3px); border-color: var(--border-hi); box-shadow: 0 10px 30px rgba(20, 70, 200, .3); }
@media (max-width: 760px) { .about-hero { padding: 56px 0 10px; } .about-grid { gap: 20px; } }

/* ---------- character art ---------- */
.hero-grid { display: flex; align-items: center; justify-content: space-between; gap: 48px; }
.hero-grid > div:first-child { flex: 1 1 0; min-width: 0; }
.oc {
  flex: none; width: min(380px, 38vw); aspect-ratio: 1; object-fit: cover; border-radius: 30px;
  border: 3px solid rgba(125, 176, 255, .85);
  box-shadow: 0 0 0 8px rgba(59, 130, 255, .14), 0 0 70px rgba(59, 130, 255, .5);
  transform: rotate(3deg); animation: ocfloat 7s ease-in-out infinite;
}
@keyframes ocfloat { 50% { transform: rotate(1deg) translateY(-10px); } }
@media (max-width: 860px) {
  .hero-grid { flex-direction: column-reverse; align-items: flex-start; gap: 28px; }
  .oc { width: min(260px, 70vw); }
}

/* ---------- projects page ---------- */
.page-hero { padding: 80px 0 10px; }
.page-hero h1 { font-size: clamp(40px, 7vw, 68px); }
.page-hero .lede { margin-top: 10px; }
.all-link { margin: 28px 0 0; font-weight: 600; }
.all-link a { color: #7db0ff; }
.all-link a:hover { text-decoration: underline; }
@media (max-width: 760px) { .page-hero { padding: 50px 0 6px; } }

/* closing call-to-action */
.cta-sec { padding-top: 24px; padding-bottom: 80px; }
.cta-box {
  text-align: center; padding: 44px 24px; border-radius: 20px;
  background: var(--glass); border: 1px solid var(--border);
  box-shadow: 0 0 60px rgba(59, 130, 255, .12);
}
.cta-box h2 { justify-content: center; margin-bottom: 8px; font-size: 26px; }
.cta-box h2::before { display: none; }
.cta-box p { margin: 0 0 24px; color: var(--muted); }

/* ---------- social buttons ---------- */
.social-row { margin-top: 28px; }
.links a.social { display: inline-flex; align-items: center; gap: 10px; padding: 11px 20px 11px 16px; }
.links a.social svg { flex: none; }
.links a.social:hover { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 8px 26px color-mix(in srgb, var(--brand) 55%, transparent); }

/* ---------- layout on any screen ---------- */
html { -webkit-text-size-adjust: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
main { flex: 1 0 auto; width: 100%; }
footer { margin-top: auto; flex: none; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.to-top { right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); }
img, svg, canvas { max-width: 100%; }
h1, h2, h3, p, a, .chip, .make { overflow-wrap: anywhere; }
.top-in, .wrap { padding-left: max(22px, env(safe-area-inset-left)); padding-right: max(22px, env(safe-area-inset-right)); }

/* big screens: a little more room and bigger type */
@media (min-width: 1500px) {
  .wrap { max-width: 1280px; }
  .narrow { max-width: 800px; }
  body { font-size: 17px; }
  .oc { width: 440px; }
}
@media (min-width: 2200px) {
  .wrap { max-width: 1500px; }
  body { font-size: 19px; }
  .oc { width: 520px; }
}

/* tablets */
@media (max-width: 1024px) {
  .grid, .grid.feat { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

/* phones */
@media (max-width: 560px) {
  .wrap, .top-in { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .logo span span:last-child { display: none; }          /* keep just the name in the header */
  h2 { font-size: 24px; }
  .cta .btn { flex: 1 1 100%; text-align: center; }
  .stats { gap: 10px; }
  .stat { flex: 1 1 calc(50% - 10px); padding: 12px 14px; }
  .stat dd { font-size: 28px; }
  .tabs { gap: 6px; }
  .tab { padding: 6px 12px; font-size: 13px; }
  .bar-r { width: 100%; }
  #sort, #q { flex: 1 1 100%; }
  .links { gap: 10px; }
  .links a { padding: 10px 16px; }
  .make-grid { grid-template-columns: 1fr 1fr; }
  .cta-box { padding: 32px 16px; }
  dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .m-body { padding: 18px 18px 22px; }
  .m-body h3 { font-size: 22px; }
}

/* very small phones */
@media (max-width: 360px) {
  .make-grid { grid-template-columns: 1fr; }
  .stat { flex: 1 1 100%; }
  h1 { font-size: 34px; }
}

/* short landscape screens */
@media (max-height: 520px) and (orientation: landscape) {
  .hero, .about-hero, .page-hero { padding-top: 40px; }
  .top { position: static; }
}

/* character art: keep it square (the height attribute was stretching it into a tall crop) */
.oc { height: auto; }
@media (max-width: 860px) {
  .hero-grid { align-items: center; gap: 24px; }
  .hero-grid > div:first-child { width: 100%; }
  .oc { width: min(230px, 62vw); transform: rotate(2deg); animation-name: ocfloat-s; }
}
@keyframes ocfloat-s { 50% { transform: rotate(0deg) translateY(-6px); } }
@media (max-width: 560px) { .oc { border-width: 2px; border-radius: 24px; box-shadow: 0 0 0 5px rgba(59, 130, 255, .14), 0 0 44px rgba(59, 130, 255, .45); } }

/* the character is always shown as a square (never a circle, never stretched) */
.logo-img { border-radius: 8px; object-fit: contain; aspect-ratio: 1; }
.pfp { border-radius: 24px; height: auto; aspect-ratio: 1; }
.oc { object-fit: contain; }

/* glow on the heading you just scrolled to */
h2.flash::before { animation: barpulse 1.1s ease-out; }
h2.flash { animation: headglow 1.1s ease-out; }
@keyframes barpulse { 0% { transform: scaleY(1); } 30% { transform: scaleY(1.9); box-shadow: 0 0 18px var(--cyan); } 100% { transform: scaleY(1); } }
@keyframes headglow { 30% { text-shadow: 0 0 22px rgba(80, 190, 255, .75); } }
