/* ==========================================================================
   webdev — Web Creation & Digital Portfolio
   Design System: 01 Colours Cafe — Noir Chic
   Palette:
     #171717 (Deep Noir Black)
     #343434 (Dark Charcoal Gray)
     #515151 (Slate Gray)
     #8C8C8C (Cool Mid Gray)
     #B6B6B6 (Light Silver Gray)
     #FFFFFF (Pure White)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties / Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Noir Chic Core Palette */
  --c-noir: #171717;
  --c-charcoal: #343434;
  --c-slate: #515151;
  --c-mid-gray: #8C8C8C;
  --c-light-gray: #B6B6B6;

  /* Surfaces & Backgrounds */
  --c-bg: #FFFFFF;
  --c-surface: #FAFAFA;
  --c-surface-card: #FFFFFF;
  --c-surface-alt: #F4F4F4;

  /* Borders & Dividers */
  --c-border: #E8E8E8;
  --c-border-subtle: #F0F0F0;
  --c-border-focus: #171717;

  /* Typography */
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Shadows */
  --shadow-subtle: 0 2px 10px rgba(23, 23, 23, 0.04);
  --shadow-card: 0 8px 30px rgba(23, 23, 23, 0.06);
  --shadow-hover: 0 16px 40px rgba(23, 23, 23, 0.12);
  --shadow-modal: 0 24px 60px rgba(23, 23, 23, 0.25);

  /* Transitions */
  --transition-fast: 0.18s ease;
  --transition-smooth: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);

  /* Radii */
  --radius-pill: 9999px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--c-charcoal);
  background-color: var(--c-bg);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

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

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

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Ambient Radial Lighting in Top Corners */
body::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50vw;
  height: 50vw;
  max-width: 650px;
  max-height: 650px;
  background: radial-gradient(circle, rgba(182, 182, 182, 0.18) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Utility Text */
.text-center {
  text-align: center;
}

/* --------------------------------------------------------------------------
   3. Header & Navigation (Matches Top Bar of User Mockup)
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-border-subtle);
  z-index: 100;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.site-header.scrolled {
  box-shadow: 0 4px 20px rgba(23, 23, 23, 0.05);
  border-color: var(--c-border);
}

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

/* --------------------------------------------------------------------------
   Brand Logo: Pure CSS Animated Coding Laptop (Refined Grey Monochrome)
   -------------------------------------------------------------------------- */
:root {
  --lid: linear-gradient(180deg, #2D2D2D, #181818);
}

.logo,
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  color: var(--c-noir);
  text-decoration: none !important;
  line-height: 1;
  font-size: 15px;
  direction: ltr;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.logo *,
.brand-logo * {
  text-decoration: none !important;
}

.logo:hover,
.brand-logo:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.logo .mark,
.brand-logo .mark {
  position: relative;
  flex: none;
  width: 3.2em;
  height: 2em;
}

.logo .lid,
.brand-logo .lid {
  position: absolute;
  left: 0.2em;
  top: 0;
  width: 2.8em;
  height: 1.76em;
  box-sizing: border-box;
  padding: 0.16em;
  background: var(--lid);
  border-radius: 0.22em 0.22em 0.04em 0.04em;
}

.logo .scr,
.brand-logo .scr {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 0.16em 0.2em;
  background: #111111;
  border-radius: 0.08em;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12em;
}

.logo .r,
.brand-logo .r {
  height: 0.26em;
  display: flex;
  align-items: center;
}

.logo .b,
.brand-logo .b {
  height: 0.14em;
  width: 0;
  border-radius: 0.07em;
  margin-left: 0.3em;
  animation: 5s linear infinite;
}

/* Refined Grey Monochrome Code Lines */
.logo .b1,
.brand-logo .b1 {
  margin-left: 0;
  background: #D8D8D8;
  animation-name: k1;
}

.logo .b2,
.brand-logo .b2 {
  background: #949494;
  animation-name: k2;
}

.logo .b3,
.brand-logo .b3 {
  background: #626262;
  animation-name: k3;
}

.logo .cur,
.brand-logo .cur {
  display: inline-block;
  width: 0.12em;
  height: 0.18em;
  margin-left: 0.16em;
  background: #FFFFFF;
  opacity: 0;
  animation: cshow 5s linear infinite, blink 0.8s steps(1) infinite;
}

.logo .base,
.brand-logo .base {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 3.2em;
  height: 0.22em;
  background: linear-gradient(180deg, #444444, #262626);
  border-radius: 0.04em 0.04em 0.25em 0.25em;
}

.logo .word,
.brand-logo .word,
.brand-logo .logo-text {
  font: 600 1.35em / 1 "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: -0.03em;
  color: var(--c-noir);
}

@keyframes k1 {
  0%, 4% { width: 0; animation-timing-function: steps(8); }
  22%, 88% { width: 0.85em; }
  92%, 100% { width: 0; }
}

@keyframes k2 {
  0%, 24% { width: 0; animation-timing-function: steps(10); }
  44%, 88% { width: 1.3em; }
  92%, 100% { width: 0; }
}

@keyframes k3 {
  0%, 46% { width: 0; animation-timing-function: steps(8); }
  64%, 88% { width: 0.9em; }
  92%, 100% { width: 0; }
}

@keyframes cshow {
  0%, 46% { opacity: 0; }
  46.1%, 88% { opacity: 1; }
  92%, 100% { opacity: 0; }
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .logo .b1, .brand-logo .b1 { animation: none; width: 0.85em; }
  .logo .b2, .brand-logo .b2 { animation: none; width: 1.3em; }
  .logo .b3, .brand-logo .b3 { animation: none; width: 0.9em; }
  .logo .cur, .brand-logo .cur { animation: none; opacity: 1; }
}

.footer-brand .brand-logo {
  font-size: 16px;
  margin-bottom: 16px;
}

/* Nav Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-link {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--c-charcoal);
  position: relative;
  padding: 6px 0;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--c-noir);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2.5px;
  background-color: var(--c-noir);
  transition: width var(--transition-smooth);
}

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

.mobile-only-link {
  display: none;
}

/* Header Actions & Boxed Contact Button */
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Language Switcher (EN / FR / AR) */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background-color: var(--c-surface-alt);
  border: none;
  outline: none;
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-slate);
  background: transparent;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: all var(--transition-fast);
  text-transform: uppercase;
}

.lang-btn[data-lang="ar"] {
  font-family: 'Cairo', var(--font-heading);
  text-transform: none;
}

.lang-btn:hover {
  color: var(--c-noir);
  background-color: #FFFFFF;
}

.lang-btn.active {
  background-color: var(--c-noir);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(23, 23, 23, 0.15);
}

.btn-contact-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-noir);
  background: transparent;
  border: 1.8px solid var(--c-noir);
  border-radius: 6px;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-contact-box:hover {
  background: var(--c-noir);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.hamburger-bar {
  width: 22px;
  height: 2px;
  background-color: var(--c-noir);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* --------------------------------------------------------------------------
   4. Hero Section (Matches Section 1 in User Mockup)
   -------------------------------------------------------------------------- */
.hero-section {
  padding: 140px 0 90px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}

/* Left Hero Column */
.hero-content {
  display: flex;
  flex-direction: column;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-slate);
  margin-bottom: 18px;
}

.kicker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--c-noir);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 5.5vw, 4.2rem);
  font-weight: 800;
  color: var(--c-noir);
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin-bottom: 24px;
}

.hero-description {
  margin-bottom: 34px;
}

.hero-lead {
  font-size: 1.22rem;
  font-weight: 500;
  color: var(--c-charcoal);
  line-height: 1.55;
  margin-bottom: 14px;
}

.hero-subtext {
  font-size: 0.98rem;
  color: var(--c-slate);
  line-height: 1.65;
}

/* CTA & Contact Details Group */
.hero-cta-group {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Black Pill Button with Bullet Dot (● CONTACT US) */
.btn-primary-pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px;
  background-color: var(--c-noir);
  color: var(--c-bg);
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: all var(--transition-smooth);
  box-shadow: 0 4px 14px rgba(23, 23, 23, 0.2);
}

.pill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--c-bg);
  display: inline-block;
  animation: pulseDot 2.4s infinite ease-in-out;
}

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

.btn-primary-pill:hover {
  background-color: var(--c-charcoal);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(23, 23, 23, 0.28);
}

/* Direct Contact Info Card */
.hero-contact-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 4px;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--c-charcoal);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.contact-item:hover {
  color: var(--c-noir);
  transform: translateX(3px);
}

.contact-icon {
  width: 18px;
  height: 18px;
  color: var(--c-noir);
  flex-shrink: 0;
}

.contact-text {
  word-break: break-word;
}

/* Right Hero Visual (Floating Coding Laptop Mockup) */
.hero-visual {
  position: relative;
  animation: floatHeroImage 4.6s ease-in-out infinite;
}

@keyframes floatHeroImage {
  0%, 100% {
    transform: translateY(0);
    filter: drop-shadow(0 16px 32px rgba(23, 23, 23, 0.12)) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.05));
  }
  50% {
    transform: translateY(-14px);
    filter: drop-shadow(0 28px 48px rgba(23, 23, 23, 0.2)) drop-shadow(0 8px 16px rgba(0, 0, 0, 0.08));
  }
}

.visual-frame {
  position: relative;
  background: var(--c-surface-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  cursor: grab;
  cursor: -webkit-grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  will-change: transform;
  transform-style: preserve-3d;
  perspective: 1200px;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.visual-frame:active {
  cursor: grabbing;
  cursor: -webkit-grabbing;
}

.visual-frame.is-dragging {
  cursor: grabbing !important;
  cursor: -webkit-grabbing !important;
  z-index: 50 !important;
  transition: none !important;
  box-shadow: 0 28px 60px rgba(23, 23, 23, 0.25) !important;
}

.visual-frame img,
.visual-frame .frame-bar {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.visual-frame .dot-btn {
  pointer-events: auto;
}

.visual-frame:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
}

.frame-bar {
  height: 32px;
  background: var(--c-surface-alt);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  position: relative;
}

.frame-title-text {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: var(--c-slate);
  margin-left: 8px;
  letter-spacing: -0.01em;
  opacity: 0.75;
  transition: color 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visual-frame.snake-active .frame-title-text {
  color: #27C93F;
  opacity: 1;
  font-weight: 700;
}

/* 3D Morph & Flip Transitions */
.visual-frame.snake-flipping-in {
  animation: snakeFlipIn 0.85s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
}

.visual-frame.snake-flipping-out {
  animation: snakeFlipOut 0.75s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
}

.visual-frame.is-spinning-360 {
  animation: smooth360Spin 0.75s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
}

@keyframes snakeFlipIn {
  0% {
    transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) perspective(1200px) rotateY(0deg) scale(1);
    box-shadow: var(--shadow-card);
    filter: brightness(1);
  }
  48% {
    transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) perspective(1200px) rotateY(90deg) scale(1.06);
    box-shadow: 0 32px 70px rgba(0, 0, 0, 0.35);
    filter: brightness(1.15);
  }
  52% {
    transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) perspective(1200px) rotateY(-90deg) scale(1.06);
    box-shadow: 0 32px 70px rgba(0, 0, 0, 0.35);
    filter: brightness(1.15);
  }
  100% {
    transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) perspective(1200px) rotateY(0deg) scale(1);
    box-shadow: var(--shadow-card);
    filter: brightness(1);
  }
}

@keyframes snakeFlipOut {
  0% {
    transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) perspective(1200px) rotateY(0deg) scale(1);
    box-shadow: var(--shadow-card);
    filter: brightness(1);
  }
  48% {
    transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) perspective(1200px) rotateY(-90deg) scale(1.05);
    box-shadow: 0 32px 70px rgba(0, 0, 0, 0.35);
    filter: brightness(1.15);
  }
  52% {
    transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) perspective(1200px) rotateY(90deg) scale(1.05);
    box-shadow: 0 32px 70px rgba(0, 0, 0, 0.35);
    filter: brightness(1.15);
  }
  100% {
    transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) perspective(1200px) rotateY(0deg) scale(1);
    box-shadow: var(--shadow-card);
    filter: brightness(1);
  }
}

@keyframes smooth360Spin {
  0% {
    transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) rotate(0deg) scale(1);
  }
  50% {
    transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) rotate(180deg) scale(1.05);
  }
  100% {
    transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) rotate(360deg) scale(1);
  }
}

.dot-btn {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot-btn.red { background: #FF5F56; }
.dot-btn.yellow { background: #FFBD2E; }
.dot-btn.green { background: #27C93F; }

.frame-image-wrapper {
  position: relative;
  overflow: hidden;
  background: #0D1117;
}

.hero-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  transition: opacity 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.35s ease, transform var(--transition-slow);
}

.visual-frame.snake-active .hero-img {
  opacity: 0;
  filter: blur(8px);
  pointer-events: none;
}

.visual-frame:hover .hero-img {
  transform: scale(1.03);
}

/* ==========================================================================
   Easter Egg: Retro Snake Game Overlay
   ========================================================================== */
.snake-overlay {
  position: absolute;
  inset: 0;
  background: #0D1117;
  display: flex;
  flex-direction: column;
  z-index: 20;
  color: #FFFFFF;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform: scale(0.96);
}

.snake-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
  animation: crtPowerOn 0.45s ease-out;
}

@keyframes crtPowerOn {
  0% {
    opacity: 0.3;
    filter: brightness(2) contrast(1.4);
  }
  100% {
    opacity: 1;
    filter: brightness(1) contrast(1);
  }
}

.snake-header {
  height: 34px;
  background: #161B22;
  border-bottom: 1px solid #30363D;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 0.74rem;
  flex-shrink: 0;
}

.snake-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.snake-title {
  color: #27C93F;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.snake-score strong,
.snake-high strong {
  color: #FFFFFF;
}

.snake-close-btn {
  background: transparent;
  color: #8B949E;
  border: 1px solid #30363D;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  pointer-events: auto;
}

.snake-close-btn:hover {
  background: #FF5F56;
  border-color: #FF5F56;
  color: #FFFFFF;
}

.snake-canvas-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #161B22 0%, #0D1117 100%);
  overflow: hidden;
  padding: 8px;
}

#snakeCanvas {
  display: block;
  background: #0A0D12;
  border: 1px solid #21262D;
  border-radius: 4px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8), 0 0 12px rgba(39, 201, 63, 0.12);
  width: 100%;
  height: 100%;
  max-width: 440px;
  max-height: 280px;
  pointer-events: auto;
}

.snake-start-prompt {
  position: absolute;
  inset: 0;
  background: rgba(13, 17, 23, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.snake-start-prompt.is-hidden {
  opacity: 0;
}

.prompt-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #27C93F;
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(39, 201, 63, 0.5);
}

.prompt-sub {
  font-size: 0.74rem;
  color: #8B949E;
  animation: promptBlink 1.2s infinite ease-in-out;
}

@keyframes promptBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* On-Screen Touch Controls for Mobile/Tablets */
.snake-touch-controls {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: #161B22;
  border-top: 1px solid #30363D;
  flex-shrink: 0;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .snake-touch-controls {
    display: flex;
  }
}

.snake-touch-row {
  display: flex;
  gap: 12px;
}

.snake-touch-btn {
  width: 48px;
  height: 36px;
  background: #21262D;
  border: 1px solid #30363D;
  border-radius: 6px;
  color: #C9D1D9;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
}

.snake-touch-btn:active {
  background: #27C93F;
  color: #000000;
}

.visual-badge {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(23, 23, 23, 0.85);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.badge-accent {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #27C93F;
}

/* --------------------------------------------------------------------------
   5. Work Showcase Section (Matches Section 2 in User Mockup)
   -------------------------------------------------------------------------- */
.showcase-section {
  padding: 100px 0 110px;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  position: relative;
}

.section-header {
  max-width: 760px;
  margin: 0 auto 52px;
}

.section-kicker {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-mid-gray);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--c-noir);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 18px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--c-slate);
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   5. Featured Work Showcase (Bento Grid Architecture matching Reference)
   -------------------------------------------------------------------------- */
.showcase-section {
  padding: 100px 0 120px;
  background-color: var(--c-bg);
}

/* ==========================================================================
   5. Work Showcase Carousel (Desktop Browser Mockup matching Reference)
   ========================================================================== */
.showcase-carousel-wrapper {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Navigation Arrow Buttons */
.carousel-arrow {
  position: absolute;
  top: 38%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  color: var(--c-noir);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all var(--transition-fast);
  outline: none;
}

.carousel-arrow--prev {
  left: -26px;
}

.carousel-arrow--next {
  right: -26px;
}

.carousel-arrow:hover {
  background: var(--c-noir);
  color: #FFFFFF;
  border-color: var(--c-noir);
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 8px 24px rgba(23, 23, 23, 0.18);
}

.carousel-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

.carousel-arrow .arrow-icon {
  width: 24px;
  height: 24px;
  stroke-width: 2.5;
  transition: transform var(--transition-fast);
}

.carousel-arrow--prev:hover .arrow-icon {
  transform: translateX(-3px);
}

.carousel-arrow--next:hover .arrow-icon {
  transform: translateX(3px);
}

/* RTL Arrow Positions */
[dir="rtl"] .carousel-arrow--prev {
  left: auto;
  right: -26px;
}

[dir="rtl"] .carousel-arrow--next {
  right: auto;
  left: -26px;
}

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

[dir="rtl"] .carousel-arrow--prev:hover .arrow-icon {
  transform: scaleX(-1) translateX(-3px);
}

[dir="rtl"] .carousel-arrow--next:hover .arrow-icon {
  transform: scaleX(-1) translateX(3px);
}

/* Track Container */
.carousel-track-container {
  overflow: hidden;
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  border-radius: 16px;
  padding: 10px 4px 24px;
}

.carousel-track {
  display: flex;
  width: 100%;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}

/* Slide Base - Butter-smooth, zero glitching, no nested scale transforms */
.carousel-slide {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 0;
  opacity: 1;
  transform: none;
  transition: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.carousel-slide.active {
  opacity: 1;
  transform: none;
}

/* Desktop Browser Mockup Window (Matching Reference Image) */
.browser-mockup {
  background: var(--c-surface-card);
  border-radius: 14px;
  box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.12), 0 8px 24px -8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  border: 1px solid var(--c-border);
  transition: box-shadow var(--transition-smooth);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}

.browser-mockup:hover {
  box-shadow: 0 28px 64px -14px rgba(0, 0, 0, 0.16), 0 12px 28px -8px rgba(0, 0, 0, 0.08);
}

/* Window Top Chrome Bar */
.browser-top-bar {
  height: 42px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  user-select: none;
}

.browser-dots {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 70px;
}

.browser-dots .dot-btn {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.browser-dots .dot-btn.red { background: #FF5F56; }
.browser-dots .dot-btn.yellow { background: #FFBD2E; }
.browser-dots .dot-btn.green { background: #27C93F; }

/* Address Bar / Title Badge */
.browser-address-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--c-surface-alt);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  color: var(--c-slate);
  letter-spacing: -0.01em;
}

.browser-address-bar .lock-icon {
  width: 11px;
  height: 11px;
  opacity: 0.7;
}

/* Top-Right Menu Dots */
.browser-options {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 70px;
}

.browser-options .menu-dots {
  font-size: 1.1rem;
  letter-spacing: 2px;
  color: #9CA3AF;
  line-height: 1;
}

/* Screen Viewport */
.browser-screen {
  position: relative;
  width: 100%;
  height: 480px;
  background: #0D1117;
  overflow: hidden;
}

.browser-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.browser-mockup:hover .browser-img {
  transform: scale(1.025);
}

/* Hover Overlay on Image */
.preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 18, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity var(--transition-smooth);
  z-index: 5;
}

.browser-mockup:hover .preview-overlay {
  opacity: 1;
}

.btn-preview-modal,
.btn-preview-link {
  padding: 9px 18px;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-preview-modal {
  background: #FFFFFF;
  color: var(--c-noir);
  border: none;
}

.btn-preview-modal:hover {
  background: #F0F0F0;
  transform: translateY(-2px);
}

.btn-preview-link {
  background: transparent;
  color: #FFFFFF;
  border: 1.5px solid #FFFFFF;
}

.btn-preview-link:hover {
  background: #FFFFFF;
  color: var(--c-noir);
  transform: translateY(-2px);
}

/* Project Info Below Mockup Screen */
.slide-project-info {
  padding: 24px 30px;
  background: var(--c-surface-card);
  border-top: 1px solid var(--c-border);
}

/* Pagination Dots (Matching Reference Image) */
.carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 30px auto 0;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D1D5DB;
  border: none;
  outline: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.carousel-dot:hover {
  background: var(--c-slate);
}

.carousel-dot.active {
  width: 24px;
  border-radius: 12px;
  background: var(--c-noir);
}

/* Card Body Content Layout */
.card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--c-surface-card);
}

/* Feature Badges & Tags above Title (matching reference) */
.card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.feature-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--c-slate);
  background: var(--c-surface-alt);
  border: none;
  outline: none;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.feature-badge.badge--label {
  background: var(--c-noir);
  color: #FFFFFF;
  border: none;
}

.feature-badge.badge--category {
  background: #EAEAEA;
  color: var(--c-noir);
  border: none;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-noir);
  letter-spacing: -0.02em;
  line-height: 1.28;
  margin-bottom: 10px;
}

.card-summary {
  font-size: 0.88rem;
  color: var(--c-slate);
  line-height: 1.55;
  margin-bottom: 18px;
  flex-grow: 1;
}

/* Card Bottom Actions - Clean link matching "VIEW PROJECT ↗" */
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 6px;
}

.btn-card-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--c-noir);
  background: transparent;
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  padding: 0;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.btn-card-primary:hover {
  color: var(--c-charcoal);
  background: transparent;
  transform: none;
}

.action-arrow {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.btn-card-primary:hover .action-arrow {
  transform: translate(3px, -3px);
}

[dir="rtl"] .btn-card-primary:hover .action-arrow {
  transform: translate(-3px, -3px) scaleX(-1);
}

.btn-card-secondary {
  padding: 6px 14px;
  background: var(--c-surface-alt);
  color: var(--c-noir);
  border: none;
  outline: none;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-card-secondary:hover {
  background: var(--c-noir);
  color: #FFFFFF;
  border: none;
  outline: none;
}

/* --------------------------------------------------------------------------
   6. Skills, Tools & Stack Section (About Us - Noir Chic Monochrome)
   -------------------------------------------------------------------------- */
.about-skills-section {
  padding: 100px 0 115px;
  background-color: var(--c-surface);
  color: var(--c-charcoal);
  position: relative;
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
}

.skills-header {
  margin-bottom: 56px;
}

.skills-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--c-slate);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 18px;
}

.skills-kicker::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 2px;
  background-color: var(--c-noir);
}

.skills-title {
  font-family: var(--font-heading);
  font-size: clamp(2.3rem, 4.5vw, 3.4rem);
  font-weight: 800;
  color: var(--c-noir);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 18px;
}

.skills-subtitle {
  font-size: 1.05rem;
  color: var(--c-slate);
  max-width: 620px;
  line-height: 1.65;
}

/* Skills 2-Column Grid */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  margin-bottom: 60px;
}

.skills-col-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--c-noir);
  letter-spacing: -0.01em;
  margin-bottom: 34px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--c-border);
}

.skill-item {
  margin-bottom: 28px;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.skill-name {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--c-charcoal);
  letter-spacing: -0.01em;
}

.skill-pct {
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace, var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--c-slate);
}

.skill-track {
  width: 100%;
  height: 2px;
  background-color: var(--c-border);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.skill-fill {
  height: 100%;
  background: var(--c-noir);
  border-radius: 2px;
  width: 0;
  transition: width 1.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Tech Stack & Badges Container */
.tech-stack-wrap {
  margin-top: 20px;
  padding-top: 48px;
  border-top: 1px solid var(--c-border);
}

.tech-stack-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--c-noir);
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.tech-badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background-color: var(--c-surface-alt);
  border: none;
  outline: none;
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  color: var(--c-charcoal);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: none;
  transition: all var(--transition-smooth);
  user-select: none;
}

.tech-badge:hover {
  background-color: var(--c-noir);
  border: none;
  outline: none;
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(23, 23, 23, 0.14);
}

.tech-badge-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
  filter: grayscale(100%);
}

.tech-badge-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* RTL Support for Skills & Tools */
[dir="rtl"] .skills-kicker::before {
  display: none;
}
[dir="rtl"] .skills-kicker::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 2px;
  background-color: var(--c-noir);
}
[dir="rtl"] .skills-header,
[dir="rtl"] .skills-grid,
[dir="rtl"] .tech-stack-wrap {
  text-align: right;
}

/* Responsive */
@media (max-width: 860px) {
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }
}

/* --------------------------------------------------------------------------
   7. Contact Section (Matches Section 3 in User Mockup)
   -------------------------------------------------------------------------- */
.contact-section {
  padding: 100px 0 120px;
  background: var(--c-bg);
  border-top: 1px solid var(--c-border);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.contact-info-col {
  display: flex;
  flex-direction: column;
}

.contact-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.8vw, 2.8rem);
  font-weight: 800;
  color: var(--c-noir);
  letter-spacing: -0.03em;
  line-height: 1.18;
  margin-bottom: 18px;
}

.contact-lead {
  font-size: 1.05rem;
  color: var(--c-slate);
  line-height: 1.65;
  margin-bottom: 36px;
}

/* Direct Contact List (numbers, email, office directly from mockup) */
.contact-direct-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.direct-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.direct-label {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-noir);
  text-transform: lowercase;
  letter-spacing: -0.02em;
}

.direct-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-charcoal);
  transition: color var(--transition-fast);
}

a.direct-value:hover {
  color: var(--c-noir);
  text-decoration: underline;
}

.direct-sub {
  font-size: 0.85rem;
  color: var(--c-slate);
}

/* Inquiry Form */
.form-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 36px 32px;
  box-shadow: var(--shadow-subtle);
}

.form-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--c-noir);
  margin-bottom: 6px;
}

.form-desc {
  font-size: 0.92rem;
  color: var(--c-slate);
  margin-bottom: 24px;
}

.inquiry-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-charcoal);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  color: var(--c-charcoal);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--c-noir);
  box-shadow: 0 0 0 3px rgba(23, 23, 23, 0.08);
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--c-noir);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 6px;
}

.btn-submit:hover {
  background: var(--c-charcoal);
  transform: translateY(-1px);
}

.submit-icon {
  width: 16px;
  height: 16px;
}

.form-feedback {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  display: none;
}

.form-feedback.success {
  display: block;
  background: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #C8E6C9;
}

.form-feedback.error {
  display: block;
  background: #FFEBEE;
  color: #C62828;
  border: 1px solid #FFCDD2;
}

/* --------------------------------------------------------------------------
   9. Footer (Matches Bottom Bar in User Mockup)
   -------------------------------------------------------------------------- */
.site-footer {
  background: #FFFFFF;
  border-top: 1px solid var(--c-border);
  padding: 70px 0 36px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 50px;
}

.footer-brand {
  max-width: 380px;
}

.footer-tagline {
  font-size: 0.92rem;
  color: var(--c-slate);
  margin-top: 12px;
  line-height: 1.6;
}

.footer-nav-groups {
  display: flex;
  gap: 60px;
}

.footer-nav-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--c-noir);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-link-list a {
  font-size: 0.9rem;
  color: var(--c-slate);
}

.footer-link-list a:hover {
  color: var(--c-noir);
}

.footer-bottom {
  padding-top: 30px;
  border-top: 1px solid var(--c-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--c-mid-gray);
}

.footer-palette-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.palette-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.palette-swatch.s1 { background: #171717; }
.palette-swatch.s2 { background: #343434; }
.palette-swatch.s3 { background: #515151; }
.palette-swatch.s4 { background: #8C8C8C; }
.palette-swatch.s5 { background: #B6B6B6; }

.palette-swatch-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-slate);
  margin-left: 6px;
}

/* --------------------------------------------------------------------------
   10. Interactive Live Preview Modal (Device Viewport Switcher)
   -------------------------------------------------------------------------- */
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.preview-modal.is-active {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 23, 23, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-window {
  position: relative;
  width: 95vw;
  max-width: 1320px;
  height: 90vh;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2;
  transform: scale(0.96);
  transition: transform var(--transition-smooth);
}

.preview-modal.is-active .modal-window {
  transform: scale(1);
}

/* Modal Top Bar */
.modal-header {
  height: 54px;
  background: var(--c-noir);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 16px;
  flex-shrink: 0;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.modal-live-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #27C93F;
  flex-shrink: 0;
  box-shadow: 0 0 8px #27C93F;
}

.modal-site-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-url-badge {
  font-size: 0.72rem;
  font-family: monospace;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--c-light-gray);
  white-space: nowrap;
}

/* Device Viewport Switcher */
.viewport-switchers {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.1);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.viewport-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: transparent;
  color: var(--c-light-gray);
  border: none;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.viewport-btn svg {
  width: 14px;
  height: 14px;
}

.viewport-btn:hover {
  color: #FFFFFF;
}

.viewport-btn.active {
  background: #FFFFFF;
  color: var(--c-noir);
}

/* Modal Actions */
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-modal-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #FFFFFF;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.btn-modal-action:hover {
  background: rgba(255, 255, 255, 0.22);
}

.btn-modal-action svg {
  width: 13px;
  height: 13px;
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: #FFFFFF;
  padding: 6px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.btn-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-modal-close svg {
  width: 18px;
  height: 18px;
}

/* Modal Iframe Container */
.modal-iframe-container {
  flex-grow: 1;
  background: #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.iframe-loader {
  position: absolute;
  inset: 0;
  background: var(--c-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--c-slate);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 5;
  transition: opacity 0.25s ease;
}

.loader-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-noir);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.modal-iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #FFFFFF;
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.4);
}

/* --------------------------------------------------------------------------
   11. Back to Top Button
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-noir);
  color: #FFFFFF;
  border: none;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--transition-smooth), transform var(--transition-smooth), background var(--transition-fast);
  z-index: 90;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--c-charcoal);
  transform: translateY(-2px);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* --------------------------------------------------------------------------
   12. Responsive Design (Tablets & Mobile)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-visual {
    max-width: 580px;
    margin: 0 auto;
  }

  .carousel-arrow--prev {
    left: 8px;
  }

  .carousel-arrow--next {
    right: 8px;
  }

  [dir="rtl"] .carousel-arrow--prev {
    right: 8px;
    left: auto;
  }

  [dir="rtl"] .carousel-arrow--next {
    left: 8px;
    right: auto;
  }

  .carousel-track-container {
    max-width: 92%;
  }

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

  .process-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

@media (max-width: 768px) {
  .site-header {
    height: 70px;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: #FFFFFF;
    border-bottom: 1px solid var(--c-border);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    box-shadow: var(--shadow-card);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition-smooth), opacity var(--transition-smooth);
  }

  .nav-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-only-link {
    display: inline-block;
  }

  .hero-section {
    padding: 110px 0 60px;
  }

  .showcase-carousel-wrapper {
    padding: 0 4px;
  }

  .carousel-arrow {
    width: 44px;
    height: 44px;
    top: 30%;
  }

  .carousel-arrow .arrow-icon {
    width: 20px;
    height: 20px;
  }

  .carousel-arrow--prev {
    left: 4px;
  }

  .carousel-arrow--next {
    right: 4px;
  }

  [dir="rtl"] .carousel-arrow--prev {
    right: 4px;
    left: auto;
  }

  [dir="rtl"] .carousel-arrow--next {
    left: 4px;
    right: auto;
  }

  .browser-screen {
    height: 320px;
  }

  .browser-top-bar {
    height: 38px;
    padding: 0 12px;
  }

  .browser-dots {
    width: 48px;
    gap: 5px;
  }

  .browser-dots .dot-btn {
    width: 8px;
    height: 8px;
  }

  .browser-address-bar {
    font-size: 0.68rem;
    padding: 3px 10px;
  }

  .slide-project-info {
    padding: 18px 20px;
  }

  .card-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .btn-card-primary {
    justify-content: center;
  }

  .btn-card-secondary {
    text-align: center;
  }

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

  .footer-top {
    flex-direction: column;
    gap: 36px;
  }

  .footer-nav-groups {
    gap: 40px;
  }

  .footer-bottom {
    text-align: center;
    justify-content: center;
  }

  .viewport-switchers {
    display: none;
  }
}

@media (max-width: 480px) {
  .browser-screen {
    height: 240px;
  }

  .hero-title {
    font-size: 2.4rem;
  }

  .hero-lead {
    font-size: 1.1rem;
  }

  .form-card {
    padding: 24px 18px;
  }

  .footer-nav-groups {
    flex-direction: column;
    gap: 24px;
  }

  .btn-contact-box {
    display: none;
  }

  .lang-btn {
    padding: 4px 8px;
    font-size: 0.74rem;
  }
}

/* --------------------------------------------------------------------------
   12. Toast Notification System
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--c-noir);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(23, 23, 23, 0.22);
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
}

.toast-item.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
}

/* --------------------------------------------------------------------------
   13. Right-to-Left (RTL) Layout & Arabic Typography
   -------------------------------------------------------------------------- */
[dir="rtl"] {
  font-family: 'Cairo', var(--font-body);
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6,
[dir="rtl"] .hero-title,
[dir="rtl"] .section-title,
[dir="rtl"] .section-kicker,
[dir="rtl"] .hero-kicker,
[dir="rtl"] .card-title,
[dir="rtl"] .service-title,
[dir="rtl"] .btn-primary-pill,
[dir="rtl"] .btn-contact-box,
[dir="rtl"] .btn-card-primary,
[dir="rtl"] .btn-card-secondary,
[dir="rtl"] .filter-btn,
[dir="rtl"] .btn-submit,
[dir="rtl"] .example-label,
[dir="rtl"] .project-tag,
[dir="rtl"] .feature-badge {
  font-family: 'Cairo', var(--font-heading);
  letter-spacing: normal !important;
}

/* Header & Nav in RTL */
[dir="rtl"] .brand-logo,
[dir="rtl"] .logo {
  direction: ltr;
  text-align: left;
}

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

/* Hero Section in RTL */
[dir="rtl"] .hero-content {
  text-align: right;
}

[dir="rtl"] .hero-contact-card {
  padding-left: 0;
  padding-right: 4px;
}

[dir="rtl"] .contact-item:hover {
  transform: translateX(-3px);
}

[dir="rtl"] .visual-badge {
  right: auto;
  left: 14px;
}

/* About / Services in RTL */
[dir="rtl"] .service-card {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .service-icon-box {
  margin-left: 0;
  margin-right: 0;
  align-self: flex-start;
}

[dir="rtl"] .service-desc {
  text-align: right;
  line-height: 1.7;
}

[dir="rtl"] .service-list li {
  padding-left: 0;
  padding-right: 18px;
  text-align: right;
  line-height: 1.6;
}

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

/* Showcase & Cards in RTL */
[dir="rtl"] .card-body {
  text-align: right;
}

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

[dir="rtl"] .btn-card-primary:hover .action-arrow {
  transform: scaleX(-1) translate(-2px, -2px);
}

/* Contact Info & Inquiry Form in RTL */
[dir="rtl"] .contact-info-col {
  text-align: right;
}

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

[dir="rtl"] .form-input,
[dir="rtl"] .form-select,
[dir="rtl"] .form-textarea {
  text-align: right;
  direction: rtl;
}

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

[dir="rtl"] .btn-submit:hover .submit-icon {
  transform: scaleX(-1) translate(-3px, -3px);
}

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

/* Footer in RTL */
[dir="rtl"] .footer-brand {
  text-align: right;
}

[dir="rtl"] .footer-nav-col {
  text-align: right;
}

[dir="rtl"] .palette-swatch-name {
  margin-left: 0;
  margin-right: 6px;
}

/* Back to Top & Toast in RTL */
[dir="rtl"] .back-to-top {
  right: auto;
  left: 28px;
}

[dir="rtl"] .toast-container {
  right: auto;
  left: 24px;
}

/* Preview Modal in RTL */
[dir="rtl"] .modal-header {
  direction: rtl;
}

[dir="rtl"] .modal-actions {
  margin-left: 0;
  margin-right: auto;
}

/* Mobile Responsiveness for RTL */
@media (max-width: 768px) {
  [dir="rtl"] .nav-menu {
    left: auto;
    right: 0;
    text-align: right;
  }
}

/* ==========================================================================
   Scroll-Driven Pop-up Reveal Animations
   ========================================================================== */
.reveal-card {
  opacity: 0;
  transform: translateY(40px) scale(0.97);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-card.is-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Reveal for showcase carousel */
.showcase-carousel-wrapper.reveal-card { transition-delay: 0.1s; }

/* Staggered skills columns in about section */
.skills-grid .skills-col:nth-child(1).reveal-card { transition-delay: 0.08s; }
.skills-grid .skills-col:nth-child(2).reveal-card { transition-delay: 0.18s; }
.tech-stack-wrap.reveal-card { transition-delay: 0.12s; }

@media (prefers-reduced-motion: reduce) {
  .reveal-card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}


