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

:root {
  --navy: #1E2A5C;
  --navy-ink: #16204A;
  --amber: #C97B0C;
  --amber-bg: #FBEFDA;
  --teal: #0E9C74;
  --teal-bg: #E3F5EE;
  --purple: #4B3FA0;
  --cream: #EFEBE3;
  --paper: #FFFFFF;
  --canvas: #FAF9F6;
  --muted: #5A574C;
  --line: #E4E1D8;
  --maroon: #8B3A3A;
  --maroon-bg: #F7EAEA;
  --max: 960px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--navy-ink);
  font-family: 'Heebo', 'Rubik', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

[dir="rtl"] body { font-family: 'Heebo', 'Rubik', Arial, sans-serif; }
[dir="ltr"] body { font-family: 'Rubik', 'Heebo', Arial, sans-serif; }

h1, h2, h3, .display {
  font-family: 'Rubik', Arial, sans-serif;
  color: var(--navy);
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

a { color: inherit; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.brand { font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 18px; color: var(--navy); text-decoration: none; }
.nav-links { display: flex; gap: 20px; align-items: center; font-size: 15px; }
.nav-links a { text-decoration: none; color: var(--navy); font-weight: 500; }
.nav-links a.lang { color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; }
.nav-links a.lang:hover { border-color: var(--navy); color: var(--navy); }
.nav-links a.lang.flag { padding: 6px 14px; font-size: 15px; line-height: 1; display: inline-flex; align-items: center; gap: 7px; }

/* ---------- Projects dropdown (details/summary, no JS) ---------- */
details.projects-dd { position: relative; }
details.projects-dd > summary { cursor: pointer; list-style: none; }
details.projects-dd > summary::-webkit-details-marker { display: none; }
details.projects-dd > summary::marker { content: ""; }

/* Top-nav "Projects" control styled as a visible button (bottom CTA already uses .btn.primary) */
.nav-links details.projects-dd > summary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border: 1px solid var(--line); border-radius: 999px;
  font-weight: 600; color: var(--navy); background: var(--paper);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.nav-links details.projects-dd > summary::after { content: "▾"; font-size: 10px; color: var(--muted); }
.nav-links details.projects-dd > summary:hover { border-color: var(--navy); background: var(--cream); }
.nav-links details.projects-dd[open] > summary { border-color: var(--navy); background: var(--cream); }
.nav-links details.projects-dd[open] > summary::after { content: "▴"; }
.projects-panel {
  position: absolute; z-index: 30; min-width: 240px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(30,42,92,0.18); padding: 8px;
  inset-inline-end: 0;
}
.projects-panel.drop-down { top: calc(100% + 10px); }
.projects-panel.drop-up { bottom: calc(100% + 10px); }
.projects-panel a.project-item { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--navy-ink); }
.projects-panel a.project-item:hover { background: var(--cream); }
.projects-panel a.project-item strong { display: block; color: var(--navy); font-size: 14px; font-weight: 600; }
.projects-panel a.project-item span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; }
.hero-grid { display: flex; gap: 40px; align-items: center; }
.hero-grid .photo-frame { flex: 0 0 180px; }
.hero-grid > div:last-child { flex: 1 1 auto; min-width: 0; }
.photo-frame {
  width: 180px; height: 180px; border-radius: 50%;
  border: 4px solid var(--paper);
  box-shadow: 0 2px 14px rgba(30,42,92,0.15);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-frame.empty {
  border: 2px dashed var(--line); box-shadow: none;
  color: var(--muted); font-size: 13px; text-align: center; padding: 12px; background: var(--paper);
}
.eyebrow { color: var(--amber); font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.hero h1 { font-size: 34px; margin-bottom: 10px; }
.hero .role { font-size: 18px; color: var(--muted); font-weight: 500; }

.hero-proj { background: var(--navy); color: #fff; padding: 64px 0 48px; }
.hero-proj h1 { color: #fff; font-size: 32px; }
.hero-proj .sub { color: #B9C4E0; font-size: 16px; margin-top: 12px; max-width: 640px; line-height: 1.7; }
.hero-proj .tag { display: inline-block; background: var(--amber); color: var(--navy-ink); font-weight: 700; font-size: 13px; padding: 6px 16px; border-radius: 999px; margin-bottom: 18px; }
.hero-proj .cta-top { margin-top: 26px; }

/* ---------- Emphasis / access note ---------- */
.accent-em { font-weight: 700; font-size: 1.08em; }
.access-note { font-size: 13.5px; color: var(--muted); margin-top: 12px; max-width: 520px; line-height: 1.6; }
.access-note.on-dark { color: #B9C4E0; }

/* ---------- Sections ---------- */
section { padding: 40px 0; }
section.tight { padding: 24px 0; }
.section-title { font-size: 22px; margin-bottom: 20px; }
.lede { font-size: 18px; line-height: 1.75; color: var(--navy-ink); max-width: 72ch; }
p.body-text { max-width: 72ch; color: #33322D; }

/* ---------- Bridge callout ---------- */
.callout { background: var(--purple); color: #fff; border-radius: 14px; padding: 26px 30px; line-height: 1.75; font-size: 16px; }
.callout.soft { background: var(--teal-bg); color: #0B5C46; }
.callout.warn { background: var(--maroon-bg); color: #5A2A2A; border-inline-start: 4px solid var(--maroon); }
[dir="ltr"] .callout.warn { border-left: 4px solid var(--maroon); border-right: none; }
[dir="rtl"] .callout.warn { border-right: 4px solid var(--maroon); border-left: none; }

/* ---------- Timeline ---------- */
.timeline { border-inline-start: 2px solid var(--line); padding-inline-start: 24px; display: flex; flex-direction: column; gap: 26px; }
[dir="ltr"] .timeline { border-left: 2px solid var(--line); border-right: none; padding-left: 24px; padding-right: 0; }
[dir="rtl"] .timeline { border-right: 2px solid var(--line); border-left: none; padding-right: 24px; padding-left: 0; }
.timeline .item { position: relative; }
.timeline .item::before {
  content: ""; position: absolute; top: 6px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--amber);
}
[dir="ltr"] .timeline .item::before { left: -29px; }
[dir="rtl"] .timeline .item::before { right: -29px; }
.timeline .period { font-size: 13px; color: var(--amber); font-weight: 700; }
.timeline .role { font-size: 17px; font-weight: 600; color: var(--navy); margin-top: 2px; }
.timeline .detail { font-size: 15px; color: var(--muted); margin-top: 2px; }

/* ---------- Pills ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { background: var(--cream); color: var(--navy-ink); font-size: 14px; font-weight: 500; padding: 7px 16px; border-radius: 999px; }
.pill.new { background: var(--teal-bg); color: #0B5C46; }
.pill.amber { background: var(--amber-bg); color: #7A4A08; }

/* ---------- Cards ---------- */
.grid-3 { display: flex; gap: 18px; flex-wrap: wrap; }
.grid-3 > * { flex: 1 1 260px; }
.grid-2 { display: flex; gap: 18px; flex-wrap: wrap; }
.grid-2 > * { flex: 1 1 320px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 22px;
}
.card .num { font-family: 'Rubik', sans-serif; font-size: 30px; font-weight: 800; color: var(--navy); }
.card .label { font-size: 14px; color: var(--muted); margin-top: 4px; }

.card.stripe { border: none; overflow: hidden; padding: 0; }
.card.stripe .bar { height: 6px; }
.card.stripe .body { padding: 20px; }
.card.stripe.amber { background: var(--amber-bg); }
.card.stripe.amber .bar { background: var(--amber); }
.card.stripe.teal { background: var(--teal-bg); }
.card.stripe.teal .bar { background: var(--teal); }
.card.stripe .kicker { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.card.stripe.amber .kicker { color: #7A4A08; }
.card.stripe.teal .kicker { color: #0B5C46; }
.card.stripe p { font-size: 14.5px; color: #3A3A3A; margin: 0; }

/* ---------- Decision list ---------- */
.decision { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.decision:first-child { border-top: none; }
.decision .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--navy); margin-top: 9px; flex-shrink: 0; }
.decision p { margin: 0; font-size: 15.5px; }
.decision b { color: var(--navy); }

/* ---------- Images ---------- */
.figure { margin: 0; }
.figure img { width: 100%; display: block; border-radius: 10px; border: 1px solid var(--line); }
.figure figcaption { font-size: 13px; color: var(--muted); font-style: italic; margin-top: 10px; text-align: center; }

.gallery { display: flex; flex-wrap: wrap; gap: 16px; }
.gallery > * { flex: 1 1 45%; min-width: 260px; }

/* ---------- Gallery lightbox (pure CSS, no JS) ---------- */
.gallery-link { display: block; text-decoration: none; cursor: zoom-in; }
.gallery-link .figure img { transition: opacity .15s; }
.gallery-link:hover .figure img { opacity: 0.88; }

.lightbox {
  display: none; position: fixed; inset: 0; z-index: 200;
  align-items: center; justify-content: center; padding: 40px;
}
.lightbox:target { display: flex; }
.lightbox-bg { position: absolute; inset: 0; background: rgba(15,18,38,0.92); }
.lightbox-content { position: relative; z-index: 2; max-width: 92vw; max-height: 86vh; display: flex; flex-direction: column; align-items: center; }
.lightbox-content img { max-width: 92vw; max-height: 74vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); display: block; }
.lightbox-cap { color: #E8E6DE; font-size: 14px; margin-top: 14px; text-align: center; max-width: 70ch; }
.lightbox-close {
  position: absolute; top: -18px; z-index: 3; width: 42px; height: 42px; border-radius: 50%;
  background: #fff; color: var(--navy-ink); text-decoration: none; border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1;
}
[dir="rtl"] .lightbox-close { left: -18px; }
[dir="ltr"] .lightbox-close { right: -18px; }
.lightbox-close:hover { background: var(--amber); color: var(--navy-ink); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 56px; height: 56px; border-radius: 50%; background: #fff; color: var(--navy-ink);
  border: 1px solid rgba(0,0,0,0.08); box-shadow: 0 6px 20px rgba(0,0,0,0.45);
  text-decoration: none; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700;
}
.lightbox-nav:hover { background: var(--amber); color: var(--navy-ink); }
.lightbox-prev { inset-inline-start: 12px; }
.lightbox-next { inset-inline-end: 12px; }
@media (max-width: 720px) {
  .lightbox { padding: 16px; }
  .lightbox-nav { width: 46px; height: 46px; font-size: 22px; }
  .lightbox-prev { inset-inline-start: 6px; }
  .lightbox-next { inset-inline-end: 6px; }
  .lightbox-close { width: 38px; height: 38px; top: -14px; }
  [dir="rtl"] .lightbox-close { left: -8px; }
  [dir="ltr"] .lightbox-close { right: -8px; }
}

/* ---------- CTA band ---------- */
.cta-band { background: var(--navy); border-radius: 16px; padding: 36px; text-align: center; color: #fff; }
.cta-band h3 { color: #fff; font-size: 20px; margin-bottom: 18px; }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; text-decoration: none; padding: 12px 24px; border-radius: 999px;
  font-weight: 600; font-size: 15px;
}
.btn.primary { background: var(--amber); color: var(--navy-ink); }
.btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.4); }
.btn.dark { background: #fff; color: var(--navy); }

/* ---------- Downloads ---------- */
.dl-list { display: flex; flex-direction: column; gap: 10px; }
.dl-item {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px;
  text-decoration: none; color: var(--navy-ink);
}
.dl-item .name { font-weight: 600; }
.dl-item .go { color: var(--amber); font-weight: 700; }
.dl-item.pending { opacity: 0.6; cursor: default; }

/* ---------- Footer ---------- */
footer { padding: 40px 0 60px; border-top: 1px solid var(--line); margin-top: 40px; }
footer .wrap { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; flex-wrap: wrap; gap: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero-grid { flex-direction: column; text-align: center; }
  .hero-grid .photo-frame { margin: 0 auto; }
  .grid-3 > *, .grid-2 > *, .gallery > * { flex: 1 1 100%; }
  .hero h1 { font-size: 27px; }
  .hero-proj h1 { font-size: 25px; }
}

/* ---------- Accessibility ---------- */
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
