/* ═══════════════════════════════════════════════════════════════
   OUSSAMA BOUKHALFA PORTFOLIO
   Dual Theme: Dark Obsidian + Beige Liquid Glass
   Theme Transition: Circular Ripple Reveal Animation
   Senior UI/UX Design System
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────
   THEME TRANSITION OVERLAY (circle ripple)
   ───────────────────────────────────────────── */
#theme-ripple {
  position: fixed;
  inset: 0;
  z-index: 8000;
  pointer-events: none;
  display: none;
  will-change: clip-path;
}

/* ── Icon visibility per theme ── */
#theme-toggle .icon-sun  { display: none; }
#theme-toggle .icon-moon { display: block; }

html[data-theme="beige"] #theme-toggle .icon-sun  { display: block; }
html[data-theme="beige"] #theme-toggle .icon-moon { display: none; }

/* ── Toggle button spin on activation ── */
#theme-toggle.switching {
  animation: toggle-spin 0.55s var(--ease-out) forwards;
}
@keyframes toggle-spin {
  0%   { transform: scale(1) rotate(0deg); }
  40%  { transform: scale(0.85) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;0,14..32,900;1,14..32,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─────────────────────────────────────────────
   BASE TOKENS (theme-independent)
   ───────────────────────────────────────────── */
:root {
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;
  --space-10: 128px;

  --font:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-w:     1120px;
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─────────────────────────────────────────────
   DARK THEME  (default)
   ───────────────────────────────────────────── */
html,
html[data-theme="dark"] {
  --bg:          #080c12;
  --bg-raised:   #0d1117;
  --surface-1:   rgba(255, 255, 255, 0.028);
  --surface-2:   rgba(255, 255, 255, 0.052);
  --surface-3:   rgba(255, 255, 255, 0.075);

  --border:        rgba(255, 255, 255, 0.07);
  --border-mid:    rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.22);

  --text-1: #f4f4f5;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --text-4: #3f3f46;

  --amber:        #c9a96e;
  --amber-dim:    rgba(201, 169, 110, 0.12);
  --amber-border: rgba(201, 169, 110, 0.30);

  --glass-bg:   rgba(12, 16, 24, 0.82);
  --glass-blur: blur(24px) saturate(160%);

  --shadow-card:  0 1px 3px rgba(0,0,0,0.4), 0 8px 32px rgba(0,0,0,0.35);
  --shadow-modal: 0 0 0 1px rgba(255,255,255,0.08), 0 32px 80px rgba(0,0,0,0.75);

  --term-bg:       #0a0d14;
  --term-titlebar: #111620;
  --term-quickbar: #0d1220;

  --body-grad-1: rgba(201,169,110,0.04);
  --body-grad-2: rgba(255,255,255,0.015);
  --dot-color:   rgba(255,255,255,0.025);
}

/* ─────────────────────────────────────────────
   BEIGE LIQUID GLASS THEME
   ───────────────────────────────────────────── */
html[data-theme="beige"] {
  --bg:          #f2ebe0;
  --bg-raised:   #f8f3ea;
  --surface-1:   rgba(255, 255, 255, 0.52);
  --surface-2:   rgba(255, 255, 255, 0.72);
  --surface-3:   rgba(255, 255, 255, 0.88);

  --border:        rgba(180, 158, 128, 0.22);
  --border-mid:    rgba(160, 138, 108, 0.38);
  --border-strong: rgba(130, 108, 78, 0.52);

  --text-1: #1c1814;
  --text-2: #574e44;
  --text-3: #8a7a6a;
  --text-4: #b8a898;

  --amber:        #8b6420;
  --amber-dim:    rgba(139, 100, 32, 0.09);
  --amber-border: rgba(139, 100, 32, 0.28);

  --glass-bg:   rgba(248, 242, 232, 0.86);
  --glass-blur: blur(28px) saturate(180%);

  --shadow-card:  0 1px 4px rgba(100,80,50,0.10), 0 8px 28px rgba(100,80,50,0.09);
  --shadow-modal: 0 0 0 1px rgba(180,158,128,0.22), 0 32px 80px rgba(80,60,30,0.22);

  --term-bg:       rgba(255, 250, 242, 0.90);
  --term-titlebar: rgba(246, 239, 228, 0.95);
  --term-quickbar: rgba(242, 234, 222, 0.95);

  --body-grad-1: rgba(139,100,32,0.06);
  --body-grad-2: rgba(180,158,128,0.08);
  --dot-color:   rgba(139,100,32,0.06);
}

/* ─────────────────────────────────────────────
   GLOBAL RESET
   ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  transition: background 0.45s var(--ease-out), color 0.35s var(--ease-out);
}

/* Beige body gets a warm gradient instead of flat color */
html[data-theme="beige"] body {
  background: linear-gradient(150deg, #f7f0e4 0%, #ede3d2 55%, #f2ebe0 100%);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input, select, textarea {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}
button { cursor: pointer; }

/* ─────────────────────────────────────────────
   AMBIENT OVERLAY
   ───────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--body-grad-1) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 100%, var(--body-grad-2) 0%, transparent 60%);
  transition: background-image 0.45s;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 100% 100% at 50% 0%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 100% 100% at 50% 0%, black 30%, transparent 80%);
  transition: background-image 0.45s;
}

/* ─────────────────────────────────────────────
   SCROLLBAR
   ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

::selection { background: var(--amber-dim); color: var(--text-1); }

/* ─────────────────────────────────────────────
   LAYOUT
   ───────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-6);
  position: relative;
  z-index: 1;
}

/* ─────────────────────────────────────────────
   REVEAL ANIMATION
   ───────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.70s var(--ease-out), transform 0.70s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ─────────────────────────────────────────────
   NAVIGATION
   ───────────────────────────────────────────── */
#site-nav {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 8px 6px 12px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-full);
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  pointer-events: auto;
  transition: background 0.45s, border-color 0.35s, box-shadow 0.35s;
}

/* Beige nav pill gets a warmer glass shadow */
html[data-theme="beige"] .nav-pill {
  box-shadow: 0 8px 32px rgba(100,80,50,0.14), 0 1px 0 rgba(255,255,255,0.8) inset;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-right: var(--space-3);
  padding-right: var(--space-3);
  border-right: 1px solid var(--border);
}

.nav-monogram {
  width: 30px;
  height: 30px;
  background: var(--text-1);
  color: var(--bg);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.35s, color 0.35s;
}

.nav-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  transition: color 0.35s;
}

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

.nav-links a {
  padding: 5px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-3);
  border-radius: var(--radius-full);
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-1);
  background: var(--surface-2);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: var(--space-3);
  padding-left: var(--space-3);
  border-left: 1px solid var(--border);
}

#lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 5px 22px 5px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: background-color 0.35s, border-color 0.35s, color 0.35s;
}
#lang-select option { background: var(--bg-raised); color: var(--text-1); }

/* ── Theme Toggle Button ── */
#theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.35s;
  flex-shrink: 0;
  cursor: pointer;
}

#theme-toggle:hover {
  background: var(--surface-2);
  border-color: var(--border-mid);
  color: var(--text-1);
}

/* Icon rotation on switch */
#theme-toggle .icon-sun  { display: none; }
#theme-toggle .icon-moon { display: block; }

html[data-theme="beige"] #theme-toggle .icon-sun  { display: block; }
html[data-theme="beige"] #theme-toggle .icon-moon { display: none; }

.nav-hire {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  background: var(--text-1);
  color: var(--bg);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 700;
  transition: opacity 0.2s, transform 0.2s, background 0.35s, color 0.35s;
}
.nav-hire:hover { opacity: 0.85; transform: translateY(-1px); }

.nav-download-spec {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border-mid);
  color: var(--amber);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.nav-download-spec:hover {
  background: var(--amber-dim);
  border-color: var(--amber-border);
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────────
   HERO
   ───────────────────────────────────────────── */
#hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-8);
  padding-top: 100px;
  padding-bottom: var(--space-9);
}

.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-availability {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-5);
  width: fit-content;
  background: var(--surface-1);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: background 0.35s, border-color 0.35s, color 0.35s;
}
.hero-availability svg { color: var(--amber); }

.hero-eyebrow {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
  transition: color 0.35s;
}

.hero-headline {
  font-size: clamp(2.6rem, 4.5vw, 4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: var(--text-1);
  margin-bottom: var(--space-5);
  transition: color 0.35s;
}
.hero-headline em { font-style: normal; color: var(--amber); }

.hero-sub {
  font-size: 1.0625rem;
  color: var(--text-2);
  line-height: 1.65;
  max-width: 500px;
  margin-bottom: var(--space-6);
  font-weight: 400;
  transition: color 0.35s;
}

.hero-ctas {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}

/* Primary CTA */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 24px;
  background: var(--text-1);
  color: var(--bg);
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  font-weight: 700;
  transition: background 0.35s, color 0.35s, transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.18); }

/* Ghost CTA */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 22px;
  background: var(--surface-1);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-mid);
  color: var(--text-2);
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background 0.35s, border-color 0.35s, color 0.35s, transform 0.2s;
}
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text-1);
  transform: translateY(-2px);
}

/* Metrics */
.hero-metrics {
  display: flex;
  gap: var(--space-6);
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  transition: border-color 0.35s;
}
.metric-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1;
  margin-bottom: 4px;
  transition: color 0.35s;
}
.metric-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.35s;
}

/* Hero Photo Area */
.hero-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 520px;
}

.hero-photo-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-1);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: background 0.45s, border-color 0.35s;
}

/* Beige frame gets a warmer inner glow */
html[data-theme="beige"] .hero-photo-frame {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.7) inset, 0 8px 40px rgba(100,80,50,0.12);
}

.hero-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  mask-image: radial-gradient(ellipse 100% 90% at 50% 50%, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 100% 90% at 50% 50%, black 40%, transparent 80%);
}

.hero-photo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}
.hero-photo-placeholder svg { color: var(--text-4); }
.hero-photo-placeholder p { font-size: 0.875rem; color: var(--text-4); text-align: center; line-height: 1.5; }
.hero-photo-placeholder code { font-family: var(--font-mono); font-size: 0.75rem; background: var(--surface-2); padding: 2px 6px; border-radius: var(--radius-sm); }

.hero-photo-badge {
  position: absolute;
  bottom: var(--space-4);
  left: var(--space-4);
  right: var(--space-4);
  padding: 12px 16px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  z-index: 15;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s var(--ease-out);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

html[data-theme="beige"] .hero-photo-badge {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75) inset, 0 8px 30px rgba(100, 80, 50, 0.14);
}

.badge-main-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  justify-content: space-between;
}

.badge-header-info {
  display: flex;
  flex-direction: column;
}

.hero-photo-badge-label {
  font-size: 0.6875rem;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
  transition: color 0.35s;
}

.hero-photo-badge-val {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-1);
  transition: color 0.35s;
}

/* Subtle bouncing arrow enticing hover interaction */
.badge-arrow-icon {
  color: var(--amber);
  transition: transform 0.35s var(--ease-out), color 0.35s;
  animation: arrow-nudge 1.8s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes arrow-nudge {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(5px); }
}

/* Hover & Focus Drawer Expansion */
.hero-photo-badge.relocation-drawer:hover,
.hero-photo-badge.relocation-drawer:focus-within {
  border-color: var(--amber-border);
  background: var(--surface-3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

html[data-theme="beige"] .hero-photo-badge.relocation-drawer:hover {
  background: rgba(255, 255, 255, 0.94);
}

.hero-photo-badge.relocation-drawer:hover .badge-arrow-icon,
.hero-photo-badge.relocation-drawer:focus-within .badge-arrow-icon {
  transform: rotate(90deg);
  animation: none;
}

/* Collapsible Drawer Content */
.badge-drawer-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.45s var(--ease-out), opacity 0.35s var(--ease-out), margin-top 0.35s;
}

.hero-photo-badge.relocation-drawer:hover .badge-drawer-content,
.hero-photo-badge.relocation-drawer:focus-within .badge-drawer-content {
  max-height: 200px;
  opacity: 1;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.drawer-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber);
  margin-bottom: var(--space-2);
}

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

.drawer-list li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.78125rem;
  font-weight: 500;
  color: var(--text-2);
  line-height: 1.3;
}

.drawer-list li svg {
  color: var(--amber);
  flex-shrink: 0;
}

/* Floating Glass Social Links Bar (Anchored between hero title and profile image) */
.hero-social-floating {
  position: absolute;
  top: 50%;
  left: -24px;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 8px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-full);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  transition: background 0.45s, border-color 0.35s, box-shadow 0.35s;
}

html[data-theme="beige"] .hero-social-floating {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7) inset, 0 8px 32px rgba(100, 80, 50, 0.12);
}

.hero-social-floating a {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  background: var(--surface-1);
  border: 1px solid var(--border);
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
}

.hero-social-floating a:hover {
  color: var(--amber);
  background: var(--amber-dim);
  border-color: var(--amber-border);
  transform: scale(1.1);
}

@media (max-width: 900px) {
  .hero-social-floating {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    flex-direction: row;
    width: fit-content;
    margin: var(--space-4) auto 0;
  }
}

/* ─────────────────────────────────────────────
   MARQUEE
   ───────────────────────────────────────────── */
.marquee-section {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  background: var(--surface-1);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  overflow: hidden;
  position: relative;
  z-index: 1;
  transition: background 0.45s, border-color 0.35s;
}

/* Beige marquee gets a frosted strip */
html[data-theme="beige"] .marquee-section {
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset;
}

.marquee-track-wrap {
  display: flex;
  overflow: hidden;
  user-select: none;
}
.marquee-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
  min-width: 100%;
  animation: ticker 40s linear infinite;
}
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}
.marquee-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.78125rem;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
  background: var(--surface-1);
  transition: background 0.45s, border-color 0.35s, color 0.35s;
}
.marquee-sep { color: var(--text-4); font-size: 0.875rem; }

/* ─────────────────────────────────────────────
   SECTION HEADERS
   ───────────────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
  transition: color 0.35s;
}
.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-1);
  margin-bottom: var(--space-4);
  transition: color 0.35s;
}
.section-sub {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 540px;
  line-height: 1.65;
  transition: color 0.35s;
}

/* ─────────────────────────────────────────────
   GLASS CARD MIXIN (beige adds inset highlight)
   ───────────────────────────────────────────── */
.glass-surface {
  background: var(--surface-1);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  transition: background 0.45s, border-color 0.35s;
}

html[data-theme="beige"] .glass-surface {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.65) inset, 0 4px 20px rgba(100,80,50,0.08);
}

/* ─────────────────────────────────────────────
   PHILOSOPHY
   ───────────────────────────────────────────── */
#approach { padding: var(--space-10) 0 var(--space-9); }

.approach-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: start;
}
.approach-right { display: flex; flex-direction: column; gap: var(--space-4); }

.principle {
  padding: var(--space-5);
  background: var(--surface-1);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: background 0.35s, border-color 0.35s;
}
.principle:hover { background: var(--surface-2); border-color: var(--border-mid); }

html[data-theme="beige"] .principle {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.65) inset, 0 4px 16px rgba(100,80,50,0.07);
}

.principle-num   { font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 600; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: var(--space-3); }
.principle-title { font-size: 1rem; font-weight: 700; color: var(--text-1); margin-bottom: var(--space-2); transition: color 0.35s; }
.principle-body  { font-size: 0.9375rem; color: var(--text-2); line-height: 1.6; transition: color 0.35s; }

/* ─────────────────────────────────────────────
   WORK / PROJECTS
   ───────────────────────────────────────────── */
#work { padding: var(--space-9) 0; }

.work-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.filter-bar { display: flex; gap: var(--space-1); flex-wrap: wrap; }

.filter-btn {
  padding: 6px 14px;
  background: var(--surface-1);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-3);
  transition: all 0.2s;
}
.filter-btn:hover { background: var(--surface-2); color: var(--text-1); border-color: var(--border-mid); }
.filter-btn.active { background: var(--text-1); color: var(--bg); border-color: var(--text-1); font-weight: 700; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

/* Project Card */
.project-card {
  position: relative;
  padding: var(--space-5);
  background: var(--surface-1);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background 0.35s, border-color 0.3s, transform 0.3s var(--ease-out), box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow: hidden;
}

/* Beige card inset highlight */
html[data-theme="beige"] .project-card {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.65) inset, 0 4px 16px rgba(100,80,50,0.07);
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--amber-dim) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: inherit;
  pointer-events: none;
}

.project-card:hover {
  background: var(--surface-2);
  border-color: var(--border-mid);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}
html[data-theme="beige"] .project-card:hover {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.75) inset, 0 12px 40px rgba(100,80,50,0.13);
}

.project-card:hover::before { opacity: 1; }

.card-head { display: flex; align-items: center; justify-content: space-between; }
.card-index { font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 600; color: var(--text-4); letter-spacing: 0.06em; }
.card-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: var(--amber-dim);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.35s, border-color 0.35s, color 0.35s;
}

.card-icon-wrap {
  width: 44px;
  height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.project-card:hover .card-icon-wrap {
  color: var(--amber);
  border-color: var(--amber-border);
  background: var(--amber-dim);
}

.card-title { font-size: 1.0625rem; font-weight: 700; color: var(--text-1); line-height: 1.25; letter-spacing: -0.02em; transition: color 0.35s; }
.card-desc  { font-size: 0.875rem; color: var(--text-2); line-height: 1.55; flex: 1; transition: color 0.35s; }

.card-pills  { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.card-pill   {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 3px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  transition: background 0.35s, border-color 0.35s, color 0.35s;
}

.card-expand-hint {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.78125rem;
  font-weight: 500;
  color: var(--text-4);
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  transition: color 0.2s, border-color 0.35s;
}
.project-card:hover .card-expand-hint { color: var(--amber); }
.card-expand-hint svg { transition: transform 0.2s; }
.project-card:hover .card-expand-hint svg { transform: translateX(3px); }

/* ─────────────────────────────────────────────
   INTERACTIVE ARCHITECTURE VISUALIZER
   ───────────────────────────────────────────── */
#architecture {
  padding: var(--space-10) 0;
  border-top: 1px solid var(--border);
}

.arch-header {
  max-width: 640px;
  margin-bottom: var(--space-6);
}

.arch-tabs {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.arch-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 18px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-3);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}

.arch-tab-btn:hover {
  color: var(--text-1);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.arch-tab-btn.active {
  color: var(--amber);
  background: var(--amber-dim);
  border-color: var(--amber-border);
  box-shadow: 0 0 16px rgba(139, 100, 32, 0.15);
}

.arch-card {
  padding: var(--space-6);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  transition: background 0.45s, border-color 0.35s;
}

html[data-theme="beige"] .arch-card {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6) inset, 0 8px 32px rgba(100, 80, 50, 0.1);
}

.arch-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: var(--space-2);
}

.arch-card-desc {
  font-size: 0.875rem;
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: var(--space-6);
  max-width: 680px;
}

.arch-canvas-wrap {
  width: 100%;
  height: 260px;
  background: var(--surface-1);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

/* SVG Node Graph Elements */
.arch-edge-line {
  stroke: var(--border-strong);
  stroke-width: 1.8;
  stroke-dasharray: 4 4;
}

.arch-packet-dot {
  fill: var(--amber);
  filter: drop-shadow(0 0 6px var(--amber));
}

.arch-node-rect {
  fill: var(--surface-2);
  stroke: var(--border-strong);
  stroke-width: 1.5;
  transition: fill 0.3s, stroke 0.3s;
}

.arch-node-group:hover .arch-node-rect {
  stroke: var(--amber);
  fill: var(--surface-3);
}

.arch-node-title {
  font-size: 10px;
  font-weight: 700;
  fill: var(--text-1);
  font-family: var(--font-sans);
}

.arch-node-sub {
  font-size: 8px;
  font-weight: 500;
  fill: var(--amber);
  font-family: var(--font-mono);
}

/* Node Types Tinting */
.arch-node-source  { stroke: #3b82f6; }
.arch-node-proc    { stroke: var(--amber); }
.arch-node-buffer  { stroke: #ec4899; }
.arch-node-storage { stroke: #10b981; }
.arch-node-client  { stroke: #8b5cf6; }

/* ─────────────────────────────────────────────
   TESTIMONIALS / SOCIAL PROOF
   ───────────────────────────────────────────── */
#testimonials {
  padding: var(--space-10) 0;
  border-top: 1px solid var(--border);
}

.testimonial-header {
  max-width: 560px;
  margin-bottom: var(--space-8);
}

.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-5);
  align-items: start;
}

@media (max-width: 900px) {
  .testimonials-grid { grid-template-columns: 1fr; }
}

.testimonial-card {
  position: relative;
  padding: var(--space-6) var(--space-5);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-lg);
  transition: border-color 0.35s, background 0.45s, transform 0.25s, box-shadow 0.25s;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  border-color: var(--amber-border);
}

html[data-theme="beige"] .testimonial-card {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6) inset, 0 4px 20px rgba(100, 80, 50, 0.08);
}

.testimonial-quote-mark {
  font-family: Georgia, serif;
  font-size: 4rem;
  line-height: 1;
  color: var(--amber);
  opacity: 0.6;
  margin-bottom: var(--space-3);
  margin-top: calc(-1 * var(--space-2));
}

.testimonial-body {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-2);
  font-style: italic;
  margin-bottom: var(--space-5);
  transition: color 0.35s;
}

.testimonial-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-3);
}

.testimonial-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 2px;
}

.testimonial-company {
  font-size: 0.75rem;
  color: var(--text-4);
  font-weight: 500;
}

/* Reference card variant */
.testimonial-card--reference {
  border-left: 3px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-5);
  min-height: 220px;
}

.testimonial-reference-icon {
  color: var(--text-3);
  opacity: 0.7;
}

.testimonial-ref-text {
  font-size: 0.875rem;
  color: var(--text-3);
  line-height: 1.6;
}

.testimonial-ref-cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-full);
  color: var(--amber);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.testimonial-ref-cta:hover {
  background: var(--amber-dim);
}

/* ─────────────────────────────────────────────
   ENGAGEMENT PROCESS
   ───────────────────────────────────────────── */
#process {
  padding: var(--space-10) 0;
  border-top: 1px solid var(--border);
}

.process-header {
  max-width: 640px;
  margin-bottom: var(--space-10);
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
}

@media (max-width: 860px) {
  .process-steps {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .process-connector { display: none; }
}

.process-step {
  position: relative;
  padding: var(--space-6) var(--space-5);
  border-left: 1px solid var(--border);
}

.process-step:first-child {
  border-left: none;
}

@media (max-width: 860px) {
  .process-step {
    border-left: 3px solid var(--amber);
    border-top: none;
    padding: var(--space-5);
  }
  .process-step:first-child { border-left: 3px solid var(--amber); }
}

/* Animated dashed connector line between steps on desktop */
.process-connector {
  position: absolute;
  top: 28px;
  right: 0;
  width: 1px;
  height: 40px;
  border-right: 2px dashed var(--border-mid);
  transform: none;
  z-index: 1;
}

.process-step-num {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-1);
  opacity: 0.08;
  line-height: 1;
  margin-bottom: var(--space-4);
  transition: opacity 0.3s, color 0.35s;
  letter-spacing: -0.04em;
}

.process-step:hover .process-step-num {
  opacity: 0.18;
  color: var(--amber);
}

.process-step-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: var(--space-3);
  letter-spacing: -0.02em;
  transition: color 0.35s;
}

.process-step-desc {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-3);
  margin-bottom: var(--space-4);
  transition: color 0.35s;
}

.process-step-deliverable {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--amber);
  padding: 4px 10px;
  background: var(--amber-dim);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm);
  display: inline-block;
  letter-spacing: 0.01em;
}

/* ─────────────────────────────────────────────
   PROJECT DETAIL MODAL
   ───────────────────────────────────────────── */
#project-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
}
#project-modal.open { opacity: 1; pointer-events: auto; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.45s;
}
html[data-theme="beige"] .modal-backdrop {
  background: rgba(80, 60, 40, 0.45);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-bottom: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.45s var(--ease-out), background 0.45s;
}
html[data-theme="beige"] .modal-panel {
  background: rgba(248, 242, 232, 0.96);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.7) inset, 0 -24px 80px rgba(80,60,30,0.18);
}
#project-modal.open .modal-panel { transform: translateY(0); }

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border-mid);
  border-radius: var(--radius-full);
  margin: 14px auto 0;
  flex-shrink: 0;
}

.modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-topbar-left { display: flex; align-items: center; gap: var(--space-3); }
.modal-index { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; color: var(--text-4); }
.modal-cat-tag {
  padding: 3px 10px;
  background: var(--amber-dim);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all 0.2s;
  cursor: pointer;
}
.modal-close:hover { color: var(--text-1); background: var(--surface-3); }

.modal-body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.modal-visual {
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.45s;
  overflow: hidden;
}
html[data-theme="beige"] .modal-visual { background: rgba(235, 225, 210, 0.6); }

.modal-screenshot {
  width: 100%;
  max-height: 480px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-mid);
  object-fit: contain;
  background: var(--surface-1);
  cursor: zoom-in;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  transition: opacity 0.2s, transform 0.2s, border-color 0.35s;
}
.modal-screenshot:hover { opacity: 0.95; transform: scale(1.01); }

.modal-result-callout {
  padding: 14px 18px;
  background: var(--amber-dim);
  border: 1px solid var(--amber-border);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-md);
  margin-top: 4px;
  margin-bottom: var(--space-2);
  transition: background 0.35s, border-color 0.35s;
}
.modal-result-callout p {
  font-size: 0.9375rem;
  color: var(--text-1);
  line-height: 1.6;
  transition: color 0.35s;
}
.modal-result-callout strong {
  color: var(--amber);
  font-weight: 700;
}
html[data-theme="beige"] .modal-result-callout {
  background: rgba(139, 100, 32, 0.08);
  border-color: rgba(139, 100, 32, 0.22);
  border-left-color: var(--amber);
}
html[data-theme="beige"] .modal-result-callout p {
  color: #1f1a14;
}

.modal-detail {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  overflow-y: auto;
}
.modal-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text-1); line-height: 1.2; transition: color 0.35s; }

.modal-block { padding-top: var(--space-4); border-top: 1px solid var(--border); transition: border-color 0.35s; }
.modal-section-label { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-4); margin-bottom: var(--space-2); }
.modal-section-body  { font-size: 0.9375rem; color: var(--text-2); line-height: 1.65; transition: color 0.35s; }

.modal-stack-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-3); }
.modal-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  transition: background 0.35s, border-color 0.35s, color 0.35s;
}
  transition: background 0.35s, border-color 0.35s, color 0.35s;
}

/* ─────────────────────────────────────────────
   TERMINAL
   ───────────────────────────────────────────── */
#terminal-section { padding: var(--space-9) 0; }

.terminal-wrap {
  max-width: 800px;
  margin: var(--space-6) auto 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-mid);
  box-shadow: var(--shadow-card);
  transition: border-color 0.35s, box-shadow 0.35s;
}
html[data-theme="beige"] .terminal-wrap {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.6) inset, 0 12px 40px rgba(100,80,50,0.12);
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--term-titlebar);
  border-bottom: 1px solid var(--border);
  transition: background 0.45s, border-color 0.35s;
}
.terminal-window-controls { display: flex; gap: 7px; }
.twc { width: 11px; height: 11px; border-radius: 50%; }
.twc-close { background: rgba(255,100,80,0.35); }
.twc-min   { background: rgba(255,190,50,0.30); }
.twc-max   { background: rgba(80,190,80,0.30); }

.terminal-label { font-family: var(--font-mono); font-size: 0.78125rem; color: var(--text-3); }

.terminal-body {
  background: var(--term-bg);
  padding: var(--space-5);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.65;
  min-height: 240px;
  max-height: 340px;
  overflow-y: auto;
  transition: background 0.45s;
}

.term-line   { margin-bottom: var(--space-2); color: var(--text-3); }
.term-prompt { color: var(--amber); font-weight: 600; transition: color 0.35s; }
.term-host   { color: var(--text-3); }
.term-user   { color: var(--text-1); transition: color 0.35s; }

.term-output {
  color: var(--text-2);
  padding-left: var(--space-5);
  border-left: 2px solid var(--border-mid);
  margin-top: 4px;
  margin-bottom: var(--space-3);
  transition: color 0.35s, border-color 0.35s;
}

.term-input-row { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }
.term-input-field {
  flex: 1;
  background: transparent;
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  caret-color: var(--amber);
  transition: color 0.35s;
}

.terminal-quickbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 16px;
  background: var(--term-quickbar);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  transition: background 0.45s, border-color 0.35s;
}
.term-quick-label { font-size: 0.6875rem; font-weight: 600; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.06em; }

.cmd-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  background: var(--surface-1);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  transition: all 0.2s;
}
.cmd-pill:hover { background: var(--text-1); color: var(--bg); border-color: var(--text-1); }

/* ─────────────────────────────────────────────
   CAPABILITIES
   ───────────────────────────────────────────── */
#capabilities { padding: var(--space-9) 0; }

.caps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.cap-card {
  padding: var(--space-5);
  background: var(--surface-1);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: background 0.35s, border-color 0.35s;
}
.cap-card:hover { background: var(--surface-2); border-color: var(--border-mid); }

html[data-theme="beige"] .cap-card {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.65) inset, 0 4px 16px rgba(100,80,50,0.07);
}

.cap-icon  { width: 36px; height: 36px; color: var(--amber); margin-bottom: var(--space-4); transition: color 0.35s; }
.cap-title { font-size: 0.9375rem; font-weight: 700; color: var(--text-1); margin-bottom: var(--space-3); transition: color 0.35s; }
.cap-items { display: flex; flex-wrap: wrap; gap: 5px; }
.cap-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-family: var(--font-mono);
  transition: background 0.35s, border-color 0.35s, color 0.35s;
}

/* ─────────────────────────────────────────────
   CONTACT
   ───────────────────────────────────────────── */
#contact { padding: var(--space-9) 0 var(--space-10); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: var(--space-6);
  margin-top: var(--space-6);
}

.contact-info {
  padding: var(--space-6);
  background: var(--surface-1);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  transition: background 0.45s, border-color 0.35s;
}
html[data-theme="beige"] .contact-info {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.65) inset, 0 8px 32px rgba(100,80,50,0.09);
}

.contact-intro { font-size: 1rem; color: var(--text-2); line-height: 1.65; transition: color 0.35s; }

.contact-details { display: flex; flex-direction: column; gap: var(--space-3); }
.contact-row { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) 0; border-bottom: 1px solid var(--border); transition: border-color 0.35s; }
.contact-row:last-child { border-bottom: none; }
.contact-row-label { font-size: 0.8125rem; color: var(--text-3); display: flex; align-items: center; gap: var(--space-2); transition: color 0.35s; }
.contact-row-label svg { color: var(--text-4); }
.contact-row-val { font-size: 0.875rem; font-weight: 600; color: var(--text-1); transition: color 0.35s; }
.contact-row-val a { color: var(--amber); transition: opacity 0.2s; }
.contact-row-val a:hover { opacity: 0.75; }

.copy-email-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px;
  background: var(--surface-2);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.2s;
  width: 100%;
}
.copy-email-btn:hover { background: var(--text-1); color: var(--bg); border-color: var(--text-1); }

.contact-form-card {
  padding: var(--space-6);
  background: var(--surface-1);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  transition: background 0.45s, border-color 0.35s;
}
html[data-theme="beige"] .contact-form-card {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.65) inset, 0 8px 32px rgba(100,80,50,0.09);
}

.form-group  { margin-bottom: var(--space-4); }
.form-label  { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--text-1); margin-bottom: var(--space-2); transition: color 0.35s; }

.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface-2);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--text-1);
  transition: border-color 0.2s, background 0.35s, color 0.35s;
}
.form-input::placeholder { color: var(--text-4); }
.form-input:focus { border-color: var(--amber-border); background: var(--surface-3); }
.form-input option { background: var(--bg-raised); color: var(--text-1); }

.form-submit {
  width: 100%;
  padding: 13px;
  background: var(--text-1);
  color: var(--bg);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 700;
  transition: background 0.35s, color 0.35s, transform 0.2s, opacity 0.2s;
}
.form-submit:hover { opacity: 0.88; transform: translateY(-1px); }
.form-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.form-confirm {
  display: none;
  padding: var(--space-4);
  background: var(--amber-dim);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-md);
  color: var(--amber);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  margin-top: var(--space-3);
}

/* ─────────────────────────────────────────────
   LIGHTBOX
   ───────────────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(4, 6, 10, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
html[data-theme="beige"] #lightbox { background: rgba(60, 45, 28, 0.92); }
#lightbox.open { opacity: 1; pointer-events: auto; }
#lightbox img { max-width: 100%; max-height: 90vh; border-radius: var(--radius-lg); border: 1px solid var(--border-mid); }

.lightbox-close-btn {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  width: 40px;
  height: 40px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.lightbox-close-btn:hover { color: var(--text-1); background: var(--surface-3); }

/* ─────────────────────────────────────────────
   TOAST
   ───────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 3000;
  padding: 10px 20px;
  background: var(--text-1);
  color: var(--bg);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  transform: translateY(16px);
  opacity: 0;
  transition: all 0.3s var(--ease-out), background 0.35s, color 0.35s;
  pointer-events: none;
}
#toast.show { transform: translateY(0); opacity: 1; }

/* ─────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────── */
footer {
  padding: var(--space-5) 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
  transition: background 0.45s, border-color 0.35s;
}
html[data-theme="beige"] footer { background: rgba(235, 225, 208, 0.7); }

.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); }
.footer-name  { font-size: 0.9375rem; font-weight: 700; color: var(--text-1); transition: color 0.35s; }
.footer-copy  { font-size: 0.8125rem; color: var(--text-3); transition: color 0.35s; }
.footer-email { font-size: 0.8125rem; font-weight: 500; color: var(--text-3); transition: color 0.2s; }
.footer-email:hover { color: var(--amber); }

/* ─────────────────────────────────────────────
   RTL
   ───────────────────────────────────────────── */
html[dir="rtl"] .term-output {
  padding-left: 0;
  padding-right: var(--space-5);
  border-left: none;
  border-right: 2px solid var(--border-mid);
}

/* ─────────────────────────────────────────────
   RESPONSIVE DESIGN SYSTEM (Mobile First Polish)
   ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .caps-grid     { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  #hero {
    grid-template-columns: 1fr;
    padding-top: 100px;
    padding-bottom: var(--space-7);
    min-height: auto;
    gap: var(--space-6);
  }

  .hero-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  /* Executive Portrait on Mobile: visible, beautifully framed */
  .hero-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 360px;
    height: auto;
    margin: 0 auto;
  }

  .hero-photo-frame {
    width: 100%;
    height: 390px;
    max-width: 360px;
    border-radius: var(--radius-xl);
    overflow: hidden;
  }

  .hero-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
  }

  .hero-social-floating {
    position: static;
    transform: none;
    flex-direction: row;
    width: fit-content;
    margin: 0 auto var(--space-3);
  }

  .hero-photo-badge.relocation-drawer {
    left: var(--space-3);
    right: var(--space-3);
    bottom: var(--space-3);
    padding: 10px 14px;
  }

  .approach-layout { grid-template-columns: 1fr; gap: var(--space-6); }
  .contact-grid    { grid-template-columns: 1fr; gap: var(--space-6); }
  .testimonials-grid { grid-template-columns: 1fr; }

  /* Modal Mobile Layout */
  .modal-panel {
    max-height: 94vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  .modal-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-visual {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: var(--space-4);
    max-height: none;
    width: 100%;
  }
  .modal-screenshot {
    max-height: 280px;
    width: 100%;
    object-fit: contain;
  }
  .modal-detail {
    padding: var(--space-5);
    overflow: visible;
    gap: var(--space-4);
  }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  
  #site-nav {
    padding: 0 var(--space-3);
    top: 8px;
  }
  
  .nav-pill {
    width: 100%;
    max-width: 100%;
    padding: 5px 12px;
    justify-content: space-between;
  }

  .nav-right {
    gap: 6px;
    margin-left: auto;
    padding-left: 6px;
  }

  .projects-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .caps-grid     { grid-template-columns: 1fr 1fr; gap: var(--space-4); }

  .hero-headline {
    font-size: clamp(2rem, 7.5vw, 2.75rem);
    line-height: 1.15;
  }

  .hero-sub {
    font-size: 0.9375rem;
    line-height: 1.6;
  }

  .hero-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    width: 100%;
  }

  .hero-ctas {
    flex-direction: column;
    width: 100%;
    gap: var(--space-3);
  }
  .hero-ctas .btn-primary,
  .hero-ctas .btn-ghost {
    width: 100%;
    justify-content: center;
  }

  /* Process steps stack */
  .process-steps {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .process-connector { display: none; }
  .process-step {
    border-left: 3px solid var(--amber);
    padding: var(--space-4);
  }

  /* Architecture visualizer tabs scroll */
  .arch-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .arch-tab-btn {
    flex-shrink: 0;
    font-size: 0.8125rem;
    padding: 8px 14px;
  }
  .arch-canvas-wrap {
    height: 220px;
  }

  /* Filters scroll */
  .filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .filter-btn {
    flex-shrink: 0;
  }

  /* Prevent iOS zoom on input focus */
  .form-input {
    font-size: 16px;
  }
  
  .copy-email-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 540px) {
  .nav-download-spec span {
    display: none;
  }
  .nav-download-spec {
    padding: 6px 8px;
  }
  .nav-hire {
    padding: 5px 12px;
    font-size: 0.75rem;
  }
}

@media (max-width: 440px) {
  .container { padding: 0 var(--space-4); }
  .nav-name { display: none; }
  .caps-grid { grid-template-columns: 1fr; }
  .hero-photo-frame { height: 320px; }
  .modal-detail { padding: var(--space-4); }
  .modal-title { font-size: 1.25rem; }
  .modal-result-callout { padding: 12px 14px; }
  .modal-result-callout p { font-size: 0.875rem; }
}
