/* ==========================================================================
   DESIGN TOKENS & FOUNDATIONS (Derived from DESIGN.MD & SKILL.MD)
   Product: Md. Morshed Milton Portfolio (Inspired by kamran.fyi/lamp)
   ========================================================================== */

:root {
  /* Colors */
  --bg: #050607;
  --text: #ECE6DA;
  --color-2: #FFB45A;       /* Accent Amber */
  --color-3: #F3C98F;       /* Warm Glow / Secondary */
  --color-5: #FFFFFF;       /* Pure White Text */
  --muted: rgba(236, 230, 218, 0.45);
  --muted-dark: rgba(236, 230, 218, 0.18);
  --grid: rgba(255, 255, 255, 0.05);
  --card-bg: rgba(14, 15, 18, 0.88);
  --card-border: rgba(255, 255, 255, 0.1);
  --card-border-hover: rgba(255, 180, 90, 0.4);

  /* Typography Stacks */
  --font-display: "Funnel Display", "Bricolage Grotesque", -apple-system, sans-serif;
  --font-body: "Bricolage Grotesque", -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: "Times New Roman", Times, serif;

  /* Font Sizes */
  --text-xs: 8px;
  --text-sm: 12px;
  --text-base: 16px;
  --text-lg: 78px;

  /* Font Weights */
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-bold: 800;

  /* Line Heights */
  --lh-tight: 0.98;
  --lh-body: 1.5;
  --lh-sm: 12px;
  --lh-xs: 8px;
  --lh-base: 25.5px;
  --lh-lg: 76.7222px;

  /* Spacing Scale (Base: 4px) */
  --space-1: 7px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 22px;
  --space-5: 97px;

  /* Shapes / Radius */
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 11px;
  --radius-full: 999px;
  --radius-circle: 50%;

  /* Elevation & Shadows */
  --shadow-sm: rgba(255, 255, 255, 0.09) 0px 1px 0px 0px inset,
               rgba(0, 0, 0, 0.6) 0px -1px 0px 0px inset,
               rgba(255, 255, 255, 0.03) 0px 1px 0px 0px,
               rgba(0, 0, 0, 0.7) 0px 14px 30px 0px;
  --shadow-md: rgba(0, 0, 0, 0.9) 0px 2px 5px 0px inset,
               rgba(255, 255, 255, 0.06) 0px 1px 0px 0px;
  --shadow-lg: rgba(255, 170, 80, 0.8) 0px 0px 6px 1px;
  --shadow-xl: rgba(0, 0, 0, 0.6) 0px 5px 6px 0px;

  /* Transitions & Motion */
  --duration-fast: transform 0.14s cubic-bezier(0.3, 1.6, 0.5, 1);
  --duration-base: background 0.2s, box-shadow 0.2s, border-color 0.2s, opacity 0.2s;
  --duration-slow: 0.32s cubic-bezier(0.3, 0.7, 0.4, 1) knock;
}

/* Base Reset & Layout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

/* Background Atmosphere Grid */
.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 76px 76px;
  background-position: center top;
  pointer-events: none;
  z-index: 1;
}

/* Interactive Canvas Layer */
canvas#c {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: block;
  z-index: 2;
  will-change: transform;
  transform: translateZ(0);
}

/* Scene / Hero Center Display */
.scene {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) clamp(110px, 16vh, 180px) max(16px, env(safe-area-inset-left, 0px));
  text-align: center;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.scene.dimmed {
  opacity: 0.25;
}

.scene .meta-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font: 500 var(--text-sm)/1 var(--font-mono);
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
}

.scene .meta-bar .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: rgba(255, 180, 90, 0.1);
  border: 1px solid rgba(255, 180, 90, 0.25);
  border-radius: var(--radius-full);
  color: var(--color-2);
  font-size: 11px;
}

.scene .meta-bar .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-circle);
  background: var(--color-2);
  box-shadow: 0 0 6px var(--color-2);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.scene h1 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: clamp(38px, 6.2vw, 86px);
  letter-spacing: -0.04em;
  line-height: var(--lh-tight);
  color: var(--text);
  max-width: 18ch;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.scene h1 em {
  font-style: normal;
  color: var(--color-3);
  position: relative;
  display: inline-block;
}

.hero-dossier {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  max-width: 58ch;
  margin-left: auto;
  margin-right: auto;
}

.hero-role {
  font: 500 15px/1.4 var(--font-mono);
  color: var(--color-3);
  letter-spacing: 0.02em;
  text-align: center;
  width: 100%;
}

.hero-callouts {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.hero-pill-pub {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 180, 90, 0.09);
  border: 1px solid rgba(255, 180, 90, 0.35);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  color: var(--text);
  text-decoration: none;
  font: 500 13px/1.3 var(--font-body);
  pointer-events: auto;
  max-width: min(94vw, 560px);
  box-sizing: border-box;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.hero-pill-pub:hover {
  background: rgba(255, 180, 90, 0.18);
  border-color: rgba(255, 180, 90, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 180, 90, 0.25);
  color: #fff;
}

.pub-badge {
  font: 700 9px/1 var(--font-mono);
  background: var(--color-2);
  color: #0c0d0f;
  padding: 2.5px 6px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.06em;
}

.pub-text {
  font-weight: 600;
  color: var(--text);
}

.pub-arrow {
  color: var(--color-2);
  font-size: 12px;
}

.hero-focus-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: rgba(236, 230, 218, 0.75);
  width: 100%;
}

.hero-focus-tags .focus-label {
  font: 500 11px/1 var(--font-mono);
  color: var(--muted);
  text-transform: uppercase;
  margin-right: 2px;
}

.hero-focus-tags .focus-tag,
.hero-stack-tags .focus-tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 12px;
  color: var(--text);
}

.hero-focus-tags .focus-sep {
  opacity: 0.3;
}

.hero-stack-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  width: 100%;
}

.hero-stack-tags .stack-sep {
  color: var(--color-2);
  font-family: var(--font-mono);
  font-weight: 600;
  opacity: 0.85;
}

/* Button & Pill Styles */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  background: var(--text);
  color: #0b0c0e;
  border: none;
  border-radius: var(--radius-full);
  padding: 10px 20px;
  font: 500 var(--text-sm)/1 var(--font-mono);
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  background: var(--color-3);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 180, 90, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  font: 500 var(--text-sm)/1 var(--font-mono);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 180, 90, 0.5);
  color: var(--color-3);
  transform: translateY(-2px);
}

.btn-secondary:focus-visible, .btn-primary:focus-visible {
  outline: 2px solid var(--color-2);
  outline-offset: 2px;
}

/* ==========================================================================
   HEADS UP DISPLAY (HUD)
   ========================================================================== */
.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  font: var(--text-sm)/1 var(--font-mono);
  color: var(--muted);
  z-index: 10;
}

.hud > * {
  pointer-events: auto;
}

/* Top Left Brand & Live Metrics */
.hud-tl {
  position: absolute;
  top: 20px;
  left: 20px;
  letter-spacing: 0.04em;
  line-height: 1.7;
}

.hud-tl a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}

.hud-tl a:hover {
  color: var(--color-2);
}

.hud-tl .stats-line {
  color: var(--muted);
  font-size: 11px;
}

.hud-tl b {
  font-weight: 500;
  color: var(--text);
}

/* Top Right Navigation Pills */
.hud-tr {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-pill {
  background: rgba(20, 21, 24, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  color: var(--muted);
  font: 500 13px/1 var(--font-mono);
  letter-spacing: 0.05em;
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  white-space: nowrap;
  transition: var(--duration-base), transform 0.15s ease;
}

.nav-pill:hover, .nav-pill.active {
  color: var(--text);
  border-color: rgba(255, 180, 90, 0.45);
  background: rgba(35, 36, 40, 0.85);
  transform: translateY(-1px);
}

.nav-pill:focus-visible {
  outline: 2px solid var(--color-2);
}

/* Reset Controls */

.reset-btn {
  position: absolute;
  left: 50%;
  bottom: 54px;
  transform: translateX(-50%);
  background: var(--text);
  color: #111;
  border: none;
  border-radius: var(--radius-full);
  font: 500 12px/1 var(--font-mono);
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  animation: rise 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reset-btn:hover {
  background: var(--color-3);
  box-shadow: 0 8px 30px rgba(255, 180, 90, 0.3);
}

@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================================================================
   3D TACTILE INDUSTRIAL WALL SWITCH
   Token-matched with shadows, knock animation, lever perspective
   ========================================================================== */
.switch {
  --sw-scale: 1;
  position: absolute;
  right: max(24px, 7vw);
  top: 50%;
  transform: translateY(-50%) scale(var(--sw-scale));
  width: 74px;
  height: 120px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #26282b, #151618 60%, #101112);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  outline: none;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 0.2s ease;
}

.switch:focus-visible {
  box-shadow: 0 0 0 2px rgba(243, 201, 143, 0.6), 0 14px 30px rgba(0, 0, 0, 0.7);
}

.switch.knock {
  animation: knock var(--duration-slow);
}

@keyframes knock {
  0% { transform: translateY(-50%) scale(var(--sw-scale)) translate(var(--kx, 0), var(--ky, 0)) rotate(var(--kr, 0deg)); }
  100% { transform: translateY(-50%) scale(var(--sw-scale)); }
}

.screw {
  position: absolute;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: var(--radius-circle);
  background: radial-gradient(circle at 35% 35%, #6b6d70, #2a2b2d 70%);
}

.screw::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 3px;
  height: 1px;
  background: rgba(0, 0, 0, 0.7);
  transform: rotate(35deg);
}

.screw.t { top: 9px; }
.screw.b { bottom: 9px; }

.slot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 50px;
  margin: -25px 0 0 -13px;
  border-radius: var(--radius-md);
  background: linear-gradient(#060607, #0d0e0f);
  box-shadow: var(--shadow-md);
  perspective: 120px;
}

.lever {
  position: absolute;
  left: 3px;
  right: 3px;
  top: 3px;
  bottom: 3px;
  border-radius: var(--radius-sm);
  transition: var(--duration-fast);
  transform-origin: 50% 50%;
  transform: rotateX(-26deg);
  background: linear-gradient(#9d9b97 0%, #d8d4cc 38%, #8c8984 52%, #54524f 100%);
  box-shadow: var(--shadow-xl);
}

.switch[aria-checked="false"] .lever {
  transform: rotateX(26deg);
  background: linear-gradient(#4d4b48 0%, #85827d 48%, #d0ccc4 64%, #97948f 100%);
  box-shadow: 0 -5px 6px rgba(0, 0, 0, 0.6);
}

.engrave {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font: var(--text-xs)/1 var(--font-mono);
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.22);
}

.engrave.on { top: 20px; }
.engrave.off { bottom: 20px; }

.pilot {
  position: absolute;
  right: 9px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: var(--radius-circle);
  background: #3a2a1a;
  transition: var(--duration-base);
}

.switch[aria-checked="true"] .pilot {
  background: var(--color-2);
  box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   PORTFOLIO MODAL & DRAWER SYSTEM
   Smooth pop-out dossiers for Projects, Research, Stack, and Contact
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 5, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-panel {
  width: 100%;
  max-width: 920px;
  max-height: 86vh;
  background: #090a0d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 180, 90, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(18px) scale(0.98) translateZ(0);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
  will-change: transform;
  contain: paint;
}

.drawer-backdrop.open .drawer-panel {
  transform: translateY(0) scale(1);
}

.panel-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(14, 15, 18, 0.6);
}

.panel-header h2 {
  font: 800 20px/1.2 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.panel-header h2 span {
  font: 400 12px/1 var(--font-mono);
  color: var(--color-2);
  background: rgba(255, 180, 90, 0.12);
  border: 1px solid rgba(255, 180, 90, 0.25);
  border-radius: var(--radius-full);
  padding: 3px 8px;
}

.panel-close {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-full);
  color: var(--muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: var(--duration-base);
}

.panel-close:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

.panel-body {
  padding: var(--space-4);
  overflow-y: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  contain: content;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 180, 90, 0.4) transparent;
}

.panel-body::-webkit-scrollbar {
  width: 6px;
}
.panel-body::-webkit-scrollbar-thumb {
  background: rgba(255, 180, 90, 0.3);
  border-radius: var(--radius-full);
}

/* Project Cards Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: var(--space-3);
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-2);
  transition: var(--duration-base), transform 0.18s ease;
  will-change: transform;
  transform: translateZ(0);
}

.project-card:hover {
  border-color: var(--card-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.project-card-title {
  font: 700 17px/1.3 var(--font-display);
  color: var(--text);
}

.project-card-badge {
  font: 500 10px/1 var(--font-mono);
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.project-card-badge.flagship {
  background: rgba(255, 180, 90, 0.15);
  color: var(--color-2);
  border-color: rgba(255, 180, 90, 0.35);
}

.project-card-desc {
  font: 400 13px/1.5 var(--font-body);
  color: rgba(236, 230, 218, 0.7);
}

.project-card-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.tech-tag {
  font: 400 10px/1 var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(236, 230, 218, 0.65);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
}

.tech-tag.gold {
  border-color: rgba(255, 180, 90, 0.55);
  color: var(--color-2);
  background: rgba(255, 180, 90, 0.09);
  box-shadow: 0 2px 8px rgba(255, 180, 90, 0.12);
  font-weight: 500;
}

.project-card-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.card-link {
  font: 500 11px/1 var(--font-mono);
  color: var(--color-3);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.card-link:hover {
  color: var(--color-5);
  text-decoration: underline;
}

/* Research Highlight Box */
.research-feature {
  background: linear-gradient(145deg, rgba(30, 25, 20, 0.8), rgba(15, 15, 18, 0.9));
  border: 1px solid rgba(255, 180, 90, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.research-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.research-title {
  font: 700 20px/1.35 var(--font-display);
  color: var(--color-3);
  margin-bottom: var(--space-2);
}

.research-desc {
  font: 400 14px/1.6 var(--font-body);
  color: rgba(236, 230, 218, 0.8);
  margin-bottom: var(--space-3);
}

/* Skills Matrix */
.skills-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
}

.skill-group {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.skill-group-title {
  font: 600 12px/1 var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--color-2);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

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

.skill-pill {
  font: 500 11px/1 var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text);
  padding: 5px 9px;
  border-radius: var(--radius-full);
}

/* Terminal / Contact Dialog */
.terminal-card {
  background: #050607;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-family: var(--font-mono);
}

.terminal-header {
  background: #111215;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.term-dots {
  display: flex;
  gap: 5px;
}
.term-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-circle);
}
.term-dot.r { background: #ff5f56; }
.term-dot.y { background: #ffbd2e; }
.term-dot.g { background: #27c93f; }

.terminal-content {
  padding: var(--space-4);
  font-size: 13px;
  line-height: 1.8;
  color: rgba(236, 230, 218, 0.85);
}

.terminal-content .term-accent {
  color: var(--color-2);
}

.terminal-content .term-comment {
  color: var(--muted);
}

.terminal-content pre {
  overflow-x: auto;
  white-space: pre;
  max-width: 100%;
  font-size: clamp(10.5px, 2.5vw, 12.5px);
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.contact-actions .btn-primary,
.contact-actions .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.contact-actions svg {
  flex-shrink: 0;
  display: block;
}

/* ==========================================================================
   ABOUT & CV DOSSIER STYLES
   Executive Profile Card, Education Timeline, Coursework & References
   ========================================================================== */
.profile-card {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  background: linear-gradient(135deg, rgba(25, 27, 32, 0.85), rgba(12, 13, 16, 0.95));
  border: 1px solid rgba(255, 180, 90, 0.25);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 110px;
  height: 110px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 2px solid rgba(255, 180, 90, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(255, 180, 90, 0.15);
  display: block;
  background: #111;
}

.profile-status-dot {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  background: #27c93f;
  border: 2px solid #090a0d;
  border-radius: var(--radius-circle);
  box-shadow: 0 0 8px #27c93f;
  transform-origin: center;
  animation: pulse-green 2s infinite ease-in-out;
}

@keyframes pulse-green {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 8px #27c93f, 0 0 14px rgba(39, 201, 63, 0.5);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.85);
    box-shadow: 0 0 3px #27c93f, 0 0 5px rgba(39, 201, 63, 0.2);
  }
}

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

.profile-name {
  font: 800 24px/1.1 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--text);
}

.profile-title {
  font: 500 13px/1.3 var(--font-mono);
  color: var(--color-2);
}

.profile-summary {
  font: 400 13.5px/1.55 var(--font-body);
  color: rgba(236, 230, 218, 0.8);
  margin-top: 4px;
}

.cv-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
}

.cv-section-title {
  font: 600 12px/1 var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--color-2);
  text-transform: uppercase;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cv-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.achievement-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.55;
}

.achievement-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-2);
  flex-shrink: 0;
  margin-top: 3px;
  line-height: 1;
}

.achievement-icon svg {
  display: block;
  width: 14px;
  height: 14px;
}

.achievement-text {
  color: rgba(236, 230, 218, 0.85);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline-main h4 {
  font: 600 14px/1.3 var(--font-display);
  color: var(--text);
}

.timeline-main p {
  font: 400 12.5px/1.5 var(--font-body);
  color: rgba(236, 230, 218, 0.7);
  margin-top: 2px;
}

.timeline-meta {
  font: 500 11px/1 var(--font-mono);
  color: var(--color-3);
  text-align: right;
  white-space: nowrap;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
}

.course-group {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}

.course-group h5 {
  font: 600 11.5px/1 var(--font-mono);
  color: var(--color-3);
  margin-bottom: 8px;
}

.references-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-3);
}

.ref-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
}

.ref-card h4 {
  font: 700 14px/1.2 var(--font-display);
  color: var(--text);
  margin-bottom: 4px;
}

.ref-card .ref-role {
  font: 400 12px/1.4 var(--font-body);
  color: rgba(236, 230, 218, 0.75);
}

.ref-card .ref-email {
  font: 500 11px/1 var(--font-mono);
  color: var(--color-2);
  margin-top: 8px;
  display: inline-block;
  text-decoration: none;
}

.ref-card .ref-email:hover {
  text-decoration: underline;
}

.personal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  font-size: 12.5px;
}

.personal-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.personal-item .label {
  font: 500 10.5px/1 var(--font-mono);
  color: var(--muted);
  text-transform: uppercase;
}

.personal-item .val {
  color: var(--text);
}

/* ==========================================================================
   COMPREHENSIVE MULTI-DEVICE RESPONSIVE SYSTEM
   Tablets, iPads, Mobile Phones, Foldables, Landscape & High-DPI
   ========================================================================== */

/* 1. Tablets, iPads & Narrow Laptops (<= 900px) */
@media (max-width: 900px) {
  .hud-tl {
    top: max(12px, env(safe-area-inset-top, 0px));
    left: max(14px, env(safe-area-inset-left, 0px));
    font-size: 11px;
  }

  .hud-tr {
    top: max(48px, calc(env(safe-area-inset-top, 0px) + 38px));
    left: 0;
    right: 0;
    padding: 0 max(14px, env(safe-area-inset-left, 0px));
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    display: flex;
    justify-content: flex-start;
    scroll-padding: 14px;
    z-index: 10;
  }

  .hud-tr::-webkit-scrollbar {
    display: none;
  }

  .nav-pill {
    flex-shrink: 0;
  }

  .switch {
    --sw-scale: 0.82;
    right: max(16px, env(safe-area-inset-right, 0px));
    top: 42%;
    transform-origin: right center;
  }

  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  }

  .drawer-panel {
    max-height: calc(100dvh - 30px);
    width: min(920px, calc(100vw - 24px));
  }
}

/* 2. Mobile Phones (<= 640px) */
@media (max-width: 640px) {
  .scene {
    padding-bottom: clamp(100px, 15vh, 150px);
  }

  .scene .meta-bar {
    font-size: 10.5px;
    margin-bottom: var(--space-2);
  }

  .scene h1 {
    font-size: clamp(28px, 8.5vw, 44px);
    max-width: 16ch;
  }

  .hero-dossier {
    gap: 9px;
    margin-top: 10px;
    max-width: 95vw;
  }

  .hero-role {
    font-size: 13px;
    line-height: 1.35;
  }

  .hero-pill-pub {
    padding: 6px 12px;
    font-size: 12px;
    gap: 6px;
  }

  .pub-badge {
    font-size: 8.5px;
    padding: 2px 5px;
  }

  .pub-text {
    font-size: 12px;
  }

  .hero-focus-tags {
    font-size: 11.5px;
    gap: 5px;
  }

  .hero-focus-tags .focus-tag,
  .hero-stack-tags .focus-tag {
    padding: 2px 7px;
    font-size: 11px;
  }

  .hero-stack-tags {
    font-size: 11.5px;
  }

  .switch {
    --sw-scale: 0.72;
    right: max(10px, env(safe-area-inset-right, 0px));
    top: 38%;
    transform-origin: right center;
  }

  .drawer-backdrop {
    padding: max(8px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  }

  .drawer-panel {
    max-height: calc(100dvh - 16px);
    width: 100%;
    border-radius: var(--radius-md);
  }

  .panel-header {
    padding: 10px 14px;
  }

  .panel-header h2 {
    font-size: 16px;
  }

  .panel-header h2 span {
    font-size: 11px;
  }

  .panel-body {
    padding: 14px;
  }

  .profile-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
    padding: 16px;
    gap: 12px;
  }

  .profile-avatar-wrap {
    margin: 0 auto;
  }

  .profile-avatar {
    width: 90px;
    height: 90px;
  }

  .profile-details {
    align-items: center;
  }

  .profile-name {
    font-size: 20px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .course-grid {
    grid-template-columns: 1fr;
  }

  .references-grid {
    grid-template-columns: 1fr;
  }

  .personal-grid {
    grid-template-columns: 1fr 1fr;
  }

  .contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .contact-actions .btn-primary,
  .contact-actions .btn-secondary {
    flex: 1 1 125px;
    justify-content: center;
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* 3. Small Screen Phones (<= 380px) */
@media (max-width: 380px) {
  .scene h1 {
    font-size: 26px;
  }

  .hero-role {
    font-size: 11.5px;
  }

  .hero-pill-pub .pub-text {
    font-size: 10.5px;
  }

  .personal-grid {
    grid-template-columns: 1fr;
  }
}

/* 4. Mobile Landscape / Very Short Screens (<= 520px height) */
@media (max-height: 520px) {
  .scene {
    padding-bottom: 50px;
  }

  .scene h1 {
    font-size: 24px;
  }

  .hero-dossier {
    gap: 5px;
    margin-top: 5px;
  }

  .switch {
    --sw-scale: 0.62;
    top: 50%;
    right: 10px;
  }

  .drawer-panel {
    max-height: calc(100dvh - 12px);
  }
}
