/* ------------------------------------------------------------------
   Mohamed Sobhy Elkamhawy — site styles
   Tokens → base → layout → components → page sections → responsive
------------------------------------------------------------------- */

:root {
  color-scheme: light;
  --bg: #F5F7F9;
  --surface: #FFFFFF;
  --surface-2: #EEF2F6;
  --ink: #101826;
  --ink-2: #3A4655;
  --muted: #5B6675;
  --line: #DDE3EA;
  --accent: #1F5F8B;
  --accent-ink: #FFFFFF;
  --teal: #0E7C7B;
  --inverse-bg: #101826;
  --inverse-ink: #F5F7F9;
  --inverse-muted: #9FB3C8;
  --shadow: 0 20px 50px -30px rgba(16, 24, 38, .35);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 56px);
  --section: clamp(64px, 9vw, 120px);
  --radius: 10px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F1720;
  --surface: #16212C;
  --surface-2: #1C2936;
  --ink: #E6ECF2;
  --ink-2: #C3CDD8;
  --muted: #8A9AAB;
  --line: #22303D;
  --accent: #7FB3D9;
  --accent-ink: #0B121A;
  --teal: #5FB3B0;
  --inverse-bg: #E6ECF2;
  --inverse-ink: #101826;
  --inverse-muted: #5B6675;
  --shadow: 0 20px 50px -30px rgba(0, 0, 0, .7);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0F1720;
    --surface: #16212C;
    --surface-2: #1C2936;
    --ink: #E6ECF2;
    --ink-2: #C3CDD8;
    --muted: #8A9AAB;
    --line: #22303D;
    --accent: #7FB3D9;
    --accent-ink: #0B121A;
    --teal: #5FB3B0;
    --inverse-bg: #E6ECF2;
    --inverse-ink: #101826;
    --inverse-muted: #5B6675;
    --shadow: 0 20px 50px -30px rgba(0, 0, 0, .7);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--teal); }
h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: -.015em; line-height: 1.1; text-wrap: pretty; }
p { margin: 0; text-wrap: pretty; }
em { font-style: italic; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip-link:focus { top: 12px; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-top: var(--section); }
.grid { display: grid; gap: 20px; }
.muted { color: var(--muted); }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); flex: none; }
.lede { font-size: clamp(17px, 1.3vw, 19px); line-height: 1.6; color: var(--ink-2); max-width: 60ch; }
.more { font-size: 14px; font-weight: 600; white-space: nowrap; }
.more::after { content: " →"; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(30px, 3.4vw, 40px); }
.section-head .lede { margin-top: 12px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 6px; font-weight: 600; font-size: 14px; line-height: 1; white-space: nowrap; border: 1px solid transparent; transition: background-color .2s, color .2s, border-color .2s, transform .15s; min-height: 44px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--teal); color: var(--accent-ink); }
.btn-ink { background: var(--inverse-bg); color: var(--inverse-ink); }
.btn-ink:hover { background: var(--accent); color: var(--accent-ink); }
.btn-outline { border-color: var(--ink); color: var(--ink); border-radius: 999px; padding: 10px 18px; min-height: 40px; }
.btn-outline:hover { background: var(--ink); color: var(--bg); }
.btn-ghost { color: var(--ink); padding-inline: 8px; }
.btn-ghost:hover { color: var(--accent); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.brand { display: inline-flex; align-items: center; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; background: var(--inverse-bg); color: var(--inverse-ink); display: grid; place-items: center; font-family: var(--serif); font-size: 15px; letter-spacing: .02em; flex: none; }
.brand-name { font-family: var(--serif); font-weight: 500; font-size: 20px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.brand-role { display: block; font-family: var(--sans); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 5px; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a:not(.btn) { font-size: 14px; font-weight: 500; color: var(--ink-2); position: relative; padding: 6px 0; }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); border-radius: 2px; }
.header-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
.menu-btn { display: none; }

/* ---------- Footer ---------- */
.site-footer { margin-top: var(--section); background: var(--surface); border-top: 1px solid var(--line); }
.site-footer .wrap { padding-block: clamp(48px, 6vw, 72px) 28px; display: flex; flex-direction: column; gap: 40px; }
.footer-cta { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.footer-cta h2 { font-size: clamp(30px, 3.6vw, 44px); max-width: 20ch; }
.footer-meta { display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 18px; }
.footer-meta ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px 20px; flex-wrap: wrap; }
.footer-meta a { color: var(--ink-2); }
.footer-meta a:hover { color: var(--accent); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.card h3 { font-size: 24px; line-height: 1.2; }
.card p { font-size: 14.5px; color: var(--muted); }
.card-dark { background: var(--inverse-bg); color: var(--inverse-ink); border-color: transparent; padding: 34px; justify-content: space-between; min-height: 300px; }
.card-dark .kicker { color: var(--inverse-muted); }
.card-dark h3 { font-size: clamp(24px, 2.4vw, 30px); max-width: 24ch; }
.card-dark p { color: color-mix(in srgb, var(--inverse-ink) 78%, var(--inverse-bg)); max-width: 54ch; }
.card .outcome { font-size: 13px; font-weight: 600; color: var(--teal); }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; padding-top: clamp(48px, 6vw, 80px); }
.hero-copy { display: flex; flex-direction: column; gap: 26px; }
.hero h1 { font-size: clamp(40px, 5.2vw, 64px); line-height: 1.04; letter-spacing: -.02em; }
.hero h1 em { color: var(--accent); }
.hero-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.portrait { position: relative; }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; }
.portrait figcaption { position: absolute; left: -28px; bottom: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; font-size: 13px; line-height: 1.5; box-shadow: var(--shadow); max-width: 280px; }
.portrait figcaption q { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink); quotes: "“" "”"; }
.portrait figcaption span { display: block; color: var(--muted); margin-top: 4px; }

/* ---------- Proof strip ---------- */
.proof { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); margin-top: clamp(48px, 6vw, 72px); }
.proof > div { padding: 22px; border-right: 1px solid var(--line); }
.proof > div:first-child { padding-left: 0; }
.proof > div:last-child { border-right: 0; padding-right: 0; }
.proof strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1; }
.proof span { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ---------- Home: work teaser ---------- */
.work-teaser { grid-template-columns: 1.4fr 1fr; }
.work-teaser .stack { display: flex; flex-direction: column; gap: 20px; }
.work-teaser .stack .card { flex: 1; }
.work-teaser .stack h3 { font-size: 20px; }

/* ---------- Recommendations ---------- */
.recs { grid-template-columns: repeat(3, 1fr); }
.rec { margin: 0; justify-content: space-between; gap: 18px; }
.rec p { font-family: var(--serif); font-style: italic; font-size: 17.5px; line-height: 1.45; color: var(--ink); }
.rec footer { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.rec footer b { color: var(--ink); font-weight: 600; font-size: 14px; }
/* ---------- Curiosity (skills cloud) ---------- */
.curiosity { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.cloud { display: grid; place-items: center; padding: clamp(16px, 3vw, 40px); border-radius: 50%; background: radial-gradient(closest-side, var(--surface) 70%, transparent); }
.cloud img { width: 100%; max-width: 560px; }
.curiosity-copy { display: flex; flex-direction: column; gap: 20px; }
.curiosity-copy h2 { font-size: clamp(30px, 3.4vw, 40px); }
.landscape { margin: 8px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; border-top: 1px solid var(--line); padding-top: 22px; }
.landscape dt { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.landscape dd { margin: 0; font-size: 14.5px; color: var(--ink-2); }
.glance-wide { margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; border-top: 1px solid var(--line); padding-top: 22px; }
.glance-wide dt { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.glance-wide dd { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; }
.glance-wide b { font-weight: 600; }
.glance-wide span { color: var(--muted); font-size: 13.5px; }

/* ---------- Home: quote + glance ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 56px); align-items: start; }
blockquote.testimonial { margin: 0; display: flex; flex-direction: column; gap: 18px; }
blockquote.testimonial p { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2vw, 26px); line-height: 1.35; }
blockquote.testimonial footer { font-size: 13px; color: var(--muted); }
.glance { display: grid; grid-template-columns: 96px 1fr; gap: 10px 16px; font-size: 14.5px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 12px; }
.glance dt { color: var(--muted); }
.glance dd { margin: 0; }
.glance b { font-weight: 600; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding-top: clamp(48px, 6vw, 80px); display: flex; flex-direction: column; gap: 20px; }
.page-hero h1 { font-size: clamp(38px, 4.8vw, 58px); letter-spacing: -.02em; max-width: 22ch; }

/* ---------- Case studies ---------- */
.case { display: grid; grid-template-columns: 240px 1fr; gap: clamp(24px, 4vw, 52px); padding-block: 44px; border-top: 1px solid var(--line); }
.case:last-of-type { border-bottom: 1px solid var(--line); }
.case-meta { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); }
.case-meta .org { font-weight: 600; color: var(--ink); font-size: 15px; }
.case-meta .yrs { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; margin-top: 8px; }
.case-body { display: flex; flex-direction: column; gap: 18px; }
.case-body h3 { font-size: clamp(24px, 2.6vw, 32px); max-width: 26ch; }
.case-body .txt { max-width: 62ch; color: var(--ink-2); font-size: 16.5px; }
.decision { margin: 0; padding-left: 22px; border-left: 2px solid var(--accent); font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.35; max-width: 46ch; }
.decision b { display: block; font-family: var(--sans); font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.case .outcome { font-size: 14px; color: var(--muted); }
.case .outcome b { color: var(--teal); font-weight: 600; }

/* ---------- Archive ---------- */
.filters { display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-row > span { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); width: 72px; flex: none; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--ink-2); min-height: 36px; transition: background-color .15s, color .15s, border-color .15s; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--inverse-bg); color: var(--inverse-ink); border-color: var(--inverse-bg); }
.archive-count { font-size: 13.5px; color: var(--muted); }
.archive { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.project { display: flex; flex-direction: column; gap: 10px; padding: 22px; height: 100%; }
.project[hidden] { display: none; }
.project-top { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
.project-top .yr { font-variant-numeric: tabular-nums; }
.project h3 { font-size: 20px; line-height: 1.25; }
.project .org { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.project p { font-size: 14px; color: var(--muted); }
.project .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.project .tags span { font-size: 11.5px; padding: 4px 8px; border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.archive-empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- Services ---------- */
.services { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.service { display: grid; grid-template-columns: 240px 1fr; gap: clamp(24px, 4vw, 52px); padding-block: 44px; border-top: 1px solid var(--line); }
.service:last-of-type { border-bottom: 1px solid var(--line); }
.service-meta .dur { font-family: var(--serif); font-style: italic; font-size: 22px; display: block; margin-bottom: 8px; }
.service-meta p { font-size: 13.5px; color: var(--muted); }
.service-body { display: flex; flex-direction: column; gap: 18px; }
.service-body h3 { font-size: clamp(24px, 2.6vw, 32px); }
.service-body .txt { color: var(--ink-2); max-width: 62ch; font-size: 16.5px; }
.service-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.service-cols h4 { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.checklist li { padding-left: 18px; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .7em; width: 8px; height: 1px; background: var(--accent); }
.note { padding: 22px 26px; border-radius: var(--radius); background: var(--surface-2); color: var(--ink-2); font-size: 15px; max-width: 72ch; }
.note b { color: var(--ink); font-weight: 600; }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 600; font-size: 16px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 20px; color: var(--muted); max-width: 66ch; }

/* ---------- About ---------- */
.about-intro { grid-template-columns: 1fr 1.3fr; align-items: start; gap: clamp(32px, 5vw, 64px); }
.about-intro .portrait img { border-radius: 8px; }
.prose { display: flex; flex-direction: column; gap: 18px; font-size: 17px; color: var(--ink-2); max-width: 62ch; }
.prose .drop { font-family: var(--serif); font-size: clamp(22px, 2.2vw, 27px); line-height: 1.35; color: var(--ink); }
.timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 140px 1fr; gap: 12px 32px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.timeline time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 4px; }
.timeline h3 { font-family: var(--sans); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.timeline .org { font-size: 14px; color: var(--muted); margin-top: 2px; }
.timeline p { margin-top: 10px; font-size: 14.5px; color: var(--ink-2); max-width: 66ch; }
.skills { grid-template-columns: repeat(2, 1fr); gap: 0 clamp(24px, 4vw, 56px); border-top: 1px solid var(--line); }
.skill { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.skill h4 { font-family: var(--sans); font-size: 14px; font-weight: 600; }
.skill p { font-size: 14px; color: var(--muted); }
.certs { grid-template-columns: repeat(3, 1fr); }
.cert { gap: 6px; padding: 20px 22px; }
.cert .kicker { color: var(--muted); }
.cert h3 { font-family: var(--sans); font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.cert time { font-size: 13px; color: var(--muted); }

/* ---------- Writing ---------- */
.posts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.posts li { display: grid; grid-template-columns: 140px 1fr; gap: 12px 32px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.posts time { font-size: 13px; color: var(--muted); padding-top: 6px; }
.posts h3 { font-size: 26px; }
.posts p { margin-top: 10px; color: var(--muted); max-width: 64ch; }

/* ---------- Contact ---------- */
.contact { grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.contact-links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.contact-links li { border-bottom: 1px solid var(--line); }
.contact-links a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 2px; color: var(--ink); font-weight: 500; transition: padding-left .2s, color .2s; }
.contact-links a:hover { color: var(--accent); padding-left: 12px; }
.contact-links a span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.form { display: grid; gap: 18px; padding: clamp(24px, 3vw, 36px); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; min-height: 46px; width: 100%; }
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.form small { color: var(--muted); font-size: 13px; }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .nav { gap: 20px; }
  .brand-role { display: none; }
  .proof { grid-template-columns: repeat(2, 1fr); }
  .proof > div:nth-child(2) { border-right: 0; padding-right: 0; }
  .proof > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .proof > div:nth-child(3) { padding-left: 0; }
  .archive { grid-template-columns: repeat(2, 1fr); }
  .services, .certs, .recs { grid-template-columns: 1fr 1fr; }
  .glance-wide { grid-template-columns: repeat(3, 1fr); }
  .skills { grid-template-columns: 1fr; }
}

@media (max-width: 1000px) {
  .menu-btn { display: grid; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 20px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding: 14px 0; font-size: 16px; border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"]::after { display: none; }
  .nav a.btn { margin-top: 14px; }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero .portrait { order: -1; max-width: 360px; }
  .portrait figcaption { position: static; margin-top: 14px; box-shadow: none; max-width: none; }
  .work-teaser, .two-col, .about-intro, .contact, .curiosity { grid-template-columns: 1fr; }
  .cloud img { max-width: 420px; }
  .glance-wide { grid-template-columns: 1fr 1fr; }
  .about-intro .portrait { max-width: 360px; }
  .case, .service { grid-template-columns: 1fr; gap: 16px; }
  .service-cols { grid-template-columns: 1fr; }
  .skill { grid-template-columns: 1fr; gap: 4px; }
  .timeline li, .posts li { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 600px) {
  body { font-size: 15.5px; }
  .brand-name { font-size: 16px; letter-spacing: .06em; }
  .proof { grid-template-columns: 1fr; }
  .proof > div { padding: 16px 0 !important; border-right: 0 !important; border-top: 1px solid var(--line); }
  .proof > div:first-child { border-top: 0; }
  .archive, .services, .certs, .grid-2, .recs, .landscape, .glance-wide { grid-template-columns: 1fr; }
  .filter-row > span { width: 100%; }
  .form .row { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .decision { font-size: 18px; }
}
