/* =========================================================
   Adel Sulaiman — Portfolio
   Design system: "two windows, one person"
   Code projects render as editor/terminal chrome.
   Design projects render as image-viewer chrome.
   Same window shell, different contents — the throughline.
   ========================================================= */

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

:root {
  /* ---- dark theme (default) ---- */
  --ink: #e8eaed;
  --ink-dim: #9aa3af;
  --bg: #11151c;
  --bg-raised: #161b24;
  --bg-sunken: #0b0e13;
  --line: #262d39;
  --line-soft: #1c222c;

  --accent-code: #5eead4;       /* terminal cyan — code side */
  --accent-code-dim: #2c4a46;
  --accent-design: #ff8a65;     /* warm coral — design side */
  --accent-design-dim: #4a2e26;

  --shadow: 0 20px 50px -20px rgba(0,0,0,0.5);

  --font-display: 'JetBrains Mono', monospace;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 10px;
  --radius-sm: 6px;

  color-scheme: dark;
}

[data-theme="light"] {
  --ink: #1a1d23;
  --ink-dim: #5b6270;
  --bg: #f7f6f2;
  --bg-raised: #ffffff;
  --bg-sunken: #ececE6;
  --line: #ded9cd;
  --line-soft: #e8e4d9;

  --accent-code: #0d9488;
  --accent-code-dim: #d6f0ec;
  --accent-design: #d9532c;
  --accent-design-dim: #fbe2d6;

  --shadow: 0 20px 50px -20px rgba(0,0,0,0.18);

  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  transition: background 0.25s ease, color 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- eyebrow / comment-style labels (replaces numbering) ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-dim);
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}
.eyebrow::before { content: "// "; color: var(--accent-code); }
.eyebrow.is-design::before { color: var(--accent-design); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

section {
  padding: 96px 0;
  border-bottom: 1px solid var(--line-soft);
}
section:last-of-type { border-bottom: none; }

/* ---------- top nav ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  max-width: 1100px;
  margin: 0 auto;
}
.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
}
.nav-logo span { color: var(--accent-code); }
.nav-links {
  display: flex;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-dim);
}
.nav-links a:hover { color: var(--ink); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--bg-sunken);
  cursor: pointer;
  flex-shrink: 0;
}
.theme-toggle .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-code);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1), background 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
[data-theme="light"] .theme-toggle .knob {
  transform: translateX(24px);
  background: var(--accent-design);
}

/* ---------- language switcher ---------- */
.lang-switcher {
  position: relative;
}
.lang-btn {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s ease;
}
.lang-btn:hover { border-color: var(--accent-code); color: var(--ink); }
.lang-chevron { font-size: 10px; opacity: 0.6; }
.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  min-width: 100%;
  z-index: 100;
  overflow: visible;
}
.lang-dropdown::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}
.lang-switcher:hover .lang-dropdown,
.lang-switcher:focus-within .lang-dropdown { display: flex; }
.lang-option {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 14px;
  color: var(--ink-dim);
  white-space: nowrap;
  transition: background 0.15s ease;
}
.lang-option:hover { background: var(--bg-sunken); color: var(--ink); }
.lang-option.is-active { color: var(--accent-code); }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ---------- hero ---------- */
.hero {
  padding: 88px 0 80px;
  border-bottom: 1px solid var(--line-soft);
}
.hero-tag {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-dim);
  margin-bottom: 18px;
}
.hero-tag .dot { color: var(--accent-code); }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
  margin-bottom: 10px;
}
.hero-roles {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--ink-dim);
  margin: 0 0 24px;
  letter-spacing: 0.02em;
}
.hero-roles .hl-code { color: var(--accent-code); }
.hero-roles .hl-design { color: var(--accent-design); }
.hero-sub {
  font-family: var(--font-body);
  max-width: 640px;
  margin-bottom: 36px;
}
.hero-sub p {
  font-size: 1.15rem;
  color: var(--ink-dim);
  margin: 0 0 14px;
}
.hero-sub p:last-child { margin-bottom: 0; }
.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.btn {
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary {
  background: var(--accent-code);
  color: var(--bg-sunken);
  border-color: var(--accent-code);
  font-weight: 700;
}
.btn.ghost:hover { border-color: var(--accent-design); }

/* ---------- window chrome (the signature element) ---------- */
.win {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.win:hover { transform: translateY(-4px); }
.win.kind-code:hover { border-color: var(--accent-code); }
.win.kind-design:hover { border-color: var(--accent-design); }

.win-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
}
.win-dots { display: flex; gap: 6px; margin-right: 4px; }
.win-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.win-bar .win-title { flex: 1; text-align: center; opacity: 0.8; }

.win-body { flex: 1; display: flex; flex-direction: column; }

/* code window contents */
.win.kind-code .win-body { padding: 18px; font-family: var(--font-mono); }
.code-tag { font-size: 11px; color: var(--accent-code); margin-bottom: 8px; }
.win.kind-code h3 { font-size: 1.05rem; margin-bottom: 6px; }
.win.kind-code p {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink-dim);
  margin: 0 0 16px;
}
.stack-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.chip {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 20px;
  background: var(--accent-code-dim);
  color: var(--accent-code);
}
.win.kind-design .chip { background: var(--accent-design-dim); color: var(--accent-design); }

/* design window contents */
.win.kind-design .win-body { padding: 0; }
.design-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-bottom: 1px solid var(--line-soft);
}
.design-meta { padding: 16px 18px; }
.win.kind-design h3 { font-size: 1.0rem; margin-bottom: 4px; }
.win.kind-design .design-tagline {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--ink-dim);
}

/* ---------- grids ---------- */
.grid { display: grid; gap: 22px; margin-top: 36px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid.cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid.cols-3 { grid-template-columns: 1fr; } }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.section-head h2 { font-size: 1.9rem; }
.section-head .link-out {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-dim);
  border-bottom: 1px dotted var(--line);
}
.section-head .link-out:hover { color: var(--accent-code); }

/* ---------- achievements ---------- */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 36px;
}
@media (max-width: 760px) { .ach-grid { grid-template-columns: 1fr; } }

.ach-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  background: var(--bg-raised);
  transition: transform 0.2s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}
.ach-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-code), var(--accent-design));
  opacity: 0;
  transition: opacity 0.25s ease;
}
.ach-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-code);
  box-shadow: 0 12px 32px -12px rgba(94, 234, 212, 0.15);
}
[data-theme="light"] .ach-card:hover {
  box-shadow: 0 12px 32px -12px rgba(13, 148, 136, 0.15);
}
.ach-card:hover::before { opacity: 1; }
.ach-icon { width: 38px; height: 38px; margin-bottom: 18px; color: var(--accent-code); }
.ach-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.ach-tagline {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent-design);
  margin-bottom: 12px;
}
.ach-card p { font-size: 0.92rem; color: var(--ink-dim); margin: 0; }

/* ---------- skills summary strip ---------- */
.skill-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.skill-pill {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  color: var(--ink-dim);
}
.skill-pill.lvl-code { border-color: var(--accent-code); color: var(--accent-code); }
.skill-pill.lvl-design { border-color: var(--accent-design); color: var(--accent-design); }

/* ---------- about / timeline ---------- */
.timeline-full {
  position: relative;
  margin-top: 40px;
  padding-left: 28px;
}
.timeline-full::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}
.timeline-full .tl-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  position: relative;
  padding-bottom: 36px;
}
.timeline-full .tl-item:last-child { padding-bottom: 0; }
.timeline-full .tl-marker {
  position: absolute;
  left: -24px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 2px solid var(--accent-code);
  z-index: 1;
  flex-shrink: 0;
}
.timeline-full .tl-now .tl-marker {
  background: var(--accent-code);
  box-shadow: 0 0 12px rgba(94, 234, 212, 0.4);
}
[data-theme="light"] .timeline-full .tl-now .tl-marker {
  box-shadow: 0 0 12px rgba(13, 148, 136, 0.4);
}
.timeline-full .tl-content { flex: 1; }
.timeline-full .tl-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-code);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}
.timeline-full .tl-item h4 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
}
.timeline-full .tl-item p {
  font-size: 0.92rem;
  color: var(--ink-dim);
  margin: 0;
  line-height: 1.55;
}

/* ---------- contact / footer ---------- */
.contact-section { text-align: center; }
.contact-section h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 18px; }
.contact-section p { color: var(--ink-dim); max-width: 480px; margin: 0 auto 32px; }
.contact-cta { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

footer {
  padding: 32px 0 48px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-dim);
}

/* ---------- modal (popup project details) ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}
.modal-backdrop.is-open { display: flex; }

.modal {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 620px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
}
.modal-bar .win-dots span { cursor: default; }
.modal-bar .win-dots span:first-child { cursor: pointer; }
.modal-bar .win-dots span:first-child:hover { background: #ff5f57; }
.modal-close-x {
  position: absolute;
  right: 16px;
  top: 10px;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--ink-dim);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal-close-x:hover {
  background: rgba(255, 95, 87, 0.15);
  color: #ff5f57;
}
.modal-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
}
.modal-img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-bottom: 1px solid var(--line-soft);
}
.modal-body { padding: 26px 28px 30px; }
.modal-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-code);
  margin-bottom: 6px;
}
.modal.is-design .modal-kicker { color: var(--accent-design); }
.modal-body h3 { font-size: 1.4rem; margin-bottom: 14px; }
.modal-body p.lead { color: var(--ink-dim); margin: 0 0 18px; font-family: var(--font-body); }
.modal-list { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.modal-list li { font-size: 0.92rem; color: var(--ink-dim); padding-left: 20px; position: relative; }
.modal-list li::before { content: "›"; position: absolute; left: 0; color: var(--accent-code); font-weight: 700; }
.modal.is-design .modal-list li::before { color: var(--accent-design); }
.modal-footer-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }

body.modal-open { overflow: hidden; }

/* ---------- RTL support (Arabic) ---------- */
[dir="rtl"] { direction: rtl; text-align: right; }
[dir="rtl"] .nav-inner { flex-direction: row-reverse; }
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] .nav-right { flex-direction: row-reverse; }
[dir="rtl"] .hero-cta { flex-direction: row-reverse; justify-content: flex-end; }
[dir="rtl"] .skill-strip { justify-content: flex-end; }
[dir="rtl"] .section-head { flex-direction: row-reverse; }
[dir="rtl"] .eyebrow::before { content: " //"; }
[dir="rtl"] .eyebrow { direction: rtl; }
[dir="rtl"] .contact-section { text-align: center; }
[dir="rtl"] .contact-section .eyebrow { justify-content: center; }
[dir="rtl"] .contact-cta { justify-content: center; }

/* RTL timeline */
[dir="rtl"] .timeline-full { padding-left: 0; padding-right: 28px; }
[dir="rtl"] .timeline-full::before { left: auto; right: 7px; }
[dir="rtl"] .timeline-full .tl-marker { left: auto; right: -24px; }

/* RTL modal */
[dir="rtl"] .modal-close-x { right: auto; left: 16px; }
[dir="rtl"] .modal-list li { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .modal-list li::before { left: auto; right: 0; }
[dir="rtl"] .modal-footer-row { flex-direction: row-reverse; }

/* RTL lang dropdown */
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
