/* ==========================================================================
   MAHMOUD GALAL — ARCHITECTURAL PORTFOLIO DESIGN SYSTEM
   ========================================================================== */

/* --- CSS Variables & Color Tokens --- */
:root {
  /* Dark Theme Palette (Default) */
  --bg-primary: #0A0E15;
  --bg-surface: #101722;
  --bg-surface-secondary: #172131;
  --bg-surface-hover: #1E2B3E;
  
  --text-primary: #F3F1EB;
  --text-muted: #9CA7B6;
  --text-dim: #606F82;
  
  --accent-gold: #D8AA70;
  --accent-gold-rgb: 216, 170, 112;
  --accent-gold-muted: rgba(216, 170, 112, 0.15);
  
  --accent-blue: #91B8CA;
  --accent-blue-rgb: 145, 184, 202;
  --accent-blue-muted: rgba(145, 184, 202, 0.15);
  
  --accent-rust: #BD7655;
  --accent-rust-rgb: 189, 118, 85;
  
  --border-color: rgba(243, 241, 235, 0.08);
  --border-accent: rgba(216, 170, 112, 0.3);
  --border-light: rgba(243, 241, 235, 0.04);
  
  --grid-line-color: rgba(243, 241, 235, 0.035);
  --grid-datum-color: rgba(216, 170, 112, 0.2);

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-arabic-heading: 'Amiri', 'Playfair Display', Georgia, serif;
  --font-arabic-sans: 'Alexandria', 'DM Sans', sans-serif;

  --header-height: 80px;
  --container-max: 1320px;
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease;
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #F4F1E9;
  --bg-surface: #E8E3D7;
  --bg-surface-secondary: #DDD7C9;
  --bg-surface-hover: #D2CABE;
  
  --text-primary: #17202B;
  --text-muted: #647080;
  --text-dim: #8E9BAA;
  
  --accent-gold: #A6673D;
  --accent-gold-rgb: 166, 103, 61;
  --accent-gold-muted: rgba(166, 103, 61, 0.15);
  
  --accent-blue: #547F91;
  --accent-blue-rgb: 84, 127, 145;
  --accent-blue-muted: rgba(84, 127, 145, 0.15);
  
  --accent-rust: #A84E37;
  --accent-rust-rgb: 168, 78, 55;
  
  --border-color: rgba(23, 32, 43, 0.12);
  --border-accent: rgba(166, 103, 61, 0.35);
  --border-light: rgba(23, 32, 43, 0.06);
  
  --grid-line-color: rgba(23, 32, 43, 0.04);
  --grid-datum-color: rgba(166, 103, 61, 0.25);

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.15);
}

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

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

section[id] {
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  font-weight: 400;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  position: relative;
  min-height: 100vh;
}

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

p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

ul {
  list-style: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 4px;
}

[dir="rtl"] .nav-link::after {
  right: 0;
  left: auto;
}

/* Keep phone numbers readable left-to-right while anchoring them to the RTL edge. */
[dir="rtl"] .phone-link {
  align-self: stretch;
  justify-content: flex-end;
  text-align: left;
}

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

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

/* --- Scroll Progress Bar --- */
.scroll-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 1000;
  pointer-events: none;
}

.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue));
  transition: width 0.1s ease-out;
}

/* --- Custom Architectural Cursor --- */
@media (hover: hover) and (pointer: fine) {
  body {
    cursor: none;
  }

  .cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background-color: var(--accent-gold);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.05s ease-out, background-color 0.2s ease;
  }

  .cursor-reticle {
    position: fixed;
    top: 0;
    left: 0;
    width: 38px;
    height: 38px;
    border: 1px dashed var(--accent-gold);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9998;
    transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, transform 0.15s cubic-bezier(0.2, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .cursor-reticle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    background: rgba(var(--accent-gold-rgb), 0.3);
  }

  .cursor-reticle::after {
    content: '';
    position: absolute;
    width: 1px;
    height: 100%;
    background: rgba(var(--accent-gold-rgb), 0.3);
  }

  .cursor-coords {
    position: absolute;
    top: 42px;
    left: 42px;
    font-size: 0.65rem;
    font-family: var(--font-sans);
    letter-spacing: 0.5px;
    color: var(--accent-gold);
    white-space: nowrap;
    opacity: 0.7;
    pointer-events: none;
  }

  /* Hovering Interactive Element */
  body.cursor-hover .cursor-dot {
    transform: translate(-50%, -50%) scale(1.8);
    background-color: var(--accent-blue);
  }

  body.cursor-hover .cursor-reticle {
    width: 54px;
    height: 54px;
    border-style: solid;
    border-color: var(--accent-blue);
  }
}

@media (hover: none) or (pointer: coarse) {
  .cursor-dot, .cursor-reticle {
    display: none !important;
  }
}

/* --- Architectural Background Canvas --- */
.arch-bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* --- Header / Navigation --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 900;
  background: rgba(10, 14, 21, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.4s ease, border-color 0.4s ease, transform 0.3s ease;
}

[data-theme="light"] .site-header {
  background: rgba(244, 241, 233, 0.88);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Monogram Logo */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  position: relative;
}

.brand-monogram {
  font-size: 1.35rem;
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--accent-gold);
}

.brand-divider {
  font-size: 1.1rem;
  color: var(--text-dim);
  font-weight: 300;
}

.brand-year {
  font-size: 1rem;
  color: var(--text-muted);
}

.brand-subtext {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  padding: 0.2rem 0.5rem;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  margin-left: 0.5rem;
  border-radius: 2px;
}

/* Desktop Nav Links */
.desktop-nav .nav-list {
  display: flex;
  align-items: center;
  gap: 2.2rem;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  padding: 0.5rem 0;
}

.nav-index {
  font-size: 0.7rem;
  color: var(--accent-gold);
  opacity: 0.7;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 1.5px;
  background-color: var(--accent-gold);
  transition: width 0.3s ease;
}

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

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Header Actions: Language & Theme Switchers */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Language Toggle Button */
.lang-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 2px;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-primary);
  font-weight: 600;
}

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

.lang-icon {
  font-size: 0.85rem;
}

.lang-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.9rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 2px;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-primary);
}

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

.theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .light-icon {
  display: flex;
}
[data-theme="dark"] .dark-icon {
  display: none;
}
[data-theme="light"] .light-icon {
  display: none;
}
[data-theme="light"] .dark-icon {
  display: flex;
}

.theme-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* Mobile Hamburger Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  cursor: pointer;
  z-index: 1001;
}

.burger-line {
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-btn.active .burger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.mobile-menu-btn.active .burger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active .burger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: var(--bg-primary);
  z-index: 850;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--header-height) + 2rem) 2rem 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.mobile-nav-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-content {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  justify-content: space-between;
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 2rem;
  flex: 1;
}

.mobile-nav-link {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 7vw, 1.85rem);
  display: flex;
  align-items: baseline;
  gap: 1rem;
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.mobile-nav-link .m-num {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--accent-gold);
}

.mobile-nav-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  margin-top: 2rem;
}

.m-footer-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text-primary);
}

.m-footer-role {
  font-size: 0.85rem;
  color: var(--accent-gold);
}

@media (max-width: 991px) {
  .desktop-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: flex;
  }
}

/* Prevent body scroll when mobile nav is open */
body.mobile-nav-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* --- Section Structure & Headings --- */
.section {
  padding-top: 7rem;
  padding-bottom: 7rem;
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--border-light);
}

.section-header-block {
  margin-bottom: 4rem;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 1.25rem;
}

.label-number {
  color: var(--accent-gold);
}

.label-slash {
  color: var(--text-dim);
}

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

.section-heading {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.section-subtitle {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--text-muted);
  max-width: 780px;
  line-height: 1.6;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.95rem 1.85rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background-color: var(--accent-gold);
  color: #0A0E15;
  border: 1px solid var(--accent-gold);
}

.btn-primary:hover {
  background-color: #E2B881;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(var(--accent-gold-rgb), 0.3);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--accent-gold);
  background-color: var(--bg-surface);
  transform: translateY(-2px);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  min-height: 100vh;
  padding-top: calc(var(--header-height) + 2rem);
  padding-bottom: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

.hero-grid-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.grid-line {
  position: absolute;
  background-color: var(--grid-line-color);
}

.grid-line-v {
  top: 0;
  bottom: 0;
  width: 1px;
}
.grid-line-v.v1 { left: 15%; }
.grid-line-v.v2 { left: 50%; }
.grid-line-v.v3 { left: 85%; }

.grid-line-h {
  left: 0;
  right: 0;
  height: 1px;
}
.grid-line-h.h1 { top: 35%; }
.grid-line-h.h2 { top: 75%; }

.hero-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.hero-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
  margin-bottom: 3.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-gold);
  border-radius: 50%;
}

.datum-indicator {
  color: var(--accent-gold);
}

@media (max-width: 768px) {
  .datum-indicator {
    display: none;
  }
}

.hero-main-layout {
  display: block;
  max-width: 920px;
  margin-bottom: 3.75rem;
}

.hero-text-column {
  max-width: 860px;
}

.hero-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: 2px;
  margin-bottom: 1.5rem;
}

.role-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-gold);
}

.role-title {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.hero-identity-group {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  margin-bottom: 2rem;
}

.hero-portrait-card {
  flex-shrink: 0;
  width: 150px;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  padding: 0.75rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.hero-portrait-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-gold);
  box-shadow: 0 12px 30px rgba(var(--accent-gold-rgb), 0.18);
}

.hero-portrait-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-surface-secondary);
}

.hero-portrait-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
  display: block;
  filter: contrast(1.04) saturate(1.06) brightness(1.02);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-portrait-card:hover .hero-portrait-photo {
  transform: scale(1.05);
}

.hero-portrait-datum {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.45rem;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--accent-gold);
  font-weight: 700;
}

.hero-name-wrap {
  display: flex;
  flex-direction: column;
}

.hero-name {
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.hero-surname {
  color: var(--accent-gold);
  font-style: italic;
}

.hero-statement {
  font-size: clamp(1.2rem, 1.9vw, 1.5rem);
  color: var(--text-primary);
  line-height: 1.6;
  max-width: 720px;
  margin-bottom: 2.75rem;
  font-family: var(--font-serif);
  font-weight: 400;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* Hero Visual Composition */
.hero-visual-column {
  position: relative;
}

.hero-arch-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  padding: 1.25rem;
  position: relative;
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s ease, border-color 0.4s ease;
}

.hero-arch-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-gold);
}

.arch-blueprint-view,
.hero-book-cover-view {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-book-cover-img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
  filter: contrast(1.03) saturate(1.04);
}

.hero-arch-card:hover .hero-book-cover-img {
  transform: scale(1.03);
}

.blueprint-svg {
  width: 100%;
  height: auto;
  display: block;
  direction: ltr;
  unicode-bidi: isolate;
}

.arch-visual-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  font-size: 0.75rem;
  border-top: 1px solid var(--border-color);
  margin-top: 1rem;
}

.caption-tag {
  color: var(--accent-gold);
  font-weight: 600;
  letter-spacing: 0.1em;
}

.caption-desc {
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* Hero Bottom Strip */
.hero-bottom-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.strip-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.strip-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
  font-weight: 600;
}

.strip-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

.strip-separator {
  width: 1px;
  height: 35px;
  background-color: var(--border-color);
}

@media (max-width: 991px) {
  .strip-separator {
    display: none;
  }
}

/* ==========================================================================
   SECTION 01: ABOUT ME
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  grid-template-rows: auto auto;
  gap: 0 4.5rem;
  align-items: start;
}

.about-text-col {
  grid-column: 1;
  grid-row: 1;
}

.about-stats-col {
  grid-column: 1;
  grid-row: 2;
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-color);
}

.about-visual-col {
  grid-column: 2;
  grid-row: 1 / 3;
}

.lead-paragraph {
  font-size: 1.25rem;
  line-height: 1.65;
  color: var(--text-primary);
  margin-bottom: 2rem;
  font-weight: 500;
  border-left: 2px solid var(--accent-gold);
  padding-left: 1.5rem;
}

.editorial-body p {
  margin-bottom: 1.5rem;
  line-height: 1.75;
}

.about-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-color);
}

.stat-card {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Portrait Visual Frame */
.about-portrait-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  padding: 1.25rem;
  position: relative;
  box-shadow: var(--shadow-lg);
  perspective: 1000px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.about-portrait-card:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 16px 40px rgba(var(--accent-gold-rgb), 0.2);
}

.portrait-frame {
  position: relative;
  transform-style: preserve-3d;
}

.portrait-inner {
  border: 1px solid var(--border-color);
  overflow: hidden;
  background: var(--bg-surface-secondary);
  position: relative;
  border-radius: 2px;
  max-height: 480px;
  aspect-ratio: 4 / 5;
}

.architect-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
  display: block;
  filter: contrast(1.04) saturate(1.06) brightness(1.02);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

.about-portrait-card:hover .architect-portrait-img {
  transform: scale(1.04);
  filter: contrast(1.06) saturate(1.08) brightness(1.03);
}

/* Luminous Architectural Scan Line Animation */
.portrait-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), var(--accent-blue), transparent);
  box-shadow: 0 0 12px 1px var(--accent-gold);
  z-index: 3;
  opacity: 0.8;
  pointer-events: none;
  animation: archScanSweep 5s ease-in-out infinite alternate;
}

@keyframes archScanSweep {
  0% {
    top: 0%;
    opacity: 0;
  }
  15% {
    opacity: 0.9;
  }
  85% {
    opacity: 0.9;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* Tech Overlay & Precision Corner Brackets */
.portrait-tech-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.corner-bracket {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent-gold);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.cb-tl {
  top: 10px;
  left: 10px;
  border-right: none;
  border-bottom: none;
}

.cb-tr {
  top: 10px;
  right: 10px;
  border-left: none;
  border-bottom: none;
}

.cb-bl {
  bottom: 10px;
  left: 10px;
  border-right: none;
  border-top: none;
}

.cb-br {
  bottom: 10px;
  right: 10px;
  border-left: none;
  border-top: none;
}

.about-portrait-card:hover .corner-bracket {
  opacity: 1;
  width: 22px;
  height: 22px;
}

.about-portrait-card:hover .cb-tl {
  top: 6px;
  left: 6px;
}
.about-portrait-card:hover .cb-tr {
  top: 6px;
  right: 6px;
}
.about-portrait-card:hover .cb-bl {
  bottom: 6px;
  left: 6px;
}
.about-portrait-card:hover .cb-br {
  bottom: 6px;
  right: 6px;
}

/* Floating Datum Point Tags on Portrait */
.portrait-coord-tag {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  background: rgba(10, 14, 21, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-accent);
  border-radius: 2px;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--accent-gold);
  font-weight: 600;
  font-family: var(--font-sans);
}

.portrait-coord-tag.top-tag {
  top: 14px;
  left: 32px;
}

.portrait-coord-tag.bottom-tag {
  bottom: 14px;
  right: 32px;
}

.tag-point {
  width: 5px;
  height: 5px;
  background-color: var(--accent-gold);
  border-radius: 50%;
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.6); opacity: 1; }
}

.portrait-detail-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  padding: 1rem;
  margin-top: 1rem;
  border-radius: 2px;
}

.badge-icon {
  color: var(--accent-gold);
  display: flex;
}

.badge-text {
  display: flex;
  flex-direction: column;
}

.badge-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.badge-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

@media (max-width: 991px) {
  .about-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 3rem;
  }
  .about-portrait-card {
    max-width: 420px;
    margin: 0 auto;
  }
  .about-text-col {
    grid-column: 1;
    grid-row: auto;
    order: 1;
  }
  .about-visual-col {
    grid-column: 1;
    grid-row: auto;
    order: 2;
  }
  .about-stats-col {
    grid-column: 1;
    grid-row: auto;
    order: 3;
    margin-top: 1rem;
    padding-top: 2rem;
  }
}

/* ==========================================================================
   SECTION 02: SKILLS
   ========================================================================== */
.skills-categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.skill-category-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 2.25rem;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  position: relative;
}

.skill-category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0%;
  background-color: var(--accent-gold);
  transition: height 0.3s ease;
}

.skill-category-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.skill-category-card:hover::before {
  height: 100%;
}

.card-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
}

.category-index {
  color: var(--accent-gold);
  font-weight: 700;
}

.category-tag {
  color: var(--text-dim);
}

.category-name {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}

.category-desc {
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 2rem;
}

/* Tags List */
.skills-tag-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: auto;
}

.skill-tag {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  border-radius: 2px;
}

.tag-bullet {
  width: 6px;
  height: 6px;
  background-color: var(--accent-gold);
  border-radius: 50%;
}

/* Software Levels */
.skills-level-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: auto;
}

.skill-level-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.level-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

[dir="rtl"] .level-info {
  flex-direction: row-reverse;
}

.tool-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.proficiency-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
}

.badge-excellent {
  background: linear-gradient(135deg, rgba(var(--accent-gold-rgb), 0.25), rgba(var(--accent-blue-rgb), 0.15));
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  box-shadow: 0 0 10px rgba(var(--accent-gold-rgb), 0.2);
  font-weight: 700;
}

.badge-very-good {
  background: rgba(var(--accent-gold-rgb), 0.2);
  color: var(--accent-gold);
  border: 1px solid rgba(var(--accent-gold-rgb), 0.55);
  box-shadow: 0 0 6px rgba(var(--accent-gold-rgb), 0.12);
  font-weight: 600;
}

.badge-good {
  background: rgba(var(--accent-gold-rgb), 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(var(--accent-gold-rgb), 0.3);
}

.badge-intermediate {
  background: rgba(145, 184, 202, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(145, 184, 202, 0.3);
}

.level-track {
  width: 100%;
  height: 4px;
  background: var(--bg-surface-secondary);
  border-radius: 2px;
  overflow: hidden;
}

.level-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue));
  border-radius: 2px;
}

[dir="rtl"] .level-track {
  transform: scaleX(-1);
}

/* Skills Chips Wrap */
.skill-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
}

.skill-chip {
  font-size: 0.82rem;
  padding: 0.4rem 0.8rem;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition-fast);
}

.skill-chip:hover {
  border-color: var(--accent-gold);
  background: var(--bg-surface-hover);
}

@media (max-width: 768px) {
  .skills-categories-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SECTION 03: SELECTED PROJECTS
   ========================================================================== */
.projects-collection {
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 2rem;
  transition: var(--transition-smooth);
  position: relative;
}

.project-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg);
}

.project-layout-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 3.5rem;
  align-items: center;
}

.project-visual-wrapper {
  order: 2;
}

.project-info-wrapper {
  order: 1;
}

.arch-drawing-canvas {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.project-drawing-svg,
.project-drawing-img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #0B0F17;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-drawing-svg,
.project-card:hover .project-drawing-img {
  transform: scale(1.02);
}

.drawing-overlay-protection {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 1rem;
  background: rgba(10, 14, 21, 0.85);
  backdrop-filter: blur(4px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

[data-theme="light"] .drawing-overlay-protection {
  background: rgba(244, 241, 233, 0.9);
}

.protect-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent-gold);
}

/* Project Info Area */
.project-info-wrapper {
  display: flex;
  flex-direction: column;
}

.project-meta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.project-category-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.75rem;
  border-radius: 2px;
}

.badge-academic {
  background: rgba(var(--accent-gold-rgb), 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(var(--accent-gold-rgb), 0.3);
}

.badge-commercial {
  background: rgba(145, 184, 202, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(145, 184, 202, 0.3);
}

.badge-saudi {
  background: rgba(189, 118, 85, 0.15);
  color: var(--accent-rust);
  border: 1px solid rgba(189, 118, 85, 0.3);
}

.badge-external {
  background: rgba(243, 241, 235, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.project-number {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.project-title {
  font-size: clamp(1.8rem, 2.5vw, 2.3rem);
  margin-bottom: 0.35rem;
}

.project-subtitle {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 1.25rem;
  font-weight: 600;
}

.project-description {
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 1.75rem;
}

/* Specs Table */
.project-specs-table {
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.85rem;
}

.spec-label {
  color: var(--text-dim);
  font-weight: 500;
  flex-shrink: 0;
}

.spec-val {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

[dir="rtl"] .spec-val {
  text-align: left;
}

@media (max-width: 576px) {
  .spec-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.35rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  }

  [data-theme="light"] .spec-row {
    border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
  }

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

  .spec-label {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent-gold);
    opacity: 0.85;
  }

  .spec-val {
    text-align: left;
    font-size: 0.88rem;
  }

  [dir="rtl"] .spec-row {
    align-items: flex-start;
  }

  [dir="rtl"] .spec-val {
    text-align: right;
  }
}

/* Concept Breakdown */
.concept-breakdown {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
  border-radius: 2px;
}

.concept-title {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.concept-text {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

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

.pathway-item {
  padding: 0.75rem;
  background: var(--bg-surface);
  border-left: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pathway-item.path-saqqara {
  border-left-color: var(--accent-gold);
}

.pathway-item.path-memphis {
  border-left-color: var(--accent-blue);
}

.path-title {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.path-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Tags & Skills list */
.project-skills-block {
  margin-bottom: 1rem;
}

.skills-block-heading {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.project-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.prog-tag {
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 2px;
}

@media (max-width: 991px) {
  .project-layout-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .pathways-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SECTION 04: EXPERIENCE
   ========================================================================== */
.arch-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  max-width: 960px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 2.5rem;
  position: relative;
}

.timeline-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.marker-dot {
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent-gold);
  background: var(--bg-primary);
  border-radius: 50%;
  z-index: 2;
  margin-top: 2rem;
}

.marker-dot.current-pulse {
  background: var(--accent-gold);
  box-shadow: 0 0 0 6px rgba(var(--accent-gold-rgb), 0.2);
}

.marker-dot.edu-dot {
  border-color: var(--accent-blue);
}

.marker-line {
  flex-grow: 1;
  width: 1px;
  background: var(--border-color);
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.timeline-content-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 2.5rem;
  margin-bottom: 3rem;
  transition: var(--transition-smooth);
}

.timeline-content-card:hover {
  border-color: var(--border-accent);
  transform: translateX(4px);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.timeline-meta-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.timeline-period {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
}

.timeline-meta-group .timeline-period {
  margin-bottom: 0;
}

.timeline-period.current-badge {
  color: #0A0E15;
  background: var(--accent-gold);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}

.timeline-date-range {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
}

.timeline-role {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

.timeline-company {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.timeline-category {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  white-space: nowrap;
}

.timeline-tasks {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.timeline-tasks li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.timeline-tasks li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent-gold);
}

/* Education Specific */
.edu-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.edu-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.edu-detail-item.full-span {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.edu-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.edu-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.project-link-highlight {
  color: var(--accent-gold);
}

@media (max-width: 768px) {
  .timeline-item {
    grid-template-columns: 24px 1fr;
    gap: 1.25rem;
  }
  .timeline-header {
    flex-direction: column;
  }
  .timeline-content-card {
    padding: 1.5rem;
  }
  .edu-details-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SECTION 05: SERVICES
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.75rem;
}

.service-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 2.25rem;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.service-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.service-num {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.1em;
}

.service-icon-wrap {
  color: var(--accent-blue);
  transition: transform 0.3s ease;
}

.service-card:hover .service-icon-wrap {
  transform: scale(1.15) rotate(5deg);
  color: var(--accent-gold);
}

.service-title {
  font-size: 1.45rem;
  margin-bottom: 1rem;
  line-height: 1.25;
}

.service-desc {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
}

@media (max-width: 1200px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ==========================================================================
   SECTION 06: CAREER OBJECTIVE
   ========================================================================== */
.objective-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding-top: 8rem;
  padding-bottom: 8rem;
}

.objective-inner-wrap {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.objective-inner-wrap .section-label {
  margin-bottom: 3rem;
}

.objective-quote-layout {
  position: relative;
  margin-bottom: 3rem;
}

.quote-mark {
  font-family: var(--font-serif);
  font-size: 5rem;
  color: var(--accent-gold);
  opacity: 0.35;
  line-height: 0;
  display: block;
}

.quote-mark.open-quote {
  margin-bottom: 1rem;
}

.quote-mark.close-quote {
  margin-top: 1.5rem;
}

.objective-statement {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.2vw, 2.5rem);
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-primary);
  font-style: italic;
}

.objective-author-tag {
  display: inline-flex;
  flex-direction: column;
  gap: 0.25rem;
  border-top: 1px solid var(--border-accent);
  padding-top: 1.25rem;
}

.author-name {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
}

.author-title {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ==========================================================================
   SECTION 07: CONTACT
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 760px);
}

.contact-card-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 3rem;
}

.contact-box-title {
  font-size: 1.6rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.contact-channel-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 2rem;
}

.channel-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
}

.channel-value {
  font-size: 1.15rem;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.channel-value:hover {
  color: var(--accent-gold);
}

.channel-value-static {
  font-size: 1.15rem;
  color: var(--text-primary);
}

.social-channels-block {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  margin-top: 1rem;
}

.social-links-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 1rem;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 2px;
  transition: var(--transition-fast);
}

.social-btn:hover {
  border-color: var(--accent-gold);
  background: var(--bg-surface-hover);
  color: var(--accent-gold);
  transform: translateY(-2px);
}

/* LinkedIn specific — full-width accent treatment */
.social-btn-linkedin {
  border-color: var(--border-accent);
  background: var(--bg-surface);
  justify-content: center;
  letter-spacing: 0.04em;
}

.social-btn-linkedin svg {
  color: var(--accent-gold);
  flex-shrink: 0;
}

.social-btn-linkedin:hover {
  background: linear-gradient(135deg, rgba(var(--accent-gold-rgb), 0.12), rgba(var(--accent-blue-rgb), 0.08));
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: 0 4px 20px rgba(var(--accent-gold-rgb), 0.15);
}

@media (max-width: 991px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .contact-card-box {
    padding: 2rem;
  }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  position: relative;
  z-index: 1;
}

.footer-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-copy {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.footer-role {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-datum {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--accent-gold);
  text-decoration: none;
  transition: color 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-bottom: 1px dashed transparent;
}

.footer-datum:hover {
  color: var(--text-primary);
  border-bottom-color: var(--accent-gold);
  transform: translateY(-1px);
}

.back-to-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.back-to-top-btn:hover {
  color: var(--accent-gold);
}

@media (max-width: 768px) {
  .footer-center {
    display: none;
  }
}

/* ==========================================================================
   IMAGE PROTECTION & TOAST NOTIFICATION
   ========================================================================== */
.protected-visual {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.protected-visual img,
.protected-visual svg {
  pointer-events: auto;
  -webkit-user-drag: none;
  user-drag: none;
}

.arch-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--accent-gold);
  padding: 0.85rem 1.4rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 2px;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  font-size: 0.85rem;
}

.arch-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   ANIMATIONS & SCROLL REVEALS
   ========================================================================== */
.reveal-fade,
.reveal-slide-up {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-fade {
  transform: scale(0.98);
}

.reveal-slide-up {
  transform: translateY(35px);
}

.reveal-fade.is-revealed,
.reveal-slide-up.is-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ==========================================================================
   RTL (ARABIC) COMPLETE LAYOUT & TYPOGRAPHY ADJUSTMENTS
   ========================================================================== */
[dir="rtl"] {
  font-family: var(--font-arabic-sans);
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] .section-heading,
[dir="rtl"] .hero-name,
[dir="rtl"] .objective-statement,
[dir="rtl"] .brand-monogram,
[dir="rtl"] .footer-copy {
  font-family: var(--font-arabic-heading);
}

/* Amiri's Arabic letterforms need more vertical room than the Latin headings. */
[dir="rtl"] .section-heading {
  line-height: 1.35;
}

[dir="rtl"] .brand-subtext {
  margin-left: 0;
  margin-right: 0.5rem;
}

[dir="rtl"] .lead-paragraph {
  border-left: none;
  border-right: 2px solid var(--accent-gold);
  padding-left: 0;
  padding-right: 1.5rem;
}

[dir="rtl"] .skill-category-card::before {
  left: auto;
  right: 0;
}

[dir="rtl"] .spec-val {
  text-align: left;
}

[dir="rtl"] .pathway-item {
  border-left: none;
  border-right: 2px solid var(--border-color);
}

[dir="rtl"] .pathway-item.path-saqqara {
  border-right-color: var(--accent-gold);
}

[dir="rtl"] .pathway-item.path-memphis {
  border-right-color: var(--accent-blue);
}

[dir="rtl"] .timeline-content-card:hover {
  transform: translateX(-4px);
}

[dir="rtl"] .timeline-tasks li {
  padding-left: 0;
  padding-right: 1.5rem;
}

[dir="rtl"] .timeline-tasks li::before {
  left: auto;
  right: 0;
}

[dir="rtl"] .cursor-coords {
  left: auto;
  right: 42px;
}

[dir="rtl"] .arch-toast {
  right: auto;
  left: 2rem;
}

[dir="rtl"] .cta-arrow-icon,
[dir="rtl"] .link-arrow-icon {
  transform: scaleX(-1);
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE REFINEMENTS
   ========================================================================== */
@media (max-width: 768px) {
  .section {
    padding-top: 4.5rem;
    padding-bottom: 4.5rem;
  }

  .section-header-block {
    margin-bottom: 2.5rem;
  }

  .hero-section {
    padding-top: calc(var(--header-height) + 1rem);
    padding-bottom: 3rem;
  }

  .hero-meta-bar {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
  }

  .hero-name {
    margin-bottom: 1.25rem;
  }

  .hero-statement {
    margin-bottom: 2rem;
  }

  .hero-identity-group {
    gap: 1.25rem;
  }

  .hero-portrait-card {
    width: 115px;
  }

  .about-stats-grid {
    margin-top: 2.5rem;
    padding-top: 2rem;
    gap: 1.25rem;
  }

  .stat-number {
    font-size: 2.2rem;
  }

  .projects-collection {
    gap: 3.5rem;
  }

  .project-card {
    padding: 1.25rem;
  }

  .objective-section {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }

  .quote-mark {
    font-size: 3.5rem;
  }
}

@media (max-width: 480px) {
  .header-inner {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .brand-subtext {
    display: none;
  }

  .header-actions {
    gap: 0.35rem;
  }

  .lang-toggle-btn,
  .theme-toggle-btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.7rem;
  }

  .theme-label {
    display: none;
  }

  .hero-identity-group {
    flex-direction: row;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    flex-wrap: nowrap;
  }

  .hero-name-wrap {
    min-width: 0;
    flex: 1;
  }

  .hero-name {
    font-size: clamp(1.7rem, 9vw, 2.4rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }

  .hero-portrait-card {
    width: 85px;
    flex-shrink: 0;
    padding: 0.4rem;
  }

  .hero-portrait-datum {
    font-size: 0.52rem;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta-group .btn {
    width: 100%;
  }

  .about-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .about-stats-grid .stat-card:nth-child(3) {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
  }

  .social-links-grid {
    grid-template-columns: 1fr;
  }

  .contact-card-box {
    padding: 1.5rem 1.25rem;
  }

  .about-portrait-card {
    padding: 0.85rem;
  }

  .portrait-detail-badge {
    padding: 0.75rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-fade, .reveal-slide-up, .portrait-scan-line, .tag-point {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

/* ==========================================================================
   PROJECT 01 THESIS TRIGGER & ARCHITECTURAL READER MODAL (PROTECTED VIEWER)
   ========================================================================== */

/* Project Thesis Action Button */
.project-thesis-action {
  margin: 0.85rem 0 0 0;
}

/* Design Code Tag — shown below viewer */
.project-design-code {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  background: rgba(212, 163, 89, 0.04);
  width: fit-content;
}

/* Clickable / button variant */
.project-design-code--btn {
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-design-code--btn:hover {
  background: rgba(212, 163, 89, 0.1);
  border-color: var(--accent-gold);
  box-shadow: 0 2px 10px rgba(212, 163, 89, 0.15);
}

.project-design-code--btn:active {
  transform: scale(0.99);
}

.project-design-code--bottom {
  margin: 1rem 0 0 0;
  width: auto;
}

.design-code-sep {
  color: var(--accent-gold);
  opacity: 0.5;
}

.design-code-label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
  text-transform: uppercase;
  opacity: 0.75;
  white-space: nowrap;
}

.design-code-value {
  font-family: 'Courier New', 'Courier', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

[dir="rtl"] .project-design-code {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .project-design-code--btn {
  text-align: right;
}

.btn-open-thesis {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.4rem;
  background: linear-gradient(135deg, rgba(212, 163, 89, 0.08) 0%, rgba(10, 14, 21, 0.95) 100%);
  border: 1px solid var(--accent-gold);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-align: left;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

[dir="rtl"] .btn-open-thesis {
  text-align: right;
}

.btn-open-thesis:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(212, 163, 89, 0.16) 0%, rgba(10, 14, 21, 0.98) 100%);
  box-shadow: 0 8px 28px rgba(212, 163, 89, 0.22);
  border-color: #e5b96f;
}

.thesis-glow-effect {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 163, 89, 0.2), transparent);
  transition: left 0.75s ease;
  pointer-events: none;
}

.btn-open-thesis:hover .thesis-glow-effect {
  left: 100%;
}

.thesis-icon-box {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 163, 89, 0.15);
  border: 1px solid rgba(212, 163, 89, 0.35);
  color: var(--accent-gold);
  border-radius: 2px;
  transition: transform 0.35s ease, background 0.35s ease;
}

.btn-open-thesis:hover .thesis-icon-box {
  transform: scale(1.08);
  background: var(--accent-gold);
  color: #0A0E15;
}

.thesis-text-stack {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex-grow: 1;
}

.thesis-title-text {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  display: block;
}

.thesis-sub-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
}

.thesis-security-tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem;
  background: rgba(212, 163, 89, 0.12);
  border: 1px solid rgba(212, 163, 89, 0.3);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-gold);
  border-radius: 2px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-gold);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px var(--accent-gold);
  animation: pulseGold 2s infinite ease-in-out;
}

@keyframes pulseGold {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

/* Canvas Quick Read Button */
.btn-canvas-read-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem;
  background: var(--accent-gold);
  color: #0A0E15;
  border: none;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-canvas-read-trigger:hover {
  background: #FFFFFF;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Thesis Modal Overlay & Container
   -------------------------------------------------------------------------- */
body.reader-modal-open {
  overflow: hidden !important;
}

.thesis-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 7, 12, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99999;
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
}

.thesis-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.thesis-modal-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #080B10;
  color: var(--text-primary);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Reader Header Bar */
.reader-header {
  height: 64px;
  background: #0E131C;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1.5rem;
  flex-shrink: 0;
  z-index: 10;
}

.reader-brand {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  min-width: 260px;
}

.reader-monogram {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
  border: 1px solid var(--border-accent);
  padding: 0.25rem 0.55rem;
  background: var(--bg-surface);
}

.reader-titles {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow: hidden;
}

.reader-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.reader-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Center Controls */
.reader-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #131924;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  direction: ltr !important;
}

.reader-nav-group,
.reader-zoom-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  direction: ltr !important;
}

.reader-page-counter {
  direction: ltr !important;
}

.reader-control-sep {
  width: 1px;
  height: 22px;
  background: var(--border-color);
  margin: 0 0.35rem;
}

.reader-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reader-btn:hover:not(:disabled) {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--accent-gold);
}

.reader-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.reader-page-counter {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 600;
  padding: 0 0.35rem;
}

.page-input {
  width: 44px;
  height: 28px;
  background: #080B10;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 2px;
}

.page-input:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.page-divider {
  color: var(--text-muted);
}

.page-total {
  color: var(--text-muted);
  min-width: 24px;
}

.zoom-level-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 44px;
  text-align: center;
}

/* Reader Actions */
.reader-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.security-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(212, 163, 89, 0.1);
  border: 1px solid rgba(212, 163, 89, 0.25);
  padding: 0.35rem 0.65rem;
  border-radius: 2px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-gold);
}

.sec-dot {
  width: 6px;
  height: 6px;
  background: #4ADE80;
  border-radius: 50%;
  box-shadow: 0 0 5px #4ADE80;
}

.reader-close-btn {
  width: 36px;
  height: 36px;
  background: #131924;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reader-close-btn:hover {
  background: #EF4444;
  border-color: #EF4444;
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   Reader Body & Stage
   -------------------------------------------------------------------------- */
.reader-body {
  flex-grow: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  background: #05070A;
}

.reader-stage {
  flex-grow: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
  background-image: 
    radial-gradient(circle, rgba(212, 163, 89, 0.04) 1px, transparent 1px),
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 24px 24px, 48px 48px, 48px 48px;
  transition: filter 0.25s ease, opacity 0.25s ease;
}

.reader-canvas-container {
  position: relative;
  display: inline-block;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(212, 163, 89, 0.25);
  background: #000000;
  line-height: 0;
  margin: auto;
}

.pdf-render-canvas {
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Indelible Watermark Overlay */
.canvas-watermark-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
}

.watermark-grid-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(rgba(212, 163, 89, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(212, 163, 89, 0.03) 1px, transparent 1px);
  background-size: 100px 100px;
}

.watermark-diagonal-text {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: rgba(212, 163, 89, 0.12);
  transform: rotate(-25deg);
  white-space: nowrap;
  text-transform: uppercase;
}

/* Loading State Overlay */
.reader-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #080B10;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 2px solid rgba(212, 163, 89, 0.15);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spinLoader 0.9s linear infinite;
}

@keyframes spinLoader {
  to { transform: rotate(360deg); }
}

.loader-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
}

.loader-text strong {
  font-size: 1.05rem;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.loader-text span {
  font-size: 0.82rem;
  color: var(--accent-gold);
}

.loader-bar-wrap {
  width: 240px;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.loader-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--accent-gold);
  transition: width 0.2s ease;
}

/* Security Blurring and Blank States */
.reader-stage.security-focus-lost {
  filter: blur(28px) grayscale(0.5);
  opacity: 0.2;
}

.reader-stage.security-blank {
  filter: brightness(0);
}

/* Reader Footer Bar */
.reader-footer {
  height: 42px;
  background: #0E131C;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.footer-copy-protect {
  letter-spacing: 0.05em;
}

.reader-footer-keys {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.key-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.key-hint kbd {
  background: #1B2230;
  border: 1px solid var(--border-color);
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  color: var(--accent-gold);
}

/* --------------------------------------------------------------------------
   PRINT PROTECTION (BLANK ON PRINT/SAVE-AS-PDF)
   -------------------------------------------------------------------------- */
@media print {
  body, .site-header, .site-footer, .hero-section, .about-section, .skills-section, .projects-section, .timeline-section, .services-section, .contact-section, .thesis-modal-overlay, .pdf-render-canvas {
    display: none !important;
    visibility: hidden !important;
  }
  body::after {
    content: "ACADEMIC ARCHITECTURAL DOCUMENT IS PROTECTED. UNAUTHORIZED PRINTING OR EXPORT IS STRICTLY RESTRICTED. © MAHMOUD GALAL";
    display: block !important;
    font-size: 16pt;
    text-align: center;
    color: #000;
    margin-top: 10cm;
    font-family: sans-serif;
  }
}

/* --------------------------------------------------------------------------
   RESPONSIVE ADJUSTMENTS FOR THESIS VIEWER
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .reader-header {
    padding: 0.75rem 1rem;
    height: auto;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .reader-brand {
    min-width: unset;
  }
  .reader-controls {
    order: 3;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: center;
  }
  .reader-footer-keys {
    display: none;
  }
}

@media (max-width: 600px) {
  .btn-open-thesis {
    padding: 0.85rem 1rem;
    gap: 0.85rem;
  }
  .thesis-icon-box {
    width: 38px;
    height: 38px;
  }
  .thesis-title-text {
    font-size: 0.85rem;
  }
  .thesis-sub-text {
    font-size: 0.72rem;
  }
  .thesis-security-tag {
    display: none;
  }
  .reader-header {
    padding: 0.5rem 0.65rem;
    gap: 0.5rem;
  }
  .reader-brand {
    min-width: 0;
    flex: 1;
    gap: 0.5rem;
  }
  .reader-monogram {
    font-size: 0.72rem;
    padding: 0.2rem 0.4rem;
    flex-shrink: 0;
  }
  .reader-titles {
    min-width: 0;
    max-width: 180px;
  }
  .reader-title {
    font-size: 0.8rem;
  }
  .reader-subtitle {
    display: none;
  }
  .reader-actions {
    gap: 0.45rem;
    flex-shrink: 0;
  }
  .security-status-pill {
    padding: 0.25rem 0.45rem;
    font-size: 0.58rem;
    letter-spacing: 0.06em;
  }
  .reader-close-btn {
    width: 32px;
    height: 32px;
  }
  .reader-stage {
    padding: 1rem 0.5rem;
  }
  .reader-controls {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.35rem 0.45rem;
    gap: 0.25rem;
    justify-content: space-between;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .reader-controls::-webkit-scrollbar {
    display: none;
  }
  .reader-nav-group,
  .reader-zoom-group {
    gap: 0.2rem;
    flex-shrink: 0;
  }
  .reader-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    flex-shrink: 0;
    touch-action: manipulation;
  }
  .reader-btn svg {
    width: 15px;
    height: 15px;
  }
  .reader-page-counter {
    padding: 0 0.15rem;
    gap: 0.2rem;
    font-size: 0.75rem;
    flex-shrink: 0;
  }
  .page-input {
    width: 34px;
    height: 26px;
    font-size: 0.75rem;
    padding: 0;
  }
  .page-total {
    min-width: unset;
    font-size: 0.75rem;
  }
  .zoom-level-text {
    font-size: 0.72rem;
    min-width: 36px;
    text-align: center;
  }
  .reader-control-sep {
    margin: 0 0.2rem;
    height: 16px;
    flex-shrink: 0;
  }
}

@media (max-width: 380px) {
  .security-status-pill .sec-text {
    display: none;
  }
  .security-status-pill {
    padding: 0.3rem 0.4rem;
  }
  .reader-controls {
    padding: 0.25rem 0.3rem;
    gap: 0.15rem;
  }
  .reader-btn {
    width: 27px;
    height: 27px;
  }
  .page-input {
    width: 30px;
    height: 24px;
    font-size: 0.7rem;
  }
  .zoom-level-text {
    min-width: 30px;
    font-size: 0.68rem;
  }
  .reader-control-sep {
    margin: 0 0.1rem;
  }
  #fullscreenBtn,
  .reader-controls > .reader-control-sep:last-of-type {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   LIGHT THEME — THESIS VIEWER OVERRIDES
   -------------------------------------------------------------------------- */
[data-theme="light"] .thesis-modal-overlay {
  background: rgba(220, 218, 210, 0.92);
}

[data-theme="light"] .thesis-modal-container {
  background: #F4F1E9;
  color: #1A1A2E;
}

[data-theme="light"] .reader-header {
  background: #EDEAE0;
  border-bottom-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .reader-controls {
  background: #E2DED4;
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .reader-body {
  background: #F0EDE3;
}

[data-theme="light"] .reader-stage {
  background-image:
    radial-gradient(circle, rgba(0, 0, 0, 0.06) 1px, transparent 1px),
    linear-gradient(to right, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 24px 24px, 48px 48px, 48px 48px;
}

[data-theme="light"] .reader-canvas-container {
  background: #FFFFFF;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .reader-loader {
  background: #F4F1E9;
}

[data-theme="light"] .reader-close-btn {
  background: #E2DED4;
  border-color: rgba(0, 0, 0, 0.15);
  color: #1A1A2E;
}

[data-theme="light"] .reader-close-btn:hover {
  background: #EF4444;
  border-color: #EF4444;
  color: #FFFFFF;
}

[data-theme="light"] .reader-footer {
  background: #EDEAE0;
  border-top-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .page-input {
  background: #E2DED4;
  color: #1A1A2E;
  border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .key-hint kbd {
  background: #D8D4CA;
  color: var(--accent-gold);
  border-color: rgba(0, 0, 0, 0.15);
}
