/* ===== NAGAR PORTFOLIO — BRUTALLY MINIMAL INDUSTRIAL DESIGN SYSTEM ===== */

/* --- CSS RESET & ROOT VARIABLES --- */
:root {
  /* Surfaces */
  --bg-base: #090A0F;
  --bg-surface: #111319;
  --bg-surface-hover: #161922;
  --bg-surface-inset: #0D0E14;

  /* Structural Hairlines */
  --border-subtle: #1E222D;
  --border-strong: #2D3342;
  --border-focus: #485166;

  /* Typography */
  --text-primary: #F4F5F7;
  --text-secondary: #A1A7B5;
  --text-muted: #636A7B;

  /* Instrument Accent (Clinical Phosphor / Electric Ice Blue) */
  --accent-primary: #38BDF8;
  --accent-hover: #60A5FA;
  --accent-subtle: rgba(56, 189, 248, 0.10);
  --accent-glow: rgba(56, 189, 248, 0.25);

  /* Typography Stacks */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, monospace;
  --font-arabic: 'Noto Kufi Arabic', 'Inter', sans-serif;

  /* Layout Constants */
  --max-width: 1120px;
  --header-height: 64px;
}

/* Global Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important;
  /* STRICT 0PX INDUSTRIAL RECTILINEAR RULE */
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100vw;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

main,
section,
.container,
.hero-section,
.hero-monument,
.spec-block,
.spec-content-column,
.education-card,
.synthesis-card,
.arsenal-quad-card {
  min-width: 0;
}

/* Selection */
::selection {
  background-color: var(--accent-primary);
  color: #000000;
}

/* Focus Visible */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Typography Defaults */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

p {
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 68ch;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

ul,
ol {
  list-style: none;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}


/* --- FLOATING ARCHITECTURAL HEADER (HERO-WIDTH) --- */
.site-header {
  position: fixed;
  top: 1rem;
  left: 0;
  right: 0;
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  z-index: 100;
  pointer-events: none;
}

.header-container {
  pointer-events: auto;
  width: 100%;
  height: 56px;
  background-color: rgba(17, 19, 25, 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 0 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.site-header.scrolled .header-container {
  border-color: var(--border-strong);
  background-color: rgba(9, 10, 15, 0.96);
}

.header-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 0;
}

.header-logo-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-primary);
  display: inline-block;
  box-shadow: 0 0 8px var(--accent-glow);
}

.header-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.header-link {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.35rem 0;
  position: relative;
  transition: color 0.15s ease;
}

.header-link:hover,
.header-link.active {
  color: var(--text-primary);
}

.header-link.active {
  border-bottom: 1px solid var(--accent-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex-shrink: 1;
  margin-left: auto;
}

.header-status-strip {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.85rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
  user-select: none;
  line-height: 1;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.header-status-strip:hover {
  border-color: var(--border-strong);
  background-color: var(--bg-surface-hover);
}

.header-status-strip .pip-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-primary);
  display: inline-block;
  box-shadow: 0 0 8px var(--accent-glow);
  flex-shrink: 0;
}

.header-status-text {
  font-weight: 600;
  color: var(--text-primary);
}

.header-status-coords {
  color: var(--text-muted);
}

.header-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.45rem 0.85rem;
  height: 34px;
  box-sizing: border-box;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.header-btn:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.header-talk-btn {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.header-talk-btn:hover {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #06121f;
}

.header-lang-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  padding: 0.45rem 0.75rem;
  height: 34px;
  box-sizing: border-box;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.header-lang-btn:hover {
  border-color: var(--border-strong);
  color: var(--accent-primary);
}

/* --- MOBILE NAV (HAMBURGER + DROPDOWN, ≤768px) --- */
.header-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: border-color 0.15s ease;
}

.header-menu-btn:hover {
  border-color: var(--accent-primary);
}

.header-menu-btn span {
  display: block;
  width: 16px;
  height: 2px;
  background-color: var(--text-primary);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.header-menu-btn.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.header-menu-btn.open span:nth-child(2) {
  opacity: 0;
}

.header-menu-btn.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.header-mobile-nav {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  margin-top: 0;
  background-color: rgba(17, 19, 25, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: max-height 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, transform 0.25s ease, margin-top 0.25s ease, visibility 0s linear 0.3s;
}

.header-mobile-nav.open {
  display: flex;
  max-height: 420px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  margin-top: 0.5rem;
  transition: max-height 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease 0.03s, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), margin-top 0.18s ease;
}

.header-mobile-nav .header-mobile-link {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.16s ease, color 0.15s ease, background-color 0.15s ease;
}

.header-mobile-nav.open .header-mobile-link {
  opacity: 1;
  transform: translateY(0);
}

.header-mobile-nav.open .header-mobile-link:nth-child(1) { transition-delay: 0.02s, 0.02s, 0s, 0s; }
.header-mobile-nav.open .header-mobile-link:nth-child(2) { transition-delay: 0.04s, 0.04s, 0s, 0s; }
.header-mobile-nav.open .header-mobile-link:nth-child(3) { transition-delay: 0.06s, 0.06s, 0s, 0s; }
.header-mobile-nav.open .header-mobile-link:nth-child(4) { transition-delay: 0.08s, 0.08s, 0s, 0s; }
.header-mobile-nav.open .header-mobile-link:nth-child(5) { transition-delay: 0.1s, 0.1s, 0s, 0s; }
.header-mobile-nav.open .header-mobile-link:nth-child(6) { transition-delay: 0.12s, 0.12s, 0s, 0s; }
.header-mobile-nav.open .header-mobile-link:nth-child(7) { transition-delay: 0.14s, 0.14s, 0s, 0s; }

.header-mobile-link {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.header-mobile-link:last-child {
  border-bottom: none;
}

.header-mobile-link:hover {
  color: var(--accent-primary);
  background-color: var(--bg-surface-hover);
}


/* --- SECTION LAYOUT & HEADERS --- */
.section-block {
  padding: 6.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.section-title {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 54ch;
}

.section-meta-index {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}


/* --- HERO SECTION (100% VIEWPORT HEIGHT FULL-SCREEN LANDING) --- */
.hero-section {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: calc(56px + 1.5rem);
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
  position: relative;
  box-sizing: border-box;
}

.hero-section .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: auto;
  margin-bottom: auto;
}

.hero-status-strip {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 0.65rem 1.25rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 3rem;
  width: auto;
  max-width: 100%;
}

.status-active-pip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.pip-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-primary);
  display: inline-block;
  box-shadow: 0 0 8px var(--accent-glow);
}

.coords-label {
  color: var(--text-muted);
}

.hero-monument {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  margin-bottom: clamp(1.5rem, 3vh, 2.25rem);
}

.hero-monument h1 {
  font-size: clamp(2.5rem, 6.2vw, 4.75rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  text-align: center;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  text-wrap: balance;
}

.hero-subheading-spec {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem 0.85rem;
  font-family: var(--font-mono);
  font-size: clamp(0.875rem, 1.3vw, 1.0625rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  max-width: 1040px;
  width: 100%;
  min-width: 0;
  margin-top: 0.75rem;
  line-height: 1.6;
  color: var(--text-primary);
  text-align: center;
}

.spec-role-item {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
}

.spec-index {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 0.875em;
  letter-spacing: 0.04em;
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
}

.spec-name {
  color: var(--text-primary);
  letter-spacing: -0.01em;
  min-width: 0;
  overflow-wrap: break-word;
}

.spec-divider {
  color: var(--text-muted);
  user-select: none;
  font-size: 1.1em;
  opacity: 0.6;
}

/* Single-line rotating role — replaces the 8-item wall to remove crowding */
.hero-rotator {
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.6rem;
  min-height: 1.9em;
  white-space: nowrap;
  overflow: hidden;
}

.hero-rotating-text {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(80vw, 560px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.hero-rotating-text.is-switching {
  opacity: 0;
  transform: translateY(6px);
}

.hero-rotator-cursor {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  flex: none;
  align-self: center;
  background-color: var(--accent-primary);
  animation: heroCaretBlink 1.05s steps(1) infinite;
}

@keyframes heroCaretBlink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .hero-rotator-cursor {
    animation: none;
  }
  .hero-rotating-text {
    transition: none;
  }
}

.hero-manifesto {
  font-size: clamp(1.0625rem, 1.8vw, 1.25rem);
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 68ch;
  width: 100%;
  min-width: 0;
  overflow-wrap: break-word;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: clamp(1.25rem, 2.5vh, 1.75rem);
  text-align: center;
}

/* Key Hero Metrics Strip */
.hero-metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background-color: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: clamp(1.5rem, 3vh, 2.25rem);
  max-width: 860px;
  width: 100%;
  min-width: 0;
}

.hero-metric-card {
  background-color: var(--bg-surface);
  padding: clamp(0.75rem, 1.5vh, 1.15rem) 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  min-width: 0;
  overflow-wrap: break-word;
  transition: background-color 0.2s ease;
}

.hero-metric-card:hover {
  background-color: rgba(56, 189, 248, 0.04);
}

.hero-metric-val {
  font-family: var(--font-mono);
  font-size: clamp(1.625rem, 2.75vw, 2.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  transition: color 0.15s ease;
}

.hero-metric-card:hover .hero-metric-val {
  color: var(--accent-primary);
}

.hero-metric-lbl {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  line-height: 1.4;
  text-transform: uppercase;
}

html[dir="rtl"] .hero-metric-lbl {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  letter-spacing: 0;
  text-transform: none;
}

.hero-actions-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  align-items: center;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* Industrial Buttons */
.btn-industrial-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--text-primary);
  color: #090A0F;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-industrial-primary:hover {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #090A0F;
}

.btn-industrial-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-industrial-secondary:hover {
  background-color: var(--bg-surface);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}


/* --- SELECTED WORKS (HIGH-PRECISION SPEC BLOCKS) --- */
.works-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.spec-block {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  min-width: 0;
  max-width: 100%;
  transition: border-color 0.15s ease;
}

.spec-block:hover {
  border-color: var(--border-strong);
}

.spec-media-column {
  background-color: var(--bg-surface-inset);
  border-right: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
}

.spec-media-column picture {
  display: block;
  width: 100%;
  height: 100%;
}

.spec-media-column img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(15%) contrast(105%);
  transition: filter 0.2s ease;
}

.spec-block:hover .spec-media-column img {
  filter: grayscale(0%) contrast(105%);
}

.spec-media-column img.spec-media-logo {
  object-fit: contain;
  padding: 2.25rem 1.75rem;
  filter: none;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.spec-block:hover .spec-media-column img.spec-media-logo {
  transform: scale(1.03);
}

.spec-block[data-project="siraj"]:hover .spec-media-column img.spec-media-logo {
  filter: drop-shadow(0 0 16px rgba(197, 155, 88, 0.3));
}

.spec-block[data-project="speedtech"]:hover .spec-media-column img.spec-media-logo {
  filter: drop-shadow(0 0 18px rgba(0, 85, 255, 0.4));
}

/* Siraj Academy brand backdrop (matches live site deep green) */
.spec-block[data-project="siraj"] .spec-media-column {
  background-color: #093035;
}

/* --- MEDIA CREDIT BADGE (MADE BY ME) --- */
.media-credit-badge {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #06121f;
  background-color: var(--accent-primary);
  border: 1px solid rgba(0, 0, 0, 0.25);
  padding: 0.3rem 0.6rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  white-space: nowrap;
}

.media-credit-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  background-color: #06121f;
  border-radius: 50%;
  flex-shrink: 0;
}

.spec-media-item,
.drawer-video-container {
  position: relative;
}

.spec-media-item .media-credit-badge,
.drawer-video-container .media-credit-badge {
  top: 10px;
  inset-inline-start: 10px;
}

/* Inline credit inside caption bar (next to description) */
.spec-media-caption,
.drawer-video-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.media-credit-badge.media-credit-inline {
  position: static;
  flex-shrink: 0;
  font-size: 0.625rem;
  padding: 0.2rem 0.5rem;
  box-shadow: none;
}

.spec-media-placeholder {
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.spec-content-column {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  max-width: 100%;
}

.spec-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.spec-category-tag {
  color: var(--accent-primary);
}

.spec-project-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.spec-project-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* Why It Was Built / Purpose Callout */
.spec-why-box {
  background-color: var(--bg-surface-inset);
  border-left: 2px solid var(--accent-primary);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

html[dir="rtl"] .spec-why-box {
  border-left: none;
  border-right: 2px solid var(--accent-primary);
}

.spec-why-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent-primary);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.25rem;
}

.spec-why-text {
  margin: 0;
  color: var(--text-secondary);
}

/* Stack Pills */
.spec-stack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.75rem;
}

.spec-pill {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  background-color: var(--bg-surface-inset);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.5rem;
  letter-spacing: 0.02em;
}

/* Extra Projects & Show More Button */
.spec-block-extra {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.spec-block-extra.is-collapsed {
  display: none !important;
}

.works-toggle-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

.works-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 2.25rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.works-toggle-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background-color: var(--bg-surface-hover);
}

/* Drawer Video Container */
.drawer-video-container {
  margin: 1.25rem 0;
  border: 1px solid var(--border-subtle);
  background-color: #000;
  overflow: hidden;
}

.drawer-video-container video {
  width: 100%;
  height: auto;
  display: block;
}

.drawer-video-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.drawer-video-dl {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
  text-decoration: none;
  border: 1px solid rgba(56, 189, 248, 0.3);
  background-color: var(--accent-subtle);
  padding: 0.25rem 0.5rem;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.drawer-video-dl:hover {
  background-color: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-primary);
}

/* --- DRAWER YOUTUBE (MAIN TUTORIAL + SHORTS) --- */
.drawer-tube {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.drawer-tube-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-inset);
  padding: 1rem;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.drawer-tube-main:hover {
  border-color: var(--accent-primary);
}

.drawer-tube-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}

.drawer-tube-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.drawer-tube-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.drawer-tube-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.drawer-tube-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
}

.drawer-tube-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
}

.drawer-tube-stats {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.drawer-tube-watch {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary);
  letter-spacing: 0.04em;
  margin-top: auto;
}

.drawer-tube-shortshead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.drawer-tube-shortshead .drawer-sec-heading {
  margin: 0;
}

.drawer-tube-all {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  white-space: nowrap;
}

.drawer-tube-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.875rem;
}

.drawer-tube-short {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-inset);
  padding: 0.625rem;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.drawer-tube-short:hover {
  border-color: var(--accent-primary);
}

.drawer-tube-thumb-sm {
  aspect-ratio: 16 / 9;
}

.drawer-tube-thumb-sm .drawer-tube-play {
  font-size: 1.4rem;
}

.drawer-tube-short-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
}

.drawer-tube-short-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.drawer-tube-short-meta span:last-child {
  color: var(--accent-primary);
}

.spec-metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  padding: 1rem;
  background-color: var(--bg-surface-inset);
  border: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
}

.spec-metric-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.spec-metric-val {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.spec-metric-lbl {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spec-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.spec-action-trigger {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-subtle);
  background-color: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.spec-action-trigger:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background-color: var(--accent-subtle);
}

.spec-action-live {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.5rem 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s ease;
}

.spec-action-live:hover {
  color: var(--text-primary);
}


/* --- DUAL SYNTHESIS SECTION --- */
.synthesis-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.synthesis-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
}

.synthesis-domain-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.synthesis-domain-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.synthesis-institution {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
}

.synthesis-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Parameters Ledger Table */
.parameters-ledger {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.parameters-header {
  padding: 1rem 1.5rem;
  background-color: var(--bg-surface-inset);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.parameter-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.875rem;
}

.parameter-row:last-child {
  border-bottom: none;
}

.parameter-lbl {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.parameter-val {
  color: var(--text-primary);
  font-weight: 500;
}


/* --- TECHNICAL ARSENAL SECTION --- */
.arsenal-quad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background-color: var(--border-subtle);
  border: 1px solid var(--border-subtle);
}

.arsenal-quad-card {
  background-color: var(--bg-surface);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.arsenal-category-title {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.arsenal-items-list {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.8;
}


/* --- ACADEMIC & CLINICAL EDUCATION SECTION --- */
.education-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.education-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: 100%;
  justify-self: stretch;
}

.education-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.education-card:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-surface-hover);
  transform: translateY(-2px);
}

.education-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  min-width: 0;
}

.education-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 auto;
}

.education-index {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  font-weight: 600;
}

.education-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-top: 0.25rem;
  overflow-wrap: break-word;
  min-width: 0;
}

.education-institution {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  margin-top: 0.25rem;
  overflow-wrap: break-word;
  min-width: 0;
}

.education-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  background-color: var(--accent-subtle);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-primary);
  white-space: nowrap;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.education-body {
  font-size: 0.90625rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.education-date {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.education-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.education-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--bg-surface-inset);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

a.education-cert-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--accent-primary);
  border-color: rgba(56, 189, 248, 0.3);
  background-color: var(--accent-subtle);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

a.education-cert-link:hover {
  background-color: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-primary);
}

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


/* --- TRAJECTORY & HONORS SECTION --- */
.trajectory-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  table-layout: auto;
}

.trajectory-table th,
.trajectory-table td {
  padding: 1.25rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.trajectory-table th {
  background-color: var(--bg-surface-inset);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.trajectory-table tbody tr {
  transition: background-color 0.15s ease;
}

.trajectory-table tbody tr:hover {
  background-color: var(--bg-surface-hover);
}

.trajectory-table tbody tr:last-child td {
  border-bottom: none;
}

.trajectory-period {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow-wrap: break-word;
}

.trajectory-event {
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: break-word;
  min-width: 0;
}

.trajectory-role {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-primary);
}

.trajectory-verify-link {
  color: inherit;
  text-decoration: none;
}

.trajectory-verify-link:hover {
  text-decoration: underline;
}

.trajectory-inst .trajectory-verify-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
}

.trajectory-inst {
  font-size: 0.875rem;
  color: var(--text-secondary);
  overflow-wrap: break-word;
  min-width: 0;
}


/* --- DIRECT COORDINATES & FOOTER --- */
.contact-section {
  padding: 6.5rem 0;
}

.contact-ledger {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  margin-bottom: 3.5rem;
}

.contact-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}

.contact-row:last-child {
  border-bottom: none;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.contact-link {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: color 0.15s ease;
}

.contact-link:hover {
  color: var(--accent-primary);
}

.site-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.cairo-clock {
  color: var(--text-primary);
  font-weight: 500;
}


/* --- DIRECT MESSAGE TRANSMISSION (CONTACT FORM) --- */
.contact-transmission {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  margin-bottom: 3.5rem;
}

.contact-transmission-head {
  padding: 1.5rem 1.5rem 0;
}

.contact-transmission-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 0.5rem;
}

.contact-transmission-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.contact-transmission-sub {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.form-label .required {
  color: #F87171;
}

.form-input,
.form-textarea {
  background-color: var(--bg-surface-inset);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  padding: 0.75rem 1rem;
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary);
  background-color: var(--bg-surface-inset);
}

.form-textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.65;
}

.form-error {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #F87171;
  min-height: 1em;
}

.form-error:empty {
  display: none;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.form-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-whatsapp-btn {
  text-decoration: none;
}

.form-feedback {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--text-secondary);
  background-color: var(--bg-surface-inset);
  border: 1px solid var(--border-strong);
  padding: 1rem 1.25rem;
  overflow-wrap: break-word;
}

.form-feedback.success {
  border-color: #34D399;
  color: var(--text-primary);
  background-color: rgba(52, 211, 153, 0.08);
}

.form-feedback a {
  color: var(--accent-primary);
  font-weight: 600;
}

html[dir="rtl"] .contact-form {
  text-align: right;
}


/* --- CERTIFICATE LIGHTBOX (3RD PLACE SECONDARY EXCELLENCE) --- */
.cert-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cert-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.cert-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(9, 10, 15, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cert-lightbox-card {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform: translateY(8px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.cert-lightbox.active .cert-lightbox-card {
  transform: translateY(0);
}

.cert-lightbox-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background-color: var(--bg-surface-inset);
  border-bottom: 1px solid var(--border-subtle);
}

.cert-lightbox-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  letter-spacing: 0.05em;
}

.cert-lightbox-close {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cert-lightbox-close:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.cert-lightbox-card img {
  width: 100%;
  height: auto;
  max-height: calc(90vh - 180px);
  object-fit: contain;
  background: #0A0D14;
  display: block;
}

.cert-lightbox-caption {
  padding: 0.875rem 1.25rem 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.cert-lightbox-actions {
  padding: 0.875rem 1.25rem 1.25rem;
  display: flex;
  gap: 0.75rem;
}

.cert-lightbox-open {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  text-decoration: none;
  border: 1px solid rgba(56, 189, 248, 0.3);
  background-color: var(--accent-subtle);
  padding: 0.5rem 0.875rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.cert-lightbox-open:hover {
  background-color: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-primary);
}


/* --- SLIDE-OVER SPEC DRAWER --- */
.spec-drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(9, 10, 15, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.spec-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.spec-drawer-card {
  width: 100%;
  max-width: 620px;
  height: 100vh;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-strong);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.6);
}

.spec-drawer-overlay.active .spec-drawer-card {
  transform: translateX(0);
}

.drawer-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  background-color: var(--bg-surface-inset);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 10;
}

.drawer-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  letter-spacing: 0.05em;
}

.drawer-close-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.drawer-close-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.drawer-scroll-body {
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.drawer-header-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-pretitle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
}

.drawer-title {
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.drawer-tagline {
  font-size: 1rem;
  color: var(--text-secondary);
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-sec-heading {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.drawer-sec-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.spec-stack-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.spec-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  background-color: var(--bg-surface-inset);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.spec-media-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.spec-media-item {
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-inset);
}

.spec-media-caption {
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}

.drawer-footer-actions {
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

/* --- DRAWER DOCS (PDF TECH PACKS) --- */
.drawer-docs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-doc-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background-color: var(--bg-surface-inset);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.drawer-doc-item:hover {
  border-color: var(--accent-primary);
  background-color: var(--bg-surface-hover);
}

.drawer-doc-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #06121f;
  background-color: var(--accent-primary);
  padding: 0.3rem 0.5rem;
  flex-shrink: 0;
}

.drawer-doc-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.drawer-doc-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.drawer-doc-hint {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--accent-primary);
  letter-spacing: 0.04em;
}

.drawer-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.drawer-list li {
  padding-left: 1rem;
  border-left: 2px solid var(--border-subtle);
}


/* --- FLOATING BACK TO TOP --- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 90;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, border-color 0.15s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}


/* --- RTL (ARABIC) TAILORED STYLES --- */
html[dir="rtl"],
html[lang="ar"] {
  font-family: var(--font-arabic);
}

html[dir="rtl"] .hero-subheading-spec {
  font-family: var(--font-sans);
  letter-spacing: 0;
}

html[dir="rtl"] .spec-index {
  font-family: var(--font-mono);
  direction: ltr;
  display: inline-block;
}

html[dir="rtl"] .spec-drawer-overlay {
  justify-content: flex-start;
}

html[dir="rtl"] .spec-drawer-card {
  border-left: none;
  border-right: 1px solid var(--border-strong);
  transform: translateX(-100%);
  box-shadow: 12px 0 32px rgba(0, 0, 0, 0.6);
}

html[dir="rtl"] .spec-drawer-overlay.active .spec-drawer-card {
  transform: translateX(0);
}

html[dir="rtl"] .spec-media-column {
  border-right: none;
  border-left: 1px solid var(--border-subtle);
}

html[dir="rtl"] .trajectory-table th,
html[dir="rtl"] .trajectory-table td {
  text-align: right;
}

html[dir="rtl"] .drawer-list li {
  padding-left: 0;
  padding-right: 1rem;
  border-left: none;
  border-right: 2px solid var(--border-subtle);
}

html[dir="rtl"] .back-to-top {
  right: auto;
  left: 2rem;
}


@media (max-width: 1120px) and (min-width: 961px) {
  .arsenal-quad-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 960px) {
  .spec-block {
    grid-template-columns: 1fr;
  }

  .spec-media-column {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    max-height: 280px;
  }

  html[dir="rtl"] .spec-media-column {
    border-left: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .synthesis-split {
    grid-template-columns: 1fr;
  }

  .arsenal-quad-grid {
    grid-template-columns: 1fr;
  }

  .parameter-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .contact-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

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

  .header-status-coords {
    display: none;
  }

  .spec-metrics-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .site-header {
    top: 0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .header-container {
    height: 52px;
    padding: 0 0.75rem;
    gap: 0.5rem;
  }

  .header-logo {
    font-size: 0.875rem;
  }

  .header-links {
    display: none;
    /* Keep header compact on mobile */
  }

  .header-actions {
    gap: 0.5rem;
  }

  .header-btn,
  .header-lang-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
    height: 32px;
  }

  .header-menu-btn {
    display: inline-flex;
    width: 32px;
    height: 32px;
  }

  .section-block {
    padding: 4rem 0;
  }

  .hero-section {
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: calc(52px + 1.25rem);
    padding-bottom: 2rem;
    justify-content: center;
    overflow-x: clip;
  }

  .hero-monument {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .hero-monument h1 {
    font-size: clamp(1.85rem, 10.5vw, 2.5rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
  }

  .hero-subheading-spec {
    gap: 0.4rem 0.6rem;
    font-size: 0.85rem;
    max-width: 100%;
    line-height: 1.7;
  }

  .spec-role-item {
    white-space: normal;
    text-align: center;
    justify-content: center;
    max-width: 100%;
  }

  .hero-manifesto {
    font-size: 1rem;
    line-height: 1.65;
    max-width: 100%;
  }

  .hero-metric-strip {
    grid-template-columns: 1fr;
    margin-bottom: 1.5rem;
    max-width: 100%;
  }

  .hero-metric-card {
    padding: 1rem 0.75rem;
  }

  .hero-metric-val {
    font-size: 1.75rem;
    overflow-wrap: break-word;
  }

  .hero-metric-lbl {
    overflow-wrap: break-word;
    max-width: 100%;
  }

  .hero-actions-bar {
    gap: 0.75rem;
  }

  .btn-industrial-primary,
  .btn-industrial-secondary {
    max-width: 100%;
    text-align: center;
    overflow-wrap: break-word;
  }

  .spec-content-column {
    padding: 1.5rem;
  }

  .synthesis-card,
  .arsenal-quad-card,
  .education-card {
    padding: 1.5rem;
  }

  .spec-metrics-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .spec-metric-val {
    font-size: 1rem;
    overflow-wrap: break-word;
  }

  .trajectory-table th,
  .trajectory-table td {
    padding: 0.875rem 0.75rem;
  }

  .trajectory-period {
    white-space: normal;
    font-size: 0.75rem;
    overflow-wrap: break-word;
  }

  .trajectory-event {
    font-size: 0.875rem;
  }

  .trajectory-table th:nth-child(3),
  .trajectory-table td:nth-child(3) {
    display: none;
    /* Hide institutional role column on small mobile for density */
  }

  .spec-drawer-card {
    max-width: 100vw;
  }

  .drawer-scroll-body {
    padding: 1.5rem 1rem;
  }

  .drawer-tube-main {
    grid-template-columns: 1fr;
  }

  .contact-row {
    padding: 1rem 0.75rem;
  }

  .contact-transmission-head,
  .contact-form {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions .btn-industrial-primary,
  .form-actions .btn-industrial-secondary {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 620px) {
  /* "Let's Talk" also lives in the mobile nav — hide the header copy so
     CV + lang + hamburger always fit on narrow phones (fixes cut-off). */
  .header-talk-btn {
    display: none;
  }

  .education-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .education-badge {
    align-self: flex-start;
    white-space: normal;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .header-status-strip {
    display: none;
  }

  .site-header {
    padding-left: 0.625rem;
    padding-right: 0.625rem;
  }

  .header-container {
    padding: 0 0.625rem;
    gap: 0.5rem;
  }

  .header-actions {
    gap: 0.4rem;
  }

  .header-btn,
  .header-lang-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.6875rem;
  }

  .hero-monument h1 {
    font-size: clamp(1.7rem, 11vw, 2.2rem);
  }

  .hero-subheading-spec {
    gap: 0.35rem 0.5rem;
    font-size: 0.8rem;
  }

  .spec-role-item {
    white-space: normal;
    text-align: center;
    justify-content: center;
  }

  .hero-manifesto {
    font-size: 0.9375rem;
  }

  .hero-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-industrial-primary,
  .btn-industrial-secondary {
    width: 100%;
    justify-content: center;
  }

  .spec-content-column {
    padding: 1.25rem;
  }

  .spec-metrics-strip {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.625rem;
  }

  .drawer-tube-grid {
    grid-template-columns: 1fr;
  }

  .trajectory-table th,
  .trajectory-table td {
    padding: 0.75rem 0.625rem;
  }

  .trajectory-table th:nth-child(4),
  .trajectory-table td:nth-child(4) {
    display: none;
    /* Keep only TIMELINE + MILESTONE on very small phones to avoid squeeze */
  }

  .contact-link {
    font-size: 0.85rem;
  }

  .site-footer-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}