/* ----------  TOKENS  ---------- */
:root {
  --bg:        #f5f1e8;
  --bg-2:      #ebe5d6;
  --ink:       #18140f;
  --ink-2:     #3b342b;
  --ink-3:     #6b6256;
  --line:      #d8cfb9;
  --line-2:    #c5b99c;
  --accent:    #b8893c;
  --accent-2:  #d4a85a;
  --paper:     #fbf8f1;
  --shadow-sm: 0 1px 2px rgba(24, 20, 15, 0.04);
  --shadow:    0 24px 60px -22px rgba(24, 20, 15, 0.30);
  --radius:    18px;
  --radius-lg: 26px;

  --font-serif: "Fraunces", "Iowan Old Style", "Georgia", "Noto Naskh Arabic", "Noto Serif SC", "PingFang SC", "Microsoft YaHei", serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Arabic", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;

  --controls-h:  72px;
  --topbar-h:    56px;

  --gutter: clamp(20px, 3.2vw, 48px);
  --slide-pad: clamp(24px, 4vw, 56px);

  --ease: cubic-bezier(0.7, 0, 0.2, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ----------  RESET  ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  overflow: hidden;
  position: relative;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
em { font-style: italic; }

/* ----------  TYPOGRAPHY  ---------- */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 16px;
}
.display {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(36px, 4.6vw, 64px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  font-variation-settings: "opsz" 144;
}
.display em { font-style: italic; color: var(--accent); }

/* ----------  TOP BAR (fixed, overlays slides)  ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: transform .35s var(--ease), opacity .25s var(--ease);
}
.topbar.is-collapsed {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
.topbar-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px var(--gutter);
  height: var(--topbar-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 11px; height: 11px;
  border-radius: 999px;
  background: var(--accent);
  display: inline-block;
}
.topbar-controls {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
}

/* ---------- LANGUAGE SWITCHER ---------- */
.lang-switcher { position: relative; }
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--ink-2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.lang-toggle:hover { border-color: var(--ink-3); color: var(--ink); }
.lang-toggle[aria-expanded="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.lang-toggle svg { flex: 0 0 auto; }
.lang-current { font-variant-numeric: tabular-nums; }
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  list-style: none;
  margin: 0;
  padding: 6px;
  min-width: 150px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 28px -12px rgba(24, 20, 15, 0.22);
  z-index: 40;
  animation: drawerIn .18s var(--ease);
}
.lang-menu[hidden] { display: none; }
.lang-menu li {
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
  transition: background .12s var(--ease), color .12s var(--ease);
  outline: 0;
}
.lang-menu li:hover,
.lang-menu li:focus-visible { background: var(--bg-2); color: var(--ink); }
.lang-menu li.is-active {
  background: var(--ink);
  color: var(--paper);
}
.lang-menu li[lang="ar"],
.lang-menu li[lang="zh"] { font-size: 14px; }
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.filter-toggle:hover { border-color: var(--ink-3); }
.filter-toggle.is-expanded {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--paper);
  background: var(--accent);
  border-radius: 999px;
}
.filter-count[hidden] { display: none; }
.filter-toggle.is-expanded .filter-count {
  background: var(--paper);
  color: var(--ink);
}
.result-count {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}
.topbar-collapse {
  width: 32px; height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  transition: background .18s var(--ease), color .18s var(--ease);
}
.topbar-collapse:hover {
  background: var(--bg-2);
  color: var(--ink);
}

/* Filter drawer (overlays slide content) */
.filter-drawer {
  position: relative;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 14px 28px -18px rgba(24,20,15,.18);
  padding: 16px var(--gutter) 18px;
  display: grid;
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
  animation: drawerIn .22s var(--ease);
}
.filter-drawer[hidden] { display: none; }
@keyframes drawerIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.filter-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: start;
  gap: 14px;
}
.filter-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 8px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--ink-2);
  transition: all .14s var(--ease);
  white-space: nowrap;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.filter-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.link-btn {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  padding: 4px 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.link-btn:hover { color: var(--ink); }
.link-btn:disabled { color: var(--line-2); cursor: not-allowed; }

@media (max-width: 700px) {
  .filter-row { grid-template-columns: 1fr; gap: 4px; }
  .filter-label { padding-top: 0; }
  .result-count { display: none; }
  .topbar-row { gap: 10px; }
}

/* Restore button (visible only when topbar is collapsed) */
.topbar-restore {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 30;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: rgba(24, 20, 15, 0.7);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.topbar-restore:hover { background: var(--ink); transform: scale(1.05); }
.topbar-restore[hidden] { display: none; }

/* ----------  ABOUT BUTTON (left edge tab, vertical text)  ---------- */
.about-btn {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 25;
  background: var(--ink);
  color: var(--paper);
  padding: 18px 6px;
  border-radius: 0 12px 12px 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transition: transform .25s var(--ease), background .2s var(--ease);
  box-shadow: 0 8px 24px -8px rgba(24,20,15,.5);
}
.about-btn:hover {
  background: var(--accent);
  transform: translateY(-50%) translateX(3px);
}
body.has-about-overlay .about-btn { opacity: 0; pointer-events: none; }

/* ----------  DECK (full viewport)  ---------- */
.deck {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  outline: 0;
  background: var(--bg);
}
.track {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 0.55s var(--ease);
  will-change: transform;
}
.slide {
  flex: 0 0 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 5fr 6fr;
  background: var(--bg);
  overflow: hidden;
}
.slide[aria-hidden="true"] { pointer-events: none; }

@media (max-width: 900px) {
  .slide { grid-template-columns: 1fr; grid-template-rows: 38% 62%; }
}

/* ----------  PROJECT SLIDE  ---------- */
.slide-project .project-cover {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: clamp(28px, 3.5vw, 64px);
}
.slide-project .project-cover.has-image {
  /* slightly tighter padding around real screenshots */
  padding: clamp(36px, 4vw, 72px) clamp(28px, 3vw, 56px);
}
.slide-project .project-cover.is-edge {
  /* edge-to-edge: image fills the panel, no padding */
  padding: 0;
}
.slide-project .project-cover::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255,255,255,0.22), transparent 55%),
    radial-gradient(120% 80% at 100% 100%, rgba(0,0,0,0.20), transparent 55%);
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}
.slide-project .project-cover-mark {
  position: absolute;
  left: 24px; top: 24px;
  font-family: var(--font-serif);
  font-style: italic;
  color: rgba(255,255,255,.92);
  font-size: 13px;
  letter-spacing: 0.06em;
  z-index: 3;
}
.slide-project .project-cover-title {
  font-family: var(--font-serif);
  color: rgba(255,255,255,.96);
  font-size: clamp(32px, 4vw, 64px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0;
  z-index: 2;
  position: relative;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,.18);
  max-width: 90%;
}
.project-cover-image {
  position: relative;
  z-index: 2;
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 60px -22px rgba(0, 0, 0, 0.55), 0 4px 12px -4px rgba(0,0,0,0.25);
  background: var(--paper);
}

.slide-project .project-content {
  padding: calc(var(--topbar-h) + 32px) var(--slide-pad) calc(var(--controls-h) + 32px) var(--slide-pad);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.project-role {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}
.featured-pill {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.project-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(34px, 3.8vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  font-variation-settings: "opsz" 144;
}
.project-summary {
  font-size: 17px;
  color: var(--ink-2);
  margin: 0 0 22px;
  max-width: 56ch;
}
.project-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 24px;
}
.project-tag {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  padding: 5px 11px;
  background: var(--bg-2);
  border-radius: 999px;
}
.project-tag.is-industry {
  background: transparent;
  border: 1px solid var(--line-2);
}
.project-description {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-bottom: 28px;
}
.project-description p {
  font-size: 15px;
  color: var(--ink-2);
  margin: 0 0 14px;
  line-height: 1.7;
  max-width: 60ch;
}
.project-description p:last-child { margin-bottom: 0; }
.project-actions { margin-top: auto; padding-top: 8px; }

/* ----------  BUTTONS  ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: transform .15s var(--ease), background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--paper); border-color: var(--ink-3); }

/* ----------  EDGE NAV  ---------- */
.edge-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 999px;
  background: rgba(24, 20, 15, 0.55);
  color: var(--paper);
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0;
  transition: opacity .25s var(--ease), background .2s var(--ease), transform .2s var(--ease);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.deck:hover .edge-btn,
.edge-btn:focus-visible { opacity: 1; }
.edge-btn:hover { background: var(--ink); transform: translateY(-50%) scale(1.06); }
.edge-prev { left: 60px; }
.edge-next { right: 14px; }
.edge-btn[disabled] { opacity: 0 !important; pointer-events: none; }

@media (max-width: 700px) { .edge-btn { display: none; } }

/* ----------  EMPTY OVERLAY  ---------- */
.empty-overlay {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg);
  z-index: 4;
  font-size: 16px;
  color: var(--ink-3);
  text-align: center;
  padding: 40px;
}
.empty-overlay[hidden] { display: none; }

/* ----------  CONTROLS BAR (fixed footer) ---------- */
.controls {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--controls-h);
  padding: 0 var(--gutter);
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}
.control-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
  width: max-content;
}
.control-btn:hover { background: var(--bg-2); color: var(--ink); }
.control-btn:disabled { color: var(--line-2); cursor: not-allowed; background: transparent; }
.control-btn--right { justify-self: end; }
.control-btn .arrow { font-size: 18px; line-height: 1; }
.control-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.counter { font-variant-numeric: tabular-nums; min-width: 64px; text-align: center; }
.dots {
  display: flex;
  gap: 6px;
  max-width: 40vw;
  flex-wrap: wrap;
  justify-content: center;
}
.dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--line-2);
  transition: background .18s var(--ease), transform .18s var(--ease);
  cursor: pointer;
  border: 0;
  padding: 0;
}
.dot:hover { background: var(--ink-3); }
.dot.is-current {
  background: var(--accent);
  transform: scale(1.5);
}
.dot.is-out-of-scope { opacity: 0.35; }

@media (max-width: 600px) {
  .control-label { display: none; }
  .control-btn { padding: 10px 12px; }
  .dots { max-width: 50vw; }
}

/* ----------  ABOUT OVERLAY  ---------- */
.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vh, 48px);
}
.about-overlay[hidden] { display: none; }
.about-overlay-backdrop {
  position: absolute; inset: 0;
  background: rgba(24, 20, 15, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fade .25s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.about-overlay-card {
  position: relative;
  max-width: 1100px;
  width: 100%;
  max-height: calc(100vh - 80px);
  background: var(--paper);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.35);
  animation: pop .35s var(--ease);
  outline: 0;
}
.about-overlay-close {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 3;
  width: 38px; height: 38px;
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
  color: var(--paper);
  background: rgba(0,0,0,.45);
  transition: background .2s var(--ease);
}
.about-overlay-close:hover { background: rgba(0,0,0,.7); }
.about-overlay-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  align-items: stretch;
  max-height: calc(100vh - 80px);
}
.about-overlay-image {
  background: var(--ink);
  overflow: hidden;
  min-height: 320px;
}
.about-overlay-image svg,
.about-overlay-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.about-overlay-text {
  padding: clamp(28px, 4vw, 56px);
  overflow-y: auto;
}
.about-overlay-text .display { font-size: clamp(28px, 3.4vw, 48px); }
.lede {
  font-size: clamp(15px, 1.2vw, 18px);
  color: var(--ink-2);
  margin: 0 0 16px;
  line-height: 1.55;
}
.bio {
  font-size: 15px;
  color: var(--ink-2);
  margin: 0 0 16px;
}
.about-note {
  font-size: 13px;
  color: var(--ink-3);
  border-left: 2px solid var(--line-2);
  padding-left: 12px;
  margin: 0 0 22px;
}
.about-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 22px;
}
.about-tag {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg);
}
.about-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.contact-note {
  font-size: 12px;
  font-style: italic;
  color: var(--ink-3);
  line-height: 1.5;
  margin: 12px 0 0;
  max-width: 52ch;
}

/* ----------  TIMELINE / STORY ACCORDION  ---------- */
.timeline {
  margin: 32px 0 28px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.timeline-eyebrow { margin-bottom: 14px; }

.timeline-item {
  border-bottom: 1px solid var(--line);
}
.timeline-item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  outline: 0;
  transition: color .18s var(--ease);
}
.timeline-item summary::-webkit-details-marker,
.timeline-item summary::marker { display: none; content: ""; }
.timeline-item summary:hover { color: var(--accent); }
.timeline-item summary:focus-visible {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 8px;
}

.timeline-summary-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.timeline-item summary:hover .timeline-summary-title { color: var(--accent); }

.timeline-summary-arrow {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--ink-3);
}
.timeline-summary-arrow::before,
.timeline-summary-arrow::after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 1px;
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.timeline-summary-arrow::before {
  /* horizontal bar */
  top: 50%;
  left: 0;
  right: 0;
  height: 1.5px;
  transform: translateY(-50%);
}
.timeline-summary-arrow::after {
  /* vertical bar (becomes hidden when open) */
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1.5px;
  transform: translateX(-50%);
}
.timeline-item[open] .timeline-summary-arrow { color: var(--accent); }
.timeline-item[open] .timeline-summary-arrow::after {
  transform: translateX(-50%) rotate(90deg);
  opacity: 0;
}
.timeline-item summary:hover .timeline-summary-arrow { color: var(--accent); }

.timeline-content {
  padding: 4px 4px 22px;
  animation: timelineFade .25s var(--ease);
}
@keyframes timelineFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.timeline-content p,
.timeline-content ul {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 0 0 14px;
  max-width: 62ch;
}
.timeline-content p:last-child,
.timeline-content ul:last-child { margin-bottom: 0; }
.timeline-content ul {
  padding-left: 20px;
}
.timeline-content li {
  margin-bottom: 6px;
}

@media (max-width: 800px) {
  .about-overlay-grid { grid-template-columns: 1fr; grid-template-rows: 220px 1fr; max-height: calc(100vh - 80px); }
  .about-overlay-image { min-height: 0; }
}

/* ----------  REDUCED MOTION  ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .track { transition: none; }
}

/* ----------  RTL OVERRIDES  ---------- */
/* Layout containers stay LTR so the slide deck still slides forward to the left.
   Text-bearing inner panels switch to RTL so Arabic reads naturally. */
[dir="rtl"] .topbar-row,
[dir="rtl"] .controls,
[dir="rtl"] .about-overlay-grid,
[dir="rtl"] .filter-drawer { direction: ltr; }

[dir="rtl"] .filter-row,
[dir="rtl"] .project-content,
[dir="rtl"] .about-overlay-text,
[dir="rtl"] .empty-overlay,
[dir="rtl"] .timeline-content,
[dir="rtl"] .timeline-summary {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .filter-row { grid-template-columns: 1fr; }

/* About tab: pin to the right edge instead of left */
[dir="rtl"] .about-btn {
  left: auto;
  right: 0;
  border-radius: 12px 0 0 12px;
}
[dir="rtl"] .about-btn:hover {
  transform: translateY(-50%) translateX(-3px);
}

/* Topbar restore button: top-left in RTL */
[dir="rtl"] .topbar-restore {
  right: auto;
  left: 14px;
}

/* Edge nav: prev visually on the right (where the previous slide is in RTL) */
[dir="rtl"] .edge-prev { left: auto; right: 60px; }
[dir="rtl"] .edge-next { right: auto; left: 14px; }

/* Lang menu drops to the left in RTL so it doesn't run off-screen */
[dir="rtl"] .lang-menu { right: auto; left: 0; }

/* About-overlay close button on the left in RTL */
[dir="rtl"] .about-overlay-close { right: auto; left: 18px; }

/* Timeline accordion arrow stays at the visual end of the row */
[dir="rtl"] .timeline-item summary {
  flex-direction: row-reverse;
}

/* Project description max-width should use logical end so it caps on RTL too */
[dir="rtl"] .project-description p,
[dir="rtl"] .project-summary,
[dir="rtl"] .timeline-content p,
[dir="rtl"] .timeline-content ul {
  margin-left: auto;
  margin-right: 0;
}

[dir="rtl"] .timeline-content ul {
  padding-left: 0;
  padding-right: 20px;
}
