/* Ahmed Soliman — portfolio
   One page, one panel per chapter. Each panel sets its own colors through
   --bg / --fg / --slot / --muted; everything else reads from those. */

:root {
  --font: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --pad-x: clamp(24px, 5vw, 76px);
  --pad-y: clamp(44px, 7vw, 116px);
  --rule: 1.5px solid color-mix(in oklch, var(--fg) 32%, transparent);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; background: oklch(0.255 0.042 335); }
body {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  transition: background-color .5s ease;
}
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
h1, h2, h3 { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  padding-bottom: 1px;
  transition: opacity .15s ease;
}
a:hover { opacity: .55; }
a:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus {
  left: 16px; top: 16px; z-index: 10;
  background: oklch(0.93 0.014 335); color: oklch(0.255 0.042 335);
  padding: 10px 14px; border: 0; font-weight: 600;
}

/* ── panels ─────────────────────────────────────────── */

.panel {
  background: var(--bg);
  color: var(--fg);
  padding: var(--pad-y) var(--pad-x);
}

.panel--ink {
  --bg: oklch(0.255 0.042 335);
  --fg: oklch(0.93 0.014 335);
  --soft: oklch(0.845 0.018 335);
  --muted: oklch(0.635 0.028 335);
}
.ch--steady { --bg: oklch(0.90 0.015 85);   --fg: oklch(0.22 0.006 75);  --slot: oklch(0.845 0.014 85); }
.ch--handit { --bg: oklch(0.40 0.033 248);  --fg: oklch(0.94 0.006 248); --slot: oklch(0.345 0.03 248); }
.ch--ph     { --bg: oklch(0.79 0.032 70);   --fg: oklch(0.24 0.014 60);  --slot: oklch(0.735 0.03 70); }
.ch--cw     { --bg: oklch(0.32 0.022 165);  --fg: oklch(0.93 0.008 150); --slot: oklch(0.275 0.02 165); }
.ch--docs   { --bg: oklch(0.955 0.005 85);  --fg: oklch(0.21 0.006 85);  --slot: oklch(0.905 0.005 85); --muted: oklch(0.44 0.006 85); }
.ch--book   { --bg: oklch(0.855 0.022 25);  --fg: oklch(0.23 0.014 25);  --slot: oklch(0.80 0.02 25);   --muted: oklch(0.44 0.014 25); }

.label { font-size: 14px; font-weight: 600; letter-spacing: 0; }

/* ── hero ───────────────────────────────────────────── */

.hero {
  min-height: 96vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 64px;
  padding-top: clamp(36px, 6vw, 80px);
  padding-bottom: clamp(48px, 7vw, 96px);
}
.topline {
  display: flex; flex-wrap: wrap; gap: 12px 40px; justify-content: space-between;
  font-size: 14px; font-weight: 500;
}
.hero-body { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 52px); }
.hero h1 {
  font-size: clamp(54px, 13vw, 200px);
  font-weight: 800; line-height: .82; letter-spacing: -.045em;
}
.hero-lead {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 36px);
  font-weight: 400; line-height: 1.28; letter-spacing: -.02em;
  max-width: 25ch;
  color: var(--soft);
  text-wrap: pretty;
}
.meta {
  display: flex; flex-wrap: wrap; gap: 14px 44px;
  font-size: clamp(15px, 1.5vw, 19px); font-weight: 500;
}
.meta span { color: var(--muted); }

/* ── three lanes ────────────────────────────────────── */

.lanes { padding-top: clamp(32px, 4vw, 56px); border-top: var(--rule); }
.lanes-lead {
  margin: 18px 0 clamp(36px, 5vw, 72px);
  font-size: clamp(22px, 2.5vw, 34px);
  line-height: 1.25; letter-spacing: -.02em;
  max-width: 32ch;
  color: var(--soft);
  text-wrap: pretty;
}
.lanes-list {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(24px, 3vw, 40px);
}
.lanes-list li { border-top: 2px solid var(--fg); padding-top: 18px; }
.lane-name {
  display: block;
  font-size: clamp(36px, 4vw, 58px);
  font-weight: 800; line-height: .9; letter-spacing: -.045em;
}
.lane-q { display: block; margin: 14px 0 10px; font-size: 18px; font-weight: 600; color: var(--soft); }
.lanes-list p { margin: 0; font-size: 16.5px; line-height: 1.5; color: var(--muted); max-width: 34ch; }
.lanes-foot { margin: clamp(36px, 5vw, 64px) 0 0; font-size: 15px; font-weight: 500; color: var(--muted); }

/* ── chapters ───────────────────────────────────────── */

.ch-meta {
  display: flex; flex-wrap: wrap; gap: 6px 20px;
  margin: 0 0 18px;
  font-size: 14px; font-weight: 600;
}
.ch-meta span:first-child { font-variant-numeric: tabular-nums; }
.ch-head {
  display: flex; flex-wrap: wrap; gap: 10px 32px;
  align-items: flex-end; justify-content: space-between;
  margin-bottom: clamp(24px, 3vw, 44px);
}
.ch-head h2 {
  font-size: clamp(56px, 12vw, 172px);
  font-weight: 800; line-height: .8; letter-spacing: -.05em;
}
.ch-head > a { font-size: clamp(14px, 1.4vw, 18px); font-weight: 600; }
.ch--ph .ch-head h2 { font-size: clamp(44px, 10vw, 152px); line-height: .82; }
.ch--cw .ch-head h2 { font-size: clamp(38px, 8vw, 124px); line-height: .84; letter-spacing: -.045em; max-width: 14ch; }

.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}
.stack { display: flex; flex-direction: column; gap: 30px; min-width: 0; }
.stack--tight { gap: 22px; }
.media { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.lead {
  margin: 0;
  font-size: clamp(22px, 2.5vw, 34px);
  font-weight: 400; line-height: 1.25; letter-spacing: -.02em;
  text-wrap: pretty;
}
.note { margin: 0; font-size: 16.5px; line-height: 1.5; max-width: 46ch; }
.note strong { font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chips li { font-size: 14px; font-weight: 600; padding: 7px 14px; background: var(--fg); color: var(--bg); }
.chips--quiet li { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--fg); padding: 5px 12px; font-size: 13px; }

.credits { margin: 0; max-width: 52ch; border-top: var(--rule); }
.credits div {
  display: grid; grid-template-columns: 6.5em 1fr; gap: 12px;
  padding: 11px 0; border-bottom: var(--rule);
}
.credits dt { font-size: 15px; font-weight: 700; }
.credits dd { margin: 0; font-size: 16px; line-height: 1.45; }

/* screenshots */
.shot { position: relative; overflow: hidden; min-width: 0; aspect-ratio: 16 / 10; background: var(--slot); }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.shot--wide { aspect-ratio: 16 / 9; }
.shot--43 { aspect-ratio: 4 / 3; }
.shot--band { aspect-ratio: 23 / 10; }
.shot figcaption {
  position: absolute; left: 0; bottom: 0;
  padding: 6px 12px; font-size: 13px; font-weight: 600;
  background: var(--fg); color: var(--bg);
}

.thumbs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px; margin: 14px 0 clamp(28px, 4vw, 52px);
}
.ch--ph > .shot--wide { margin-bottom: 0; }
.ch--cw > .shot--wide { margin-bottom: 14px; }
.two-up {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px; margin-bottom: clamp(28px, 4vw, 52px);
}

/* Steady: App Store art + brand kit */
.phones {
  background: var(--slot);
  padding: clamp(14px, 2vw, 24px);
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 1.2vw, 14px);
}
.phones img { width: 100%; border-radius: clamp(6px, 1vw, 12px); }
@media (max-width: 520px) { .phones { grid-template-columns: repeat(2, 1fr); } }

.brandkit { display: grid; gap: 14px; padding-top: 6px; }
.brandkit-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brandkit img { width: 64px; height: 64px; border-radius: 15px; }
.swatches {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  font-size: 13px; font-weight: 600;
}
.swatches li { display: flex; align-items: center; gap: 8px; }
.swatches li::before {
  content: ""; width: 24px; height: 24px; background: var(--c);
  box-shadow: inset 0 0 0 1.5px color-mix(in oklch, var(--fg) 25%, transparent);
}
.brandkit figcaption { font-size: 15px; line-height: 1.5; max-width: 46ch; }

/* ── documents ──────────────────────────────────────── */

.docs-title {
  font-size: clamp(38px, 8.5vw, 132px);
  font-weight: 800; line-height: .84; letter-spacing: -.045em;
  max-width: 15ch;
  margin-bottom: clamp(24px, 3vw, 44px);
}
.docs-lead { max-width: 30ch; margin-bottom: clamp(32px, 4vw, 60px); }

.doc {
  display: grid; gap: clamp(20px, 3vw, 48px); align-items: start;
  padding: clamp(28px, 3.5vw, 48px) 0;
  border-top: var(--rule);
}
@media (min-width: 900px) { .doc { grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr); } }
.doc h3 { font-size: clamp(22px, 2.2vw, 30px); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; margin-bottom: 12px; }
.doc p { margin: 0 0 18px; font-size: 16px; line-height: 1.5; color: var(--muted); max-width: 44ch; text-wrap: pretty; }
.doc .aside { font-size: 15px; color: var(--fg); font-weight: 500; }

.brochure { display: grid; grid-template-columns: 1fr 3fr; gap: 10px; align-items: start; }
.deck { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.report { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: start; }
.doc .doc-link { margin-top: 22px; }
.brochure img, .deck img, .report img {
  width: 100%; background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 10px 28px rgb(0 0 0 / .07);
}

/* a confidential document, shown redacted */
@media (min-width: 900px) { .doc--text { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: center; } }
.redacted {
  width: min(100%, 340px);
  aspect-ratio: 17 / 22;
  background: #fff; color: #1d2433;
  box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 10px 28px rgb(0 0 0 / .07);
  padding: clamp(22px, 2.6vw, 34px) clamp(22px, 2.8vw, 36px);
  display: flex; flex-direction: column; gap: 7px;
  font-family: var(--serif);
}
.redacted-h { font-size: clamp(15px, 1.6vw, 20px); font-weight: 700; border-bottom: 2px solid #1d2433; padding-bottom: 6px; }
.redacted-s { font-size: 10px; font-family: var(--font); font-weight: 600; margin-top: 8px; color: #56607a; }
.redacted i { display: block; height: 8px; width: var(--w); background: #1d2433; }

/* ── book ───────────────────────────────────────────── */

.book-title {
  font-size: clamp(38px, 7.6vw, 118px);
  font-weight: 800; line-height: .86; letter-spacing: -.045em;
  max-width: 15ch;
  margin-bottom: clamp(28px, 4vw, 56px);
}
.pull { margin: 0; padding-left: 22px; border-left: 3px solid currentColor; }
.pull p {
  margin: 0;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(22px, 2.5vw, 34px); line-height: 1.3;
  max-width: 26ch; text-wrap: pretty;
}
.pages { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(10px, 1.4vw, 18px); }
.pages img {
  width: 100%; background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 12px 30px rgb(0 0 0 / .12);
}

.more { margin-top: clamp(48px, 6vw, 88px); }
.more ul { list-style: none; margin: 14px 0 0; padding: 0; border-top: var(--rule); }
.more li { border-bottom: var(--rule); }
.more a {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px;
  padding: 16px 0; border-bottom: 0;
}
.more-t { font-size: clamp(19px, 2vw, 28px); font-weight: 500; letter-spacing: -.015em; }
.more-t::after { content: " ↗"; font-weight: 400; }
.more-k { font-size: 14px; font-weight: 500; color: var(--muted); }

/* ── about + contact ────────────────────────────────── */

.contact {
  display: flex; flex-direction: column; gap: clamp(40px, 6vw, 80px);
  padding-top: clamp(56px, 9vw, 140px);
  padding-bottom: clamp(32px, 4vw, 56px);
}
.about { display: grid; grid-template-columns: auto 1fr; gap: clamp(18px, 3vw, 40px); align-items: start; }
.about img {
  width: clamp(84px, 11vw, 148px); aspect-ratio: 1; object-fit: cover;
}
.about p {
  margin: 0;
  font-size: clamp(18px, 1.9vw, 25px); line-height: 1.4; letter-spacing: -.01em;
  color: var(--soft); max-width: 40ch; text-wrap: pretty;
}
.talk { font-size: clamp(40px, 9vw, 150px); font-weight: 800; line-height: .84; letter-spacing: -.05em; }
.contact-row { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: flex-end; justify-content: space-between; }
.email { font-size: clamp(18px, 2.4vw, 32px); font-weight: 500; letter-spacing: -.02em; overflow-wrap: anywhere; }
.links { display: flex; flex-wrap: wrap; gap: 14px 28px; font-size: 15px; font-weight: 500; }
.links a { border-bottom-width: 1px; }
.foot { margin: 0; font-size: 13px; color: var(--muted); }

@media (max-width: 560px) {
  .about { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  body, a { transition: none; }
}

/* links into case studies */
.cta { display: inline-block; font-size: clamp(17px, 1.6vw, 20px); font-weight: 700; border-bottom-width: 2.5px; }
.cta::after { content: " →"; }
.title-link { border-bottom: 0; padding-bottom: 0; font: inherit; letter-spacing: inherit; color: inherit; }
.ch-links { display: flex; flex-wrap: wrap; gap: 12px 26px; margin: 0 0 clamp(22px, 2.6vw, 34px); }
.ch-head:has(+ .ch-links) { margin-bottom: clamp(14px, 1.6vw, 20px); }
.book-title:has(+ .ch-links) { margin-bottom: clamp(14px, 1.6vw, 20px); }
.cta--out::after { content: " ↗"; }
.book-links { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: baseline; }

/* writing guide: page gallery + full-size viewer */
.ch--guide { --bg: oklch(0.955 0.005 85); --fg: oklch(0.21 0.006 85); --slot: oklch(0.905 0.005 85); --muted: oklch(0.44 0.006 85); }
.doc-gallery { margin-top: clamp(32px, 4vw, 56px); }
.dg-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(170px, 21vw, 290px);
  gap: clamp(12px, 1.6vw, 20px);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 6px 2px 18px; outline: none;
}
.dg-track:focus-visible { outline: 3px solid var(--fg); outline-offset: 4px; }
.dg-page { all: unset; cursor: zoom-in; scroll-snap-align: start; display: grid; gap: 10px; }
.dg-page img { width: 100%; height: auto; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 14px 30px -14px rgb(0 0 0 / .3); transition: transform .2s ease; }
.dg-page:hover img { transform: translateY(-4px); }
.dg-page:focus-visible img { outline: 3px solid var(--fg); outline-offset: 4px; }
.dg-page span { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.dg-controls { display: flex; gap: 10px; margin-top: 8px; }
.dg-nav { font: inherit; font-size: 20px; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--fg); background: transparent; color: var(--fg); cursor: pointer; }
.dg-nav:hover { background: var(--fg); color: var(--bg); }

.lightbox { position: fixed; inset: 0; z-index: 50; background: rgb(18 14 20 / .985); display: flex; flex-direction: column; color: #fff; }
.lightbox[hidden] { display: none; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; font-size: 14px; font-weight: 600; }
.lb-close { font: inherit; font-size: 15px; font-weight: 600; background: none; border: 1.5px solid rgb(255 255 255 / .5); color: #fff; border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.lb-stage {
  flex: 1 1 auto; min-height: 0; padding: 0 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.lb-stage.is-zoomed { align-items: flex-start; justify-content: flex-start; }
.lb-stage img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; margin: auto;
  object-fit: contain; background: #fff; box-shadow: 0 20px 60px rgb(0 0 0 / .5);
  cursor: zoom-in;
}
.lb-stage.is-zoomed img { max-width: none; max-height: none; margin: 0 auto; cursor: zoom-out; }
.lb-hint { font-size: 13px; font-weight: 500; color: rgb(255 255 255 / .6); white-space: nowrap; }
@media (max-width: 700px) { .lb-hint { display: none; } .lb-top { gap: 12px; } .lb-title { font-size: 13px; } }
.lb-bottom { display: flex; justify-content: center; align-items: center; gap: 18px; padding: 14px 18px 20px; }
.lb-bottom button { font: inherit; font-size: 20px; width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid rgb(255 255 255 / .5); background: none; color: #fff; cursor: pointer; }
.lb-bottom button:disabled { opacity: .3; cursor: default; }
.lb-count { font-size: 14px; font-weight: 600; min-width: 5em; text-align: center; font-variant-numeric: tabular-nums; }
.lb-close:focus-visible, .lb-bottom button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.ch--guide .ch-head h2 { font-size: clamp(38px, 8vw, 124px); line-height: .84; letter-spacing: -.045em; max-width: 14ch; }
.doc .with { color: var(--fg); font-size: 15px; }
.doc .with strong { font-weight: 700; }

/* brochure refresh */
.ch--aiha { --bg: oklch(0.90 0.015 85); --fg: oklch(0.22 0.006 75); --slot: oklch(0.845 0.014 85); --muted: oklch(0.42 0.008 75); }
.ch--aiha .ch-head h2 { font-size: clamp(34px, 6.4vw, 96px); line-height: .9; letter-spacing: -.04em; max-width: 16ch; }

/* exercise research deck */
.ch--talk { --bg: oklch(0.40 0.033 248); --fg: oklch(0.94 0.006 248); --slot: oklch(0.345 0.03 248); --muted: oklch(0.78 0.012 248); }
.ch--talk .ch-head h2 { font-size: clamp(38px, 8vw, 124px); line-height: .84; letter-spacing: -.045em; max-width: 14ch; }

/* ───── editorial type, 2026-10-04: Newsreader for headlines and text, Libre Franklin for labels ───── */
:root {
  --font: "Newsreader", Georgia, "Times New Roman", serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
}
body { font-optical-sizing: auto; }

/* headlines: semibold serif with gentle tracking (Bricolage needed 800 and -.05em) */
.hero h1, .lane-name, .panel .ch-head h2, .docs-title, .book-title, .talk {
  font-weight: 600; letter-spacing: -.025em; line-height: .9;
}
.doc h3 { font-weight: 600; letter-spacing: -.01em; }
.hero-lead, .lanes-lead, .lead, .about p, .more-t, .email { letter-spacing: -.005em; }

/* labels, kickers and navigation in a newspaper sans */
.skip, .label, .topline, .meta, .ch-meta, .ch-head > a, .ch-links, .cta, .lane-q, .lanes-foot,
.chips li, .credits dt, .shot figcaption, .swatches, .redacted-s, .more-k, .links, .foot,
.dg-page span, .lb-top, .lb-close, .lb-count, .lb-hint {
  font-family: var(--sans);
}
.ch-meta { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
