/* ==========================================================================
   Jerson Ian N. Sernadilla — Portfolio
   Same design system as the Quadrix Solutions site.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Brand (Quadrix palette) */
  --navy-950: #050a1c;
  --navy-900: #070d24;
  --navy-850: #08122f;
  --navy-800: #0b1838;
  --navy-700: #12224a;
  --blue-500: #1c86ff;
  --blue-400: #2b9dff;
  --cyan-400: #35cdf6;
  --indigo-500: #2a4dff;

  --bg: var(--navy-900);
  --bg-alt: var(--navy-950);
  --surface: rgba(140, 170, 255, 0.045);
  --surface-hover: rgba(140, 170, 255, 0.075);
  --border: rgba(140, 175, 255, 0.13);
  --border-strong: rgba(140, 175, 255, 0.24);
  --text: #eaf0ff;
  --text-soft: #c3cdea;
  --muted: #8f9cc2;

  --grad: linear-gradient(120deg, var(--cyan-400) 0%, var(--blue-500) 50%, var(--indigo-500) 100%);
  --glow: 0 10px 40px -12px rgba(28, 134, 255, 0.55);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;

  --font-head: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --nav-h: 68px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--cyan-400);
  outline-offset: 3px;
  border-radius: 6px;
}

svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.fill { fill: currentColor; stroke: none; }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--blue-500); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm);
}
.skip:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font-head); font-weight: 600; font-size: 15px; letter-spacing: 0.005em;
  white-space: nowrap;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn svg { font-size: 16px; }
.btn--sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn--primary { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 14px 44px -12px rgba(53, 205, 246, 0.6); }
.btn--ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { background: var(--surface-hover); border-color: rgba(53, 205, 246, 0.5); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border);
  transition: background-color .2s ease, border-color .2s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--border-strong); }
.icon-btn svg { font-size: 20px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(7, 13, 36, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: background-color .25s ease, border-color .25s ease;
}
.nav.is-scrolled { background: rgba(6, 11, 30, 0.86); border-bottom-color: var(--border); }
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__mark {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--grad); color: #fff;
  font-family: var(--font-head); font-weight: 700; font-size: 14px; letter-spacing: 0.02em;
  box-shadow: var(--glow);
}
.brand__word {
  font-family: var(--font-head); font-weight: 700; font-size: 19px; letter-spacing: 0.16em;
}
.brand__x { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand--sm .brand__mark { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
.brand--sm .brand__word { font-size: 15px; }

.nav__links { display: flex; align-items: center; gap: 6px; }
.nav__links a:not(.btn) {
  padding: 8px 14px; border-radius: 999px;
  color: var(--text-soft); font-size: 15px; font-weight: 500;
  transition: color .2s ease, background-color .2s ease;
}
.nav__links a:not(.btn):hover { color: var(--text); background: var(--surface); }
.nav__links a.is-active { color: var(--text); background: var(--surface-hover); }
.nav__cta { margin-left: 8px; }

.nav__toggle {
  display: none;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  place-items: center;
}
.nav__toggle svg { font-size: 22px; }

@media (max-width: 760px) {
  .nav__toggle { display: inline-grid; }
  .nav__links {
    position: absolute; left: 0; right: 0; top: var(--nav-h);
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px var(--gutter) 20px;
    background: #060b1e;
    box-shadow: 0 24px 40px -12px rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .nav.is-open .nav__links { transform: none; opacity: 1; visibility: visible; }
  .nav.is-open { background: #060b1e; }
  .nav__links a:not(.btn) { padding: 12px 14px; font-size: 16px; }
  .nav__cta { margin: 8px 0 0; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin-top: calc(var(--nav-h) * -1);
  padding: calc(var(--nav-h) + clamp(40px, 7vw, 96px)) 0 clamp(64px, 9vw, 112px);
  background:
    radial-gradient(60% 50% at 12% 70%, rgba(28, 80, 200, 0.28), transparent 70%),
    radial-gradient(40% 40% at 88% 12%, rgba(20, 110, 170, 0.22), transparent 70%),
    linear-gradient(#091536, var(--bg) 92%);
  overflow: hidden;
}
.hero::before {
  /* faint dot grid like the Quadrix banner */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(150, 180, 255, 0.10) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(#000, transparent 85%);
  -webkit-mask-image: linear-gradient(#000, transparent 85%);
}

.hero__grid {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(40px, 6vw, 80px); align-items: center;
}

.hero__kicker {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 10px; border-radius: 999px;
  border: 1px solid rgba(53, 205, 246, 0.3); background: rgba(53, 205, 246, 0.07);
  color: var(--cyan-400); font-family: var(--font-head); font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan-400); }
.pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--cyan-400); opacity: 0;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.8); opacity: 0; } }

.hero__name {
  margin-top: 22px;
  font-size: clamp(38px, 5.6vw, 66px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.05;
}
.hero__name .grad-text { display: inline-block; padding-bottom: 0.06em; }
.hero__role { margin-top: 18px; font-family: var(--font-head); font-weight: 600; font-size: clamp(18px, 2vw, 23px); color: var(--text); }
.hero__lead { margin-top: 12px; max-width: 560px; font-size: clamp(16px, 1.4vw, 18px); color: var(--text-soft); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px; margin: 40px 0 0; width: 100%; max-width: 520px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.stats div { display: flex; flex-direction: column; gap: 2px; background: rgba(7, 13, 36, 0.92); padding: 16px 18px; }
.stats dt { color: var(--muted); font-size: 13px; }
.stats dd {
  order: -1;
  margin: 0; font-family: var(--font-head); font-weight: 700; font-size: clamp(24px, 3vw, 30px); line-height: 1.2;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ID card + terminal */
.hero__visual { position: relative; padding: 26px 18px; }
.idcard {
  position: relative;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(16, 28, 64, 0.92), rgba(8, 16, 42, 0.95));
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(53, 205, 246, 0.05), var(--glow);
}
.idcard::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 50% at 100% 0%, rgba(53, 205, 246, 0.14), transparent 70%);
}
.idcard__bar {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  height: 38px; padding: 0 14px;
  background: rgba(16, 28, 64, 0.9); border-bottom: 1px solid var(--border);
}
.idcard__title { color: var(--muted); font-family: var(--font-mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idcard__profile { position: relative; display: flex; align-items: center; gap: 16px; padding: 22px 22px 20px; border-bottom: 1px solid var(--border); }
.idcard__name { font-family: var(--font-head); font-weight: 700; font-size: 18px; line-height: 1.25; }
.idcard__role { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

.term {
  position: relative; margin: 0;
  padding: 18px 22px 22px;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.8;
  color: var(--text-soft); white-space: pre-wrap; overflow-wrap: anywhere;
}
.term .t-p { color: var(--cyan-400); }
.term .t-cmd { color: var(--text); }
.term .t-out { color: var(--muted); }
.term .t-hi { color: #9be7b5; }
.cursor { display: inline-block; width: 8px; height: 1.05em; vertical-align: -2px; background: var(--cyan-400); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.chip {
  position: absolute; z-index: 2;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(8, 18, 47, 0.92); border: 1px solid var(--border-strong);
  font-family: var(--font-head); font-size: 13px; font-weight: 600;
  box-shadow: 0 16px 30px -14px rgba(0, 0, 0, 0.7);
  animation: float 6s ease-in-out infinite;
}
.chip::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--grad); vertical-align: 1px; }
.chip--a { top: 0; right: 0; }
.chip--b { left: -6px; bottom: 2px; animation-delay: -2s; }
.chip--c { right: 30px; bottom: 2px; animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-8px); } }

@media (max-width: 920px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__visual { max-width: 480px; }
}
@media (max-width: 600px) {
  .hero__actions .btn { flex: 1 1 200px; }
  .stats div { padding: 14px 12px; }
  .hero__visual { padding: 22px 0 18px; }
  .chip--a { right: 6px; }
  .chip--b { left: 6px; }
  .chip--c { right: 16px; }
}

/* ---------- Avatar ---------- */
.avatar {
  width: 104px; height: 104px; border-radius: 50%; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: var(--grad);
  font-family: var(--font-head); font-weight: 700; font-size: 34px; letter-spacing: 0.04em; color: #fff;
  box-shadow: 0 0 0 4px var(--navy-900), 0 0 0 5px rgba(53, 205, 246, 0.45), var(--glow);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--md { width: 68px; height: 68px; font-size: 22px; box-shadow: 0 0 0 3px var(--navy-850), 0 0 0 4px rgba(53, 205, 246, 0.45); }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 120px) 0; position: relative; }
.section--alt {
  background:
    radial-gradient(50% 60% at 100% 0%, rgba(42, 77, 255, 0.10), transparent 70%),
    var(--bg-alt);
  border-block: 1px solid var(--border);
}
.section__head { max-width: 680px; margin-bottom: clamp(36px, 5vw, 56px); }
.section__head h2, .contact h2, .about h2 { font-size: clamp(30px, 4.2vw, 46px); font-weight: 700; }
.section__lead { margin-top: 14px; color: var(--muted); font-size: clamp(16px, 1.4vw, 18px); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
  font-family: var(--font-head); font-size: 12px; font-weight: 600;
  letter-spacing: 0.32em; text-transform: uppercase; color: var(--cyan-400);
}
.eyebrow span {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 24px; padding: 0 8px; border-radius: 999px;
  border: 1px solid rgba(53, 205, 246, 0.35); background: rgba(53, 205, 246, 0.08);
  letter-spacing: 0.08em;
}

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.about__text { margin-top: 22px; display: grid; gap: 16px; color: var(--text-soft); font-size: clamp(16px, 1.4vw, 18px); }

.facts, .contact__list { display: flex; flex-direction: column; gap: 10px; }
.facts a, .facts div, .contact__list a, .contact__list div {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color .2s ease, background-color .2s ease;
}
.facts a, .facts div { background: var(--surface); }
.facts a:hover { border-color: rgba(53, 205, 246, 0.5); background: var(--surface-hover); }
.facts__arrow { color: var(--muted); font-size: 18px; }
.facts a:hover .facts__arrow { color: var(--cyan-400); }

.contact__icon {
  display: grid; place-items: center; flex: none;
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(53, 205, 246, 0.1); color: var(--cyan-400);
}
.contact__icon svg { font-size: 20px; }
.contact__label { display: block; color: var(--muted); font-size: 12.5px; }
.contact__text { min-width: 0; flex: 1; }
.contact__value { display: block; font-weight: 600; overflow-wrap: anywhere; }
.contact__value.is-muted { color: var(--muted); font-weight: 500; }

@media (max-width: 860px) {
  .about { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 262px), 1fr)); gap: clamp(14px, 2vw, 20px); }

.skill {
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px 22px 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: border-color .25s ease, background-color .25s ease, transform .25s ease;
}
.skill:hover { border-color: var(--border-strong); background: var(--surface-hover); transform: translateY(-3px); }
.skill__head { display: flex; align-items: center; gap: 14px; }
.skill__logo {
  display: grid; place-items: center; flex: none;
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(145deg, rgba(53, 205, 246, 0.2), rgba(42, 77, 255, 0.22));
  border: 1px solid rgba(53, 205, 246, 0.32);
  font-family: var(--font-head); font-weight: 700; font-size: 15px; letter-spacing: 0.02em; color: #fff;
}
.skill__logo.is-long { font-size: 12.5px; }
.skill h3 { font-size: 19px; font-weight: 700; }
.skill__kind { color: var(--muted); font-size: 13px; margin-top: 2px; }
.skill__desc { color: var(--text-soft); font-size: 15px; }
.skill__used { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; padding-top: 4px; font-size: 12.5px; color: var(--muted); }
.skill__used a {
  padding: 3px 10px; border-radius: 999px;
  background: rgba(53, 205, 246, 0.07); border: 1px solid rgba(53, 205, 246, 0.25);
  color: var(--text-soft); font-weight: 500;
  transition: color .2s ease, border-color .2s ease;
}
.skill__used a:hover { color: var(--cyan-400); border-color: rgba(53, 205, 246, 0.55); }
.skill__used .is-label { flex-basis: 100%; margin-bottom: 2px; }
.skill__used .is-none { font-style: italic; }

.skill--also {
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(28, 134, 255, 0.14), transparent 60%),
    var(--surface);
  border-style: dashed;
}
.skill--also:hover { transform: none; }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 32px); }

.project {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .25s ease, transform .25s ease, background-color .25s ease, box-shadow .25s ease;
}
.project:hover { border-color: var(--border-strong); background: var(--surface-hover); transform: translateY(-3px); }
.project.is-target { border-color: rgba(53, 205, 246, 0.7); box-shadow: 0 0 0 4px rgba(53, 205, 246, 0.15); }

.project__shot { display: block; padding: 14px 14px 0; position: relative; }
.browser {
  border-radius: 12px 12px 0 0; overflow: hidden;
  border: 1px solid var(--border-strong); border-bottom: 0;
  background: #0d1735;
}
.browser__bar {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 12px;
  background: #101c40; border-bottom: 1px solid var(--border);
}
.browser__dots { display: flex; gap: 6px; }
.browser__dots i { width: 9px; height: 9px; border-radius: 50%; background: #2a3a66; }
.browser__url {
  flex: 1; min-width: 0;
  height: 22px; line-height: 22px; padding: 0 10px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.05); color: var(--muted);
  font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.browser__url.is-file { font-family: var(--font-mono); font-size: 11.5px; }
.browser__view { aspect-ratio: 16 / 10; overflow: hidden; background: #0d1735; position: relative; }
.browser__view img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.project:hover .browser__view img { transform: scale(1.035); }
.project__open {
  position: absolute; right: 26px; bottom: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(5, 10, 28, 0.82); border: 1px solid var(--border-strong);
  font-size: 13px; font-weight: 600;
  opacity: 0; transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
}
.project:hover .project__open, .project__shot:focus-visible .project__open { opacity: 1; transform: none; }

/* Play overlay when a project has a walkthrough video */
.project__play {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: radial-gradient(closest-side, rgba(5, 10, 28, 0.5), rgba(5, 10, 28, 0.12));
  transition: background-color .25s ease;
}
.project__play-btn {
  display: grid; place-items: center;
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--grad); color: #fff;
  box-shadow: 0 0 0 8px rgba(53, 205, 246, 0.18), var(--glow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.project__play-btn svg { font-size: 30px; margin-left: 4px; }
.project__play-label {
  padding: 6px 13px; border-radius: 999px;
  background: rgba(5, 10, 28, 0.82); border: 1px solid var(--border-strong);
  font-family: var(--font-head); font-size: 13px; font-weight: 600;
}
.project:hover .project__play-btn, .project__shot:focus-visible .project__play-btn {
  transform: scale(1.08); box-shadow: 0 0 0 12px rgba(53, 205, 246, 0.22), var(--glow);
}
@media (max-width: 600px) {
  .project__play-btn { width: 58px; height: 58px; }
  .project__play-btn svg { font-size: 24px; }
}

/* Code preview inside the browser frame */
.browser__view--code { background: #0a1330; }
.browser__view--code::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
  background: linear-gradient(transparent, #0a1330 88%);
  pointer-events: none;
}
.code {
  margin: 0; padding: 14px 0;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7;
  color: #c9d4f2; white-space: pre; overflow: hidden;
  font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0;
  counter-reset: line;
}
.code .ln { display: block; padding-right: 16px; }
.code .ln::before {
  counter-increment: line; content: counter(line);
  display: inline-block; width: 3.2em; padding-right: 1.2em; text-align: right;
  color: #3b4a78; user-select: none;
}
.tok-k { color: #7cc4ff; }
.tok-s { color: #9be7b5; }
.tok-c { color: #6b7aa6; font-style: italic; }
.tok-n { color: #fbbf5c; }
.tok-f { color: var(--cyan-400); }
.tok-v { color: #e3a6ff; }
.code__lang {
  position: absolute; right: 12px; bottom: 12px; z-index: 1;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(5, 10, 28, 0.82); border: 1px solid var(--border-strong);
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-soft);
}

.project__body { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px 24px; flex: 1; border-top: 1px solid var(--border); }
.project__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.project h3 { font-size: 24px; font-weight: 700; }
.project h3 a:hover { color: var(--cyan-400); }
.project__desc { color: var(--text-soft); font-size: 15px; }
.project__note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(53, 205, 246, 0.06); border: 1px solid rgba(53, 205, 246, 0.2);
  color: var(--text-soft); font-size: 14px;
}
.project__note svg { color: var(--cyan-400); font-size: 16px; margin-top: 3px; }
.project__foot { display: flex; flex-direction: column; gap: 14px; margin-top: auto; padding-top: 6px; }
.project__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Download tiles */
.downloads { display: flex; flex-direction: column; gap: 8px; }
.dl {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 10px 10px; border-radius: 14px;
  background: rgba(53, 205, 246, 0.06); border: 1px solid rgba(53, 205, 246, 0.24);
  transition: border-color .2s ease, background-color .2s ease;
}
.dl:hover { border-color: rgba(53, 205, 246, 0.6); background: rgba(53, 205, 246, 0.11); }
.dl__icon {
  display: grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--grad); color: #fff; box-shadow: var(--glow);
}
.dl__icon svg { font-size: 18px; }
.dl__text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.dl__label { font-family: var(--font-head); font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.dl__meta { color: var(--muted); font-size: 12.5px; }
.dl__go { flex: none; color: var(--muted); font-size: 18px; transition: color .2s ease, transform .2s ease; }
.dl:hover .dl__go { color: var(--cyan-400); transform: translateY(1px); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--live { color: #4ade9b; border-color: rgba(74, 222, 155, 0.35); background: rgba(74, 222, 155, 0.08); }
.badge--done { color: #8fb8ff; border-color: rgba(143, 184, 255, 0.35); background: rgba(143, 184, 255, 0.08); }
.badge--early { color: #fbbf5c; border-color: rgba(251, 191, 92, 0.35); background: rgba(251, 191, 92, 0.08); }
.badge--dev { color: var(--cyan-400); border-color: rgba(53, 205, 246, 0.35); background: rgba(53, 205, 246, 0.08); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  color: var(--text-soft); font-size: 12.5px;
}

/* Featured project (full width) */
.project--featured { grid-column: 1 / -1; }
.project--featured .browser__view { aspect-ratio: 2048 / 922; }
.project--featured h3 { font-size: clamp(26px, 3vw, 34px); }
.project--featured .project__desc { font-size: 16px; }
@media (min-width: 1000px) {
  .project--featured { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .project--featured .project__shot { padding: 18px 0 18px 18px; align-self: center; }
  .project--featured .browser { border-radius: 12px; border-bottom: 1px solid var(--border-strong); }
  .project--featured .project__open { right: 12px; bottom: 30px; }
  .project--featured .project__body { border-top: 0; padding: 30px 30px 28px; justify-content: center; }
}

/* "Have a project in mind?" card: fills the last cell, or a full row */
.project--cta {
  justify-content: center; gap: 18px;
  padding: clamp(26px, 4vw, 40px);
  background:
    radial-gradient(80% 90% at 0% 0%, rgba(28, 134, 255, 0.18), transparent 60%),
    radial-gradient(70% 80% at 100% 100%, rgba(53, 205, 246, 0.10), transparent 60%),
    var(--surface);
  border-style: dashed;
  position: relative; overflow: hidden;
}
.project--cta:hover { transform: none; }
.project--cta h3 { font-size: clamp(24px, 2.8vw, 32px); }
.project--cta p { color: var(--muted); font-size: 16px; max-width: 420px; }
.project--cta .btn { align-self: flex-start; }
.project--cta::after {
  content: "{ }"; position: absolute; right: -10px; bottom: -50px;
  font-family: var(--font-head); font-weight: 700; font-size: 200px; line-height: 1;
  color: #fff; opacity: .035; pointer-events: none;
}
.project--cta.is-wide { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
.project--cta.is-wide .btn { align-self: center; }

@media (max-width: 860px) {
  .projects { grid-template-columns: 1fr; }
  .project--cta.is-wide { flex-direction: column; align-items: flex-start; }
  .project--cta.is-wide .btn { align-self: flex-start; }
}

/* ---------- Albums ---------- */
.albums { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: clamp(20px, 3vw, 32px); }

.album {
  display: flex; flex-direction: column; text-align: left;
  padding: 0; border: 0; background: none;
}
.album__stack { position: relative; aspect-ratio: 2 / 1; margin: 18px 18px 0; }
.album__stack > div {
  position: absolute; inset: 0;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--navy-800);
  transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}
.album__stack img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.album__stack .layer-3 { transform: rotate(-5deg) translate(-10px, 4px) scale(.94); opacity: .55; }
.album__stack .layer-2 { transform: rotate(3.5deg) translate(10px, -2px) scale(.97); opacity: .8; }
.album__stack .layer-1 { box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.7); }
.album:hover .layer-3, .album:focus-visible .layer-3 { transform: rotate(-9deg) translate(-26px, 6px) scale(.94); }
.album:hover .layer-2, .album:focus-visible .layer-2 { transform: rotate(6deg) translate(24px, -6px) scale(.97); }
.album:hover .layer-1, .album:focus-visible .layer-1 { transform: translateY(-4px); }

.album__count {
  position: absolute; left: 12px; bottom: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px;
  background: rgba(5, 10, 28, 0.82); border: 1px solid var(--border-strong);
  font-size: 13px; font-weight: 600;
}
.album__info { padding: 22px 4px 0; }
.album__business { color: var(--cyan-400); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.album__title { font-family: var(--font-head); font-size: 21px; font-weight: 700; margin-top: 6px; }
.album__desc { color: var(--muted); font-size: 15px; margin-top: 6px; }
.album:focus-visible { outline-offset: 6px; border-radius: var(--radius); }

/* Long emails: shorten the username with "…" and keep "@gmail.com" visible, on one line */
.email { display: flex; min-width: 0; white-space: nowrap; }
.email__user { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.email__domain { flex: none; }

/* ---------- Contact ---------- */
.section--contact { padding-top: clamp(72px, 10vw, 120px); }
.contact {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center;
  padding: clamp(28px, 5vw, 56px);
  border-radius: 28px;
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(70% 120% at 0% 100%, rgba(42, 77, 255, 0.30), transparent 60%),
    radial-gradient(60% 100% at 100% 0%, rgba(53, 205, 246, 0.16), transparent 60%),
    var(--navy-800);
  position: relative; overflow: hidden;
}
.contact::after {
  content: "</>"; position: absolute; right: -20px; bottom: -70px;
  font-family: var(--font-head); font-weight: 700; font-size: 260px; line-height: 1;
  color: #fff; opacity: .04; pointer-events: none;
}
.contact__list { position: relative; z-index: 1; }
.contact__list a, .contact__list div { background: rgba(5, 10, 28, 0.55); }
.contact__list a:hover { border-color: rgba(53, 205, 246, 0.5); background: rgba(5, 10, 28, 0.75); }

@media (max-width: 860px) {
  .contact { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; background: var(--bg-alt); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.footer__note { color: var(--muted); font-size: 14px; }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(3, 6, 18, 0.96); color: var(--text);
  display: none; flex-direction: column;
}
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: rgba(3, 6, 18, 0.8); backdrop-filter: blur(6px); }

.lightbox__top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px var(--gutter);
}
.lightbox__business { color: var(--cyan-400); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.lightbox__title { font-size: clamp(18px, 2.4vw, 22px); font-weight: 700; margin-top: 2px; }

.lightbox__stage {
  position: relative; flex: 1; min-height: 0;
  display: flex; align-items: stretch; justify-content: center; gap: 12px;
  padding: 0 var(--gutter);
}
.lightbox__nav { align-self: center; flex: none; }
.lightbox__figure { margin: 0; flex: 1; min-width: 0; position: relative; }
.lightbox__figure img {
  position: absolute; inset: 0; margin: auto;
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  touch-action: pan-y;
  user-select: none; -webkit-user-drag: none;
  transition: opacity .2s ease;
}
.lightbox__figure img.is-loading { opacity: 0; }

.lightbox__bottom { padding: 14px var(--gutter) 18px; }
.lightbox__caption { text-align: center; color: var(--text-soft); font-size: 15px; min-height: 24px; }
.lightbox__count { color: var(--muted); font-size: 13px; margin-left: 6px; font-variant-numeric: tabular-nums; }
.lightbox__thumbs {
  display: flex; gap: 8px; justify-content: safe center;
  margin-top: 12px; overflow-x: auto; padding: 4px 2px;
  scrollbar-width: thin;
}
.lightbox__thumbs button {
  flex: none; width: 76px; height: 50px; padding: 0;
  border-radius: 8px; overflow: hidden;
  border: 2px solid transparent; background: var(--navy-800);
  opacity: .5; transition: opacity .2s ease, border-color .2s ease;
}
.lightbox__thumbs button:hover { opacity: .85; }
.lightbox__thumbs button[aria-current="true"] { opacity: 1; border-color: var(--cyan-400); }
.lightbox__thumbs img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

@media (max-width: 600px) {
  .lightbox__nav { position: absolute; bottom: 12px; z-index: 2; background: rgba(5, 10, 28, 0.8); }
  .lightbox__nav--prev { left: calc(var(--gutter) + 6px); }
  .lightbox__nav--next { right: calc(var(--gutter) + 6px); }
  .lightbox__thumbs button { width: 60px; height: 40px; }
}

/* ---------- Walkthrough video dialog ---------- */
.videobox__tools { display: flex; align-items: center; gap: 10px; }
.videobox__stage {
  flex: 1; min-height: 0;
  display: grid; place-items: center;
  padding: 4px var(--gutter) 24px;
}
.videobox__frame {
  width: min(1200px, 100%, calc((100dvh - 150px) * 16 / 9));
  aspect-ratio: 16 / 9;
  border-radius: 14px; overflow: hidden;
  background: #000; border: 1px solid var(--border);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.85);
}
.videobox__frame iframe, .videobox__frame video { display: block; width: 100%; height: 100%; border: 0; background: #000; }
@media (max-width: 600px) {
  .videobox__tools .btn { display: none; }
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1; transform: none; }
}

.noscript { text-align: center; padding: 24px; color: var(--muted); }
body.lb-open { overflow: hidden; }
