/* Summer Tales — site styles */
:root {
  --ground: #ebd8c8;
  --surface: #f4e8dd;
  --surface-2: #f7eee6;
  --field: #fbf5ef;
  --ink: #2b1e17;
  --ink-2: #4a382c;
  --muted: #5c4636;
  --muted-2: #6b5442;
  --line: rgba(43, 30, 23, 0.2);
  --line-soft: rgba(43, 30, 23, 0.14);
  --accent: #1d4a5a;
  --accent-ink: #f6ece3;
  --accent-soft: #cfe0e6;
  --sans: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --arabic: 'IBM Plex Sans Arabic', 'Montserrat', sans-serif;
  --gutter: clamp(20px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
p { margin: 0; }
a { color: var(--accent); }
a:hover { color: #12323e; }
button { font-family: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  text-decoration: none; font-weight: 600; font-size: 14px;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 12px var(--gutter);
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.wordmark {
  font-size: 13px; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
}
.wordmark:hover { color: var(--ink); }
.header-left { display: flex; align-items: baseline; flex-wrap: wrap; gap: 14px; }
.header-tag { font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
}
.btn:hover { color: var(--accent-ink); background: #173d4b; }
.btn svg { flex-shrink: 0; }
.btn-sm { min-height: 44px; padding: 0 20px; font-size: 13px; }

/* ---------- Landing ---------- */
.landing {
  max-width: 1320px; margin: 0 auto;
  padding: clamp(24px, 6vw, 80px) var(--gutter) clamp(48px, 6vw, 80px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr));
  gap: clamp(32px, 6vw, 96px); align-items: center;
}
.poster {
  width: 100%; max-width: 580px; justify-self: center;
  aspect-ratio: 1400 / 2022; object-fit: cover; border-radius: 6px;
  box-shadow: 0 30px 60px -30px rgba(43, 30, 23, 0.45);
}
.landing-copy { display: flex; flex-direction: column; gap: 32px; max-width: 600px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin: 0; }
.prose { display: flex; flex-direction: column; gap: 14px; font-size: 16px; line-height: 1.7; text-wrap: pretty; }
.credits { display: flex; flex-direction: column; gap: 8px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.5; }
.credits strong { font-weight: 600; }
@media (max-width: 600px) {
  .landing-copy .btn { width: 100%; min-height: 56px; }
  .prose { font-size: 15px; }
}

/* ---------- Contact popover ---------- */
.contact { position: relative; }
.contact-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
}
.contact-panel {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 30;
  width: min(360px, calc(100vw - 24px));
  background: var(--surface-2); border: 1px solid rgba(43, 30, 23, 0.18); border-radius: 16px;
  box-shadow: 0 20px 44px rgba(43, 30, 23, 0.18);
  padding: 20px; display: flex; flex-direction: column; gap: 16px;
}
.contact-panel[hidden] { display: none; }
.contact-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.contact-name { font-size: 15px; font-weight: 600; }
.contact-role { font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.icon-btn {
  width: 44px; height: 44px; margin: -10px -10px 0 0; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; background: transparent; cursor: pointer;
}
.contact-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.contact-row > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.contact-label { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.contact-value { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; color: var(--ink); text-decoration: none; }
.copy-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px; border: 1px solid rgba(43, 30, 23, 0.3); border-radius: 999px;
  background: transparent; font-size: 12px; font-weight: 600; cursor: pointer;
}
@media (max-width: 600px) {
  .contact { position: static; }
  .contact-panel { left: 12px; right: 12px; width: auto; top: calc(100% + 8px); }
  .contact-btn .label-long { display: none; }
}
@media (min-width: 601px) { .contact-btn .label-short { display: none; } }

/* ---------- Dossier layout ---------- */
.dossier {
  max-width: 1320px; margin: 0 auto;
  padding: clamp(24px, 4vw, 56px) var(--gutter) 96px;
  display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 24px; }
.nav-item {
  min-height: 48px; padding: 10px 16px; display: flex; align-items: center; gap: 14px;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink);
  font-size: 14px; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer;
}
.nav-item:hover { background: rgba(43, 30, 23, 0.06); color: var(--ink); }
.nav-num { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; color: var(--muted-2); min-width: 18px; }
.nav-item[aria-current="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav-item[aria-current="true"] .nav-num { color: var(--accent-soft); }

.section-picker { display: none; }
.picker-btn {
  width: 100%; min-height: 56px; padding: 8px 16px; display: flex; align-items: center; gap: 12px;
  border: 1px solid rgba(43, 30, 23, 0.3); border-radius: 14px; background: var(--surface);
  text-align: left; cursor: pointer;
}
.picker-btn .nav-num { color: var(--muted); }
.picker-label { flex: 1; font-size: 14px; font-weight: 600; }
.picker-list { margin-top: 8px; padding: 6px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface); flex-direction: column; gap: 2px; display: flex; }
.picker-list[hidden] { display: none; }

@media (max-width: 860px) {
  .dossier { grid-template-columns: minmax(0, 1fr); padding-top: 16px; gap: 24px; }
  .side-nav { display: none; }
  .section-picker { display: block; }
  .header-tag { display: none; }
}

/* ---------- Sections ---------- */
.panel { display: flex; flex-direction: column; gap: 32px; }
.panel[hidden] { display: none; }
.panel-head { display: flex; flex-direction: column; gap: 10px; }
.panel h1 { margin: 0; font-size: clamp(30px, 4vw, 48px); font-weight: 300; line-height: 1.1; }
.readable { max-width: 720px; }
.body-text { display: flex; flex-direction: column; gap: 18px; font-size: 16px; line-height: 1.8; text-wrap: pretty; }
.lede { font-size: clamp(19px, 2vw, 22px); line-height: 1.5; font-weight: 300; }
.sub-label { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 600px) { .body-text { font-size: 15px; line-height: 1.75; gap: 16px; } .panel { gap: 24px; } }

.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); column-gap: 24px; border-top: 1px solid var(--line); }
.facts > div { padding: 18px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.facts dt { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-size: 17px; font-weight: 500; }
@media (max-width: 600px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .facts dd { font-size: 15px; } .facts dt { font-size: 10px; } }

.ruled { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.ruled > div { padding: 24px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }

/* References */
.ref-group { display: flex; flex-direction: column; gap: 18px; }
.ref-title { display: flex; align-items: baseline; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ref-title h2 { margin: 0; font-size: 24px; font-weight: 500; font-style: italic; }
.ref-title span { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; color: var(--muted); }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 16px; }
.ref-grid img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }

/* Characters */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  flex-shrink: 0; min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid rgba(43, 30, 23, 0.3); border-radius: 999px; background: transparent;
  font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.chip .ar { font-family: var(--arabic); color: var(--muted); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip[aria-pressed="true"] .ar { color: var(--accent-soft); }
@media (max-width: 600px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
}
.character { display: flex; flex-direction: column; gap: 28px; }
.character[hidden] { display: none; }
.character img { width: 100%; max-width: 960px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: #fff; border: 1px solid var(--line-soft); }
.profile { width: 100%; max-width: 960px; display: flex; flex-direction: column; gap: 16px; font-family: var(--arabic); font-size: 17px; line-height: 1.95; }
.profile h2 { margin: 0; font-size: 32px; font-weight: 500; line-height: 1.3; }
.profile h2 small { font-size: 18px; font-weight: 400; color: var(--muted); }
.profile .en { font-family: var(--sans); font-style: italic; text-align: right; }
@media (max-width: 600px) { .profile { font-size: 16px; line-height: 1.9; } .profile h2 { font-size: 28px; } .character { gap: 20px; } }

/* Bios */
.bio { display: grid; grid-template-columns: 240px minmax(0, 720px); gap: 36px; align-items: start; }
.portrait {
  width: 100%; aspect-ratio: 4 / 5; border-radius: 8px; border: 1px solid rgba(43, 30, 23, 0.18);
  background: repeating-linear-gradient(135deg, #dcc4b0 0 14px, #e3cdbb 14px 28px);
}
.bio-body { display: flex; flex-direction: column; gap: 28px; }
@media (max-width: 760px) {
  .bio { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .portrait { width: 112px; }
}
.experience { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.experience li { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.6; }
.experience strong { font-weight: 600; }
.signoff { margin-top: 8px; font-size: 15px; font-weight: 600; }
.signoff span { font-weight: 400; color: var(--muted); }

/* Prev / next */
.pager { display: flex; gap: 16px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.pager-btn {
  min-height: 64px; padding: 12px 22px; display: flex; align-items: center; gap: 14px;
  border-radius: 16px; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.pager-btn small { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 3px; }
.pager-prev { border: 1px solid rgba(43, 30, 23, 0.3); background: transparent; color: var(--ink); text-align: left; }
.pager-prev small { color: var(--muted); }
.pager-next { margin-left: auto; border: 0; background: var(--accent); color: var(--accent-ink); text-align: right; }
.pager-next small { color: var(--accent-soft); }
.pager-btn[hidden] { display: none; }
@media (max-width: 600px) {
  .pager { gap: 10px; margin-top: 40px; }
  .pager-btn { flex: 1 1 0; min-width: 0; padding: 12px 14px; font-size: 13px; line-height: 1.3; }
  .pager-btn svg { display: none; }
}

/* No-JS fallback: show every section stacked */
.no-js .panel[hidden], .no-js .character[hidden] { display: flex; }
.no-js .pager, .no-js .chips, .no-js .section-picker { display: none; }
