@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   CSS Variables & Design Tokens (Monochromatic High-Contrast System)
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg-canvas: #0a0a0a;
  --bg-surface: #141414;
  --bg-surface-hover: #1c1c1c;
  --bg-surface-active: #242424;
  --border-subtle: #262626;
  --border-strong: #404040;
  --border-focus: #737373;
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --badge-bg: #181818;
  --badge-border: #2c2c2c;
  --badge-text: #d4d4d4;
  --btn-primary-bg: #f5f5f5;
  --btn-primary-text: #0a0a0a;
  --btn-secondary-bg: #161616;
  --btn-secondary-hover: #222222;
  --btn-secondary-text: #e5e5e5;
  --timeline-line: #262626;
  --timeline-dot: #525252;
  --timeline-dot-active: #f5f5f5;
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --font-family-en: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-ar: 'Cairo', 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Fluid Spacing & Dimensions */
  --space-page-x: clamp(1rem, 4vw, 2.25rem);
  --space-page-y: clamp(2rem, 5vw, 4rem);
  --space-section-gap: clamp(2.5rem, 5.5vw, 3.75rem);
  --space-card-padding: clamp(1rem, 3.5vw, 1.5rem);
  --avatar-size: clamp(88px, 15vw, 128px);
  --project-card-carousel-h: clamp(170px, 26vw, 220px);
  --project-detail-carousel-h: clamp(260px, 42vw, 390px);
  --project-logo-size: clamp(40px, 7vw, 48px);
  --detail-logo-size: clamp(54px, 9vw, 72px);
}

[data-theme="light"] {
  --bg-canvas: #ffffff;
  --bg-surface: #fafafa;
  --bg-surface-hover: #f0f0f0;
  --bg-surface-active: #e6e6e6;
  --border-subtle: #eaeaea;
  --border-strong: #d4d4d4;
  --border-focus: #888888;
  --text-primary: #111111;
  --text-secondary: #525252;
  --text-muted: #888888;
  --badge-bg: #f2f2f2;
  --badge-border: #e0e0e0;
  --badge-text: #2c2c2c;
  --btn-primary-bg: #111111;
  --btn-primary-text: #ffffff;
  --btn-secondary-bg: #f6f6f6;
  --btn-secondary-hover: #ececec;
  --btn-secondary-text: #1a1a1a;
  --timeline-line: #eaeaea;
  --timeline-dot: #b8b8b8;
  --timeline-dot-active: #111111;
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Base & Reset Styles
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-family-en);
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* RTL / Arabic Font Switching */
[dir="rtl"],
[lang="ar"],
body.rtl {
  font-family: var(--font-family-ar);
}

body {
  min-height: 100vh;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

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

/* ==========================================================================
   Layout Containers
   ========================================================================== */

.app-container {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding-inline: var(--space-page-x);
  padding-block: var(--space-page-y);
  display: flex;
  flex-direction: column;
  gap: var(--space-section-gap);
  padding-bottom: calc(var(--space-page-y) + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 1200px) {
  .app-container {
    max-width: 880px;
  }
}

/* ==========================================================================
   Top Bar (Theme & Language Switchers)
   ========================================================================== */

.top-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
}

.toggle-group {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 0.2rem;
  gap: 0.2rem;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s ease;
  user-select: none;
}

.toggle-pill:hover {
  color: var(--text-primary);
}

.toggle-pill.active {
  background-color: var(--bg-surface-active);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

/* ==========================================================================
   Hero / Header Section
   ========================================================================== */

.hero-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

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

.hero-header-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

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

.profile-avatar {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 2px solid var(--border-subtle);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  background-color: var(--bg-surface);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.profile-avatar:hover {
  transform: scale(1.03);
  border-color: var(--border-strong);
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hero-name {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.2;
}

.hero-title {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 500;
  color: var(--text-secondary);
}

.hero-bio {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: start;
}

/* ==========================================================================
   Action Chips / Contact Links
   ========================================================================== */

.action-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.action-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.action-chip:hover {
  transform: translateY(-2px);
  background-color: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.action-chip svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.action-chip-primary {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-bg);
  font-weight: 600;
}

.action-chip-primary:hover {
  background-color: var(--btn-primary-bg);
  opacity: 0.9;
  transform: translateY(-2px);
  border-color: var(--btn-primary-bg);
}

/* ==========================================================================
   Section Dividers & Titles
   ========================================================================== */

.section-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title::after {
  content: "";
  height: 1px;
  flex-grow: 1;
  background-color: var(--border-subtle);
}

/* ==========================================================================
   Company-Separated Experience Section
   ========================================================================== */

.experience-companies-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.company-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: var(--space-card-padding);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
}

.company-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.company-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
}

.company-name-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.company-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background-color: var(--bg-surface-active);
  color: var(--text-primary);
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.company-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.company-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin: 0;
}

.company-positions-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

/* Connecting track when multiple positions in the same company */
.company-positions-list.has-multiple-positions {
  padding-inline-start: 1.25rem;
  border-inline-start: 2px solid var(--border-subtle);
  margin-inline-start: 0.5rem;
}

.position-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.has-multiple-positions .position-item::before {
  content: "";
  position: absolute;
  inset-inline-start: -1.62rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--timeline-dot);
  border: 2px solid var(--bg-surface);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.has-multiple-positions .position-item:hover::before {
  background-color: var(--timeline-dot-active);
  transform: scale(1.3);
}

.position-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

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

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

.position-period {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 500;
}

.position-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.725rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.type-full-time {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.type-part-time {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.position-achievements {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0;
  margin: 0;
}

.position-achievements li {
  position: relative;
  padding-inline-start: 1.15rem;
  font-size: 0.915rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.position-achievements li::before {
  content: "•";
  position: absolute;
  inset-inline-start: 0;
  color: var(--text-muted);
  font-weight: bold;
}

/* ==========================================================================
   Experience Section (Legacy Timeline)
   ========================================================================== */

.experience-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-inline-start: 1.5rem;
  border-inline-start: 1px solid var(--timeline-line);
  margin-inline-start: 0.5rem;
  gap: 2rem;
}

.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.timeline-dot {
  position: absolute;
  inset-inline-start: -1.82rem;
  top: 0.35rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--timeline-dot);
  border: 2px solid var(--bg-canvas);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.timeline-item:hover .timeline-dot {
  background-color: var(--timeline-dot-active);
  transform: scale(1.3);
}

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

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

.timeline-company {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-body {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-achievements {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.timeline-achievements li {
  position: relative;
  padding-inline-start: 1.1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.timeline-achievements li::before {
  content: "•";
  position: absolute;
  inset-inline-start: 0;
  color: var(--text-muted);
}

/* ==========================================================================
   Education Section
   ========================================================================== */

.education-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.education-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: var(--space-card-padding);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.education-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.education-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.education-degree-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.education-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background-color: var(--bg-surface-active);
  color: var(--text-primary);
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.education-icon svg {
  width: 20px;
  height: 20px;
}

.education-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.education-degree {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin: 0;
}

.education-institution {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

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

.education-period-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.775rem;
  font-weight: 600;
  background-color: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
}

.education-location-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.775rem;
  font-weight: 500;
  background-color: var(--bg-surface-active);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* ==========================================================================
   Tools, Frameworks & Languages (Skill Cloud)
   ========================================================================== */

.skills-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.skill-category-title {
  font-size: 0.825rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  background-color: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: 6px;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--badge-text);
  transition: border-color 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
  user-select: none;
}

.skill-tag:hover {
  border-color: var(--border-strong);
  background-color: var(--bg-surface-hover);
  transform: translateY(-1px);
}

/* ==========================================================================
   Featured Projects Section & Cards
   ========================================================================== */

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

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}

.project-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  text-decoration: none;
  cursor: pointer;
  border-radius: inherit;
}

.project-cover-container {
  display: block;
  text-decoration: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-surface-active);
  position: relative;
  z-index: 2;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

.project-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .project-cover,
.project-card:focus-within .project-cover {
  transform: scale(1.02);
}

.project-screenshots-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  background-color: var(--bg-surface-active);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  padding: 0.85rem 0.85rem;
}

.project-screenshots-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.project-screenshots-scroll::-webkit-scrollbar {
  height: 6px;
}

.project-screenshots-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.project-screenshots-scroll::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: 9999px;
}

.project-screenshot-item {
  display: block;
  text-decoration: none;
  cursor: pointer;
  flex: 0 0 auto;
  scroll-snap-align: start;
  height: var(--project-card-carousel-h);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.project-screenshot-item:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--border-strong);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.project-screenshot-img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: cover;
}

.project-info {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  gap: 0.85rem;
  flex-grow: 1;
}

.project-header-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.project-app-logo {
  width: var(--project-logo-size);
  height: var(--project-logo-size);
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

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

.project-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.project-title-link {
  color: inherit;
  text-decoration: none;
  position: relative;
  z-index: 2;
  transition: color 0.15s ease;
}

.project-title-link:hover,
.project-card:hover .project-title-link {
  color: var(--primary);
}

.project-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.4;
}

.project-description {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

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

.project-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background-color: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: 4px;
  color: var(--badge-text);
  font-weight: 500;
}

.project-actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background-color: var(--btn-secondary-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--btn-secondary-text);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.action-btn:hover {
  background-color: var(--btn-secondary-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

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

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  position: relative;
  z-index: 2;
}

.project-details-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.project-card:hover .project-details-link,
.project-details-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-hover);
}

.project-details-link:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.project-details-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.project-card:hover .project-details-icon,
.project-details-link:hover .project-details-icon {
  transform: translateX(3px);
}

[dir="rtl"] .project-card:hover .project-details-icon,
[dir="rtl"] .project-details-link:hover .project-details-icon {
  transform: translateX(-3px);
}

/* ==========================================================================
   Project Detail Page
   ========================================================================== */

.detail-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.back-btn:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-strong);
  transform: translateX(-2px);
}

[dir="rtl"] .back-btn:hover {
  transform: translateX(2px);
}

[dir="ltr"] .back-btn:hover {
  transform: translateX(-2px);
}

.detail-banner {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-active);
}

.detail-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-header {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-header-identity {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.detail-app-logo {
  width: var(--detail-logo-size);
  height: var(--detail-logo-size);
  border-radius: 16px;
  object-fit: cover;
  border: 1.5px solid var(--border-subtle);
  background-color: var(--bg-surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.detail-header-titles {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.detail-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.2;
}

.detail-tagline {
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.detail-screenshots-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.detail-screenshots-scroll::-webkit-scrollbar {
  height: 6px;
}

.detail-screenshots-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.detail-screenshots-scroll::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: 9999px;
}

.detail-screenshot-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  height: var(--project-detail-carousel-h);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-active);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  cursor: zoom-in;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.detail-screenshot-item:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--border-strong);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.detail-screenshot-img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: cover;
}

/* Lightbox Modal */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: lightboxFadeIn 0.2s ease;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-close-btn {
  position: absolute;
  top: -2.75rem;
  inset-inline-end: 0;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

@keyframes lightboxFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

.detail-section-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.detail-section-text {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.detail-role-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0;
  padding-inline-start: 0;
}

.detail-role-list li {
  position: relative;
  padding-inline-start: 1.25rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.detail-role-list li::before {
  content: "•";
  position: absolute;
  inset-inline-start: 0;
  color: var(--text-muted);
  font-weight: bold;
}

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

/* ==========================================================================
   Contact Me Form Section
   ========================================================================== */

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: var(--space-card-padding);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-card:hover {
  border-color: var(--border-strong);
}

.contact-description {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.contact-form-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 110px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.contact-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(115, 115, 115, 0.15);
}

.contact-textarea.has-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.contact-error-text {
  font-size: 0.8rem;
  color: #ef4444;
  font-weight: 500;
}

.contact-email-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.contact-email-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(115, 115, 115, 0.15);
}

.contact-email-input.has-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.contact-actions-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.contact-buttons-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
}

.contact-whatsapp-btn,
.contact-email-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.75rem 1.6rem;
  min-width: 190px;
  border-radius: 8px;
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: 1px solid var(--btn-primary-bg);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.contact-whatsapp-btn:hover,
.contact-email-btn:hover {
  transform: translateY(-2px);
  opacity: 0.92;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.contact-whatsapp-btn:active,
.contact-email-btn:active {
  transform: translateY(0);
}

.contact-whatsapp-btn svg,
.contact-email-btn svg {
  flex-shrink: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.app-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ==========================================================================
   Responsive Architecture & Multi-Device Breakpoints
   Tier 1: Desktop / PC Enhancements (min-width: 1024px)
   Tier 2: Tablets Portrait & Intermediate (max-width: 840px)
   Tier 3: Standard Mobile (max-width: 640px)
   Tier 4: Compact Mobile (max-width: 480px)
   Tier 5: Micro Mobile (max-width: 360px)
   ========================================================================== */

/* --- Tier 1: Desktop / PC Enhancements (min-width: 1024px) --- */
@media (min-width: 1024px) {
  .hero-name {
    font-size: 2.25rem;
  }

  .detail-title {
    font-size: 2.5rem;
  }

  .project-screenshots-scroll::-webkit-scrollbar,
  .detail-screenshots-scroll::-webkit-scrollbar {
    height: 7px;
  }
}

/* --- Tier 2: Tablets Portrait & Intermediate Devices (max-width: 840px) --- */
@media (max-width: 840px) {
  .contact-actions-bar {
    justify-content: center;
    width: 100%;
  }

  .contact-buttons-group {
    justify-content: center;
    width: 100%;
  }

  .detail-actions-row {
    gap: 0.6rem;
  }
}

/* --- Tier 3: Standard Mobile (max-width: 640px) --- */
@media (max-width: 640px) {
  .hero-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.15rem;
  }

  .hero-meta {
    gap: 0.35rem;
  }

  .hero-name {
    font-size: clamp(1.65rem, 6.5vw, 2.1rem);
  }

  .hero-bio {
    font-size: 0.95rem;
    line-height: 1.65;
  }

  /* Experience Section Stacking */
  .position-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .position-meta {
    gap: 0.4rem;
  }

  .timeline-achievements li,
  .position-achievements li {
    font-size: 0.875rem;
    padding-inline-start: 1rem;
  }

  /* Education Section Stacking */
  .education-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .education-degree-group {
    width: 100%;
  }

  .education-meta {
    width: 100%;
    gap: 0.4rem;
  }

  /* Projects & Actions */
  .project-header-row {
    gap: 0.75rem;
  }

  .project-title {
    font-size: 1.1rem;
  }

  .project-tagline {
    font-size: 0.825rem;
  }

  .project-description {
    font-size: 0.875rem;
  }

  .project-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  /* Contact Section */
  .contact-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .contact-buttons-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .contact-whatsapp-btn,
  .contact-email-btn {
    width: 100%;
    min-width: 0;
    padding: 0.75rem 1.25rem;
  }

  /* Project Detail Page */
  .detail-header-identity {
    gap: 0.9rem;
  }

  .detail-title {
    font-size: clamp(1.5rem, 5.5vw, 2rem);
  }

  .detail-tagline {
    font-size: 0.95rem;
  }

  .detail-section-title {
    font-size: 1.05rem;
  }

  .detail-section-text {
    font-size: 0.925rem;
  }

  /* Lightbox Mobile Safety */
  .lightbox-overlay {
    padding: 1rem;
  }

  .lightbox-close-btn {
    position: fixed;
    top: max(0.85rem, env(safe-area-inset-top));
    inset-inline-end: 0.85rem;
    z-index: 1010;
    width: 42px;
    height: 42px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
  }

  .lightbox-img {
    max-height: 80vh;
    border-radius: 10px;
  }
}

/* --- Tier 4: Compact Mobile Screens (max-width: 480px) --- */
@media (max-width: 480px) {
  .project-actions,
  .detail-actions-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    width: 100%;
    gap: 0.5rem;
  }

  .action-btn {
    justify-content: center;
    padding: 0.45rem 0.65rem;
    font-size: 0.775rem;
  }

  .action-chips-container {
    gap: 0.5rem;
  }

  .action-chip {
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
  }

  .skill-tag {
    padding: 0.25rem 0.6rem;
    font-size: 0.775rem;
  }

  .detail-nav-row {
    gap: 0.5rem;
  }

  .back-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .toggle-pill {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }
}

/* --- Tier 5: Micro Mobile Devices (max-width: 360px) --- */
@media (max-width: 360px) {
  .project-actions,
  .detail-actions-row {
    grid-template-columns: 1fr;
  }
}