/* byfahad blog: shared article system (Cost of the Cradle I + II and any future post).
   Layout = one named grid: default column is the reading column; .wide breaks out to ~1200px; .full goes edge to edge.
   Palette/fonts come from the existing site (Space Grotesk, Newsreader, Inter); nothing new is loaded. */
:root { --bg:#0B0B0A; --ink:#F2EFE8; --body:#DCD8CD; --muted:#A39C8E; --faint:#8F897B; --line:#262319; --panel:#17150F; --accent:#B23A2E;
  --font-display:'Space Grotesk',-apple-system,'Segoe UI','Helvetica Neue',Arial,sans-serif;
  --font-sans:'Inter',-apple-system,'Segoe UI','Helvetica Neue',Arial,sans-serif;
  --font-serif:'Newsreader','Iowan Old Style','Palatino Linotype',Palatino,Georgia,serif;
  --fw-regular:400; --fw-medium:500; --fw-bold:700; --ease:cubic-bezier(0.22,0.7,0.2,1);
  --fs-xs:.75rem; --fs-sm:.875rem; --fs-md:1rem; --fs-lg:1.25rem;
  --measure:700px; --wide:1200px; --gutter:clamp(20px,5.5vw,96px);
  --space-section:clamp(56px,8vw,96px); --space-block:clamp(32px,5vw,56px);
  color-scheme: dark; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body { min-height: 100dvh; overflow-x: clip; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-weight: var(--fw-regular); font-synthesis: none; -webkit-font-smoothing: antialiased; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -64px; z-index: 10; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: #0B0B0A; font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.skip:focus-visible { top: max(12px, env(safe-area-inset-top)); outline-color: var(--accent); }

/* site bar (unchanged look) */
.bar { display: flex; align-items: center; justify-content: space-between; padding: max(18px, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 18px max(var(--gutter), env(safe-area-inset-left)); }
.wordmark { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-lg); letter-spacing: -0.03em; }
.back { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid rgba(242,239,232,.22); border-radius: 999px; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--muted); transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease); }
.back:hover { color: var(--ink); border-color: rgba(242,239,232,.6); background: rgba(242,239,232,.05); }

/* grid */
.wrap { padding: 0 0 max(80px, env(safe-area-inset-bottom)); container-type: inline-size; }
.collab { --g: max(var(--gutter), env(safe-area-inset-left), env(safe-area-inset-right));
  --read: min(var(--measure), 100cqw - 2 * var(--g));
  --side: max(0px, (min(var(--wide), 100cqw - 2 * var(--g)) - var(--read)) / 2);
  display: grid; align-items: start;
  grid-template-columns: [full-start] minmax(var(--g), 1fr) [wide-start] var(--side) [read-start] var(--read) [read-end] var(--side) [wide-end] minmax(var(--g), 1fr) [full-end]; }
.collab > *, .masthead > * { grid-column: read; min-width: 0; }
.masthead { display: contents; }
.collab .wide { grid-column: wide; }
.collab .full { grid-column: full; }

/* header */
.crumbs { margin-top: clamp(20px,4vw,48px); font-size: var(--fs-xs); font-weight: var(--fw-medium); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.crumbs li { display: flex; align-items: center; }
.crumbs li + li::before { content: "/"; margin-right: 10px; color: var(--faint); }
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--faint); }
.meta { margin-top: clamp(28px,5vw,48px); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-xs); font-weight: var(--fw-medium); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.meta .tag { color: var(--accent); }
.collab h1.title { margin-top: 10px; font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.6rem, 6.4vw, 5.5rem); line-height: 1.02; letter-spacing: -.02em; text-wrap: balance; overflow-wrap: break-word; }
.collab .sub { margin-top: clamp(14px,2.5vw,22px); font-family: var(--font-serif); font-size: clamp(1.125rem, 1rem + .6vw, 1.5rem); line-height: 1.35; color: var(--muted); text-wrap: balance; }
.collab .credit { margin-top: clamp(22px,3.5vw,32px); padding-top: 14px; border-top: 1px solid var(--line); font-size: var(--fs-xs); font-weight: var(--fw-medium); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.collab .credit b { font-weight: var(--fw-medium); color: var(--muted); }

/* photography */
.lead, .photo { margin: 0; }
.lead { margin-top: var(--space-block); }
.lead img, .photo img { display: block; width: 100%; height: auto; background: #000; }
.lead.portrait { grid-column: read; }
.lead.portrait img { width: auto; max-width: 100%; max-height: min(88vh, 960px); }
figcaption { margin-top: 12px; font-size: var(--fs-xs); line-height: 1.5; letter-spacing: .04em; color: var(--faint); }
figcaption .credit-line { letter-spacing: .12em; text-transform: uppercase; }
.lead { grid-column: wide; }
.photo-pair { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: clamp(8px,1.5vw,16px); }
.photo-pair figure { margin: 0; }
.photo.full img { max-height: 92vh; object-fit: cover; }
@media (max-width: 767px) {
  .lead { grid-column: full; }
  .lead.portrait { grid-column: full; }
  .lead.portrait img { width: 100%; max-height: none; }
  .lead figcaption, .photo.full figcaption { padding-inline: var(--gutter); }
  .photo-pair { grid-template-columns: 1fr; }
}

/* pull quote (reusable: <blockquote class="pull"><p>…</p><footer>— Name</footer></blockquote>) */
.pull, .collab .essay-quote { margin-top: var(--space-section); padding: 0; border: 0; }
.pull::before, .essay-quote::before { content: ""; display: block; width: 40px; height: 1px; margin-bottom: clamp(20px,3vw,28px); background: var(--faint); }
.pull p, .essay-quote p { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: clamp(1.625rem, 1.1rem + 2.3vw, 2.75rem); line-height: 1.22; letter-spacing: -.01em; color: var(--ink); text-wrap: balance; }
.pull footer, .essay-quote footer { margin-top: 18px; font-size: var(--fs-xs); font-weight: var(--fw-medium); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.essay-quote + .essay { margin-top: var(--space-section); }

/* body copy */
.essay { margin-top: var(--space-section); }
.essay p { margin-top: 1.4em; font-size: clamp(1.0625rem, .98rem + .4vw, 1.1875rem); line-height: 1.75; color: var(--body); text-wrap: pretty; }
.essay > p:first-child { margin-top: 0; }
.essay a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(242,239,232,.4); }
.essay a:hover { text-decoration-color: var(--ink); }
.essay em { font-style: italic; }
.essay p.beat { margin-top: clamp(40px,6vw,56px); font-family: var(--font-serif); font-style: italic; font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.125rem); line-height: 1.3; color: var(--ink); text-wrap: balance; }
.essay p.beat + p { margin-top: clamp(24px,4vw,36px); }
.essay h2 { margin-top: var(--space-section); font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); line-height: 1.15; letter-spacing: -.01em; color: var(--ink); text-wrap: balance; }
.essay h2 + p, .essay h2 + ul { margin-top: clamp(18px,3vw,26px); }
.essay ul.points { list-style: none; margin-top: clamp(24px,4vw,32px); border-top: 1px solid var(--line); }
.essay ul.points li { padding: clamp(18px,3vw,26px) 0; border-bottom: 1px solid var(--line); font-size: clamp(1.0625rem, .98rem + .4vw, 1.1875rem); line-height: 1.75; color: var(--body); text-wrap: pretty; }
.essay ul.points strong { display: block; margin-bottom: 6px; font-size: var(--fs-xs); font-weight: var(--fw-medium); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* closing statement: full-bleed band, the one intentionally centred moment */
.closing { grid-column: full; margin-top: calc(var(--space-section) + 16px); background: #050505; border-block: 1px solid var(--line); padding: clamp(72px,14vw,140px) var(--gutter); text-align: center; }
.closing::before { content: ""; display: block; width: 40px; height: 1px; margin: 0 auto clamp(28px,5vw,44px); background: var(--faint); }
.closing h2 { max-width: 24ch; margin: 0 auto; font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.85rem, 1.2rem + 2.8vw, 3.25rem); line-height: 1.18; letter-spacing: -.01em; color: var(--ink); text-wrap: balance; }
.closing h2.long { max-width: 30ch; font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.5rem); line-height: 1.25; }

/* ending */
.read { margin-top: var(--space-block); }
.read p { max-width: 54ch; color: #BDB6A8; font-size: var(--fs-md); }
.btn { display: inline-flex; align-items: center; gap: 12px; margin-top: 20px; min-height: 52px; padding: 0 26px; border: 1px solid rgba(242,239,232,.7); border-radius: 999px; background: rgba(242,239,232,.06); font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--ink); transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease); }
.btn [aria-hidden] { display: inline-block; transition: transform .2s var(--ease); }
.btn:hover { background: var(--ink); border-color: var(--ink); color: #0B0B0A; }
.btn:hover [aria-hidden] { transform: translateX(4px); }
.btn:active { transform: scale(.98); }
.article-foot { display: contents; }
.colophon { grid-column: read; margin-top: var(--space-section); padding-top: 20px; border-top: 1px solid var(--line); font-size: var(--fs-xs); line-height: 1.9; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.colophon > div { display: flex; flex-wrap: wrap; align-items: center; column-gap: .6em; min-height: 32px; }
.colophon dt { color: var(--muted); }
.colophon dd { margin: 0; }
.colophon a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.colophon a:hover { color: var(--ink); }
.series-next { grid-column: read; margin-top: var(--space-block); }
.series-next a { display: block; padding: clamp(22px,4vw,32px) 0; border-block: 1px solid var(--line); transition: padding-left .25s var(--ease); }
.series-next a:hover { padding-left: 10px; }
.series-next .kicker { display: block; font-size: var(--fs-xs); font-weight: var(--fw-medium); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.series-next .t { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-top: 10px; font-family: var(--font-serif); font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.25rem); line-height: 1.15; color: var(--ink); }
.series-next .t [aria-hidden] { transition: transform .2s var(--ease); }
.series-next a:hover .t [aria-hidden] { transform: translateX(4px); }
.series-next .d { display: block; margin-top: 8px; max-width: 54ch; font-size: var(--fs-sm); color: var(--muted); }
.post-foot { grid-column: read; margin-top: clamp(20px,4vw,32px); display: flex; flex-wrap: wrap; gap: 4px 24px; justify-content: space-between; align-items: center; color: var(--muted); font-size: var(--fs-sm); }
.post-foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: var(--fw-medium); }
.post-foot a:hover { text-decoration: underline; text-underline-offset: 4px; }
.post-foot .quiet { color: var(--muted); font-weight: var(--fw-regular); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.series-next.prev .t { flex-direction: row-reverse; justify-content: flex-end; }
.series-next.prev a:hover .t [aria-hidden] { transform: translateX(-4px); }

/* Progressive blur at the top and bottom edge of the viewport: text softens as it leaves the screen. */
.pblur { position: fixed; left: 0; right: 0; z-index: 5; pointer-events: none; user-select: none; -webkit-user-select: none; height: clamp(64px, 13vh, 120px);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.pblur.top { top: 0; background: linear-gradient(to top, transparent, rgba(11,11,10,.72));
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent); mask-image: linear-gradient(to bottom, #000 45%, transparent); }
.pblur.bottom { bottom: 0; background: linear-gradient(to bottom, transparent, rgba(11,11,10,.72));
  -webkit-mask-image: linear-gradient(to top, #000 45%, transparent); mask-image: linear-gradient(to top, #000 45%, transparent); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .pblur { display: none; } }

/* Scroll ruler: tick marks fill as you read, a pointer + percentage follows the current position (wide screens only). */
.ruler { position: fixed; left: max(20px, calc(var(--gutter) * .5)); top: 50%; z-index: 5; width: 72px; height: 240px; margin-top: -120px; pointer-events: none; user-select: none; display: none; font-family: var(--font-sans); }
@media (min-width: 1100px) { .ruler { display: block; } }
.ruler i { position: absolute; left: 0; width: 20px; height: 1px; background: rgba(242,239,232,.18); }
.ruler i.on { background: rgba(242,239,232,.9); }
.ruler .cur { position: absolute; left: 0; top: 0; width: 72px; height: 0; will-change: transform; }
.ruler .cur::before { content: ""; position: absolute; left: 0; top: 0; width: 40px; height: 1px; background: rgba(242,239,232,.7); }
.ruler .cur b { position: absolute; left: 48px; top: -10px; font-size: var(--fs-sm); font-weight: var(--fw-medium); line-height: 20px; font-variant-numeric: tabular-nums; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .ruler .cur { transition: none; } }
