/* ==========================================================================
   Bareq Maher Khudhair — Portfolio
   Sage-minimal aesthetic (Lean style) · Light/Dark · LTR/RTL
   ========================================================================== */

:root {
  /* palette — light (sage) */
  --bg: #d9e0e0;
  --bg-soft: #d2dada;
  --surface: #e7eded;
  --surface-2: #f0f4f4;
  --ink: #171b1b;
  --ink-soft: #586363;
  --line: rgba(23, 27, 27, 0.10);
  --accent: #161a1a;
  --accent-ink: #eef2f2;
  --shadow: 0 18px 40px -18px rgba(23, 27, 27, 0.22);
  --shadow-lg: 0 30px 70px -25px rgba(23, 27, 27, 0.32);

  --font-display: "Poppins", "IBM Plex Sans Arabic", sans-serif;
  --font-body: "Manrope", "IBM Plex Sans Arabic", sans-serif;

  --radius: 24px;
  --radius-sm: 16px;
  --nav-h: 76px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  --bg: #131717;
  --bg-soft: #0f1313;
  --surface: #1c2222;
  --surface-2: #232a2a;
  --ink: #e8eeee;
  --ink-soft: #93a0a0;
  --line: rgba(232, 238, 238, 0.10);
  --accent: #e8eeee;
  --accent-ink: #131717;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 30px 70px -25px rgba(0, 0, 0, 0.65);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.45s ease, color 0.45s ease;
}

html[lang="ar"] body { font-family: "IBM Plex Sans Arabic", var(--font-body); }
html[lang="ar"] .hero-title,
html[lang="ar"] .section-title,
html[lang="ar"] .contact-title { font-family: "IBM Plex Sans Arabic", var(--font-display); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

.container { width: min(1160px, 100% - 48px); margin-inline: auto; }
@media (max-width: 640px) { .container { width: min(1160px, 100% - 36px); } }

::selection { background: var(--ink); color: var(--bg); }

/* language visibility helpers */
.lang-ar, .lang-ar-block { display: none; }
html[lang="ar"] .lang-ar { display: inline; }
html[lang="ar"] .lang-ar-block { display: block; }
html[lang="ar"] .lang-en, html[lang="ar"] .lang-en-block { display: none; }
.lang-en-block { display: block; }

/* ==========================================================================
   Preloader
   ========================================================================== */
.preloader {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: var(--accent);
  transition: transform 0.7s var(--ease-out), visibility 0.7s;
}
.preloader.done { transform: translateY(-100%); visibility: hidden; }
.preloader-name {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7vw, 4.2rem);
  font-weight: 800; letter-spacing: 0.04em;
  color: var(--accent-ink);
  display: flex; gap: 0.32em; align-items: baseline;
}
html[lang="ar"] .preloader-name { font-family: "IBM Plex Sans Arabic", var(--font-display); letter-spacing: 0; }
.preloader-name span {
  opacity: 0; transform: translateY(24px);
  animation: pre-in 0.55s var(--ease-out) forwards;
}
.preloader-name span:nth-child(1) { animation-delay: 0.05s; }
.preloader-name span:nth-child(2) { animation-delay: 0.2s; }
.preloader-name span:nth-child(3) { animation-delay: 0.05s; }
.preloader-name span:nth-child(4) { animation-delay: 0.2s; }
.preloader-name span.dot { animation-delay: 0.42s; color: #8fa3a0; margin-inline-start: -0.28em; }
@keyframes pre-in { to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
  position: fixed; inset-inline: 0; top: 0; z-index: 100;
  transition: background 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}
.navbar.scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner {
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  flex-shrink: 0;
}
.logo-mark svg { width: 17px; height: 17px; animation: spin-slow 14s linear infinite; }
@keyframes spin-slow { to { transform: rotate(360deg); } }
.logo-text {
  font-size: 1.08rem; font-weight: 800;
  letter-spacing: 0.09em; white-space: nowrap;
}
html[lang="ar"] .logo-text {
  font-family: "IBM Plex Sans Arabic", var(--font-display);
  letter-spacing: 0; font-size: 1.18rem;
}
.logo-dot { color: var(--ink-soft); font-size: 1.3rem; font-weight: 800; margin-inline-start: -6px; }
@media (max-width: 380px) { .logo-text { font-size: 0.95rem; letter-spacing: 0.06em; } }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 8px 14px; border-radius: 999px;
  font-size: 0.92rem; font-weight: 600; color: var(--ink-soft);
  transition: color 0.25s, background 0.25s;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); background: color-mix(in srgb, var(--surface-2) 80%, transparent); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  border: 1px solid var(--line);
  transition: transform 0.25s, background 0.25s;
}
.icon-btn:hover { transform: translateY(-2px); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }

.lang-btn {
  height: 40px; padding-inline: 16px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 0.88rem;
  transition: transform 0.25s, opacity 0.25s;
}
.lang-btn:hover { transform: translateY(-2px); opacity: 0.92; }

/* burger */
.menu-btn { display: none; flex-direction: column; gap: 5px; }
.menu-btn span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.menu-btn.open span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

@media (max-width: 900px) {
  .menu-btn { display: flex; }
  .nav-links {
    position: fixed; top: var(--nav-h); inset-inline: 16px;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 12px; box-shadow: var(--shadow-lg);
    opacity: 0; transform: translateY(-12px); pointer-events: none;
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  }
  .nav-links.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-link { padding: 12px 16px; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding-top: calc(var(--nav-h) + 28px);
  padding-bottom: 40px;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%;
  opacity: 0.8;
}
.blob-1 {
  width: 680px; height: 680px;
  background: radial-gradient(circle, color-mix(in srgb, var(--surface-2) 82%, #8fc3b6) 0%, transparent 62%);
  top: -240px; inset-inline-end: -220px;
  animation: drift 16s ease-in-out infinite alternate;
}
.blob-2 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, color-mix(in srgb, var(--surface-2) 85%, #9caccf) 0%, transparent 62%);
  bottom: -220px; inset-inline-start: -200px;
  animation: drift 20s ease-in-out infinite alternate-reverse;
}
@keyframes drift { to { transform: translate(40px, 30px) scale(1.08); } }
.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 10%, transparent 70%);
  opacity: 0.5;
}

.hero-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 5vw, 72px); align-items: center;
  position: relative;
}

.eyebrow {
  font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-soft);
}
html[lang="ar"] .eyebrow { letter-spacing: 0.08em; }
.eyebrow.light { color: color-mix(in srgb, var(--accent-ink) 70%, transparent); }

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 6.4vw, 4.9rem);
  font-weight: 800; line-height: 1.06;
  letter-spacing: -0.02em;
  margin-top: 18px;
}
html[lang="ar"] .hero-title { letter-spacing: 0; line-height: 1.25; }
.hero-title .line { display: block; }
.hero-title .accent { color: var(--ink-soft); }

.hero-subname {
  margin-top: 14px;
  font-size: 1.05rem; font-weight: 600; color: var(--ink-soft);
  font-family: "IBM Plex Sans Arabic", var(--font-body);
}

.hero-typing {
  margin-top: 10px; min-height: 1.8em;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 600;
}
.caret {
  display: inline-block; width: 2px; height: 1.1em;
  background: var(--ink); vertical-align: text-bottom;
  margin-inline-start: 3px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  margin-top: 18px; max-width: 54ch;
  color: var(--ink-soft); font-size: 1.02rem;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 30px; border-radius: 999px;
  font-weight: 700; font-size: 0.95rem;
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s, opacity 0.28s;
}
.btn:hover { transform: translateY(-3px); }
.btn-dark { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn-ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.btn-light { background: var(--bg); color: var(--ink); }

.hero-social { display: flex; gap: 10px; margin-top: 30px; }
.hero-social a {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface-2) 75%, transparent);
  border: 1px solid var(--line);
  transition: transform 0.28s var(--ease-out), background 0.28s, color 0.28s;
}
.hero-social a:hover { transform: translateY(-4px); background: var(--accent); color: var(--accent-ink); }
.hero-social svg { width: 20px; height: 20px; }

/* portrait + floating cards */
.hero-visual { position: relative; }
.portrait-card {
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--surface-2) 70%, #b9cdc7) 0%, var(--surface) 70%);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.portrait-card img { width: 100%; height: auto; }

.float-card {
  position: absolute;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px;
  animation: floaty 5.5s ease-in-out infinite;
}
.fc-1 { top: 8%; inset-inline-start: -9%; animation-delay: 0s; }
.fc-2 { bottom: 20%; inset-inline-end: -8%; animation-delay: 1.6s; }
.fc-3 { bottom: -5%; inset-inline-start: 8%; animation-delay: 3s; }
@keyframes floaty { 50% { transform: translateY(-10px); } }
.fc-num { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; line-height: 1; }
.fc-badge {
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; line-height: 1;
}
.fc-label { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); }

.scroll-hint {
  position: absolute; bottom: 26px; inset-inline-start: 50%;
  transform: translateX(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--ink-soft);
  animation: floaty 2.6s ease-in-out infinite;
}
html[dir="rtl"] .scroll-hint { transform: translateX(50%); }
.scroll-hint svg { width: 16px; height: 16px; }

@media (max-width: 900px) {
  .hero { padding-top: calc(var(--nav-h) + 12px); }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; width: min(340px, 78%); margin-inline: auto; }
  .hero-title { font-size: clamp(2.3rem, 10vw, 3.2rem); }
  .fc-1 { inset-inline-start: -12%; }
  .fc-2 { inset-inline-end: -10%; }
  .fc-3 { bottom: -7%; }
  .scroll-hint { display: none; }
}

/* ==========================================================================
   Marquee
   ========================================================================== */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  padding-block: 16px;
}
.marquee-track {
  display: flex; gap: 28px; width: max-content;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  color: var(--ink-soft); white-space: nowrap;
  animation: marquee 36s linear infinite;
}
html[dir="rtl"] .marquee-track { animation-name: marquee-rtl; }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes marquee-rtl { to { transform: translateX(50%); } }

/* ==========================================================================
   Stats
   ========================================================================== */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; padding-block: 56px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s;
}
.stat:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.stat-num {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.1;
  display: block;
}
.stat-label { color: var(--ink-soft); font-size: 0.9rem; font-weight: 600; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr 1fr; gap: 12px; } .stat { padding: 22px 18px; } }

/* ==========================================================================
   Sections (shared)
   ========================================================================== */
.section { padding-block: clamp(72px, 9vw, 120px); }
.section-alt {
  background: color-mix(in srgb, var(--bg-soft) 70%, var(--bg));
  border-block: 1px solid var(--line);
}
.section-head { max-width: 720px; margin-bottom: clamp(40px, 5vw, 64px); }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  font-weight: 800; line-height: 1.15; letter-spacing: -0.015em;
  margin-top: 14px;
}
html[lang="ar"] .section-title { letter-spacing: 0; line-height: 1.35; }
.section-title .muted { color: var(--ink-soft); }
.section-desc { margin-top: 16px; color: var(--ink-soft); max-width: 60ch; }

/* ==========================================================================
   About
   ========================================================================== */
.about-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
.about-text p { color: var(--ink-soft); margin-bottom: 18px; font-size: 1.02rem; }

.about-quote {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 26px 28px 14px;
  margin-bottom: 26px;
  box-shadow: var(--shadow);
}
.about-quote::before {
  content: "\201C";
  position: absolute;
  top: -6px; inset-inline-end: 18px;
  font-family: var(--font-display);
  font-size: 4.6rem; line-height: 1;
  color: var(--ink); opacity: 0.12;
}
.about-quote .aq-lead {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  line-height: 1.7;
  color: var(--ink);
}
.about-quote p:last-child { font-size: 0.98rem; }

.timeline { margin-top: 34px; position: relative; padding-inline-start: 26px; }
.timeline::before {
  content: ""; position: absolute; inset-block: 6px; inset-inline-start: 7px;
  width: 2px; background: var(--line);
}
.timeline li { position: relative; padding-block: 10px; }
.timeline li::before {
  content: ""; position: absolute;
  inset-inline-start: -26px; top: 18px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--ink);
}
.tl-year {
  font-family: var(--font-display); font-weight: 700; font-size: 0.82rem;
  letter-spacing: 0.08em; color: var(--ink-soft);
  display: block;
}
.tl-title { font-weight: 700; }

.about-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.service-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s, background 0.35s;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); background: var(--surface-2); }
.sc-icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  margin-bottom: 16px;
}
.sc-icon svg { width: 22px; height: 22px; }
.service-card h3 { font-family: var(--font-display); font-size: 1.02rem; font-weight: 700; margin-bottom: 8px; }
.service-card p { color: var(--ink-soft); font-size: 0.9rem; }

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

/* ==========================================================================
   Skills
   ========================================================================== */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.skill-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s;
}
.skill-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.skill-card h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  padding: 6px 13px; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 60%, var(--surface-2));
  border: 1px solid var(--line);
  font-size: 0.82rem; font-weight: 600; color: var(--ink-soft);
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.chips span:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
@media (max-width: 900px) { .skills-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .skills-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Projects
   ========================================================================== */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s, background 0.35s;
}
.project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); background: var(--surface-2); }
.pc-top { display: flex; justify-content: space-between; align-items: baseline; }
.pc-num {
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
  color: var(--ink-soft); opacity: 0.6;
}
.pc-year {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em;
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-soft);
}
.project-card h3 { font-family: var(--font-display); font-size: 1.08rem; font-weight: 700; line-height: 1.35; }
.pc-org { font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); }
.project-card > p:last-child { color: var(--ink-soft); font-size: 0.9rem; }
@media (max-width: 900px) { .projects-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .projects-grid { grid-template-columns: 1fr; } }

/* GitHub highlights */
.gh-row { margin-top: 56px; }
.gh-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin-bottom: 20px; }
.gh-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.gh-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s, border-color 0.3s;
}
.gh-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--ink-soft); }
.gh-name { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; word-break: break-word; }
.gh-desc { font-size: 0.82rem; color: var(--ink-soft); flex: 1; }
.gh-lang { display: flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); }
.dot-lang { width: 10px; height: 10px; border-radius: 50%; }
.dot-lang.html { background: #e34c26; }
.dot-lang.js { background: #f1e05a; }
.dot-lang.cs { background: #178600; }
.gh-more { margin-top: 22px; }
@media (max-width: 900px) { .gh-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .gh-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Research
   ========================================================================== */
.pub-list { display: flex; flex-direction: column; gap: 14px; }
.pub-card {
  display: flex; align-items: center; gap: clamp(18px, 3vw, 36px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px clamp(20px, 3vw, 34px);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s, background 0.35s;
}
.pub-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); background: var(--surface-2); }
.pub-year {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem); color: var(--ink-soft);
  flex-shrink: 0;
}
.pub-body { flex: 1; }
.pub-card h3 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(0.98rem, 2vw, 1.15rem); line-height: 1.4;
}
.pub-meta { margin-top: 6px; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); }
.pub-arrow {
  font-size: 1.4rem; color: var(--ink-soft); flex-shrink: 0;
  transition: transform 0.3s var(--ease-out), color 0.3s;
}
.pub-card:hover .pub-arrow { transform: translate(4px, -4px); color: var(--ink); }
html[dir="rtl"] .pub-arrow { transform: scaleX(-1); }
html[dir="rtl"] .pub-card:hover .pub-arrow { transform: scaleX(-1) translate(4px, -4px); }

.research-links {
  margin-top: 36px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 22px;
}
.orcid-line {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.92rem; color: var(--ink-soft);
  transition: color 0.25s;
}
.orcid-line:hover { color: var(--ink); }

@media (max-width: 560px) {
  .pub-card { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-card {
  background: var(--accent); color: var(--accent-ink);
  border-radius: calc(var(--radius) + 8px);
  padding: clamp(48px, 7vw, 88px) clamp(24px, 6vw, 80px);
  text-align: center;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.contact-card::before {
  content: ""; position: absolute;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-ink) 10%, transparent) 0%, transparent 65%);
  top: -180px; inset-inline-end: -140px;
}
.contact-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.4vw, 3.4rem);
  font-weight: 800; line-height: 1.12; letter-spacing: -0.015em;
  margin-top: 16px;
}
html[lang="ar"] .contact-title { letter-spacing: 0; line-height: 1.3; }
.contact-desc {
  margin: 20px auto 0; max-width: 52ch;
  color: color-mix(in srgb, var(--accent-ink) 72%, transparent);
}
.contact-mail {
  margin-top: 34px; font-size: 1.02rem;
  font-family: var(--font-display);
}
.contact-meta {
  margin-top: 30px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  font-size: 0.9rem; font-weight: 600;
  color: color-mix(in srgb, var(--accent-ink) 70%, transparent);
}
.contact-meta a { text-decoration: underline; text-underline-offset: 4px; transition: color 0.25s; }
.contact-meta a:hover { color: var(--accent-ink); }
.sep { opacity: 0.5; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { border-top: 1px solid var(--line); padding-block: 30px; }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  font-size: 0.88rem; color: var(--ink-soft);
}
.footer-name { font-weight: 700; }

/* ==========================================================================
   Reveal animations
   ========================================================================== */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal.d-1 { transition-delay: 0.08s; }
.reveal.d-2 { transition-delay: 0.16s; }
.reveal.d-3 { transition-delay: 0.24s; }
.reveal.d-4 { transition-delay: 0.32s; }
.reveal.d-5 { transition-delay: 0.4s; }
.reveal.d-6 { transition-delay: 0.48s; }

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .preloader { display: none; }
}
