/* ==========================================================================
   RUSHI.BUILD | Full-Stack & AI Developer Portfolio
   Visual Identity: Carbon Noir & Signal Emerald Editorial System + WebGL2
   Pure HTML5, CSS3, and Vanilla JavaScript (zero frameworks)
   ========================================================================== */

:root {
  --ink: #050a08;
  --surface: #0b1310;
  --surface-hi: #111e19;
  --paper: #eef7f2;
  --accent: #10b981;
  --accent-hot: #34d399;
  --emerald: #22c55e;
  --muted: #96aea3;
  --hair: rgba(238, 247, 242, 0.14);
  --hair-strong: rgba(238, 247, 242, 0.28);
  --shade: rgba(5, 10, 8, 0.74);
  --frame-bg: #0b1410;
  color-scheme: dark;

  --font-display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --font-text: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --pad-x: clamp(14px, 3.2vw, 52px);

  --fs-xs: clamp(11px, 0.78vw, 13px);
  --fs-s: clamp(14px, 1vw, 16px);
  --fs-20: clamp(15px, 1.3vw, 19px);
  --fs-p: clamp(15.5px, 1.35vw, 19px);
  --fs-lead: clamp(16px, 1.45vw, 22px);
  --fs-m: clamp(42px, 5.4vw, 82px);
  --fs-l: clamp(48px, 6.8vw, 104px);
  --fs-xxl: clamp(56px, 9.2vw, 144px);
  --fs-xl: clamp(64px, 13.5vw, 188px);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-wipe: cubic-bezier(0.7, 0, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-text);
  font-size: var(--fs-s);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid var(--accent-hot);
  outline-offset: 3px;
}

[id] {
  scroll-margin-top: 96px;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip {
  position: fixed;
  left: 16px;
  top: -120px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  transition: top 0.2s ease;
}

.skip:focus {
  top: 16px;
}

/* ---------- Typography Helpers ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.display--xl { font-size: var(--fs-xl); }
.display--xxl { font-size: var(--fs-xxl); }
.display--l { font-size: var(--fs-l); }
.display--m { font-size: var(--fs-m); }

.mono {
  font-family: var(--font-mono);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-hot);
  margin-bottom: 10px;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent);
}

.section-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  max-width: 44ch;
}

/* ---------- Fixed 3D Particle Backdrop Canvas ---------- */

#portrait-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.55s ease;
}

.is-3d #portrait-canvas {
  opacity: 1;
}

/* ---------- Floating Editorial Topbar ---------- */

.topbar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - 20px), 1380px);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px 9px 16px;
  border-radius: 999px;
  background: rgba(8, 14, 11, 0.82);
  border: 1px solid rgba(238, 247, 242, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.topbar.is-scrolled {
  background: rgba(5, 10, 8, 0.94);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38);
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-pill__sub {
  color: var(--muted);
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
  flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .status-dot {
    animation: pulse-dot 2.8s ease-in-out infinite;
  }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.84); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--paper);
  background: rgba(238, 247, 242, 0.07);
}

.nav-links a[aria-current="true"] {
  color: var(--accent-hot);
  background: rgba(16, 185, 129, 0.14);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--hair);
  color: var(--paper);
  background: rgba(238, 247, 242, 0.04);
  transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease;
  white-space: nowrap;
}

.pill-btn:hover {
  border-color: var(--accent);
  color: var(--accent-hot);
  background: rgba(16, 185, 129, 0.08);
}

.pill-btn--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

.pill-btn--accent:hover {
  background: var(--accent-hot);
  border-color: var(--accent-hot);
  color: var(--ink);
}

.nav-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--hair);
  color: var(--paper);
  font-size: 18px;
}

.nav-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-hot);
}

.mobile-drawer {
  position: fixed;
  top: 76px;
  left: 12px;
  right: 12px;
  z-index: 79;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(8, 14, 11, 0.97);
  border: 1px solid rgba(16, 185, 129, 0.26);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(18px);
}

.mobile-drawer.is-open {
  display: flex;
}

.mobile-drawer > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  color: var(--paper);
}

.mobile-drawer > a[aria-current="true"] {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.34);
  color: var(--accent-hot);
}

.mobile-drawer > a:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.mobile-drawer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
}

.mobile-drawer__actions .btn,
.mobile-drawer__actions .pill-btn {
  flex: 1 1 140px;
  min-height: 44px;
}

@media (max-width: 1024px) {
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .pill-btn--hide-sm {
    display: none;
  }
}

/* ---------- Page Frame & Atmospheric Plate ---------- */

.page {
  position: relative;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding-inline: var(--pad-x);
  z-index: 2;
}

.plate {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 64% 50% at 74% 26%, rgba(16, 185, 129, 0.095), transparent 70%),
    radial-gradient(ellipse 48% 44% at 16% 74%, rgba(52, 211, 153, 0.05), transparent 68%);
}

.poster {
  position: relative;
  z-index: 3;
}

/* ---------- HERO ---------- */

.hero {
  position: relative;
  padding-top: clamp(84px, 9.5vh, 114px);
  padding-bottom: clamp(44px, 6vw, 84px);
  min-height: min(96vh, 880px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.title {
  color: var(--accent);
  line-height: 0.82;
  letter-spacing: -0.025em;
  margin-bottom: clamp(18px, 2.4vw, 32px);
  user-select: none;
}

.title__fit {
  display: inline-block;
  white-space: nowrap;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(290px, 0.92fr);
  gap: clamp(24px, 4vw, 58px);
  align-items: center;
}

.hero__copy {
  position: relative;
  z-index: 5;
}

.hello {
  font-family: var(--font-text);
  font-size: clamp(32px, 3.4vw, 52px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-bottom: clamp(14px, 1.8vw, 22px);
}

.hello__accent {
  color: var(--accent-hot);
}

.hello__role {
  display: inline-block;
  margin-top: 6px;
  font-size: clamp(19px, 1.9vw, 29px);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: rgba(238, 247, 242, 0.88);
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.48;
  letter-spacing: -0.01em;
  color: rgba(238, 247, 242, 0.86);
  max-width: 46ch;
  margin-bottom: clamp(18px, 2.2vw, 26px);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.roles {
  margin-bottom: clamp(22px, 2.5vw, 30px);
  padding-left: 15px;
  border-left: 2px solid var(--accent);
}

.roles li {
  font-family: var(--font-mono);
  font-size: clamp(12.5px, 1.05vw, 15px);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--paper);
  line-height: 1.45;
}

.roles li span {
  color: var(--muted);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: rgba(238, 247, 242, 0.035);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--paper);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.social-pill:hover {
  border-color: var(--accent);
  color: var(--accent-hot);
  background: rgba(16, 185, 129, 0.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: transform 0.22s var(--ease-out), background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--accent);
  color: var(--ink);
}

.btn--primary:hover {
  background: var(--accent-hot);
}

.btn--ghost {
  border: 1px solid var(--hair-strong);
  background: rgba(238, 247, 242, 0.035);
  color: var(--paper);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent-hot);
  background: rgba(16, 185, 129, 0.07);
}

.hero__meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--hair);
}

/* Interactive 3D Particle Portrait Slot */
.portrait-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.portrait-slot {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 982 / 950;
  max-height: clamp(340px, 56vh, 540px);
  margin: 0 auto;
  cursor: grab;
  touch-action: pan-y;
}

.portrait-slot:active {
  cursor: grabbing;
}

.portrait-picture {
  display: block;
  width: 100%;
  height: 100%;
}

.portrait-shadow {
  position: absolute;
  inset: 12% 12% 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.18) 0%, rgba(52, 211, 153, 0.05) 45%, transparent 72%);
  filter: blur(32px);
  pointer-events: none;
  z-index: 0;
}

.portrait-scan-line {
  position: absolute;
  left: 6%;
  right: 6%;
  top: var(--scan-pct, 0%);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, rgba(16, 185, 129, 0.55) 18%, #34d399 42%, #eef7f2 50%, #34d399 58%, rgba(16, 185, 129, 0.55) 82%, transparent 100%);
  box-shadow: 0 0 14px 2px rgba(16, 185, 129, 0.65), 0 0 32px 6px rgba(52, 211, 153, 0.22);
  pointer-events: none;
  z-index: 4;
  opacity: var(--scan-alpha, 0);
  transform: translateY(-50%);
  will-change: top, opacity;
}

.portrait-fallback {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  z-index: 2;
  transition: opacity 0.24s ease;
  user-select: none;
  -webkit-user-drag: none;
  will-change: opacity, clip-path;
}

/* Seamless Retina photo-to-particle hybrid driven by JS variables (zero ghost shadow) */
.is-3d.portrait-mode-dots .portrait-fallback {
  opacity: var(--photo-alpha, 0);
  clip-path: inset(0 0 var(--scan-bottom, 0%) 0);
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at var(--mask-x, -300px) var(--mask-y, -300px), transparent 0px, transparent var(--mask-r, 0px), rgba(0, 0, 0, 0.45) calc(var(--mask-r, 0px) + 34px), #000 calc(var(--mask-r, 0px) + 74px));
  mask-image: radial-gradient(circle at var(--mask-x, -300px) var(--mask-y, -300px), transparent 0px, transparent var(--mask-r, 0px), rgba(0, 0, 0, 0.45) calc(var(--mask-r, 0px) + 34px), #000 calc(var(--mask-r, 0px) + 74px));
}

.is-3d.portrait-mode-photo .portrait-fallback {
  opacity: 1;
  clip-path: none;
  -webkit-mask-image: none;
  mask-image: none;
  transform: none;
}

.portrait-controls {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 6;
  width: 100%;
}

.portrait-controls__btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.portrait-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ---------- SECTION SPACING & DIVIDERS ---------- */

.section {
  padding-top: clamp(64px, 8.5vw, 128px);
  padding-bottom: clamp(28px, 3.5vw, 52px);
  border-top: 1px solid rgba(238, 247, 242, 0.08);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(28px, 3.8vw, 52px);
}

/* ---------- ABOUT SECTION ---------- */

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(28px, 4vw, 60px);
  align-items: start;
}

.about__story {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.about__headline {
  font-size: clamp(22px, 2.3vw, 34px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.about__headline strong {
  color: var(--accent-hot);
  font-weight: 800;
}

.about__para {
  font-size: clamp(15px, 1.15vw, 17px);
  color: rgba(238, 247, 242, 0.84);
  line-height: 1.7;
  max-width: 60ch;
}

.edu-card {
  padding: 20px 22px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.07), rgba(11, 19, 16, 0.96));
  border: 1px solid rgba(16, 185, 129, 0.28);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.edu-card__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent-hot);
}

.edu-card__title {
  font-size: clamp(17px, 1.4vw, 20px);
  font-weight: 700;
}

.edu-card__sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--hair);
}

.stat-card {
  padding: 15px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--hair);
}

.stat-card__num {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.2vw, 46px);
  font-weight: 900;
  line-height: 0.9;
  color: var(--accent-hot);
}

.stat-card__label {
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* Editorial Photo Collage */
.about__collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.ph {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: var(--frame-bg);
  border: 1px solid var(--hair);
}

.ph--wide {
  grid-column: 1 / -1;
}

.ph img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

.ph--tall img {
  aspect-ratio: 4 / 5;
  object-position: center 22%;
}

.ph--hud img {
  aspect-ratio: 16 / 9;
}

.ph__cap {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(5, 10, 8, 0.84);
  border: 1px solid rgba(238, 247, 242, 0.16);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--paper);
  backdrop-filter: blur(8px);
}

/* ---------- PROJECTS & SCREENSHOT REEL ---------- */

.projects__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-btn:hover {
  color: var(--paper);
  border-color: var(--hair-strong);
}

.filter-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
  font-weight: 700;
}

/* Edge-safe full-bleed reel (never causes 100vw horizontal overflow) */
.feed-wrap {
  position: relative;
  width: calc(100% + var(--pad-x) * 2);
  margin-inline: calc(var(--pad-x) * -1);
  margin-bottom: clamp(28px, 4vw, 48px);
}

.feed-controls {
  padding-inline: var(--pad-x);
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.feed-controls__hint {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.feed {
  overflow: hidden;
  width: 100%;
  padding-block: 6px;
  touch-action: pan-y;
}

.feed__track {
  display: flex;
  align-items: stretch;
  gap: 14px;
  width: max-content;
  will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
  .feed__track {
    animation: marquee-scroll 46s linear infinite;
  }
  .feed:hover .feed__track,
  .feed.is-paused .feed__track {
    animation-play-state: paused;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feed {
    overflow-x: auto;
  }
  .feed__track {
    animation: none;
    padding-inline: var(--pad-x);
  }
}

@keyframes marquee-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

.feed__card {
  position: relative;
  flex: none;
  width: clamp(248px, 23vw, 370px);
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--hair);
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.32s var(--ease-out), border-color 0.22s ease;
}

.feed__card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.feed__card picture {
  display: block;
  width: 100%;
  height: 100%;
}

.feed__card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.feed__label {
  position: absolute;
  inset: auto 10px 10px 10px;
  padding: 6px 11px;
  border-radius: 10px;
  background: rgba(5, 10, 8, 0.88);
  border: 1px solid rgba(238, 247, 242, 0.14);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.feed__label span:last-child {
  color: var(--accent-hot);
}

/* Engineering Product Cards Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.project-card {
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease-out), border-color 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, 0.48);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

.project-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.08fr 1fr;
}

.project-card.is-hidden {
  display: none;
}

.project-card__media {
  position: relative;
  overflow: hidden;
  background: #080f0c;
  aspect-ratio: 16 / 10;
}

.project-card--featured .project-card__media {
  aspect-ratio: auto;
  min-height: 360px;
}

.project-card__media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.65s var(--ease-out);
}

.project-card:hover .project-card__media img {
  transform: scale(1.025);
}

.project-card__num,
.project-card__status {
  position: absolute;
  top: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(5, 10, 8, 0.88);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.project-card__num {
  left: 12px;
  border: 1px solid rgba(16, 185, 129, 0.38);
  color: var(--accent-hot);
}

.project-card__status {
  right: 12px;
  border: 1px solid var(--hair);
  color: var(--muted);
}

.project-card__status--live {
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.project-card__body {
  padding: clamp(20px, 2.3vw, 30px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  flex: 1;
}

.project-card__top {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-card__kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-hot);
}

.project-card__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 2.7vw, 40px);
  font-weight: 900;
  line-height: 0.94;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.project-card__problem {
  font-size: 14.5px;
  line-height: 1.55;
  color: rgba(238, 247, 242, 0.92);
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.06);
  border-left: 2px solid var(--accent);
}

.project-card__problem strong {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-hot);
  margin-right: 4px;
}

.project-card__points {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-left: 16px;
  list-style: disc;
  font-size: 14px;
  line-height: 1.54;
  color: rgba(238, 247, 242, 0.78);
}

.project-card__points li::marker {
  color: var(--accent);
}

.project-card__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: rgba(238, 247, 242, 0.03);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.tag--bright {
  color: var(--paper);
  border-color: rgba(16, 185, 129, 0.34);
  background: rgba(16, 185, 129, 0.08);
}

.project-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- TECHNICAL SKILLS (6-Category Engineering Credibility Grid) ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.skill-card {
  padding: 22px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.skill-card:hover {
  border-color: rgba(16, 185, 129, 0.42);
  background: var(--surface-hi);
}

.skill-card__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.skill-card__num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-hot);
}

.skill-card__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--paper);
  line-height: 1.25;
}

.skill-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.skill-pill-list li {
  padding: 6px 11px;
  border-radius: 10px;
  border: 1px solid rgba(238, 247, 242, 0.14);
  background: rgba(5, 10, 8, 0.65);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--paper);
}

.skill-card__context {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.skill-card__context strong {
  color: var(--accent-hot);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.engineering-notes {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mini-metric {
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.22);
}

.mini-metric strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-hot);
  margin-bottom: 6px;
}

.mini-metric span {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(238, 247, 242, 0.84);
}

/* ---------- CERTIFICATIONS (Subordinate, Clean Verification Strip) ---------- */

.certs__head-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
}

.badge {
  width: clamp(58px, 5.8vw, 84px);
  height: clamp(58px, 5.8vw, 84px);
  flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .badge img {
    animation: spin-slow 24s linear infinite;
  }
}

@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

.certs__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.cert-card {
  position: relative;
  text-align: left;
  width: 100%;
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.25s var(--ease-out), border-color 0.22s ease, background-color 0.22s ease;
}

.cert-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--surface-hi);
}

.cert-card__issuer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-hot);
  margin-bottom: 8px;
}

.cert-card__date {
  color: var(--muted);
  white-space: nowrap;
}

.cert-card__title {
  font-size: clamp(16px, 1.25vw, 18.5px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--paper);
  margin-bottom: 6px;
}

.cert-card__desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}

.cert-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(238, 247, 242, 0.85);
}

.cert-card__cta {
  color: var(--accent-hot);
  white-space: nowrap;
}

/* ---------- K.A.I.R.O.S. SIGNAL WAVE STAGE & TERMINAL ---------- */

.kairos-stage {
  position: relative;
  margin-top: clamp(64px, 8vw, 116px);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(16, 185, 129, 0.24);
  background: linear-gradient(180deg, rgba(11, 19, 16, 0.96) 0%, rgba(5, 10, 8, 1) 100%);
  padding: clamp(22px, 4vw, 48px);
  min-height: 440px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.wave-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

.kairos-stage__head,
.kairos-console {
  position: relative;
  z-index: 2;
}

.kairos-stage__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.kairos-stage__meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.kairos-stage__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kairos-stage__sub {
  max-width: 44ch;
  font-size: 14.5px;
  color: rgba(238, 247, 242, 0.84);
}

.kairos-console {
  background: rgba(5, 10, 8, 0.84);
  border: 1px solid var(--hair-strong);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.console-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip-btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: rgba(238, 247, 242, 0.04);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--paper);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.chip-btn:hover {
  border-color: var(--accent);
  color: var(--accent-hot);
  background: rgba(16, 185, 129, 0.08);
}

.console-output {
  min-height: 82px;
  max-height: 170px;
  overflow-y: auto;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.58);
  border: 1px solid rgba(238, 247, 242, 0.08);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: #e2e8f0;
  word-break: break-word;
}

.console-output .cmd-echo {
  color: var(--accent-hot);
  font-weight: 600;
}

.console-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.console-prompt {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-hot);
  flex-shrink: 0;
}

.console-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--paper);
}

/* ---------- CONTACT & FOOTER ---------- */

.contact {
  padding-top: clamp(72px, 9vw, 132px);
  padding-bottom: clamp(40px, 5vw, 64px);
}

.contact__label {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.25vw, 17px);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(28px, 4vw, 52px);
}

.contact__line {
  flex: 1;
  height: 1px;
  background: var(--hair-strong);
  transform-origin: 0 50%;
}

.contact__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(32px, 5vw, 68px);
  align-items: start;
}

.contact__left {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contact__intro {
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.6;
  color: rgba(238, 247, 242, 0.86);
  max-width: 46ch;
}

.contact__primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact__mail {
  display: inline-block;
  width: fit-content;
  font-family: var(--font-mono);
  font-size: clamp(15px, 1.35vw, 20px);
  color: var(--accent-hot);
  word-break: break-word;
  border-bottom: 1px solid rgba(52, 211, 153, 0.35);
  padding-bottom: 2px;
}

.contact__mail:hover {
  border-color: var(--accent-hot);
}

.contact__big {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact__big a {
  display: block;
  width: max-content;
  max-width: 100%;
  font-size: clamp(46px, 7.6vw, 124px);
  transition: color 0.25s ease, transform 0.3s var(--ease-out);
}

.contact__big a:hover {
  color: var(--accent-hot);
  transform: translateX(6px);
}

/* Contact Form */
.contact-form-card {
  padding: clamp(20px, 2.8vw, 32px);
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--hair);
}

.contact-form-card h3 {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 6px;
}

.contact-form-card__sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.field {
  display: flex;
  flex-direction: column;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.hint {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--hair-strong);
  background: rgba(5, 10, 8, 0.76);
  color: var(--paper);
  font-size: 15px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.error-msg {
  display: none;
  margin-top: 6px;
  font-size: 12.5px;
  color: #fca5a5;
}

.field :is(:user-invalid, .user-invalid-fallback) {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.field :is(:user-invalid, .user-invalid-fallback) + .error-msg {
  display: block;
}

.field :is(:user-valid, .user-valid-fallback) {
  border-color: var(--emerald);
}

.form-transparency {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}

.form-status {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}

.form-status--warn {
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.38);
  color: #fef08a;
}

.footer-bar {
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 20px;
  border-top: 1px solid var(--hair);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- NATIVE TOP-LAYER CASE STUDY & CERTIFICATE DIALOG ---------- */

dialog.detail-dialog {
  width: min(calc(100vw - 20px), 920px);
  max-height: min(92dvh, 900px);
  margin: auto;
  padding: 0;
  border: 1px solid rgba(16, 185, 129, 0.34);
  border-radius: 22px;
  background: #0b1310;
  color: var(--paper);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.26s;
  transition-timing-function: var(--ease-out);
  transition-behavior: allow-discrete;
}

@media (prefers-reduced-motion: no-preference) {
  dialog.detail-dialog {
    transform: translateY(16px) scale(0.97);
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog.detail-dialog {
    transition-duration: 0.1s;
  }
}

:is(dialog.detail-dialog[open]):where(:not([data-closing])) {
  opacity: 1;
}

@starting-style {
  :is(dialog.detail-dialog[open]):where(:not([data-closing])) {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  :is(dialog.detail-dialog[open]):where(:not([data-closing])) {
    transform: translateY(0) scale(1);
  }
  @starting-style {
    :is(dialog.detail-dialog[open]):where(:not([data-closing])) {
      transform: translateY(16px) scale(0.97);
    }
  }
}

dialog.detail-dialog:modal {
  overscroll-behavior: contain;
}

dialog.detail-dialog::backdrop {
  background: rgba(4, 4, 6, 0);
  backdrop-filter: blur(0px);
  overflow: hidden;
  overscroll-behavior: contain;
  transition-property: background-color, backdrop-filter, display, overlay;
  transition-duration: 0.26s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

:is(dialog.detail-dialog[open]):where(:not([data-closing]))::backdrop {
  background: rgba(4, 4, 6, 0.8);
  backdrop-filter: blur(6px);
}

@starting-style {
  :is(dialog.detail-dialog[open]):where(:not([data-closing]))::backdrop {
    background: rgba(4, 4, 6, 0);
    backdrop-filter: blur(0px);
  }
}

.dialog__inner {
  display: flex;
  flex-direction: column;
  max-height: min(92dvh, 900px);
}

.dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--hair);
}

.dialog__head-copy {
  min-width: 0;
}

.dialog__title {
  font-family: var(--font-display);
  font-size: clamp(26px, 2.8vw, 38px);
  font-weight: 900;
  line-height: 0.95;
  text-transform: uppercase;
  margin-top: 4px;
}

.dialog__close {
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--hair-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.dialog__close:hover {
  border-color: var(--accent);
  color: var(--accent-hot);
}

.dialog__body {
  padding: 22px 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cs-subtitle {
  font-weight: 600;
  font-size: 16.5px;
  color: var(--accent-hot);
}

.cs-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
}

.cs-block__title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-hot);
}

.cs-copy {
  font-size: 14.5px;
  line-height: 1.66;
  color: rgba(238, 247, 242, 0.88);
}

.cs-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.cs-callout {
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-callout--accent {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.3);
}

.arch-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.arch-node {
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(5, 10, 8, 0.72);
  border: 1px solid rgba(16, 185, 129, 0.24);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.arch-node strong {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-hot);
}

.arch-node span {
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(238, 247, 242, 0.82);
}

.dialog__hero {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--hair);
  background: #050a08;
  max-height: 360px;
}

.dialog__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.demo-player {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-player__stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(16, 185, 129, 0.34);
  background: #050a08;
  aspect-ratio: 16 / 9;
}

.demo-player__stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: opacity 0.25s ease;
}

.demo-player__caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(5, 10, 8, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.32);
  backdrop-filter: blur(8px);
}

.demo-player__caption strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent-hot);
  margin-bottom: 2px;
}

.demo-player__caption span {
  font-size: 13px;
  color: var(--paper);
}

.demo-player__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.demo-player__dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.demo-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(238, 247, 242, 0.25);
  transition: width 0.25s var(--ease-out), background-color 0.2s ease;
}

.demo-dot.is-active {
  width: 28px;
  background: var(--accent);
}

.demo-player__btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.btn[disabled] {
  opacity: 0.65;
  cursor: wait;
}

.dialog__meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.dialog__meta-box {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hair);
}

.dialog__meta-box span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}

.dialog__meta-box strong {
  font-size: 13.5px;
  color: var(--paper);
  word-break: break-word;
}

.dialog__bullets {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 18px;
  list-style: disc;
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(238, 247, 242, 0.85);
}

.dialog__bullets li::marker {
  color: var(--accent);
}

.dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
}

/* ---------- REVEAL CHOREOGRAPHY ---------- */

.wd { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; clip-path: inset(-0.34em -0.08em -0.14em); }
.ch > span { display: inline-block; }
.ln { display: block; clip-path: inset(-0.14em -0.5em -0.22em); }
.ln > span { display: block; }

.rv:not(.rv-all) [data-rv]:not(.rv-item) {
  visibility: hidden;
}

.rv:not(.rv-all) .rv-item:not(.in) .ch > span {
  transform: translateY(125%) rotate(5deg);
  transform-origin: 0 100%;
}

.rv:not(.rv-all) .rv-item:not(.in) .ln > span {
  transform: translateY(135%) rotate(2deg);
  transform-origin: 0 100%;
}

.rv:not(.rv-all) .ph.rv-item:not(.in) img {
  clip-path: inset(100% 0 0 0);
  transform: scale(1.1);
}

.rv:not(.rv-all) .badge.rv-item:not(.in) img {
  transform: rotate(-90deg) scale(0);
}

.rv:not(.rv-all) .rv-item:not(.in) .contact__line {
  transform: scaleX(0);
}

@media (prefers-reduced-motion: no-preference) {
  .rv .rv-item .ch > span {
    transition: transform 0.82s var(--ease-out) calc(var(--i, 0) * 22ms);
  }
  .rv .rv-item .ln > span {
    transition: transform 0.68s var(--ease-out) calc(var(--i, 0) * 56ms);
  }
  .rv .ph.rv-item img {
    clip-path: inset(0);
    transform-origin: 50% 100%;
    transition: clip-path 0.9s var(--ease-wipe), transform 1.1s var(--ease-wipe);
  }
  .rv .badge.rv-item img {
    transition: transform 0.58s cubic-bezier(0.34, 1.4, 0.64, 1) 0.16s;
  }
  .rv .rv-item .contact__line {
    transition: transform 0.95s var(--ease-wipe) 0.12s;
  }
}

.rv .rv-item.settled .ch,
.rv .rv-item.settled .ln {
  clip-path: none;
}

.rv .ph.rv-item.settled img {
  clip-path: none;
  transition: none;
}

/* ---------- RESPONSIVE BREAKPOINTS (Tablet, Mobile 430 / 390 / 375 / 320) ---------- */

@media (max-width: 1079.98px) {
  .hero {
    min-height: auto;
  }
  .hero__grid {
    grid-template-columns: 1fr;
  }
  .portrait-stage {
    order: -1;
  }
  .portrait-slot {
    width: min(100%, 360px);
    max-height: clamp(270px, 44vh, 380px);
  }
  .about__grid,
  .contact__layout {
    grid-template-columns: 1fr;
  }
  .skills-grid,
  .certs__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-card--featured {
    grid-template-columns: 1fr;
  }
  .project-card--featured .project-card__media {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 720px) {
  .cs-two-col,
  .arch-flow,
  .engineering-notes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    top: 10px;
    padding: 7px 8px 7px 14px;
    gap: 8px;
  }
  .brand-pill__sub {
    display: none;
  }
  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .skills-grid,
  .certs__grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .about__collage {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .feed__card {
    width: 78vw;
  }
  .kairos-stage {
    padding: 20px 16px;
    border-radius: 20px;
  }
  .console-form {
    flex-wrap: wrap;
  }
  .console-form .pill-btn {
    width: 100%;
    min-height: 44px;
  }
  .pill-btn,
  .filter-btn,
  .chip-btn,
  .social-pill {
    min-height: 44px;
  }
  .dialog__head {
    padding: 15px 16px;
  }
  .dialog__body {
    padding: 16px 16px 22px;
  }
  .demo-player__stage {
    aspect-ratio: auto;
  }
  .demo-player__caption {
    position: static;
    border-radius: 0;
    border: 0;
    border-top: 1px solid rgba(16, 185, 129, 0.25);
  }
}

@media (max-width: 430px) {
  .hero {
    padding-top: 80px;
  }
  .portrait-slot {
    width: min(100%, 290px);
    max-height: 290px;
  }
  .hero__cta .btn,
  .contact__primary-actions .btn,
  .project-card__actions .btn {
    flex: 1 1 135px;
    padding: 0 14px;
    font-size: 13.5px;
  }
  .portrait-controls__btns .pill-btn {
    padding: 0 11px;
    font-size: 10.5px;
  }
  .about__collage {
    grid-template-columns: 1fr;
  }
  .ph--wide {
    grid-column: auto;
  }
  .contact__big a {
    font-size: clamp(38px, 12vw, 62px);
  }
  .console-prompt {
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .topbar {
    width: calc(100vw - 14px);
    padding: 6px 6px 6px 11px;
  }
  .brand-pill {
    font-size: 11px;
    gap: 7px;
  }
  .topbar-actions .pill-btn--accent {
    padding: 0 10px;
    font-size: 10px;
    min-height: 38px;
  }
  .nav-toggle {
    min-width: 40px;
    min-height: 40px;
  }
  .project-card__num,
  .project-card__status {
    font-size: 9.5px;
    padding: 4px 8px;
  }
}
