/* =========================================================================
   Ibrahim Abdullah — Curriculum Vitae
   Design Token System & Stylesheet
   Inspired by Apple HIG: generous whitespace, clear hierarchy, purposeful motion
   ========================================================================= */

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

:root {
  /* Surface */
  --surface-primary: #ffffff;
  --surface-secondary: #f5f5f7;
  --surface-tertiary: #fafafa;
  --surface-dark: #1d1d1f;
  --surface-card: #ffffff;

  /* Content */
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --text-inverse: #f5f5f7;

  /* Accent — derived from PIXEL brand red */
  --accent: #D92027;
  --accent-hover: #b81b21;
  --accent-subtle: rgba(217, 32, 39, 0.08);
  --accent-glow: rgba(217, 32, 39, 0.15);

  /* WhatsApp */
  --whatsapp: #25D366;
  --whatsapp-hover: #1ebe57;
  --whatsapp-dark: #075E54;
  --whatsapp-bubble: #DCF8C6;
  --whatsapp-bg: #E5DDD5;

  /* Utility */
  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.12);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-xl: 0 24px 60px rgba(0,0,0,0.10), 0 8px 20px rgba(0,0,0,0.06);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --space-3xl: 96px;
  --space-4xl: 128px;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  /* Transitions */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.35s;
  --duration-slow: 0.6s;

  /* Nav height */
  --nav-height: 64px;
}

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

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--surface-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden !important;
  touch-action: none;
}

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

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

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

/* ---- Utility ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-4xl) 0;
}

.section-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.section-title {
  font-family: var(--font-body);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  letter-spacing: -0.02em;
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background-color var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out);
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.05);
}

.nav.menu-open {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo-img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  transition: transform var(--duration-fast) var(--ease-spring);
}

.nav-logo:hover .nav-logo-img {
  transform: scale(1.08);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--duration-fast) var(--ease-out);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width var(--duration-normal) var(--ease-out);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  background: var(--accent) !important;
  color: var(--text-inverse) !important;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-weight: 600 !important;
  transition: background var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-spring) !important;
}

.nav-cta::after {
  display: none !important;
}

.nav-cta:hover {
  background: var(--accent-hover) !important;
  transform: scale(1.04);
}

/* ---- Apple HIG Segmented Language Control ---- */
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.lang-segmented-control {
  display: inline-flex;
  align-items: center;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
  position: relative;
  transition: all var(--duration-fast) var(--ease-out);
}

.nav.scrolled .lang-segmented-control {
  background: rgba(0, 0, 0, 0.05);
}

.lang-segment-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.2;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
  user-select: none;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.lang-segment-btn:hover {
  color: var(--text-primary);
}

.lang-segment-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.06);
}

.lang-segment-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 6px;
  z-index: 1001;
  border: none;
  background: transparent;
  outline: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle:focus {
  outline: none;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--duration-normal) var(--ease-out),
              opacity var(--duration-fast) var(--ease-out);
}

.nav-toggle.open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Hero ---- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-height) + var(--space-2xl)) var(--space-lg) var(--space-2xl);
  background: var(--surface-secondary);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0) scale(1); opacity: 0.4; }
  100% { transform: translate(-40px, 40px) scale(1.2); opacity: 0.7; }
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.hero-text {
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-md);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s var(--ease-out) 0.2s forwards;
}

.hero-title {
  font-family: var(--font-body);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s var(--ease-out) 0.35s forwards;
}

.hero-title-accent {
  color: var(--accent);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
}

.hero-subtitle {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s var(--ease-out) 0.5s forwards;
}

.hero-description {
  font-size: 1.0625rem;
  color: var(--text-tertiary);
  max-width: 460px;
  margin-bottom: var(--space-xl);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s var(--ease-out) 0.65s forwards;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s var(--ease-out) 0.8s forwards;
}

.hero-image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateX(40px);
  animation: fadeInRight 1s var(--ease-out) 0.4s forwards;
}

.hero-image-container {
  position: relative;
  width: 100%;
  max-width: 480px;
}

.hero-image {
  width: 100%;
  border-radius: var(--radius-xl);
  position: relative;
  z-index: 2;
}

.hero-image-accent {
  position: absolute;
  top: -12px;
  right: -12px;
  bottom: 12px;
  left: 12px;
  background: var(--accent);
  border-radius: var(--radius-xl);
  z-index: 1;
  opacity: 0.15;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  opacity: 0;
  animation: fadeIn 1s var(--ease-out) 1.5s forwards;
}

.hero-scroll-indicator span {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-tertiary), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50% { opacity: 0.3; transform: scaleY(0.6); }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 28px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(217, 32, 39, 0.25);
}

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

.btn-secondary:hover {
  border-color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: #fff;
}

.btn-whatsapp:hover {
  background: var(--whatsapp-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.3);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Scroll-reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- About Section ---- */
.about {
  background: var(--surface-primary);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.about-image-wrapper {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.about-image {
  width: 100%;
  transition: transform var(--duration-slow) var(--ease-out);
}

.about-image-wrapper:hover .about-image {
  transform: scale(1.03);
}

.about-body {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: var(--space-xl);
}

.about-body strong {
  color: var(--accent);
  font-weight: 700;
}

.about-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity var(--duration-fast);
}

.about-body a:hover {
  opacity: 0.8;
}

.about-stats {
  display: flex;
  gap: var(--space-xl);
}

.stat {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-suffix {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
  font-weight: 500;
}

/* ---- Skills Section ---- */
.skills {
  background: var(--surface-secondary);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.skill-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: transform var(--duration-normal) var(--ease-spring),
              box-shadow var(--duration-normal) var(--ease-out);
  border: 1px solid var(--border);
}

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.skill-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-md);
}

.skill-icon svg {
  width: 100%;
  height: 100%;
}

.skill-name {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

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

/* ---- Experience / Timeline ---- */
.experience {
  background: var(--surface-primary);
}

.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-xl);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -40px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-primary);
  border: 3px solid var(--accent);
  transition: background var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-spring);
  z-index: 1;
}

.timeline-item:hover .timeline-marker {
  background: var(--accent);
  transform: scale(1.25);
}

.timeline-content {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: box-shadow var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

.timeline-item:hover .timeline-content {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.timeline-date {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.timeline-role {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: var(--space-xs);
  color: var(--text-primary);
}

.timeline-company {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
}

.timeline-company a {
  color: var(--accent);
  font-weight: 600;
  transition: opacity var(--duration-fast);
}

.timeline-company a:hover {
  opacity: 0.8;
}

.timeline-desc {
  font-size: 0.9375rem;
  color: var(--text-tertiary);
  line-height: 1.65;
  margin-top: var(--space-sm);
}

/* ---- Languages Section ---- */
.languages {
  background: var(--surface-secondary);
}

.languages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  max-width: 700px;
}

.language-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1px solid var(--border);
  text-align: center;
  transition: transform var(--duration-normal) var(--ease-spring),
              box-shadow var(--duration-normal) var(--ease-out);
}

.language-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.language-flag {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--space-sm);
}

.language-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.language-level {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: var(--space-md);
  display: block;
}

.language-bar {
  width: 100%;
  height: 6px;
  background: var(--surface-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.language-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff6b6b);
  border-radius: var(--radius-full);
  width: 0;
  transition: width 1.2s var(--ease-out);
}

/* ---- Contact Section ---- */
.contact {
  background: var(--surface-primary);
}

.contact-info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  background: var(--surface-secondary);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
  border: 1px solid var(--border);
}

.contact-chip:hover {
  background: var(--accent-subtle);
  color: var(--accent);
  border-color: var(--accent);
}

.contact-chip svg {
  flex-shrink: 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-3xl);
}

.contact-form-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  transition: box-shadow var(--duration-normal) var(--ease-out);
}

.contact-form-card:hover {
  box-shadow: var(--shadow-lg);
}

.form-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.form-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.email-icon {
  background: var(--accent-subtle);
  color: var(--accent);
}

.whatsapp-icon {
  background: rgba(37, 211, 102, 0.1);
  color: var(--whatsapp);
}

.form-card-title {
  font-size: 1.125rem;
  font-weight: 700;
}

.form-card-subtitle {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* WhatsApp chat preview */
.whatsapp-chat {
  margin-bottom: var(--space-lg);
}

.whatsapp-chat-bg {
  background: var(--whatsapp-bg);
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c8c4b8' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  border-radius: var(--radius-md);
  padding: var(--space-md);
  min-height: 80px;
}

.whatsapp-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px 12px 12px 4px;
  font-size: 0.875rem;
  line-height: 1.5;
  position: relative;
}

.whatsapp-bubble-received {
  background: var(--surface-card);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.whatsapp-time {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  margin-top: 4px;
  text-align: right;
}

/* Form styles */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

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

.form-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  padding: 12px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--surface-secondary);
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
  outline: none;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-tertiary);
}

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

.whatsapp-card .form-group input:focus,
.whatsapp-card .form-group textarea:focus {
  border-color: var(--whatsapp);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12);
}

/* Social links */
.social-links {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
}

.social-link {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--surface-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--duration-fast) var(--ease-spring);
}

.social-link:hover {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 20px rgba(217, 32, 39, 0.2);
}

/* ---- Footer ---- */
.footer {
  background: var(--surface-dark);
  color: var(--text-inverse);
  padding: var(--space-xl) 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

.footer-brand {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

.footer-brand strong {
  color: var(--accent);
  font-weight: 700;
}

.footer-brand a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity var(--duration-fast);
}

.footer-brand a:hover {
  opacity: 0.8;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .hero-content {
    gap: var(--space-xl);
  }

  .about-grid {
    gap: var(--space-2xl);
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 58px;
  }

  .nav {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 0 var(--border);
  }

  .nav.menu-open {
    background: rgba(255, 255, 255, 0.98);
  }

  .nav-inner {
    padding: 0 var(--space-md);
  }

  .nav-actions {
    gap: var(--space-sm);
  }

  .lang-segmented-control {
    padding: 2px;
  }

  .lang-segment-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    min-height: 28px;
  }

  .section {
    padding: var(--space-3xl) 0;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: calc(100dvh - var(--nav-height));
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: saturate(180%) blur(25px);
    -webkit-backdrop-filter: saturate(180%) blur(25px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: var(--space-lg) var(--space-lg) var(--space-3xl);
    gap: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity var(--duration-normal) var(--ease-out),
                transform var(--duration-normal) var(--ease-out),
                visibility var(--duration-normal) var(--ease-out);
    z-index: 999;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .nav-links a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 52px;
    padding: 14px 12px;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color var(--duration-fast) var(--ease-out),
                background-color var(--duration-fast) var(--ease-out);
    border-radius: var(--radius-sm);
  }

  .nav-links a:hover,
  .nav-links a.active {
    color: var(--accent);
    background: var(--accent-subtle);
  }

  .nav-links a::after {
    display: none !important;
  }

  .nav-links li:last-child {
    border-bottom: none;
    margin-top: var(--space-lg);
  }

  .nav-links .nav-cta {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 14px 24px;
    font-size: 1.05rem;
    border-radius: var(--radius-full);
    text-align: center;
    background: var(--accent) !important;
    color: var(--text-inverse) !important;
    box-shadow: 0 4px 16px var(--accent-glow) !important;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-image-wrapper {
    order: -1;
  }

  .hero-image-container {
    max-width: 320px;
  }

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

  .about-stats {
    justify-content: center;
  }

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

  .footer-inner {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }

  .timeline {
    padding-left: 32px;
  }

  .timeline-marker {
    left: -32px;
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }

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

  .about-stats {
    flex-direction: column;
    gap: var(--space-lg);
  }

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

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

  .contact-info-bar {
    flex-direction: column;
  }

  .social-links {
    gap: var(--space-sm);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* =========================================================================
   FAQ Accordion Section
   ========================================================================= */

.faq-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 840px;
  margin: 0 auto;
}

.faq-item {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.faq-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: var(--space-lg);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  transition: color var(--duration-fast) var(--ease-out);
}

.faq-question:hover {
  color: var(--accent);
}

.faq-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform var(--duration-normal) var(--ease-spring);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-normal) var(--ease-out),
              padding var(--duration-normal) var(--ease-out);
  padding: 0 var(--space-lg);
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  max-height: 250px;
  padding: 0 var(--space-lg) var(--space-lg) var(--space-lg);
}

.faq-answer strong a {
  color: var(--accent);
  text-decoration: underline;
}

/* =========================================================================
   Language Visibility Control (Strict Separation: No Mixing!)
   ========================================================================= */

/* Default / English Mode: Hide all Arabic elements */
html[data-lang="en"] .t-ar,
html:not([data-lang="ar"]) .t-ar {
  display: none !important;
}

/* Arabic Mode: Hide all English elements */
html[data-lang="ar"] .t-en {
  display: none !important;
}

/* Ensure proper block display for block-level elements */
html[data-lang="en"] div.t-en,
html[data-lang="en"] p.t-en,
html:not([data-lang="ar"]) div.t-en,
html:not([data-lang="ar"]) p.t-en {
  display: block !important;
}

html[data-lang="ar"] div.t-ar,
html[data-lang="ar"] p.t-ar {
  display: block !important;
}

/* =========================================================================
   Arabic Typography: Alyamama Font & Apple HIG RTL Layout
   ========================================================================= */

html[data-lang="ar"],
html[dir="rtl"] {
  --font-body: 'Alyamama', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Alyamama', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-family: var(--font-body);
}

html[data-lang="ar"] body,
html[dir="rtl"] body {
  font-family: var(--font-body);
  direction: rtl;
  text-align: right;
  letter-spacing: 0;
}

html[data-lang="ar"] .hero-title,
html[dir="rtl"] .hero-title {
  font-family: var(--font-body);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

html[data-lang="ar"] .section-title,
html[dir="rtl"] .section-title {
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

html[data-lang="ar"] .hero-subtitle,
html[dir="rtl"] .hero-subtitle {
  font-weight: 600;
  line-height: 1.4;
}

html[data-lang="ar"] .hero-description,
html[dir="rtl"] .hero-description {
  line-height: 1.8;
}

/* RTL Hero Layout */
html[dir="rtl"] .hero-content {
  direction: rtl;
}

html[dir="rtl"] .hero-actions {
  justify-content: flex-start;
}

/* RTL About Section */
html[dir="rtl"] .about-grid {
  direction: rtl;
}

html[dir="rtl"] .about-body {
  line-height: 1.85;
}

html[dir="rtl"] .about-stats {
  direction: rtl;
}

/* RTL Skills */
html[dir="rtl"] .skill-card {
  text-align: right;
  direction: rtl;
}

html[dir="rtl"] .skill-icon {
  margin-left: auto;
  margin-right: 0;
}

html[dir="rtl"] .skill-desc {
  line-height: 1.75;
}

/* RTL Timeline (Apple HIG Precision) */
html[dir="rtl"] .timeline {
  padding-left: 0;
  padding-right: 48px;
}

html[dir="rtl"] .timeline::before {
  left: auto;
  right: 8px;
}

html[dir="rtl"] .timeline-marker {
  left: auto;
  right: -48px;
}

html[dir="rtl"] .timeline-content {
  text-align: right;
  direction: rtl;
}

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

html[dir="rtl"] .timeline-desc {
  line-height: 1.75;
}

/* RTL FAQ */
html[dir="rtl"] .faq-item {
  text-align: right;
  direction: rtl;
}

html[dir="rtl"] .faq-question {
  text-align: right;
  direction: rtl;
  font-family: var(--font-body);
}

html[dir="rtl"] .faq-answer {
  text-align: right;
  direction: rtl;
  line-height: 1.85;
}

/* RTL Contact Section */
html[dir="rtl"] .contact-info-bar {
  direction: rtl;
}

html[dir="rtl"] .contact-chip {
  direction: rtl;
}

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

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

html[dir="rtl"] .contact-form input,
html[dir="rtl"] .contact-form textarea {
  text-align: right;
  direction: rtl;
  font-family: var(--font-body);
}

html[dir="rtl"] .whatsapp-bubble-received {
  text-align: right;
  direction: rtl;
}

html[dir="rtl"] .footer-inner {
  direction: rtl;
}

/* RTL Mobile Nav Adjustments */
@media (max-width: 768px) {
  html[dir="rtl"] .nav-links a {
    text-align: right;
    justify-content: flex-start;
  }

  html[dir="rtl"] .nav-links .nav-cta {
    justify-content: center;
  }

  html[dir="rtl"] .hero-actions {
    justify-content: center;
  }
}



