/* ==========================================================================
   San Haji — Portfolio
   Design tokens, layout and components. Light + dark themes.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f8fd;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --navy: #0b1a2e;
  --text: #0d1b2a;
  --muted: #56677b;
  --muted-2: #8494a7;
  --line: #e5ecf6;
  --line-strong: #d8e2f0;
  --blue: #1f6bff;
  --blue-dark: #1257dc;
  --blue-soft: #eaf1ff;
  --blue-tint: #f3f7ff;
  --green: #12a150;
  --green-soft: #e9f9f0;
  --amber: #b76a00;
  --amber-soft: #fdf3e3;
  --violet: #6d4bff;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-xs: 0 1px 2px rgba(13, 27, 42, .06);
  --shadow-sm: 0 6px 18px -10px rgba(13, 27, 42, .18);
  --shadow-md: 0 18px 40px -24px rgba(13, 27, 42, .28);
  --shadow-lg: 0 36px 70px -34px rgba(13, 27, 42, .38);
  --header-h: 68px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --script: "Caveat", "Segoe Script", cursive;
  color-scheme: light;
}

html.dark {
  --bg: #060b14;
  --bg-soft: #0a131f;
  --surface: #0d1826;
  --surface-2: #101e2f;
  --navy: #eef4fd;
  --text: #eaf1fb;
  --muted: #a3b4c9;
  --muted-2: #7f92aa;
  --line: #1b2a3b;
  --line-strong: #2a3d52;
  --blue: #6ea2ff;
  --blue-dark: #93bbff;
  --blue-soft: rgba(96, 148, 255, .14);
  --blue-tint: rgba(96, 148, 255, .08);
  --green: #45e18d;
  --green-soft: rgba(69, 225, 141, .13);
  --amber: #f2b968;
  --amber-soft: rgba(242, 185, 104, .13);
  --violet: #a48dff;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-sm: 0 10px 24px -16px rgba(0, 0, 0, .8);
  --shadow-md: 0 22px 46px -26px rgba(0, 0, 0, .9);
  --shadow-lg: 0 44px 84px -38px rgba(0, 0, 0, .95);
  color-scheme: dark;
}

html.dark body {
  background-image:
    radial-gradient(56% 38% at 82% -8%, rgba(38, 104, 255, .22), transparent 70%),
    radial-gradient(44% 34% at 4% 22%, rgba(109, 75, 255, .12), transparent 72%),
    radial-gradient(50% 40% at 96% 62%, rgba(38, 104, 255, .1), transparent 74%);
  background-repeat: no-repeat;
}

*,
*::before,
*::after { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
ul { list-style: none; }

::selection { background: var(--blue); color: #fff; }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 0 0 10px 10px;
  background: var(--blue);
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  transition: top .2s ease;
}
.skip-link:focus { top: 0; }

.container {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease, background-color .3s ease;
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px -22px rgba(13, 27, 42, .6);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
html.dark .brand { color: var(--text); }

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
  padding: 6px 2px;
  position: relative;
  transition: color .2s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav a:hover { color: var(--text); }
.nav a:hover::after,
.nav a.is-active::after { transform: scaleX(1); }
.nav a.is-active { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .icon-sun { display: none; }
html.dark .icon-btn .icon-sun { display: block; }
html.dark .icon-btn .icon-moon { display: none; }

.menu-toggle { display: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: -.005em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .25s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn .arrow { transition: transform .25s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--blue) 80%, transparent);
}
.btn-primary:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -12px color-mix(in srgb, var(--blue) 80%, transparent);
}
html.dark .btn-primary {
  background: linear-gradient(135deg, #2a66f5, #1b51dd);
  color: #fff;
  box-shadow: 0 14px 28px -16px rgba(42, 102, 245, .85), inset 0 1px 0 rgba(255, 255, 255, .16);
}
html.dark .btn-primary:hover {
  background: linear-gradient(135deg, #2f6bf0, #245ae4);
  color: #fff;
}
html.dark .btn-ghost { background: rgba(255, 255, 255, .035); border-color: var(--line-strong); }
html.dark .btn-ghost:hover { background: rgba(255, 255, 255, .06); border-color: var(--muted-2); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover {
  transform: translateY(-1px);
  border-color: var(--muted-2);
  box-shadow: var(--shadow-sm);
}

.btn-light { background: #fff; color: #0b1a2e; }
.btn-light:hover { transform: translateY(-1px); background: #f2f6fd; }
.btn-outline-light {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .32);
  color: #fff;
  backdrop-filter: blur(6px);
}
.btn-outline-light:hover { background: rgba(255, 255, 255, .14); transform: translateY(-1px); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 56px 0 0;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 720px;
  background:
    radial-gradient(46% 54% at 72% 24%, rgba(31, 107, 255, .13), transparent 70%),
    radial-gradient(38% 46% at 12% 8%, rgba(109, 75, 255, .09), transparent 72%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(60% 55% at 50% 30%, #000, transparent 78%);
  mask-image: radial-gradient(60% 55% at 50% 30%, #000, transparent 78%);
  opacity: .5;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  align-items: center;
  gap: 40px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--blue);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: .55;
}

.hero h1 {
  margin: 18px 0 20px;
  font-size: clamp(2.35rem, 4.6vw, 3.65rem);
  line-height: 1.07;
  letter-spacing: -.035em;
  font-weight: 800;
  color: var(--navy);
  max-width: 15ch;
}
html.dark .hero h1 { color: var(--text); }
.hero h1 .accent { color: var(--blue); }

.hero-lead {
  max-width: 47ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-portrait {
  position: relative;
  justify-self: center;
  width: min(100%, 430px);
  aspect-ratio: 1 / 1.06;
  isolation: isolate;
}
.hero-portrait::before {
  content: "";
  position: absolute;
  inset: -7% -5% 3% 4%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(68% 68% at 56% 34%, rgba(146, 183, 255, .55), rgba(198, 219, 255, .28) 56%, transparent 74%);
  filter: blur(8px);
}
html.dark .hero-portrait::before {
  background: radial-gradient(68% 68% at 56% 34%, rgba(74, 124, 255, .34), rgba(74, 124, 255, .06) 58%, transparent 74%);
}

.portrait-frame {
  position: absolute;
  inset: 4% 0 6% 4%;
  border-radius: 58% 42% 47% 53% / 46% 57% 43% 54%;
  background:
    radial-gradient(120% 120% at 76% 12%, #ffffff 0%, rgba(255, 255, 255, 0) 46%),
    linear-gradient(155deg, #e9f2ff 0%, #c9ddff 40%, #aecbff 76%, #dbe9ff 100%);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6);
}
html.dark .portrait-frame {
  background:
    radial-gradient(75% 65% at 52% 30%, rgba(64, 112, 190, .5), rgba(13, 27, 45, .9) 66%, #0a1524 100%);
  box-shadow: inset 0 0 0 1px rgba(120, 170, 255, .2), 0 40px 80px -46px rgba(0, 0, 0, .95);
}
.portrait-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: none;
}
html.dark .portrait-frame::before {
  display: none;
}
.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 50% at 50% 100%, rgba(12, 30, 58, .22), transparent 70%);
  pointer-events: none;
}
.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  mix-blend-mode: normal;
  filter: brightness(1.1) contrast(1.02) saturate(1.03) drop-shadow(0 14px 26px rgba(16, 42, 78, .22));
  -webkit-mask-image: none;
  mask-image: none;
}
html.dark .portrait-frame img {
  mix-blend-mode: normal;
  opacity: 1;
  filter: brightness(1.1) contrast(1.02) saturate(1.03) drop-shadow(0 18px 34px rgba(0, 0, 0, .55));
  transform: none;
  -webkit-mask-image: none;
  mask-image: none;
}

.portrait-deco {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.portrait-deco.one {
  width: 120px; height: 120px;
  right: -8px; top: 2%;
  border: 1px dashed color-mix(in srgb, var(--blue) 45%, transparent);
  opacity: .6;
}
.portrait-deco.two {
  width: 14px; height: 14px;
  left: 6%; bottom: 18%;
  background: var(--blue);
  opacity: .5;
}

.hero-quote {
  position: absolute;
  right: -14px;
  bottom: 4%;
  z-index: 3;
  width: 254px;
  padding: 18px 20px 16px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  transform: rotate(-1.2deg);
}
.hero-quote .quote-mark {
  font-family: var(--script);
  font-size: 1.9rem;
  line-height: .4;
  color: var(--blue);
  display: block;
  margin-bottom: 8px;
}
.hero-quote p {
  font-size: .84rem;
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
}
.hero-quote .signature {
  display: block;
  margin-top: 8px;
  text-align: right;
  font-family: var(--script);
  font-size: 1.35rem;
  color: var(--navy);
  line-height: 1;
}
html.dark .hero-quote .signature { color: var(--text); }

/* Stats strip */
.hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin-top: 46px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline: 26px;
  flex: 1 1 0;
  min-width: 150px;
}
.stat:first-child { padding-left: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  flex-shrink: 0;
}
.stat-icon svg { width: 17px; height: 17px; }
.stat-num {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  color: var(--navy);
}
html.dark .stat-num { color: var(--text); }
.stat-label {
  display: block;
  font-size: .74rem;
  color: var(--muted-2);
  line-height: 1.3;
}
.stat-label .sub { display: block; font-size: .68rem; opacity: .85; }

.hero-pills {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: .76rem;
  font-weight: 600;
  color: var(--muted);
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
}
.pill svg { width: 13px; height: 13px; color: var(--blue); }
.pill .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent);
}

/* --------------------------------------------------------------------------
   Tools marquee
   -------------------------------------------------------------------------- */

.tools {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  overflow: hidden;
}
.tools-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-block: 16px;
}
.tools-label {
  flex-shrink: 0;
  font-size: .74rem;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: -.005em;
  white-space: nowrap;
}
.marquee {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 34px;
  width: max-content;
  animation: marquee 34s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: color .2s ease;
}
.tool:hover { color: var(--text); }
.tool-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #fff;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Section scaffolding
   -------------------------------------------------------------------------- */

.section { padding: 86px 0; }
.section--soft { background: var(--bg-soft); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.section-head .eyebrow { margin-bottom: 12px; }
.section-title {
  font-size: clamp(1.65rem, 2.6vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: var(--navy);
}
html.dark .section-title { color: var(--text); }
.section-desc {
  margin-top: 8px;
  color: var(--muted);
  font-size: .92rem;
  max-width: 52ch;
}

/* --------------------------------------------------------------------------
   Featured project
   -------------------------------------------------------------------------- */

.featured {
  padding: 30px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(90% 130% at 100% 0%, var(--blue-tint) 0%, transparent 58%),
    var(--surface);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 34px;
  align-items: center;
}

.featured-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
  margin-bottom: 18px;
}
.featured-icon svg { width: 24px; height: 24px; }

.featured-label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
}

.featured-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.featured h2 {
  font-size: clamp(1.55rem, 2.3vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--navy);
}
html.dark .featured h2 { color: var(--text); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: -.005em;
  border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--live { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 22%, transparent); }
.badge--screenshot { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.badge--internal { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 26%, transparent); }

.featured p {
  margin-top: 12px;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.68;
  max-width: 46ch;
}

.featured-points {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.featured-points li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: .87rem;
  line-height: 1.5;
  color: var(--muted);
}
.point-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}
.point-check svg { width: 11px; height: 11px; }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 25px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .74rem;
  font-weight: 600;
  color: var(--muted);
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.tag:hover { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 35%, var(--line)); background: var(--blue-tint); }

.featured-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

/* Terminal mock */
.terminal {
  position: relative;
  border-radius: 16px;
  background: #08121f;
  border: 1px solid rgba(120, 165, 255, .16);
  box-shadow: 0 34px 60px -34px rgba(6, 16, 31, .7), inset 0 1px 0 rgba(255, 255, 255, .04);
  color: #c3d3e8;
  font-family: var(--mono);
  font-size: .76rem;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(120, 165, 255, .12);
  border-radius: 16px 16px 0 0;
  background: rgba(255, 255, 255, .03);
}
.terminal-bar .dot { width: 9px; height: 9px; border-radius: 50%; }
.terminal-bar .dot.r { background: #ff5f57; }
.terminal-bar .dot.y { background: #febc2e; }
.terminal-bar .dot.g { background: #28c840; }
.terminal-path {
  margin-left: 8px;
  font-size: .7rem;
  color: #6f8299;
  letter-spacing: .01em;
}
.terminal-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .8fr);
  gap: 18px;
  padding: 20px 18px 36px;
}
.terminal-lines { display: flex; flex-direction: column; gap: 10px; }
.terminal-line {
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: #8ea3bb;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.terminal-line .caret { color: #4d7dff; }
.terminal-line.is-active {
  color: #e9f0fb;
  background: rgba(77, 125, 255, .12);
  border: 1px solid rgba(77, 125, 255, .22);
  border-radius: 7px;
  padding: 3px 8px;
  margin-inline: -8px;
}
.terminal-line .ok { color: #3ddc84; }
.terminal-list { display: flex; flex-direction: column; gap: 12px; border-left: 1px solid rgba(120, 165, 255, .14); padding-left: 16px; }
.terminal-list strong {
  display: block;
  font-size: .76rem;
  font-weight: 600;
  color: #dbe7f7;
  font-family: var(--font);
  letter-spacing: -.01em;
}
.terminal-list span {
  font-size: .68rem;
  color: #7d90a8;
  font-family: var(--font);
}
.terminal-cursor {
  display: inline-block;
  width: 6px;
  height: 12px;
  background: #4d7dff;
  animation: blink 1.1s steps(2) infinite;
  vertical-align: -1px;
}
@keyframes blink { 50% { opacity: 0; } }

.terminal-float {
  position: absolute;
  right: 18px;
  bottom: -18px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 8px;
  background: rgba(10, 26, 44, .96);
  border: 1px solid rgba(61, 220, 132, .3);
  color: #3ddc84;
  font-family: var(--font);
  font-size: .68rem;
  font-weight: 600;
  box-shadow: 0 12px 24px -16px rgba(0, 0, 0, .8);
}
.terminal-float svg { width: 12px; height: 12px; }

/* --------------------------------------------------------------------------
   Projects
   -------------------------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter {
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.filter:hover { color: var(--text); border-color: var(--line-strong); }
.filter[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px -12px color-mix(in srgb, var(--blue) 80%, transparent);
}
html.dark .filter[aria-pressed="true"] { color: #06101f; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease, border-color .3s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.project-card[hidden] { display: none; }

.card-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(150deg, #0b1a2e, #132b47 55%, #0a1626);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), filter .3s ease;
}
.project-card:hover .card-preview img { transform: scale(1.035); }

.card-preview--blank {
  display: grid;
  place-items: center;
  background:
    radial-gradient(80% 90% at 80% 10%, rgba(31, 107, 255, .35), transparent 60%),
    linear-gradient(150deg, #0c1b2e, #112237 60%, #0a1424);
}
.card-preview--blank::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: .6;
}
.card-monogram {
  position: relative;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: rgba(255, 255, 255, .92);
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(4px);
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  background: rgba(255, 255, 255, .95);
  color: #0b1a2e;
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .6);
}
.card-badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.card-badge--live .dot { background: #12a150; }
.card-badge--screenshot .dot { background: #64748b; }
.card-badge--internal .dot { background: #d97706; }

.card-zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(9, 22, 38, .55);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .25s ease, transform .25s ease, background-color .2s ease;
  backdrop-filter: blur(6px);
}
.project-card:hover .card-zoom,
.card-zoom:focus-visible { opacity: 1; transform: translateY(0); }
.card-zoom:hover { background: var(--blue); border-color: var(--blue); }
.card-zoom svg { width: 14px; height: 14px; }

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 18px 16px;
}
.card-body h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--navy);
}
html.dark .card-body h3 { color: var(--text); }
.card-body p {
  margin-top: 6px;
  font-size: .83rem;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-body .tag-list { margin-top: 14px; gap: 5px; }
.card-body .tag { height: 23px; padding: 0 8px; font-size: .69rem; background: var(--surface-2); }

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 16px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--blue);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  transition: gap .2s ease, color .2s ease;
}
.card-link:hover { gap: 9px; color: var(--blue-dark); }
.card-link svg { width: 13px; height: 13px; }
.card-link.is-muted { color: var(--muted-2); cursor: default; }

/* --------------------------------------------------------------------------
   Experience
   -------------------------------------------------------------------------- */

.timeline { position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 207px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(var(--line-strong), var(--line) 60%, transparent);
}

.exp-item {
  position: relative;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 32px;
  padding: 0 0 34px 32px;
}
.exp-item:last-child { padding-bottom: 0; }
.exp-item::before {
  content: "";
  position: absolute;
  left: 203px;
  top: 18px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 10%, transparent);
}
.exp-meta { padding-top: 6px; }
.exp-period {
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted-2);
  letter-spacing: -.01em;
  margin-bottom: 12px;
}
.exp-logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--navy);
  box-shadow: var(--shadow-xs);
}
html.dark .exp-logo { color: var(--text); }
.exp-body h3 {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--navy);
}
html.dark .exp-body h3 { color: var(--text); }
.exp-company {
  font-size: .85rem;
  font-weight: 600;
  color: var(--blue);
  margin-top: 2px;
}
.exp-points {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.exp-points li {
  position: relative;
  padding-left: 16px;
  font-size: .85rem;
  line-height: 1.6;
  color: var(--muted);
}
.exp-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-strong);
}
.exp-body .tag-list { margin-top: 14px; }
.exp-body .tag { height: 23px; font-size: .68rem; background: var(--surface-2); }

/* --------------------------------------------------------------------------
   Education + Skills
   -------------------------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  gap: 44px;
  align-items: start;
}

.edu-list { display: flex; flex-direction: column; gap: 14px; }
.edu-card {
  display: flex;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.edu-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.edu-logo {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(145deg, #16325a, #0b1a2e);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.edu-card:nth-child(2) .edu-logo { background: linear-gradient(145deg, #4b2a6b, #241536); }
.edu-card h3 {
  font-size: .93rem;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--navy);
}
html.dark .edu-card h3 { color: var(--text); }
.edu-degree {
  font-size: .82rem;
  font-weight: 600;
  color: var(--blue);
  margin-top: 1px;
}
.edu-period {
  font-size: .75rem;
  color: var(--muted-2);
  margin-top: 2px;
}
.edu-details {
  font-size: .8rem;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 8px;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.skill-card {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.skill-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.skill-card h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--navy);
  margin-bottom: 11px;
}
html.dark .skill-card h3 { color: var(--text); }
.skill-card h3 svg { width: 14px; height: 14px; color: var(--blue); }
.skill-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 27px;
  padding: 0 9px 0 6px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: .74rem;
  font-weight: 600;
  color: var(--text);
  transition: border-color .2s ease, background-color .2s ease;
}
.chip:hover { border-color: color-mix(in srgb, var(--blue) 32%, var(--line)); background: var(--blue-tint); }
.chip-mark {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  font-size: .52rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Certifications
   -------------------------------------------------------------------------- */

.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.cert-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease, border-color .3s ease;
}
.cert-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.cert-card:hover .card-zoom { opacity: 1; transform: none; }
.cert-media {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  padding: 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.cert-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  transition: transform .4s cubic-bezier(.22, 1, .36, 1);
}
.cert-card:hover .cert-media img { transform: scale(1.02); }
.cert-media--blank {
  background:
    radial-gradient(80% 90% at 80% 10%, rgba(31, 107, 255, .18), transparent 62%),
    linear-gradient(150deg, #eef4ff, #dfeaff 70%, #f4f8ff);
}
.cert-monogram {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #1b3a63;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(27, 58, 99, .18);
  background: rgba(255, 255, 255, .65);
}
.cert-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px 18px 18px;
}
.cert-body h3 {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--navy);
}
html.dark .cert-body h3 { color: var(--text); }
.cert-issuer {
  margin-top: 3px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted-2);
}
.cert-year { font-weight: 500; }
.cert-body .card-link { margin-top: auto; padding-top: 14px; }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact {
  position: relative;
  padding: 96px 0;
  background: #0a1524 url("../contact-mountain.png") center 42% / cover no-repeat;
  background-attachment: scroll;
  color: #fff;
  overflow: hidden;
}
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 15, 28, .9) 0%, rgba(6, 15, 28, .62) 52%, rgba(6, 15, 28, .35) 100%),
    linear-gradient(180deg, rgba(6, 15, 28, .55), transparent 30%, rgba(6, 15, 28, .55));
}
.contact-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 48px;
  align-items: center;
}
.contact .eyebrow { color: #9dc0ff; }
.contact h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.12;
  margin: 14px 0 16px;
  max-width: 16ch;
}
.contact-lead {
  color: rgba(255, 255, 255, .72);
  font-size: .95rem;
  max-width: 50ch;
  line-height: 1.7;
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.contact-quote {
  padding: 24px;
  border-radius: 18px;
  background: rgba(12, 26, 44, .5);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8);
}
.contact-quote .quote-mark {
  font-family: var(--script);
  font-size: 1.9rem;
  line-height: .4;
  color: #9dc0ff;
  display: block;
  margin-bottom: 10px;
}
.contact-quote p {
  font-size: .95rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, .92);
  font-weight: 500;
}
.contact-quote .signature {
  display: block;
  margin-top: 14px;
  text-align: right;
  font-family: var(--script);
  font-size: 1.6rem;
  line-height: 1;
  color: #fff;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 26px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--muted-2);
}
.footer-links { display: flex; gap: 18px; }
.footer-links a { transition: color .2s ease; }
.footer-links a:hover { color: var(--blue); }

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 12, 22, .88);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox-figure {
  position: relative;
  max-width: min(1100px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9);
  background: #0b1a2e;
  transform: scale(.97);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}
.lightbox.is-open img { transform: scale(1); }
.lightbox-caption {
  font-size: .8rem;
  color: rgba(255, 255, 255, .72);
  text-align: center;
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(11, 26, 46, .7);
  color: #fff;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.lightbox-close:hover,
.lightbox-nav:hover { background: var(--blue); border-color: var(--blue); }
.lightbox-close { top: 20px; right: 20px; font-size: 1.4rem; line-height: 1; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-nav.prev { left: -56px; }
.lightbox-nav.next { right: -56px; }
.lightbox-nav[hidden] { display: none; }
.lightbox-nav svg { width: 18px; height: 18px; }

body.has-overlay { overflow: hidden; }

/* --------------------------------------------------------------------------
   Reveal animation
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 1;
  transform: none;
}
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s cubic-bezier(.22, 1, .36, 1), transform .6s cubic-bezier(.22, 1, .36, 1);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1120px) {
  .nav { gap: 20px; }
}

@media (max-width: 940px) {
  .nav { gap: 15px; }
  .nav a { font-size: .84rem; }
}

@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(0, .82fr); gap: 24px; }
  .hero-quote { right: -6px; width: 232px; }
  .featured { grid-template-columns: 1fr; padding: 26px; }
  .featured p { max-width: none; }
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; gap: 40px; }
  .contact-inner { grid-template-columns: 1fr; gap: 32px; }
  .terminal-body { grid-template-columns: 1.3fr .7fr; }
}

@media (max-width: 880px) {
  .nav { display: none; }
  .menu-toggle { display: grid; }

  .site-header.is-menu-open .nav {
    display: flex;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 24px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
  }
  .site-header.is-menu-open .nav a { width: 100%; padding: 10px 0; font-size: .95rem; }
  .site-header.is-menu-open .nav a::after { display: none; }

  .hero { padding-top: 36px; }
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-copy { order: 1; }
  .hero-portrait { order: 2; width: min(100%, 380px); }
  .hero h1 { max-width: 18ch; font-size: clamp(2.1rem, 7vw, 2.9rem); }
  .hero-quote { right: 0; bottom: -6%; width: 220px; padding: 15px 17px; }
  .hero-stats { gap: 14px 0; margin-top: 64px; }
  .stat { padding-inline: 18px; flex: 1 1 44%; }
  .stat:nth-child(odd) { padding-left: 0; }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(4) { padding-left: 18px; }
  .hero-pills { margin-left: 0; flex-direction: row; width: 100%; justify-content: flex-start; margin-top: 4px; padding-top: 18px; border-top: 1px solid var(--line); }
  .tools-inner { flex-direction: column; align-items: flex-start; gap: 12px; padding-block: 16px; }
  .marquee { width: 100%; }
  .section { padding: 62px 0; }
  .section-head { margin-bottom: 26px; }
  .timeline::before { left: 15px; }
  .exp-item { grid-template-columns: 1fr; gap: 10px; padding-left: 40px; padding-bottom: 30px; }
  .exp-item::before { left: 11px; top: 8px; }
  .exp-meta { display: flex; align-items: center; gap: 12px; padding-top: 0; }
  .exp-period { margin-bottom: 0; order: 2; }
  .exp-logo { width: 36px; height: 36px; font-size: .6rem; border-radius: 10px; }
  .contact { padding: 72px 0; }
  .terminal-body { grid-template-columns: 1fr; }
  .terminal-list { flex-direction: row; flex-wrap: wrap; gap: 10px 18px; border-left: 0; padding-left: 0; border-top: 1px solid rgba(120, 165, 255, .14); padding-top: 14px; }
  .terminal-list > div { min-width: 44%; }
  .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .container { padding-inline: 18px; }
  .projects-grid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { flex: 1 1 100%; padding-left: 0; border-left: 0; }
  .stat + .stat { border-left: 0; padding-top: 14px; border-top: 1px solid var(--line); }
  .hero-stats { gap: 14px; }
  .hero-quote { position: relative; right: auto; bottom: auto; width: 100%; margin-top: 18px; transform: none; }
  .hero-portrait { aspect-ratio: auto; }
  .portrait-frame { position: relative; inset: auto; aspect-ratio: 1 / 1.04; }
  .portrait-deco { display: none; }
  .hero-actions .btn { flex: 1 1 100%; }
  .card-zoom { opacity: 1; transform: none; }
  .lightbox-nav.prev { left: 6px; }
  .lightbox-nav.next { right: 6px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .skill-grid { grid-template-columns: 1fr; }
  .pill { font-size: .72rem; }
  .terminal-list > div { min-width: 100%; }
}

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

/* ==========================================================================
   Dark theme refinements — depth, contrast and portrait treatment
   ========================================================================== */

html.dark .portrait-frame::before {
  display: none;
}
html.dark .portrait-frame::after {
  background: radial-gradient(circle at 50% 36%, rgba(6, 11, 20, 0) 48%, rgba(6, 11, 20, .28) 78%, rgba(6, 11, 20, .55) 100%);
}

html.dark .hero-quote {
  background: rgba(10, 20, 34, .88);
  border-color: rgba(120, 170, 255, .18);
  box-shadow: 0 34px 60px -34px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .05);
}

html.dark .hero-stats { border-top-color: rgba(255, 255, 255, .07); }
html.dark .stat + .stat { border-left-color: rgba(255, 255, 255, .06); }

html.dark .tools {
  background: linear-gradient(180deg, rgba(255, 255, 255, .028), rgba(255, 255, 255, .012));
  border-color: rgba(255, 255, 255, .07);
}

html.dark .section + .section { border-top: 1px solid rgba(255, 255, 255, .045); }

html.dark .featured {
  background:
    radial-gradient(85% 120% at 100% 0%, rgba(38, 104, 255, .16), transparent 58%),
    linear-gradient(180deg, #0e1b2b, #0a1421);
  border-color: var(--line-strong);
  box-shadow: 0 34px 70px -54px rgba(0, 0, 0, 1);
}
html.dark .terminal {
  background: #050c16;
  border-color: rgba(120, 165, 255, .22);
  box-shadow: 0 34px 60px -30px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .06);
}
html.dark .terminal-bar { background: rgba(255, 255, 255, .045); }

html.dark .project-card {
  background: linear-gradient(180deg, #0e1a29, #0a1420);
  border-color: var(--line);
}
html.dark .project-card:hover {
  border-color: rgba(110, 162, 255, .38);
  box-shadow: 0 26px 50px -30px rgba(0, 0, 0, 1), 0 0 0 1px rgba(110, 162, 255, .14);
}
html.dark .card-preview { border-bottom-color: var(--line); }

html.dark .filter[aria-pressed="true"] {
  background: linear-gradient(135deg, #2a66f5, #1b51dd);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 22px -14px rgba(42, 102, 245, .9);
}
html.dark .filter:hover { background: rgba(255, 255, 255, .05); border-color: var(--line-strong); }

html.dark .cert-card {
  background: linear-gradient(180deg, #0e1a29, #0a1420);
  border-color: var(--line);
}
html.dark .cert-card:hover {
  border-color: rgba(110, 162, 255, .38);
  box-shadow: 0 26px 50px -30px rgba(0, 0, 0, 1), 0 0 0 1px rgba(110, 162, 255, .14);
}
html.dark .cert-media { background: #0b1522; border-bottom-color: var(--line); }
html.dark .cert-media--blank {
  background:
    radial-gradient(80% 90% at 80% 10%, rgba(38, 104, 255, .28), transparent 62%),
    linear-gradient(150deg, #0c1a2b, #0a1522 70%, #0b1826);
}
html.dark .cert-monogram {
  color: #d6e6ff;
  background: rgba(255, 255, 255, .06);
  border-color: rgba(120, 170, 255, .24);
}

html.dark .timeline::before {
  background: linear-gradient(rgba(110, 162, 255, .45), rgba(110, 162, 255, .14) 62%, transparent);
}
html.dark .exp-item::before {
  background: #0a1421;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(110, 162, 255, .12), 0 0 16px rgba(110, 162, 255, .35);
}
html.dark .exp-period { color: var(--muted); }
html.dark .exp-logo { background: #0c1725; border-color: var(--line-strong); }

html.dark .edu-card,
html.dark .skill-card {
  background: linear-gradient(180deg, #0e1a29, #0a1420);
  border-color: var(--line);
}
html.dark .edu-card:hover,
html.dark .skill-card:hover { border-color: var(--line-strong); }

html.dark .chip { background: rgba(255, 255, 255, .04); border-color: var(--line-strong); }
html.dark .chip:hover { background: rgba(96, 148, 255, .12); border-color: rgba(110, 162, 255, .4); }
html.dark .tag { background: rgba(255, 255, 255, .03); border-color: var(--line-strong); }

html.dark .contact { background-color: #050c16; }
html.dark .site-footer { border-top-color: rgba(255, 255, 255, .07); }
