/* ============================================
   ASHUTOSH RAJBHAR — PORTFOLIO / RESUME
   Design system: "build log" — a developer's
   own Core Web Vitals report, run on himself.
   ============================================ */

:root{
  --paper: #EEF1F4;
  --paper-soft: #F6F8F9;
  --card: #FFFFFF;
  --ink: #14213D;
  --ink-soft: #33415E;
  --muted: #5B6472;
  --line: rgba(20, 33, 61, 0.13);
  --line-strong: rgba(20, 33, 61, 0.22);

  --good: #2E7D5B;
  --good-soft: rgba(46, 125, 91, 0.12);
  --warn: #C97A2B;
  --signal: #3557C7;
  --signal-soft: rgba(53, 87, 199, 0.10);
  --coral: #E8654A;

  --term-bg: #0F1A2E;
  --term-bg-soft: #16233B;
  --term-green: #7CE8A8;
  --term-amber: #F2B84B;
  --term-text: #D8DEEA;
  --term-dim: #7C88A3;

  --font-display: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container: 1180px;
  --radius: 4px;
}

html[data-theme="dark"]{
  --paper: #0B1220;
  --paper-soft: #0F1728;
  --card: #121B2E;
  --ink: #EDEFF3;
  --ink-soft: #C7CCDA;
  --muted: #8891A3;
  --line: rgba(237, 239, 243, 0.09);
  --line-strong: rgba(237, 239, 243, 0.18);

  --good: #4FBE8B;
  --good-soft: rgba(79, 190, 139, 0.14);
  --warn: #E0A155;
  --signal: #6E8CE8;
  --signal-soft: rgba(110, 140, 232, 0.14);
  --coral: #F0846A;
}
html[data-theme="dark"] .photo-frame img{ filter: grayscale(15%) contrast(1.05) brightness(1.02); }
html[data-theme="dark"] .grain{ opacity: 0.5; }

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

html{
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

body{
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
}

img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
ul, ol{ margin: 0; padding: 0; list-style: none; }
h1, h2, h3{ font-family: var(--font-display); margin: 0; color: var(--ink); }
p{ margin: 0; }

/* subtle graph-paper grain, grounded in "measurement" theme */
.grain{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  mask-image: linear-gradient(to bottom, black, transparent 700px);
}

.section, .hero, .nav, .footer{ position: relative; z-index: 1; }

/* ===== shared ===== */
.eyebrow{
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--signal);
  margin-bottom: 14px;
}

.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 13px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.btn-primary{ background: var(--ink); color: var(--paper-soft); }
.btn-primary:hover{ transform: translateY(-2px); background: var(--signal); border-color: var(--signal); }
.btn-ghost{ background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover{ transform: translateY(-2px); border-color: var(--ink); }
.btn-arrow{ transition: transform 0.18s ease; }
.btn:hover .btn-arrow{ transform: translateX(3px); }

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

.pill{
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 7px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  color: var(--ink-soft);
  background: var(--card);
}
.pill-sm{ font-size: 12px; padding: 5px 11px; }
.pill-row{ display: flex; flex-wrap: wrap; gap: 8px; }

/* ===== BUILD PROGRESS BAR ===== */
.build-bar{
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 60;
  background: transparent;
}
.build-bar-fill{
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--signal), var(--good));
  transition: width 0.1s linear;
}
.build-bar-label{
  position: absolute;
  top: 6px; right: 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  background: var(--paper-soft);
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.build-bar.is-active .build-bar-label{ opacity: 1; transform: translateY(0); }

/* ===== NAV ===== */
.nav{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(238, 241, 244, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner{
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-brand{ display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand-mark{
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--ink);
  color: var(--paper-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius);
}
.brand-text{ font-family: var(--font-mono); font-size: 14px; color: var(--ink); }
.brand-dim{ color: var(--muted); }

.nav-links{ display: flex; gap: 26px; }
.nav-links a{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}
.nav-links a:hover{ color: var(--ink); }
.nav-links .idx{ color: var(--signal); font-size: 11px; }
.nav-links a.is-active{ color: var(--ink); }
.nav-links a.is-active .idx{ color: var(--good); }

.theme-toggle{
  position: relative;
  width: 38px; height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover{ border-color: var(--ink); transform: translateY(-1px); }
.theme-icon{
  position: absolute;
  font-size: 15px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.theme-icon-sun{ opacity: 1; transform: scale(1) rotate(0deg); color: var(--warn); }
.theme-icon-moon{ opacity: 0; transform: scale(0.5) rotate(-40deg); color: var(--signal); }
html[data-theme="dark"] .theme-icon-sun{ opacity: 0; transform: scale(0.5) rotate(40deg); }
html[data-theme="dark"] .theme-icon-moon{ opacity: 1; transform: scale(1) rotate(0deg); }

.nav-cta{
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 9px 16px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.nav-cta:hover{ background: var(--ink); color: var(--paper-soft); }

.nav-toggle{
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span{ width: 22px; height: 2px; background: var(--ink); display: block; }

/* ===== HERO ===== */
.hero{ max-width: var(--container); margin: 0 auto; padding: 64px 32px 0; position: relative; overflow: hidden; }
.hero-grid{
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 56px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-glyphs{ position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.glyph{
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--signal);
  opacity: 0.08;
  animation: drift 9s ease-in-out infinite;
}
.g1{ top: 6%;  left: 4%;  font-size: 46px; animation-delay: 0s; }
.g2{ top: 62%; left: 2%;  font-size: 30px; animation-delay: 1.2s; color: var(--good); }
.g3{ top: 14%; left: 46%; font-size: 26px; animation-delay: 2.4s; }
.g4{ top: 80%; left: 40%; font-size: 34px; animation-delay: 0.6s; color: var(--coral); }
.g5{ top: 40%; left: 92%; font-size: 40px; animation-delay: 1.8s; }
.g6{ top: 4%;  left: 88%; font-size: 24px; animation-delay: 3s; color: var(--good); }
.g7{ top: 70%; left: 60%; font-size: 22px; animation-delay: 2s; }
.g8{ top: 30%; left: 20%; font-size: 20px; animation-delay: 3.6s; color: var(--coral); }

@keyframes drift{
  0%, 100%{ transform: translateY(0) rotate(0deg); }
  50%{ transform: translateY(-16px) rotate(-4deg); }
}
@media (prefers-reduced-motion: reduce){ .glyph{ animation: none; } }
@media (max-width: 980px){ .hero-glyphs{ display: none; } }

.commit-line{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.commit-hash{ color: var(--signal); }
.status-dot{
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--good);
  display: inline-block;
  box-shadow: 0 0 0 3px var(--good-soft);
  animation: pulse 2.4s ease-in-out infinite;
}
.status-text{ color: var(--good); }
@keyframes pulse{
  0%, 100%{ opacity: 1; }
  50%{ opacity: 0.45; }
}

.hero-title{
  font-size: clamp(44px, 6vw, 76px);
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.hero-role{ margin-bottom: 20px; }
.role-cycle{
  font-family: var(--font-mono);
  font-size: 17px;
  color: var(--signal);
  border-bottom: 2px solid var(--signal-soft);
  padding-bottom: 2px;
}

.hero-desc{
  max-width: 52ch;
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 32px;
}
.hero-desc strong{ color: var(--ink); }

.hero-actions{ display: flex; gap: 14px; margin-bottom: 44px; flex-wrap: wrap; }

.hero-meta{
  display: flex;
  gap: 40px;
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.hero-meta dt{ font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.hero-meta dd{ margin: 0; font-size: 14.5px; color: var(--ink-soft); }

/* ----- interactive terminal ----- */
.mini-terminal{
  margin-top: 32px;
  max-width: 560px;
  background: var(--term-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(15, 26, 46, 0.55);
  border: 1px solid rgba(255,255,255,0.06);
}
.term-bar{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: var(--term-bg-soft);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.term-dot{ width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.term-dot-r{ background: #EE6A5F; }
.term-dot-y{ background: #F4BF4F; }
.term-dot-g{ background: #61C454; }
.term-title{
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--term-dim);
}
.term-body{
  padding: 16px 18px 6px;
  max-height: 190px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
}
.term-line{ color: var(--term-text); margin: 0 0 6px; white-space: pre-wrap; word-break: break-word; }
.term-dim{ color: var(--term-dim); }
.term-cmd{ color: var(--term-green); }
.term-echo{ color: #fff; }
.term-echo::before{ content: '$ '; color: var(--term-green); }
.term-heading{ color: var(--term-amber); font-weight: 600; }
.term-link{ color: var(--signal); text-decoration: underline; text-decoration-color: rgba(53,87,199,0.4); }

.term-input-row{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 16px;
  font-family: var(--font-mono);
  font-size: 13.5px;
}
.term-prompt{ color: var(--term-green); white-space: nowrap; }
.term-tilde{ color: var(--term-dim); }
.term-input{
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13.5px;
  caret-color: var(--term-green);
}
.term-input::placeholder{ color: var(--term-dim); }

.term-body::-webkit-scrollbar{ width: 6px; }
.term-body::-webkit-scrollbar-thumb{ background: rgba(255,255,255,0.12); border-radius: 3px; }

.hero-photo{ position: relative; display: flex; justify-content: center; perspective: 1000px; }
.photo-backdrop{
  position: absolute;
  inset: 18px -18px -18px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  z-index: -1;
}
.photo-frame{
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  background: var(--ink);
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out;
  will-change: transform;
}
.photo-frame:hover{ box-shadow: 0 24px 50px -20px rgba(20, 33, 61, 0.45); }
.photo-frame img{
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  filter: grayscale(28%) contrast(1.03);
}
.frame-tag{
  position: absolute;
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #EEF1F4;
}
.frame-tag-top{
  top: 0;
  background: linear-gradient(to bottom, rgba(20,33,61,0.75), transparent);
}
.frame-tag-bottom{
  bottom: 0;
  background: linear-gradient(to top, rgba(20,33,61,0.85), transparent);
  justify-content: flex-start;
  gap: 8px;
  align-items: center;
}
.live-dot{ width: 7px; height: 7px; border-radius: 50%; background: var(--good); display: inline-block; }

/* marquee strip */
.hero-marquee{
  margin-top: 60px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 16px 0;
}
.marquee-track{
  display: flex;
  gap: 18px;
  width: max-content;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  animation: scroll-left 32s linear infinite;
}
.marquee-track span:nth-child(2n){ color: var(--line-strong); }
@keyframes scroll-left{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}

/* ===== SECTION shared ===== */
.section{ max-width: var(--container); margin: 0 auto; padding: 120px 32px; }
.section-tight{ padding-top: 96px; padding-bottom: 96px; }
.section-head{ margin-bottom: 52px; max-width: 640px; }
.section-head h2{ font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.01em; }
.section-note{ font-family: var(--font-mono); font-size: 13px; color: var(--muted); margin-top: 14px; }

/* ===== ABOUT ===== */
.about-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.about-lead{ font-size: 22px; line-height: 1.5; color: var(--ink); font-family: var(--font-display); font-weight: 500; }
.about-body{ font-size: 16px; color: var(--muted); }

/* ===== METRICS (signature element) ===== */
.metrics-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.metric-card{
  background: var(--card);
  padding: 40px 24px 32px;
  text-align: center;
  position: relative;
}
.gauge{
  width: 108px;
  height: 108px;
  margin: 0 auto 4px;
  transform: rotate(-90deg);
}
.gauge-track{
  fill: none;
  stroke: var(--paper);
  stroke-width: 8;
}
.gauge-fill{
  fill: none;
  stroke: var(--good);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.4s cubic-bezier(.16,.84,.44,1);
}
.metric-card[data-score="94"] .gauge-fill,
.metric-card[data-score="96"] .gauge-fill{ stroke: var(--good); }
.gauge-number{
  margin-top: -70px;
  margin-bottom: 44px;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
}
.metric-label{ font-family: var(--font-display); font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.metric-sub{ font-size: 13px; color: var(--muted); line-height: 1.5; }

.metric-card{ cursor: pointer; outline-offset: 4px; }
.metric-detail{
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin-top 0.35s ease;
  margin-top: 0;
}
.metric-card.is-expanded .metric-detail{ max-height: 140px; opacity: 1; margin-top: 12px; }
.metric-hint{
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--line-strong);
  margin-top: 14px;
  transition: color 0.2s ease;
}
.metric-card:hover .metric-hint{ color: var(--signal); }
.metric-card.is-expanded .metric-hint{ opacity: 0; height: 0; margin: 0; }

/* ===== EXPERIENCE / LOG ===== */
.log{ position: relative; }
.log-entry{
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 24px;
}
.log-rail{
  position: relative;
  display: flex;
  justify-content: center;
}
.log-rail::before{
  content: '';
  position: absolute;
  top: 8px; bottom: -36px;
  width: 1px;
  background: var(--line-strong);
}
.log-entry:last-child .log-rail::before{ display: none; }
.log-node{
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--signal);
  margin-top: 6px;
  z-index: 1;
}
.log-node-head{ background: var(--good); border-color: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.log-node-root{ background: var(--muted); border-color: var(--muted); }

.log-body{ padding-bottom: 40px; }
.log-top{ display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.log-hash{ font-family: var(--font-mono); font-size: 12px; color: var(--signal); background: var(--signal-soft); padding: 3px 8px; border-radius: 3px; }
.log-top h3{ font-size: 20px; font-weight: 600; }
.log-at{ font-family: var(--font-body); font-weight: 400; color: var(--muted); font-size: 15px; }
.log-date{ font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); margin-left: auto; }
.log-list{ display: flex; flex-direction: column; gap: 8px; max-width: 70ch; }
.log-list li{
  font-size: 15px;
  color: var(--ink-soft);
  padding-left: 18px;
  position: relative;
}
.log-list li::before{
  content: '+';
  position: absolute;
  left: 0;
  color: var(--good);
  font-family: var(--font-mono);
  font-weight: 600;
}

/* ===== STACK ===== */
.stack-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px 48px;
}
.stack-group h3{
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 14px;
}

/* ===== PROJECTS ===== */
.project-list{ display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.project-card{ background: var(--card); padding: 0; }
.browser-bar{
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.browser-bar .dot{ width: 8px; height: 8px; border-radius: 50%; }
.browser-bar .dot-r{ background: #EE6A5F; }
.browser-bar .dot-y{ background: #F4BF4F; }
.browser-bar .dot-g{ background: #61C454; }
.browser-url{
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--card);
  padding: 3px 12px;
  border-radius: 100px;
  border: 1px solid var(--line);
}
.project-top{ display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 28px 36px 14px; flex-wrap: wrap; }
.project-top h3{ font-size: 22px; }
.project-link{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--signal);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.project-link:hover .btn-arrow{ transform: translateX(3px); }
.project-desc{ font-size: 15.5px; color: var(--ink-soft); max-width: 72ch; margin: 0 36px 22px; }
.project-meta{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 0 36px 22px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.project-meta span:not(.meta-label){ font-size: 14px; color: var(--ink-soft); }
.project-card > .pill-row{ margin: 0 36px 30px; }

/* ===== CONTACT ===== */
.contact{ padding-top: 100px; padding-bottom: 100px; }
.contact-inner{ max-width: 760px; }
.contact h2{ font-size: clamp(30px, 4vw, 46px); line-height: 1.1; margin-bottom: 18px; letter-spacing: -0.01em; }
.contact-sub{ font-size: 17px; color: var(--muted); margin-bottom: 44px; display: block; }
.contact-row{ display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.contact-item{ background: var(--card); padding: 22px 24px; transition: background 0.15s ease; position: relative; }
.contact-item:hover{ background: var(--signal-soft); }
.contact-item span:not(.meta-label){ font-family: var(--font-mono); font-size: 15px; color: var(--ink); padding-right: 34px; display: inline-block; }
.copy-btn{
  position: absolute;
  top: 18px; right: 18px;
  width: 28px; height: 28px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--muted);
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.copy-btn:hover{ color: var(--signal); border-color: var(--signal); transform: translateY(-1px); }
.copy-btn.is-copied{ color: var(--good); border-color: var(--good); }

/* ===== TOAST ===== */
.toast{
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 90;
}
.toast.is-visible{ opacity: 1; transform: translate(-50%, 0); }

/* ===== CONFETTI (easter egg) ===== */
.confetti-piece{
  position: fixed;
  top: -30px;
  z-index: 95;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--signal);
  pointer-events: none;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall{
  to{ transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* ===== FOOTER ===== */
.footer{
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px 32px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}
.back-top{ color: var(--muted); transition: color 0.15s ease; }
.back-top:hover{ color: var(--ink); }

/* ===== SCROLL REVEAL ===== */
.reveal.is-visible{ opacity: 1; transform: translateY(0); }

/* ==========================================================================
   DYNAMIC PALETTES & THEMES
   ========================================================================== */

/* 1. Cyberpunk Theme */
html[data-theme="cyberpunk"] {
  --paper: #0c051a;
  --paper-soft: #170b33;
  --card: #150a24;
  --ink: #00f3ff;
  --ink-soft: #ff007f;
  --muted: #a372eb;
  --line: rgba(0, 243, 255, 0.15);
  --line-strong: rgba(255, 0, 127, 0.25);
  
  --good: #39ff14;
  --good-soft: rgba(57, 255, 20, 0.15);
  --warn: #ffea00;
  --signal: #00f3ff;
  --signal-soft: rgba(0, 243, 255, 0.15);
  --coral: #ff0055;

  --term-bg: #06020c;
  --term-bg-soft: #140826;
  --term-green: #39ff14;
  --term-amber: #ff007f;
  --term-text: #ffffff;
  --term-dim: #7f4ebc;
}
html[data-theme="cyberpunk"] .photo-frame {
  box-shadow: 0 0 25px rgba(255, 0, 127, 0.3);
  border-color: var(--ink-soft);
}
html[data-theme="cyberpunk"] .brand-mark {
  background: var(--ink-soft);
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.5);
}

/* 2. Matrix Hacker Theme */
html[data-theme="matrix"] {
  --paper: #000000;
  --paper-soft: #050a05;
  --card: #040804;
  --ink: #00ff41;
  --ink-soft: #00dd30;
  --muted: #008f11;
  --line: rgba(0, 255, 65, 0.14);
  --line-strong: rgba(0, 255, 65, 0.26);

  --good: #00ff41;
  --good-soft: rgba(0, 255, 65, 0.12);
  --warn: #00dd30;
  --signal: #00ff41;
  --signal-soft: rgba(0, 255, 65, 0.12);
  --coral: #005f0b;

  --term-bg: #000000;
  --term-bg-soft: #020802;
  --term-green: #00ff41;
  --term-amber: #00ff41;
  --term-text: #00ff41;
  --term-dim: #005f0b;
  
  --font-display: 'JetBrains Mono', monospace;
  --font-body: 'JetBrains Mono', monospace;
}
html[data-theme="matrix"] .photo-frame img {
  filter: matrix(1, 0, 0, 1, 0, 0) hue-rotate(90deg) brightness(0.8) contrast(1.2);
}
html[data-theme="matrix"] .btn {
  border-radius: 0;
  border-color: var(--ink);
  color: var(--ink);
}
html[data-theme="matrix"] .btn-primary {
  background: transparent;
}
html[data-theme="matrix"] .btn-primary:hover {
  background: var(--ink);
  color: #000000;
}
html[data-theme="matrix"] * {
  text-shadow: 0 0 2px rgba(0, 255, 65, 0.4);
}

/* 3. Aurora Dream Theme */
html[data-theme="aurora"] {
  --paper: #0d121f;
  --paper-soft: #12192c;
  --card: #151d33;
  --ink: #e0f2f1;
  --ink-soft: #80cbc4;
  --muted: #5e7380;
  --line: rgba(128, 203, 196, 0.12);
  --line-strong: rgba(128, 203, 196, 0.22);

  --good: #26a69a;
  --good-soft: rgba(38, 166, 154, 0.14);
  --warn: #ffa726;
  --signal: #9575cd;
  --signal-soft: rgba(149, 117, 205, 0.14);
  --coral: #ff7043;

  --term-bg: #090d17;
  --term-bg-soft: #111828;
  --term-green: #80cbc4;
  --term-amber: #ffb74d;
  --term-text: #e0f2f1;
  --term-dim: #9575cd;
}
html[data-theme="aurora"] .photo-backdrop {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  opacity: 0.15;
  filter: blur(15px);
}

/* 4. Retro Light Theme */
html[data-theme="retro-light"] {
  --paper: #f4ebd0;
  --paper-soft: #e8debe;
  --card: #faf3dd;
  --ink: #2b2b2a;
  --ink-soft: #5e5b56;
  --muted: #8e897e;
  --line: rgba(43, 43, 42, 0.12);
  --line-strong: rgba(43, 43, 42, 0.24);

  --good: #4a7c59;
  --good-soft: rgba(74, 124, 89, 0.12);
  --warn: #b86214;
  --signal: #3d5a80;
  --signal-soft: rgba(61, 90, 128, 0.12);
  --coral: #b23b3b;

  --term-bg: #2b2b2a;
  --term-bg-soft: #3a3a38;
  --term-green: #a8dadc;
  --term-amber: #f4a261;
  --term-text: #f1faee;
  --term-dim: #9eb1bb;
}
html[data-theme="retro-light"] .nav {
  background: rgba(244, 235, 208, 0.9);
}

/* Theme Swap Transition Helper */
html {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

/* ==========================================================================
   INTERACTIVE WIDGET COMPONENTS
   ========================================================================== */

/* Terminal suggestion chips */
.term-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.term-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: var(--term-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.term-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--term-green);
  border-color: var(--term-green);
  transform: translateY(-1px);
}
.term-chip:active {
  transform: translateY(0);
}

/* Floating Control Dock */
.floating-dock {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  gap: 8px;
  background: rgba(15, 26, 46, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  padding: 6px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.floating-dock:hover {
  transform: translateY(-2px);
}
html[data-theme="retro-light"] .floating-dock {
  background: rgba(250, 243, 221, 0.9);
  border-color: rgba(43, 43, 42, 0.15);
  box-shadow: 0 20px 40px -10px rgba(43, 43, 42, 0.15);
}
.dock-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
html[data-theme="retro-light"] .dock-btn {
  color: var(--ink);
}
.dock-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
html[data-theme="retro-light"] .dock-btn:hover {
  background: rgba(43, 43, 42, 0.08);
}
.dock-btn.is-active {
  background: var(--signal);
  color: #ffffff;
}
html[data-theme="matrix"] .dock-btn.is-active {
  background: var(--ink);
  color: #000000;
  font-weight: bold;
}

/* Theme Selection Overlay Menu */
.theme-menu {
  position: fixed;
  bottom: 82px;
  right: 24px;
  z-index: 101;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 210px;
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
}
.theme-menu.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.theme-menu-header {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  padding: 6px 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.theme-menu button {
  background: transparent;
  border: none;
  text-align: left;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}
.theme-menu button:hover {
  background: var(--signal-soft);
  color: var(--signal);
}
html[data-theme="matrix"] .theme-menu button:hover {
  background: var(--line-strong);
  color: var(--ink);
}

/* Interactive Git Commit Log Items */
.log-hash {
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  outline: none;
}
.log-hash:hover {
  transform: scale(1.05);
  background: var(--signal);
  color: #ffffff;
}
html[data-theme="matrix"] .log-hash:hover {
  background: var(--ink);
  color: #000000;
}
.log-hash:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* Git Diff Slide-out Drawer */
.diff-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 580px;
  background: var(--card);
  border-left: 1px solid var(--line-strong);
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.2);
  z-index: 120;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.diff-drawer.is-open {
  transform: translateX(0);
}
.diff-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-soft);
}
.diff-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.diff-icon {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--signal);
}
.diff-drawer-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.diff-close {
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
  padding: 0 4px;
}
.diff-close:hover {
  color: var(--ink);
}
.diff-drawer-meta {
  padding: 16px 24px;
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.diff-drawer-body {
  flex: 1;
  overflow-y: auto;
  background: var(--term-bg);
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.code-editor-header {
  display: flex;
  justify-content: space-between;
  background: var(--term-bg-soft);
  padding: 8px 16px;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: none;
}
.editor-file {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--term-text);
}
.editor-lang {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--term-dim);
  text-transform: uppercase;
}
.code-editor-body {
  margin: 0;
  flex: 1;
  background: #060a12;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  padding: 16px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--term-text);
}
.code-editor-body code {
  display: block;
}
.diff-line {
  display: block;
  white-space: pre;
  padding: 1px 8px;
  margin: 0 -16px;
}
.diff-line-add {
  background: rgba(46, 125, 91, 0.2);
  color: var(--term-green);
}
.diff-line-del {
  background: rgba(232, 101, 74, 0.2);
  color: #ff8b80;
}
.diff-line-ctx {
  color: var(--term-text);
  opacity: 0.85;
}
.diff-line-info {
  color: var(--term-dim);
  opacity: 0.6;
}

/* Dev Inspector Overlay Rules */
body.inspector-mode * {
  cursor: crosshair !important;
}
.inspect-highlight {
  outline: 2px dashed var(--signal) !important;
  outline-offset: -2px !important;
  position: relative !important;
}
html[data-theme="matrix"] .inspect-highlight {
  outline-color: var(--ink) !important;
}
.inspect-tooltip {
  position: fixed;
  z-index: 10000;
  background: var(--term-bg);
  color: var(--term-text);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  pointer-events: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.4;
}
.inspect-tooltip .tag-name {
  color: var(--coral);
  font-weight: bold;
}
.inspect-tooltip .class-name {
  color: var(--term-green);
}
.inspect-tooltip .dimensions {
  color: var(--term-amber);
  font-size: 10px;
  margin-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 2px;
}

/* Matrix Falling Binary Canvas */
.matrix-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
}
body.matrix-active .matrix-canvas {
  opacity: 0.22;
}

/* Extra decorative scanline for terminal aesthetics */
.mini-terminal {
  position: relative;
}
.mini-terminal::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 10;
  background-size: 100% 3px, 6px 100%;
  pointer-events: none;
  opacity: 0.45;
}

/* ===== SCROLL REVEAL ===== */
@media (max-width: 980px){
  .hero-grid{ grid-template-columns: 1fr; }
  .hero-photo{ order: -1; max-width: 280px; margin: 0 auto 12px; }
  .about-grid{ grid-template-columns: 1fr; }
  .metrics-grid{ grid-template-columns: repeat(2, 1fr); }
  .stack-grid{ grid-template-columns: 1fr; }
  .contact-row{ grid-template-columns: 1fr; }
  .nav-links{ display: none; }
  .nav-toggle{ display: flex; }
  .nav-cta{ display: none; }
}

@media (max-width: 640px){
  .nav-cta{ display: none; }
  .nav-toggle{ display: flex; }
  .nav-links{
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--paper-soft);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 8px 20px 18px;
    gap: 4px;
  }
  .nav-links a{ padding: 10px 0; border-bottom: 1px solid var(--line); }
  .nav-links-open{ display: flex; }
  .hero{ padding-top: 40px; }
  .hero-title{ font-size: 42px; }
  .hero-meta{ flex-wrap: wrap; gap: 24px; }
  .section{ padding: 72px 20px; }
  .nav-inner{ padding: 14px 20px; }
  .log-entry{ grid-template-columns: 20px 1fr; gap: 14px; }
  .log-date{ margin-left: 0; }
  .project-meta{ grid-template-columns: 1fr; }
  .metrics-grid{ grid-template-columns: 1fr 1fr; }
  .mini-terminal{ max-width: 100%; }
  .term-body{ max-height: 160px; }
  .project-top, .project-desc, .project-meta, .project-card > .pill-row{ margin-left: 20px; margin-right: 20px; }
}
