/* =========================================================
   yusif zahmati â€” personal site
   Built in Apple's interface grammar: grouped greys, one tint,
   large titles, inset grouped lists, floating material chrome.
   No frameworks, no build step.
   ========================================================= */

:root {
  color-scheme: light;

  /* grounds â€” the iOS "grouped" pair: grey page, white containers */
  --bg:        #F5F5F7;
  --surface:   #FFFFFF;
  --surface-2: #FAFAFC;
  --raised:    #F5F5F7;
  --fill:      rgba(120, 120, 128, .12);
  --fill-2:    rgba(120, 120, 128, .20);

  /* labels. --label-3 only ever sets large type: it clears 3:1, not 4.5:1 */
  --label:   #1D1D1F;
  --label-2: #6E6E73;
  --label-3: #86868B;
  --sep:     rgba(60, 60, 67, .16);

  --tint:      #0066CC;
  --tint-hi:   #0077ED;
  --tint-solid: #0066CC;
  --tint-solid-hi: #0058B0;
  --tint-fill: rgba(0, 102, 204, .09);
  --on-tint:   #FFFFFF;
  --green:     #248A3D;

  /* chrome material */
  --material:      rgba(251, 251, 253, .72);
  --material-edge: rgba(255, 255, 255, .7);
  --material-line: rgba(0, 0, 0, .06);
  --lens:          rgba(0, 0, 0, .065);
  --float: 0 10px 34px -6px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .05);

  /* logos are drawn for light grounds, so their chip stays light everywhere */
  --chip:      #FFFFFF;
  --chip-edge: rgba(0, 0, 0, .06);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Geist", "Segoe UI", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Geist", "Segoe UI", system-ui, sans-serif;

  --max: 1080px;
  --gutter: clamp(20px, 5vw, 40px);
  --r-group: 22px;
  --r-tile: 28px;
}

/* dark: true black page, raised greys for containers â€” the same pair, inverted */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:        #000000;
    --surface:   #1C1C1E;
    --surface-2: #161618;
  --raised:    #2C2C2E;
    --fill:      rgba(120, 120, 128, .24);
    --fill-2:    rgba(120, 120, 128, .34);
    --label:   #F5F5F7;
    --label-2: #A1A1A6;
    --label-3: #6E6E73;
    --sep:     rgba(84, 84, 88, .55);
    --tint:      #2997FF;
    --tint-hi:   #47A6FF;
    --tint-solid: #0071E3;
    --tint-solid-hi: #0062C4;
    --tint-fill: rgba(41, 151, 255, .15);
    --on-tint:   #FFFFFF;
    --green:     #30D158;
    --material:      rgba(30, 30, 32, .68);
    --material-edge: rgba(255, 255, 255, .1);
    --material-line: rgba(255, 255, 255, .06);
    --lens:          rgba(255, 255, 255, .14);
    --float: 0 12px 38px -6px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3);
    --chip:      #D1D1D6;
    --chip-edge: transparent;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #000000;
  --surface:   #1C1C1E;
  --surface-2: #161618;
  --raised:    #2C2C2E;
  --fill:      rgba(120, 120, 128, .24);
  --fill-2:    rgba(120, 120, 128, .34);
  --label:   #F5F5F7;
  --label-2: #A1A1A6;
  --label-3: #6E6E73;
  --sep:     rgba(84, 84, 88, .55);
  --tint:      #2997FF;
  --tint-hi:   #47A6FF;
  --tint-solid: #0071E3;
  --tint-solid-hi: #0062C4;
  --tint-fill: rgba(41, 151, 255, .15);
  --on-tint:   #FFFFFF;
  --green:     #30D158;
  --material:      rgba(30, 30, 32, .68);
  --material-edge: rgba(255, 255, 255, .1);
  --material-line: rgba(255, 255, 255, .06);
  --lens:          rgba(255, 255, 255, .14);
  --float: 0 12px 38px -6px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3);
  --chip:      #D1D1D6;
  --chip-edge: transparent;
}

/* ---------------- base ---------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  scrollbar-color: var(--fill-2) transparent;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 1.0625rem;          /* 17px, the iOS body size */
  line-height: 1.53;
  letter-spacing: -.011em;
  font-feature-settings: "kern";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  caret-color: var(--tint);
}

h1, h2, h3 { margin: 0; font-family: var(--display); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
strong { font-weight: 600; color: var(--label); }
svg { flex-shrink: 0; }

::selection { background: var(--tint-fill); color: var(--label); }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent);
  outline-offset: 2px;
  border-radius: 8px;
}

.skip {
  position: fixed; top: 10px; left: 10px; z-index: 80;
  padding: 10px 16px;
  background: var(--label); color: var(--bg);
  font-size: 14px; font-weight: 600;
  border-radius: 999px;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

/* ---------------- type ---------------- */

/* tracking is size-specific: the bigger the type, the tighter */
.display {
  font-size: clamp(2.55rem, 1.1rem + 5.4vw, 4.75rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.034em;
  text-wrap: balance;
}

.title {
  font-size: clamp(2rem, 1.25rem + 3vw, 3.25rem);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: -.028em;
  max-width: 22ch;
  text-wrap: balance;
  margin-bottom: clamp(30px, 4.5vw, 52px);
}

/* the second sentence of a headline drops to grey â€” weight unchanged */
.dim { color: var(--label-3); }

.lede {
  font-size: clamp(1.1875rem, 1rem + .6vw, 1.375rem);
  line-height: 1.45;
  letter-spacing: -.016em;
  color: var(--label-2);
  max-width: 34em;
}
.lede strong { color: var(--label); }

/* ---------------- controls ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -.011em;
  cursor: pointer;
  user-select: none;
  transition: transform .32s cubic-bezier(.2, .8, .2, 1), background-color .2s;
}
/* feedback lives on the press, and it's instant */
.btn:active { transform: scale(.96); transition: transform .1s ease-out, background-color .1s; }
.btn-primary { background: var(--tint-solid); color: var(--on-tint); }
.btn-primary:hover { background: var(--tint-solid-hi); }
.btn-tinted { background: var(--tint-fill); color: var(--tint); }
.btn-tinted:hover { background: color-mix(in srgb, var(--tint) 16%, transparent); }
.btn svg { width: 18px; height: 18px; }

/* inline "Learn more â€º" link */
.more {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--tint);
  font-weight: 400;
  white-space: nowrap;
}
.more svg { width: 14px; height: 14px; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.more:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.more:hover svg { transform: translateX(2px); }

.round {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--fill);
  color: var(--label);
  cursor: pointer;
  transition: background-color .2s, opacity .2s, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.round:hover { background: var(--fill-2); }
.round:active { transform: scale(.92); transition-duration: .1s; }
.round:disabled { opacity: .35; cursor: default; transform: none; }
.round svg { width: 18px; height: 18px; }

/* ---------------- top bar + floating tab capsule ---------------- */

.bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
  padding-top: env(safe-area-inset-top, 0px);
}

.sig {
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -.02em;
}

#theme {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--label-2);
  cursor: pointer;
  transition: background-color .2s, color .2s, transform .3s cubic-bezier(.2, .8, .2, 1);
}
#theme:hover { background: var(--fill); color: var(--label); }
#theme:active { transform: scale(.9); transition-duration: .1s; }
#theme svg { width: 20px; height: 20px; }
.i-sun { display: none; }
[data-theme="dark"] .i-sun { display: block; }
[data-theme="dark"] .i-moon { display: none; }

.tabs {
  position: fixed;
  z-index: 60;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  transform: translateX(-50%);
  display: flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--material);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
          backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--float), inset 0 0 0 .5px var(--material-line), inset 0 1px 0 var(--material-edge);
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tabs-list { position: relative; display: flex; }

.tabs a {
  position: relative; z-index: 1;
  display: block;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: -.006em;
  color: var(--label-2);
  white-space: nowrap;
  transition: color .2s;
}
.tabs a:hover, .tabs a.here { color: var(--label); }

/* the selection lens; main.js springs it between items */
.lens {
  position: absolute; z-index: 0;
  top: 0; left: 0; bottom: 0;
  width: 0;
  border-radius: 999px;
  background: var(--lens);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  will-change: transform, width;
}
.lens.on { opacity: 1; }

/* ---------------- hero ---------------- */

.hero {
  padding: clamp(28px, 6vw, 84px) 0 clamp(40px, 4vw, 56px);
}
.hero .display { max-width: 15.5ch; margin-bottom: clamp(26px, 3.4vw, 40px); }
.hero .lede { margin-bottom: 28px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }

.now {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: .9375rem;
  color: var(--label-2);
}
.now .sep { color: var(--label-3); }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent);
  flex-shrink: 0;
}

/* ---------------- logo rail ---------------- */

.strip { padding-bottom: clamp(24px, 4vw, 40px); }

.strip-label {
  font-size: .8125rem;
  color: var(--label-2);
  margin-bottom: 16px;
}

.rail {
  display: flex;
  width: calc(100vw - var(--sbw, 0px));
  margin-left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.rail-track {
  display: flex; align-items: center;
  gap: 12px;
  padding-right: 12px;
  flex-shrink: 0;
  animation: rail 48s linear infinite;
}
.rail:hover .rail-track { animation-play-state: paused; }

@keyframes rail {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

.logo {
  flex-shrink: 0;
  height: 68px;
  min-width: 136px;
  padding: 0 26px;
  display: grid; place-items: center;
  background: var(--chip);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px var(--chip-edge);
  transition: background-color .3s;
}
/* the platter stays solid; only the mark is muted until hover */
.logo img, .logo span { filter: grayscale(1) contrast(1.35) brightness(.88); transition: filter .3s; }
.logo:hover { background: #F2F2F7; }
.logo:hover img, .logo:hover span { filter: none; }

.logo img { max-height: 28px; max-width: 110px; width: auto; height: auto; display: block; }
.logo.sq img { max-height: 44px; max-width: 44px; border-radius: 10px; }
.logo.plate img { border-radius: 4px; }

.logo span,
.proj-mark span { display: none; font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: #1D1D1F; white-space: nowrap; }
.logo.is-text img, .proj-mark.is-text img { display: none; }
.logo.is-text span, .proj-mark.is-text span { display: block; }

/* ---------------- sections ---------------- */

.section { padding-block: clamp(72px, 10vw, 128px); }

/* two plain sections in a row share one gap, not two */
.section:not(.band) + .section:not(.band) { padding-top: 0; }

.band {
  background: var(--surface);
}

/* ---------------- about ---------------- */

.prose { max-width: 40em; }
.prose p {
  font-size: clamp(1.0625rem, .98rem + .35vw, 1.25rem);
  line-height: 1.5;
  letter-spacing: -.014em;
  color: var(--label-2);
  margin-bottom: 1.1em;
}
.prose p:last-child { margin-bottom: 0; }
.prose em { font-style: normal; color: var(--label); font-weight: 500; }

.aside { margin-top: 1.6em !important; }

/* ---------------- inset grouped list ---------------- */

.group {
  background: var(--surface);
  border-radius: var(--r-group);
  overflow: hidden;
}
.band .group { background: var(--raised); }

.group > li { position: relative; }

/* hairlines inset from the leading edge, never touching the container */
.group > li + li::before {
  content: "";
  position: absolute; top: 0; right: 0;
  left: var(--inset, 22px);
  height: 1px;
  background: var(--sep);
  transform: scaleY(.5);
  transform-origin: top;
}

/* work rows */
.job {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 24px;
  padding: 20px 22px;
}
.job h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -.016em;
  line-height: 1.35;
}
.job .at { display: block; font-weight: 400; color: var(--label-2); font-size: .9375rem; letter-spacing: -.01em; margin-top: 1px; }
.job p {
  grid-column: 1;
  font-size: .9375rem;
  line-height: 1.47;
  letter-spacing: -.01em;
  color: var(--label-2);
  max-width: 58ch;
  margin-top: 6px;
}
.job .when {
  grid-column: 2; grid-row: 1;
  font-size: .9375rem;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-top: 1px;
}

.foot-note {
  margin-top: 22px;
  padding-inline: 22px;
  font-size: .875rem;
  line-height: 1.5;
  color: var(--label-2);
  max-width: 66ch;
}
.foot-note .more { margin-left: 4px; }

/* disclosure rows (writing, life, contact) */
.row {
  display: flex; align-items: center; gap: 16px;
  min-height: 56px;
  padding: 14px 18px 14px 22px;
  transition: background-color .15s;
}
a.row:hover { background: var(--surface-2); }
.band a.row:hover { background: color-mix(in srgb, var(--bg) 70%, var(--fill)); }
a.row:active { background: var(--fill); transition-duration: 0s; }

.row-body { flex: 1; min-width: 0; }
.row-title { display: block; font-size: 1.0625rem; font-weight: 500; letter-spacing: -.014em; line-height: 1.35; }
.row-sub { display: block; font-size: .9375rem; line-height: 1.45; letter-spacing: -.01em; color: var(--label-2); margin-top: 2px; }
.row-meta { font-size: .9375rem; color: var(--label-2); white-space: nowrap; }
.chev { width: 14px; height: 14px; color: var(--label-3); }

.row-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--tint-solid);
  color: #fff;
}
.row-icon svg { width: 18px; height: 18px; }

/* ---------------- project shelf ---------------- */

.shelf-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin-bottom: clamp(30px, 4.5vw, 52px);
}
.shelf-head .title { margin-bottom: 0; }
.shelf-nav { display: flex; gap: 12px; flex-shrink: 0; }

.shelf {
  --edge: max(var(--gutter), (100% - var(--max)) / 2);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--edge);
  scrollbar-width: none;
  cursor: grab;
  outline-offset: -3px;
}
.shelf::-webkit-scrollbar { display: none; }
.shelf.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.shelf.coasting { scroll-snap-type: none; }

.shelf-track {
  display: flex;
  gap: 16px;
  padding: 6px var(--edge) 10px;
  width: max-content;
  will-change: transform;
}

.proj {
  scroll-snap-align: start;
  width: clamp(280px, 78vw, 352px);
  min-height: 440px;
  display: flex; flex-direction: column;
  padding: 28px;
  background: var(--raised);
  border-radius: var(--r-tile);
}
.proj-mark {
  height: 60px;
  min-width: 60px;
  padding: 0 16px;
  align-self: flex-start;
  display: grid; place-items: center;
  background: var(--chip);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--chip-edge);
  margin-bottom: 32px;
}
.proj-mark img { max-height: 26px; max-width: 132px; width: auto; height: auto; display: block; pointer-events: none; }
.proj-mark.sq { padding: 0; width: 60px; overflow: hidden; }
.proj-mark.sq img { max-height: none; max-width: none; width: 60px; height: 60px; object-fit: cover; }


.proj h3 {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.024em;
}
.proj .for { font-size: .9375rem; color: var(--label-2); margin-top: 4px; }
.proj .desc {
  margin-top: 14px;
  font-size: .9375rem;
  line-height: 1.47;
  letter-spacing: -.01em;
  color: var(--label-2);
}
.proj-foot {
  margin-top: auto;
  padding-top: 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: .875rem;
  color: var(--label-2);
}
.proj-foot .more { font-size: .9375rem; }

/* ---------------- life (home) ---------------- */

.life-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(20px, 3vw, 32px);
  align-items: stretch;
}
.life-photo {
  position: relative;
  margin: 0;
  border-radius: var(--r-tile);
  overflow: hidden;
  background: var(--fill);
  min-height: 420px;
}
.life-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.life-side { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.life-side .lede { font-size: clamp(1.0625rem, .98rem + .35vw, 1.25rem); }

/* ---------------- contact ---------------- */

.contact .group { max-width: 640px; }

.contact .row { gap: 14px; }
.contact .row-title { font-size: 1.0625rem; font-weight: 400; }
.row-value { color: var(--label-2); font-size: .9375rem; overflow-wrap: anywhere; }

.row-split { display: flex; align-items: center; }
.row-split > a { flex: 1; min-width: 0; }

.copy {
  margin-right: 14px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--tint-fill);
  color: var(--tint);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), background-color .2s;
}
.copy:hover { background: color-mix(in srgb, var(--tint) 16%, transparent); }
.copy:active { transform: scale(.94); transition-duration: .1s; }

/* ---------------- footer ---------------- */

.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding-block: 28px calc(36px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--sep);
  font-size: .8125rem;
  color: var(--label-2);
}
.foot a { display: inline-flex; align-items: center; gap: 4px; }
.foot a:hover { color: var(--label); }
.foot svg { width: 12px; height: 12px; }

/* ---------------- page header (writing, life, article) ---------------- */

.page-head { padding: clamp(56px, 9vw, 112px) 0 clamp(40px, 6vw, 72px); }
.page-head .display { margin-bottom: 22px; max-width: 18ch; }

.back {
  display: inline-flex; align-items: center; gap: 2px;
  color: var(--tint);
  font-size: 1.0625rem;
  margin-bottom: 28px;
  margin-left: -4px;
}
.back svg { width: 20px; height: 20px; }
.back:hover { text-decoration: underline; text-underline-offset: 3px; }

.page-section { padding-bottom: clamp(64px, 9vw, 112px); }
.page-section > h2 {
  font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -.024em;
  line-height: 1.1;
  margin-bottom: 18px;
}

/* author notes left in the page until the real text exists */
.draft {
  margin-top: 26px;
  max-width: 40em;
  padding: 16px 20px;
  border: 1px dashed var(--fill-2);
  border-radius: 16px;
  font-size: .9375rem;
  line-height: 1.5;
  color: var(--label-2);
}
.draft code { color: var(--label); }

code { font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace; font-size: .9em; }

/* ---------------- photo grid (life page) ---------------- */

.country {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -.014em;
  margin: 40px 0 14px;
}

.shots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.draft + .shots { margin-top: 26px; }
@media (max-width: 860px) { .shots { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.shots:not(:has(li:not([hidden]))) { display: none; }

.shots figure { margin: 0; }
.shots a { display: block; border-radius: 18px; }

.shots img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--fill);
  border-radius: 18px;
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), filter .3s;
}
.shots a:hover img { transform: scale(.985); filter: brightness(1.04); }
.shots a.is-source img { visibility: hidden; }

.shots figcaption {
  font-size: .8125rem;
  color: var(--label-2);
  margin-top: 8px;
}

/* ---------------- photo viewer ---------------- */

.viewer {
  position: fixed; inset: 0; z-index: 90;
  touch-action: none;
}
.viewer-scrim {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .92);
  -webkit-backdrop-filter: blur(20px);
          backdrop-filter: blur(20px);
  opacity: 0;
}
.viewer-frame {
  position: fixed;
  overflow: hidden;
  border-radius: 18px;
  cursor: grab;
  will-change: transform, left, top, width, height;
}
.viewer-frame:active { cursor: grabbing; }
.viewer-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.viewer-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  right: 16px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(60, 60, 64, .62);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
          backdrop-filter: blur(20px) saturate(180%);
  color: #fff;
  cursor: pointer;
  opacity: 0;
}
.viewer-close svg { width: 16px; height: 16px; }

/* ---------------- writing list + article ---------------- */

.posts-group .row-title { font-weight: 600; }

.article .display {
  font-size: clamp(2.2rem, 1.2rem + 3.6vw, 3.5rem);
  letter-spacing: -.03em;
  line-height: 1.07;
  max-width: 20ch;
}
.article .meta {
  font-size: .9375rem;
  color: var(--label-2);
}

.body { max-width: 38em; }
.body p {
  font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem);
  line-height: 1.6;
  letter-spacing: -.012em;
  margin-bottom: 1.2em;
}
.body h2 {
  font-size: clamp(1.375rem, 1.15rem + .8vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -.022em;
  line-height: 1.2;
  margin: 2em 0 .6em;
}
.body blockquote {
  margin: 1.6em 0;
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.125rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.026em;
  text-wrap: balance;
}
.body ul { margin-bottom: 1.4em; }
.body li {
  position: relative;
  padding-left: 22px;
  margin-bottom: .6em;
  font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem);
  line-height: 1.55;
}
.body li::before {
  content: "";
  position: absolute; left: 4px; top: .68em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--label-3);
}

/* ---------------- toast (HUD) ---------------- */

.toast {
  position: fixed; left: 50%; z-index: 70;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  display: flex; align-items: center; gap: 8px;
  padding: 11px 20px 11px 16px;
  border-radius: 999px;
  background: var(--material);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
          backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--float), inset 0 0 0 .5px var(--material-line);
  font-size: .9375rem;
  font-weight: 500;
  opacity: 0;
  transform: translate(-50%, 12px) scale(.94);
  filter: blur(6px);
  pointer-events: none;
  transition: opacity .3s, transform .45s cubic-bezier(.2, .8, .2, 1), filter .3s;
}
.toast svg { width: 18px; height: 18px; color: var(--green); }
.toast.on { opacity: 1; transform: translate(-50%, 0) scale(1); filter: none; }

/* ---------------- responsive ---------------- */

@media (max-width: 860px) {
  .life-grid { grid-template-columns: 1fr; }
  .life-photo { min-height: 0; aspect-ratio: 4 / 3; }
  .life-photo img { object-position: center 60%; }
}

/* below this the capsule moves to the bottom edge, where a thumb can reach it */
@media (max-width: 720px) {
  html { scroll-padding-top: 24px; }

  .tabs {
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    padding: 3px;
  }
  .tabs a { padding: 8px 10px; font-size: .8125rem; }

  .foot { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

  /* separators would dangle at a line start once the status wraps */
  .now { gap: 4px 14px; }
  .now .sep { display: none; }
  .now .dot { margin-right: -6px; }
  .toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 82px); }

  .job { grid-template-columns: 1fr; padding: 18px 20px; }
  .job .when { grid-column: 1; grid-row: auto; order: -1; font-size: .8125rem; padding: 0; }
  .group > li + li::before { left: var(--inset, 20px); }
  .row { padding-left: 20px; }
  .foot-note { padding-inline: 20px; }

  .shelf-nav { display: none; }
  .proj { min-height: 400px; padding: 24px; }

  .logo { height: 58px; min-width: 116px; padding: 0 20px; border-radius: 15px; }
  .logo img { max-height: 24px; max-width: 92px; }
  .logo.sq img { max-height: 38px; max-width: 38px; }
}

@media (max-width: 380px) {
  .tabs a { padding: 8px 8px; font-size: .78rem; }
}

/* ---------------- motion, transparency, contrast ---------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }

  /* a frozen rail inside overflow:hidden would strand every logo past the
     third â€” hand the reader a scrollbar instead, and drop the duplicate track */
  .rail { overflow-x: auto; }
  .rail-track { animation: none; }
  .rail-track[aria-hidden="true"] { display: none; }

  .toast { transition: opacity .2s !important; transform: translate(-50%, 0); filter: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .tabs, .toast { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --label-2: var(--label); --label-3: var(--label-2); --sep: var(--label-2); }
  .tabs, .toast { background: var(--surface); box-shadow: 0 0 0 1px var(--label); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .group, .proj { box-shadow: inset 0 0 0 1px var(--label-2); }
}

@media print {
  .tabs, #theme, .rail, .strip, .toast, .skip, .shelf-nav, .foot a, .shots, .actions, .life-photo { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .band { background: none; }
  .section { padding-block: 16px; page-break-inside: avoid; }
  .shelf { overflow: visible; }
  .shelf-track { flex-wrap: wrap; width: auto; padding: 0; }
  .proj { width: 45%; min-height: 0; }
}
