/* Muhammad Usama Afzal, personal portfolio. Navy #171C70, orange #EE7E2C. */
:root {
  --navy: #171c70;
  --navy-deep: #0e113f;
  --navy-soft: #232a8f;
  --orange: #ee7e2c;
  --orange-soft: #fff1e4;
  --ink: #14152e;
  --muted: #565a7a;
  --line: #e3e6f2;
  --bg: #ffffff;
  --bg-soft: #f4f6fd;
  --bg-dark: #0e113f;
  /* Theme surfaces. Dark is the default look; light mode overrides below. */
  --hero-bg: radial-gradient(900px 480px at 85% -10%, rgba(238, 126, 44, 0.35), transparent 60%), linear-gradient(160deg, #0e113f 0%, #171c70 55%, #232a8f 100%);
  --hero-text: #e8eafc;
  --hero-h1: #ffffff;
  --hero-h1-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
  --hero-pitch: #c9cdf5;
  --hero-meta: #aab0ea;
  --hero-grid-line: rgba(255, 255, 255, 0.09);
  --hero-ghost-border: rgba(255, 255, 255, 0.75);
  --hero-ghost-bg: rgba(255, 255, 255, 0.08);
  --hero-ghost-hover: rgba(255, 255, 255, 0.18);
  --orb-c-border: rgba(255, 255, 255, 0.5);
  --explorer-bg: #0e113f;
  --explorer-text: #e8eafc;
  --explorer-intro: #b9bde8;
  --explorer-h2: #ffffff;
  --tab-bg: rgba(255, 255, 255, 0.07);
  --tab-color: #dfe2ff;
  --tab-border: rgba(255, 255, 255, 0.18);
  --tab-hover-bg: rgba(255, 255, 255, 0.14);
  --canvas-wrap: #0e113f;
  --canvas-bg: #0e113f;
  --canvas-label: #e8eafc;
  --canvas-line: #e8eafc;
  --canvas-grid: rgba(148, 163, 184, 0.18);
  --canvas-dim: #94a3b8;
  --canvas-accent: #38bdf8;
  --radius: 18px;
  --shadow: 0 18px 45px rgba(23, 28, 112, 0.13);
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Light theme: daylight version of the same site. Dark stays the default. */
[data-theme="light"] {
  --hero-bg: radial-gradient(900px 480px at 85% -10%, rgba(238, 126, 44, 0.22), transparent 60%), linear-gradient(160deg, #eef1fd 0%, #ffffff 55%, #f4f6fd 100%);
  --hero-text: #14152e;
  --hero-h1: #171c70;
  --hero-h1-shadow: 0 6px 24px rgba(23, 28, 112, 0.12);
  --hero-pitch: #3a3f6e;
  --hero-meta: #565a7a;
  --hero-grid-line: rgba(23, 28, 112, 0.08);
  --hero-ghost-border: #171c70;
  --hero-ghost-bg: transparent;
  --hero-ghost-hover: rgba(23, 28, 112, 0.08);
  --orb-c-border: rgba(23, 28, 112, 0.35);
  --explorer-bg: #eef1fd;
  --explorer-text: #14152e;
  --explorer-intro: #565a7a;
  --explorer-h2: #171c70;
  --tab-bg: #ffffff;
  --tab-color: #171c70;
  --tab-border: #e3e6f2;
  --tab-hover-bg: #fff1e4;
  --canvas-wrap: #dfe6fb;
  --canvas-bg: #eef1fd;
  --canvas-label: #171c70;
  --canvas-line: #171c70;
  --canvas-grid: rgba(23, 28, 112, 0.10);
  --canvas-dim: #565a7a;
  --canvas-accent: #2563eb;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); }
.container { width: min(1120px, 92%); margin: 0 auto; }
.container.narrow { width: min(820px, 92%); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--navy); letter-spacing: -0.02em; }
.brand-dot { color: var(--orange); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: 0.92rem; padding: 8px 12px; border-radius: 999px; transition: background 0.2s, color 0.2s; }
.site-nav a:hover { background: var(--bg-soft); color: var(--navy); }
.site-nav a.nav-cta { background: var(--navy); color: #fff; padding: 9px 18px; margin-left: 6px; }
.site-nav a.nav-cta:hover { background: var(--navy-soft); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 10px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--navy); margin: 5px 0; border-radius: 2px; }

/* Header actions: theme lamp + mobile menu button */
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Site lamp theme toggle: a small hanging work lamp.
   Dark mode is the lamp switched on, glowing warm orange.
   Light mode is the lamp switched off. */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 7px 14px 7px 11px; cursor: pointer; font-family: var(--font-body);
  font-weight: 700; font-size: 0.85rem; color: var(--navy);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.theme-toggle:hover { background: var(--bg-soft); border-color: var(--orange); transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.theme-lamp { display: inline-flex; color: var(--orange); }
.theme-lamp svg { display: block; }
.theme-bulb { filter: drop-shadow(0 0 5px rgba(238, 126, 44, 0.9)) drop-shadow(0 0 12px rgba(238, 126, 44, 0.45)); }
[data-theme="light"] .theme-lamp { color: var(--muted); }
[data-theme="light"] .theme-bulb { filter: none; }
[data-theme="light"] .theme-rays { opacity: 0.25; }
@media (max-width: 600px) {
  .theme-toggle-label { display: none; }
  .theme-toggle { padding: 7px 9px; }
}

/* Buttons */
.btn { display: inline-block; text-decoration: none; font-weight: 700; font-size: 0.95rem; padding: 13px 24px; border-radius: 999px; border: 2px solid transparent; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s; font-family: var(--font-body); }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 10px 24px rgba(238, 126, 44, 0.35); }
.btn-primary:hover { background: #e06f1a; }
.btn-ghost { border-color: var(--navy); color: var(--navy); background: #fff; }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-small { padding: 9px 18px; font-size: 0.88rem; }

/* Hero */
.hero { position: relative; background: var(--hero-bg); padding: 72px 0 0; overflow: hidden; color: var(--hero-text); }
.hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--hero-grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--hero-grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, #000 30%, transparent 95%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; padding-bottom: 64px; }
.hero-eyebrow { color: var(--orange); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.8rem; margin: 0 0 14px; }
.hero h1 { font-family: var(--font-display); font-size: clamp(3.2rem, 7.5vw, 5rem); line-height: 1.0; letter-spacing: -0.03em; color: var(--hero-h1); margin: 0 0 18px; text-shadow: var(--hero-h1-shadow); animation: heroIn 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero-name-accent { color: var(--orange); }
.hero-name-word { display: inline-block; cursor: pointer; }
.hero-name-word.bounce, .brand.bounce { animation: nameBounce 0.65s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes nameBounce { 0% { transform: scale(1); } 30% { transform: scale(0.8, 0.86) rotate(-2deg); } 55% { transform: scale(1.12, 0.94) rotate(1.5deg); } 75% { transform: scale(0.96, 1.05) rotate(-0.5deg); } 100% { transform: scale(1); } }
.hero-pitch { font-size: 1.18rem; color: var(--hero-pitch); max-width: 34rem; margin: 0 0 10px; animation: heroIn 0.9s 0.12s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero-meta { color: var(--hero-meta); margin: 0 0 26px; animation: heroIn 0.9s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 34px; animation: heroIn 0.9s 0.28s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 26px; animation: heroIn 0.9s 0.36s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero-facts li { display: flex; flex-direction: column; }
.hero-facts strong { font-family: var(--font-display); font-size: 1.25rem; color: var(--hero-h1); }
.hero-facts li:nth-child(1) strong, .hero-facts li:nth-child(2) strong { font-size: 1.6rem; }
.hero-facts li > span { font-size: 0.85rem; color: var(--hero-meta); }
@keyframes heroIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* Hero visual: photo */
.hero-visual { display: flex; flex-direction: column; align-items: center; gap: 22px; animation: heroIn 0.9s 0.18s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.photo-frame { position: relative; width: min(420px, 100%); aspect-ratio: 4 / 5; animation: floatY 6s ease-in-out infinite; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.photo-ring {
  position: absolute; inset: -14px; border-radius: 50%;
  border: 2px dashed rgba(238, 126, 44, 0.65);
  animation: spinSlow 26s linear infinite;
}
@keyframes spinSlow { to { transform: rotate(360deg); } }
.photo-img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top; border-radius: 22px;
  border: 5px solid #fff;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), 0 0 0 6px rgba(238, 126, 44, 0.25);
  transition: transform 0.4s ease;
}
.photo-frame:hover .photo-img { transform: scale(1.03) rotate(-1deg); }
.photo-chip {
  position: absolute; background: #fff; color: var(--navy); font-weight: 700; font-size: 0.78rem;
  padding: 7px 13px; border-radius: 999px; box-shadow: 0 10px 24px rgba(23, 28, 112, 0.18);
  white-space: nowrap; animation: chipBob 5s ease-in-out infinite;
}
.chip-a { top: 8px; left: -58px; }
.chip-b { bottom: 34px; right: -64px; animation-delay: 1.2s; }
.chip-c { bottom: -8px; left: -30px; animation-delay: 2.4s; }
@keyframes chipBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* Hero card */
.hero-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow); width: min(430px, 100%);
  transform: perspective(900px) rotateX(2deg);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.hero-card:hover { transform: perspective(900px) rotateX(0) translateY(-4px); box-shadow: 0 26px 55px rgba(23, 28, 112, 0.18); }
.hero-card-title { font-family: var(--font-display); font-weight: 700; color: var(--navy); font-size: 1.05rem; margin: 0 0 10px; }
.hero-checklist { list-style: none; margin: 0 0 12px; padding: 0; }
.hero-checklist li { padding: 4px 0 4px 26px; position: relative; font-size: 0.95rem; color: var(--ink); }
.hero-checklist li::before { content: ""; position: absolute; left: 0; top: 11px; width: 14px; height: 8px; border-left: 2.5px solid var(--orange); border-bottom: 2.5px solid var(--orange); transform: rotate(-45deg); }
.hero-card-foot { margin: 0; font-size: 0.85rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 12px; }

/* Marquee */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--navy-deep); overflow: hidden; padding: 13px 0; }
.marquee-track { display: inline-flex; gap: 26px; white-space: nowrap; animation: marquee 26s linear infinite; will-change: transform; }
.marquee-track span { color: #fff; font-family: var(--font-display); font-weight: 700; letter-spacing: 0.06em; }
.marquee-track i { color: var(--orange); font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Sections */
.section { padding: 84px 0; }
.section-soft { background: var(--bg-soft); }
.section-eyebrow { color: var(--orange); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.8rem; margin: 0 0 10px; }
.section h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: -0.02em; line-height: 1.12; color: var(--navy); margin: 0 0 18px; }
.section-intro { color: var(--muted); max-width: 44rem; margin: 0 0 30px; font-size: 1.05rem; }
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 34px; }
.edu-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; transition: transform 0.25s, box-shadow 0.25s; }
.edu-item:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.edu-degree { font-weight: 700; color: var(--navy); margin: 0 0 4px; }
.edu-school { margin: 0 0 4px; color: var(--muted); font-size: 0.95rem; }
.edu-meta { margin: 0; font-size: 0.88rem; color: var(--muted); }

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

/* Timeline */
.timeline { list-style: none; margin: 26px 0 0; padding: 0 0 0 26px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--orange), var(--navy)); }
.timeline-item { position: relative; padding: 0 0 34px 22px; }
.timeline-item::before { content: ""; position: absolute; left: -26px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--orange); }
.timeline-date { color: var(--orange); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.04em; margin: 0 0 4px; }
.timeline-item h3 { font-family: var(--font-display); color: var(--navy); margin: 0 0 2px; font-size: 1.2rem; }
.timeline-org { font-weight: 600; margin: 0 0 8px; }
.timeline-item p:last-child { margin: 0; color: var(--muted); }

/* Skills */
.tools-grid { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 34px; }
.tool-chip { background: var(--navy); color: #fff; font-weight: 700; padding: 10px 18px; border-radius: 999px; font-size: 0.92rem; transition: transform 0.25s, background 0.25s; cursor: default; }
.tool-chip:hover { transform: translateY(-3px) scale(1.04); background: var(--orange); }
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.skill-block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; transition: transform 0.25s, box-shadow 0.25s; }
.skill-block:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.skill-block h3 { color: var(--navy); font-family: var(--font-display); margin: 0 0 10px; font-size: 1.05rem; }
.skill-block ul { margin: 0; padding-left: 20px; color: var(--muted); }
.skill-block li { padding: 2px 0; }

/* Explorer */
.section-explorer { background: var(--explorer-bg); color: var(--explorer-text); }
.section-explorer h2 { color: var(--explorer-h2); }
.section-explorer .section-intro { color: var(--explorer-intro); }
.explorer-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.explorer-tab {
  background: var(--tab-bg); color: var(--tab-color); border: 1px solid var(--tab-border);
  font-family: var(--font-body); font-weight: 700; font-size: 0.92rem; padding: 11px 20px; border-radius: 999px; cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s, border-color 0.2s;
}
.explorer-tab:hover { transform: translateY(-2px); background: var(--tab-hover-bg); }
.explorer-tab.is-active { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: 0 10px 26px rgba(238, 126, 44, 0.4); }
.explorer-stage { position: relative; }
.explorer-panel { display: none; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35); }
.explorer-panel.is-active { display: block; animation: panelIn 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(16px) scale(0.995); } to { opacity: 1; transform: none; } }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.panel-head h3 { font-family: var(--font-display); color: var(--navy); font-size: 1.3rem; margin: 0 0 6px; }
.panel-head p { margin: 0; color: var(--muted); max-width: 40rem; }
.panel-body { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: start; }
.panel-note { font-size: 0.83rem; color: var(--muted); margin: 10px 0 0; }
.readout-title { font-family: var(--font-display); font-weight: 700; color: var(--navy); font-size: 1.05rem; margin: 0 0 12px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 14px; }
.readout-grid div { background: var(--bg-soft); border-radius: 12px; padding: 12px 14px; }
.readout-grid dt { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.readout-grid dd { margin: 2px 0 0; font-weight: 700; color: var(--navy); font-size: 1.1rem; }
.readout-total { margin: 0 0 14px; }
.readout-note { font-size: 0.9rem; color: var(--muted); margin: 14px 0 0; }

/* PlanSwift */
.ps-plan-wrap { background: #fbfcff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.ps-plan { width: 100%; height: auto; display: block; }
.ps-outer { fill: #ffffff; stroke: var(--navy); stroke-width: 3; }
.ps-room { fill: #eef1fd; stroke: var(--navy); stroke-width: 1.5; cursor: pointer; transition: fill 0.25s; }
.ps-room:hover { fill: #dfe6fb; }
.ps-room.is-active { fill: #ffd9ae; stroke: var(--orange); stroke-width: 2.5; }
.ps-room.is-measured { fill: #ffe9d2; }
.ps-wall { stroke: var(--navy); stroke-width: 2; }
.ps-label { font-family: var(--font-body); font-size: 15px; font-weight: 600; fill: var(--navy); text-anchor: middle; pointer-events: none; }
.ps-label-sm { font-size: 13px; }
.ps-dim { font-size: 12px; fill: var(--muted); text-anchor: middle; font-weight: 600; }
.ps-dim-v { text-anchor: middle; }

/* Kubla */
.kubla-controls, .bb-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kubla-mode.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.kubla-canvas-wrap { background: var(--canvas-wrap); border-radius: 14px; padding: 10px; }
#kublaCanvas { width: 100%; height: auto; display: block; border-radius: 8px; cursor: grab; touch-action: none; }
#kublaCanvas:active { cursor: grabbing; }
.kubla-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; font-size: 0.88rem; color: var(--muted); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 7px; vertical-align: -2px; }
.swatch-cut { background: #f97316; }
.swatch-fill { background: #2563eb; }
.swatch-pad { background: #94a3b8; }
.readout-grid .cut dd { color: #ea580c; }
.readout-grid .fill dd { color: #2563eb; }

/* Bluebeam */
.bb-plan { position: relative; background: #fbfcff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.bb-plan svg { width: 100%; height: auto; display: block; }
.bb-outer { fill: #fff; stroke: var(--navy); stroke-width: 2.5; }
.bb-line { stroke: #c3c9e8; stroke-width: 1.5; }
.bb-beam { fill: #dfe6fb; stroke: var(--navy); stroke-width: 1.5; }
.bb-col { fill: #eef1fd; stroke: var(--navy); stroke-width: 1.5; }
.bb-label { font-size: 12px; font-weight: 600; fill: var(--muted); }
.bb-pins { position: absolute; inset: 0; }
.bb-pin {
  position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  color: #fff; font-size: 0.78rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
  background: var(--c, #e5484d); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); cursor: pointer;
  animation: pinPop 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes pinPop { from { transform: scale(0); } to { transform: scale(1); } }
.bb-color { font-family: var(--font-body); font-weight: 700; font-size: 0.85rem; padding: 8px 16px; border-radius: 999px; cursor: pointer; border: 2px solid var(--c); color: var(--c); background: #fff; transition: transform 0.2s; }
.bb-color:hover { transform: translateY(-2px); }
.bb-color.is-active { background: var(--c); color: #fff; }
.bb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow: auto; }
.bb-list li { background: var(--bg-soft); border-radius: 10px; padding: 9px 12px; font-size: 0.9rem; }
.bb-list li button { float: right; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; }
.bb-empty { color: var(--muted); }

/* RS Means */
.rs-body { grid-template-columns: 1fr 1fr; }
.rs-controls { display: flex; flex-direction: column; gap: 16px; }
.rs-field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; color: var(--navy); font-size: 0.9rem; }
.rs-field select, .rs-field input[type="range"] { width: 100%; }
.rs-field select { font-family: var(--font-body); font-size: 1rem; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.rs-field input[type="range"] { accent-color: var(--orange); }
.rs-readout { background: var(--bg-soft); border-radius: 14px; padding: 22px; text-align: center; display: flex; flex-direction: column; justify-content: center; }
.rs-total { font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; color: var(--navy); margin: 0 0 6px; }
.rs-rate { margin: 0 0 10px; color: var(--muted); }

/* Excel */
.xl-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: #fff; }
.xl-table th, .xl-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.xl-table th { background: var(--navy); color: #fff; font-size: 0.85rem; letter-spacing: 0.04em; }
.xl-table th:first-child { border-radius: 10px 0 0 0; }
.xl-table th:last-child { border-radius: 0 10px 0 0; }
.xl-table tbody tr { cursor: pointer; transition: background 0.2s; }
.xl-table tbody tr:hover { background: var(--orange-soft); }
.xl-table tbody tr.is-off { opacity: 0.38; text-decoration: line-through; }
.xl-table tfoot td { font-weight: 800; color: var(--navy); font-size: 1.05rem; border-bottom: 0; }
.xl-table td:last-child, .xl-table th:last-child { text-align: right; }

/* AutoCAD */
.ac-canvas-wrap { background: var(--canvas-wrap); border-radius: 14px; padding: 10px; }
#acCanvas { width: 100%; height: auto; display: block; border-radius: 8px; }

/* Cards */
.cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: transform 0.3s ease, box-shadow 0.3s ease; will-change: transform; }
.card:hover { box-shadow: var(--shadow); }
.card-num { color: var(--orange); font-weight: 800; font-family: var(--font-display); margin: 0 0 8px; }
.card h3 { font-family: var(--font-display); color: var(--navy); margin: 0 0 8px; font-size: 1.12rem; }
.card p:last-child { margin: 0; color: var(--muted); }
.services-note { text-align: center; margin: 30px 0 0; font-weight: 600; color: var(--navy); }
#work .cards-grid { grid-template-columns: repeat(3, 1fr); }

/* Contact */
.section-cta { background: linear-gradient(180deg, #f4f6fd, #fff); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 30px 0; }
.contact-card { display: block; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; transition: transform 0.25s, box-shadow 0.25s; }
.contact-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.contact-label { margin: 0 0 4px; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--orange); }
.contact-value { margin: 0; font-weight: 700; color: var(--navy); word-break: break-word; }
.contact-actions { justify-content: center; margin-bottom: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 26px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 0.9rem; }
.back-top { text-decoration: none; font-weight: 700; }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero-visual { order: -1; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  #work .cards-grid { grid-template-columns: 1fr 1fr; }
  .panel-body, .rs-body { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .chip-a { left: -8px; }
  .chip-b { right: -8px; }
  .chip-c { left: 0; }
}
@media (max-width: 860px) {
  .site-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0; background: #fff;
    flex-direction: column; align-items: stretch; padding: 12px 4%; border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(23, 28, 112, 0.12);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px; }
  .nav-toggle { display: block; }
}
@media (max-width: 600px) {
  .section { padding: 60px 0; }
  .hero { padding-top: 44px; }
  .edu-grid, .contact-grid { grid-template-columns: 1fr; }
  .cards-grid, #work .cards-grid { grid-template-columns: 1fr; }
  .photo-frame { width: min(320px, 88vw); height: auto; }
  .explorer-panel { padding: 20px 16px; }
  .readout-grid { grid-template-columns: 1fr 1fr; }
  .xl-table { font-size: 0.82rem; }
  .xl-table th, .xl-table td { padding: 9px 8px; }
}


/* ---------- v3: click FX, catch-me, bid builder, journey ---------- */

#fxCanvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 90; pointer-events: none; }
.hero-orb { position: absolute; border-radius: 50%; filter: blur(2px); pointer-events: none; opacity: 0.55; animation: orbDrift 18s ease-in-out infinite; }
.orb-a { width: 120px; height: 120px; background: radial-gradient(circle, rgba(238,126,44,0.7), transparent 70%); top: 12%; left: 6%; }
.orb-b { width: 80px; height: 80px; background: radial-gradient(circle, rgba(56,189,248,0.55), transparent 70%); top: 62%; left: 44%; animation-delay: 4s; }
.orb-c { width: 60px; height: 60px; border: 2px dashed var(--orb-c-border); background: transparent; top: 20%; right: 8%; animation-delay: 8s; }
@keyframes orbDrift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(18px, -22px); } }
.kinetic-eyebrow { display: inline-flex; align-items: center; gap: 10px; }
.kinetic-eyebrow::after { content: ""; width: 44px; height: 3px; background: var(--orange); border-radius: 3px; animation: eyebrowSweep 2.6s ease-in-out infinite; transform-origin: left; }
@keyframes eyebrowSweep { 0%, 100% { transform: scaleX(0.4); opacity: 0.6; } 50% { transform: scaleX(1); opacity: 1; } }
.eyebrow-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); animation: dotPulse 1.8s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.5); } }
.hero .btn-ghost { border-color: var(--hero-ghost-border); color: var(--hero-h1); background: var(--hero-ghost-bg); }
.hero .btn-ghost:hover { background: var(--hero-ghost-hover); }
.btn.magnetic { will-change: transform; }
.photo-frame { transform-style: preserve-3d; will-change: transform; }

/* Catch-me chip */
.catch-chip { position: fixed; right: 18px; bottom: 18px; z-index: 95; display: flex; align-items: flex-start; transition: transform 0.45s cubic-bezier(0.2, 1.6, 0.4, 1), opacity 0.3s; }
.catch-chip[hidden] { display: none; }
.catch-chip.is-hopping { animation: chipHop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes chipHop { 0% { transform: translate(var(--hop-x, 0), var(--hop-y, 0)) scale(1); } 40% { transform: translate(var(--hop-x, 0), calc(var(--hop-y, 0) - 14px)) scale(1.06) rotate(-2deg); } 100% { transform: translate(var(--hop-x, 0), var(--hop-y, 0)) scale(1); } }
.catch-main { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; background: var(--orange); color: #fff; border: 0; border-radius: 16px; padding: 11px 16px; cursor: pointer; font-family: var(--font-body); box-shadow: 0 14px 32px rgba(238, 126, 44, 0.45); text-align: left; }
.catch-main:hover { transform: scale(1.04); }
.catch-label { font-weight: 800; font-size: 0.95rem; }
.catch-fun { font-size: 0.78rem; opacity: 0.95; }
.catch-dismiss { position: absolute; top: -9px; left: -9px; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; color: var(--muted); font-weight: 800; cursor: pointer; line-height: 1; padding: 0; box-shadow: 0 4px 12px rgba(0,0,0,0.18); }

@keyframes numPop { from { transform: scale(1.18); } to { transform: scale(1); } }
/* Journey */
.section-journey { background: var(--bg-soft); }
.journey { position: relative; margin-top: 34px; }
.journey-line { position: absolute; top: 26px; left: 6%; right: 6%; height: 4px; background: #d5d9f0; border-radius: 4px; }
.journey-fill { height: 100%; width: 0%; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--orange) 0 10px, #f5a55c 10px 20px); transition: width 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.journey-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; position: relative; }
.journey-step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 52px 18px 20px; opacity: 0.55; transform: translateY(10px); transition: opacity 0.5s, transform 0.5s, box-shadow 0.5s, border-color 0.5s; }
.journey-step.is-lit { opacity: 1; transform: none; border-color: var(--orange); box-shadow: var(--shadow); }
.journey-dot { position: absolute; top: 12px; left: 18px; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 0.95rem; }
.journey-step.is-lit .journey-dot { background: var(--orange); animation: dotPop 0.4s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes dotPop { from { transform: scale(0.6); } to { transform: scale(1); } }
.journey-step h3 { font-family: var(--font-display); color: var(--navy); margin: 0 0 6px; font-size: 1.05rem; }
.journey-step p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.trial-reveal { background: var(--orange-soft); border: 2px dashed var(--orange); border-radius: 14px; padding: 14px 18px; font-weight: 700; color: var(--navy); text-align: center; }
.section-cta.is-caught .trial-reveal { animation: numPop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
.card:hover, .skill-block:hover, .edu-item:hover, .contact-card:hover { border-color: rgba(238, 126, 44, 0.55); }

@media (max-width: 960px) {
  .journey-steps { grid-template-columns: 1fr 1fr; }
  .journey-line { display: none; }
}
@media (max-width: 600px) {
  .journey-steps { grid-template-columns: 1fr; }
  .catch-chip { right: 12px; bottom: 12px; }
}

/* Reduced motion: v3 additions off */
@media (prefers-reduced-motion: reduce) {
  .hero-orb, .kinetic-eyebrow::after, .eyebrow-dot { animation: none !important; }
  .catch-chip { transition: none; }
  .journey-fill { transition: none; }
}

/* Reduced motion */
@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; }
  .reveal { opacity: 1; transform: none; }
  .photo-frame { animation: none; }
}

/* ---------------- CV lightbox (letterbox) ---------------- */
.cv-lightbox { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.cv-lightbox[hidden] { display: none; }
.cv-lightbox-backdrop { position: absolute; inset: 0; background: rgba(5, 7, 28, 0.82); backdrop-filter: blur(6px); animation: lightboxFade 0.3s ease both; }
.cv-lightbox-frame { position: relative; width: min(920px, 94vw); height: min(88vh, 940px); background: #fff; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); animation: lightboxIn 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.2) both; }
.cv-lightbox-bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--navy); color: #fff; }
.cv-lightbox-title { font-weight: 700; font-size: 0.95rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-lightbox-download { flex-shrink: 0; }
.cv-lightbox-close { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.cv-lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }
.cv-lightbox-view { flex: 1; width: 100%; border: 0; background: #fff; }
@keyframes lightboxFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lightboxIn { from { opacity: 0; transform: translateY(18px) scale(0.92); } to { opacity: 1; transform: translateY(0) scale(1); } }
