:root {
  --bg: #ffffff;
  --fg: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --card: #ffffff;
  --chip: #f9fafb;
  --accent: #2b9ae6;
  --btn-bg: #111827;
  --btn-fg: #ffffff;
  --pixel: #ffffff;
  --g0: #ebedf0; --g1: #9be9a8; --g2: #40c463; --g3: #30a14e; --g4: #216e39;
}
:root[data-theme="dark"] {
  --bg: #0b0d12;
  --fg: #f3f4f6;
  --muted: #9ca3af;
  --line: #1f2430;
  --card: #11141b;
  --chip: #151922;
  --accent: #4fb3ff;
  --btn-bg: #f3f4f6;
  --btn-fg: #0b0d12;
  --pixel: #0b0d12;
  --g0: #161b22; --g1: #0e4429; --g2: #006d32; --g3: #26a641; --g4: #39d353;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12; --fg: #f3f4f6; --muted: #9ca3af; --line: #1f2430; --card: #11141b;
    --chip: #151922; --accent: #4fb3ff; --btn-bg: #f3f4f6; --btn-fg: #0b0d12; --pixel: #0b0d12;
    --g0: #161b22; --g1: #0e4429; --g2: #006d32; --g3: #26a641; --g4: #39d353;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.wrap { max-width: 48rem; margin: 0 auto; padding: 0 1.5rem; }
@media (max-width: 640px) { .wrap { padding: 0 1rem; } }
main { display: flex; flex-direction: column; gap: 4rem; padding-bottom: 4rem; }

/* NAV */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.nav__logo { font-weight: 700; font-size: .85rem; letter-spacing: .02em; }
.nav__links { display: flex; align-items: center; gap: 1rem; font-size: .8rem; color: var(--muted); }
.nav__links a:hover { color: var(--fg); }
.nav__sep { width: 1px; height: 14px; background: var(--line); }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; display: grid; }
.icon-btn:hover { color: var(--fg); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}
@media (max-width: 560px) { .nav__links a:nth-child(2), .nav__links a:nth-child(3) { display: none; } }

/* HERO */
.hero { padding-top: 4rem; display: flex; flex-direction: column; gap: 1.75rem; }
@media (max-width: 640px) { .hero { padding-top: 1.5rem; } }
.hero__id { display: flex; align-items: center; gap: 1.5rem; }
.hero__name { display: flex; align-items: center; gap: .5rem; font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.verified { color: var(--accent); flex-shrink: 0; }
.hero__roles { color: var(--muted); font-size: .85rem; margin-top: .4rem; }
.hero__socials { display: flex; gap: .6rem; margin-top: .6rem; color: var(--muted); }
.hero__socials a:hover { color: var(--fg); }
.hero__title { font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; }
.accent { color: var(--accent); }
.hero__bio { color: var(--muted); font-size: 1.05rem; line-height: 1.75; }
.btn {
  align-self: flex-start; display: inline-flex; gap: .6rem; align-items: center;
  background: var(--btn-bg); color: var(--btn-fg); padding: .7rem 1.2rem; border-radius: 8px;
  font-size: .9rem; font-weight: 500; transition: transform .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); opacity: .9; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.stat { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 1rem; display: flex; flex-direction: column; }
.stat b { font-size: 1.6rem; font-weight: 700; }
.stat span { color: var(--muted); font-size: .75rem; }

/* PIXEL AVATAR */
.pixel-card {
  position: relative; overflow: hidden; flex-shrink: 0; cursor: pointer;
  width: 160px; height: 160px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
@media (max-width: 640px) { .pixel-card { width: 128px; height: 128px; } }
.pixel-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pixel-card__default, .pixel-card__active, .pixel-card__pixels {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.pixel-card img { object-fit: cover; object-position: center; }
.pixel-card__active { z-index: 2; display: none; transform: scale(1.1); }
.pixel-card.is-active .pixel-card__active { display: block; }
.pixel-card__pixels { z-index: 3; pointer-events: none; }
.pixel { position: absolute; display: none; background: var(--pixel); }
.pixel-card__hint {
  position: absolute; inset: 0; z-index: 4; display: grid; place-items: center;
  background: rgba(17, 24, 39, .55); color: #fff; font-size: .7rem; font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,.7); opacity: 0; pointer-events: none; transition: opacity .3s;
}
.pixel-card__hint.is-visible { opacity: 1; }

/* SECTIONS */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.25rem; }
.section-head h2 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
.more { color: var(--muted); font-size: .8rem; }
.more:hover { color: var(--fg); }

/* PROJECTS */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; }
.project {
  border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 1.1rem;
  display: flex; flex-direction: column; gap: .5rem; transition: transform .2s, border-color .2s;
}
.project:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.project h3 { font-size: 1rem; font-weight: 700; word-break: break-word; }
.project__meta { display: flex; gap: .8rem; color: var(--muted); font-size: .75rem; align-items: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: .3rem; }
.project p { color: var(--muted); font-size: .85rem; flex: 1; }
.project__links { display: flex; gap: 1rem; font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.project__links a:hover { color: var(--accent); }

/* MARQUEE */
.marquee { display: flex; flex-direction: column; gap: .7rem; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__row { display: flex; width: max-content; gap: .6rem; animation: scroll 40s linear infinite; }
.marquee__row:nth-child(2) { animation-direction: reverse; }
.marquee:hover .marquee__row { animation-play-state: paused; }
.chip { border: 1px solid var(--line); background: var(--chip); border-radius: 8px; padding: .35rem .75rem; font-size: .8rem; white-space: nowrap; display: inline-flex; align-items: center; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ACTIVITY */
.activity { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.activity__scroll { overflow-x: auto; }
.graph { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 9px); grid-auto-columns: 9px; gap: 2px; width: max-content; }
.graph i { border-radius: 2px; background: var(--g0); }
.graph i[data-l="1"] { background: var(--g1); }
.graph i[data-l="2"] { background: var(--g2); }
.graph i[data-l="3"] { background: var(--g3); }
.graph i[data-l="4"] { background: var(--g4); }
#contrib-total { font-size: .8rem; }

/* CONTACT */
.contact { border-top: 1px solid var(--line); padding-top: 3rem; display: flex; flex-direction: column; gap: 1rem; }
.contact h2 { font-size: 1.8rem; font-weight: 800; }
.contact p { color: var(--muted); }
.contact__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .5rem; }
.btn--ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }

.footer { padding-bottom: 6rem; font-size: .8rem; }

.fab {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 30; display: inline-flex; gap: .6rem; align-items: center;
  background: var(--btn-bg); color: var(--btn-fg); padding: .7rem 1.1rem; border-radius: 10px;
  font-size: .85rem; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.18);
}

/* SCROLL REVEAL */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee__row { animation: none; flex-wrap: wrap; width: auto; }
  .pixel-card__hint { transition: none; }
}

/* REKA SUITE */
.reka-hero {
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #0d1015; color: #f3f4f6;
  display: grid; grid-template-columns: 1.05fr 1fr; margin-bottom: .9rem;
}
.reka-hero__shot { width: 100%; height: 100%; object-fit: cover; object-position: left top; display: block; min-height: 260px; }
.reka-hero__body { padding: 1.5rem; display: flex; flex-direction: column; gap: .75rem; }
.reka-hero__mark { width: 120px; height: auto; }
.eyebrow { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #9ca3af; }
.reka-hero h3 { font-size: 1.25rem; line-height: 1.3; }
.reka-hero p:not(.eyebrow) { color: #b6bcc8; font-size: .88rem; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.tags li { font-size: .7rem; border: 1px solid #2a303c; background: #151922; border-radius: 6px; padding: .2rem .5rem; color: #d1d5db; }
.reka-hero__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: auto; padding-top: .4rem; }
.reka-hero .btn--ghost { color: #f3f4f6; border-color: #2a303c; }
.btn--reka { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
@media (max-width: 680px) { .reka-hero { grid-template-columns: 1fr; } .reka-hero__shot { max-height: 260px; } }

.reka-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; }
.reka-card__media { margin: -1.1rem -1.1rem .4rem; aspect-ratio: 1200 / 630; overflow: hidden; border-radius: 12px 12px 0 0; background: #0d1015; }
.reka-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reka-card__media--bar img { object-fit: contain; }
.reka-card__media--vm { display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #4f46e5 0, transparent 55%), radial-gradient(circle at 80% 80%, #22c55e 0, transparent 50%), #0d1015; }
.reka-card__media--vm span { color: #fff; font-weight: 800; letter-spacing: .02em; text-shadow: 0 2px 10px rgba(0,0,0,.5); }

/* CONTRIBUTION CALENDAR (GitHub-like) */
.cal { display: grid; grid-template-columns: auto max-content; grid-template-rows: auto auto; column-gap: 6px; row-gap: 4px; width: max-content; }
.cal__months { grid-column: 2; position: relative; height: 14px; font-size: .65rem; color: var(--muted); }
.cal__months span { position: absolute; top: 0; }
.cal__days { grid-row: 2; display: grid; grid-template-rows: repeat(7, 9px); gap: 2px; font-size: .6rem; color: var(--muted); line-height: 9px; }
.activity__foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .8rem; }
.activity__foot a:hover { color: var(--fg); }
.legend { display: flex; align-items: center; gap: 3px; font-size: .7rem; }
.legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--g0); }
.legend i[data-l="1"] { background: var(--g1); } .legend i[data-l="2"] { background: var(--g2); }
.legend i[data-l="3"] { background: var(--g3); } .legend i[data-l="4"] { background: var(--g4); }
