/* ============================================================
   ayushigupta.in - design system
   One border weight. One shadow ramp. One easing.
   Two signatures: the cobalt seam, and the blush that follows the cursor.
   ============================================================ */

:root {
  --bg:          #ffffff;
  --bg-2:        #f8fafc;
  --surface:     #ffffff;

  --text:        #2e3138;
  --muted:       #70767f;
  --faint:       #a1a7b0;

  --rule:        #ecEFF3;
  --rule-strong: #dbe0e7;

  --accent:      #2f5478;
  --accent-ink:  #ffffff;
  --accent-wash: #e6edf5;
  --blush:       47, 84, 120;   /* rgb, for the cursor glow */

  --shell:       68rem;
  --prose:       38rem;
  --r-lg:        20px;
  --r-md:        12px;
  --r-sm:        8px;

  --e1: 0 1px 2px -1px rgba(16,20,28,.06), 0 4px 10px -6px rgba(16,20,28,.10);
  --e2: 0 2px 4px -2px rgba(16,20,28,.06), 0 14px 30px -20px rgba(16,20,28,.24);
  --e3: 0 3px 6px -3px rgba(16,20,28,.07), 0 34px 62px -34px rgba(16,20,28,.32);
  --e4: 0 4px 8px -4px rgba(16,20,28,.08), 0 44px 78px -38px rgba(47,84,120,.28);

  --ease: cubic-bezier(.22,.68,.28,1);
  --slow: .9s;
  --mid:  .5s;
  --fast: .24s;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #20232a; --bg-2: #262a32; --surface: #282c33;
    --text: #e7eaef; --muted: #9aa2ad; --faint: #727a85;
    --rule: #333841; --rule-strong: #434a55;
    --accent: #8fb0cd; --accent-ink: #151b23; --accent-wash: #2b333d;
    --blush: 143, 176, 205;
    --e1: 0 1px 2px -1px rgba(0,0,0,.5), 0 4px 10px -6px rgba(0,0,0,.5);
    --e2: 0 2px 4px -2px rgba(0,0,0,.5), 0 14px 30px -20px rgba(0,0,0,.7);
    --e3: 0 3px 6px -3px rgba(0,0,0,.55), 0 34px 62px -34px rgba(0,0,0,.85);
    --e4: 0 4px 8px -4px rgba(0,0,0,.55), 0 44px 78px -38px rgba(143,176,205,.4);
  }
}

:root[data-theme="dark"] {
  --bg: #20232a; --bg-2: #262a32; --surface: #282c33;
  --text: #e7eaef; --muted: #9aa2ad; --faint: #727a85;
  --rule: #333841; --rule-strong: #434a55;
  --accent: #8fb0cd; --accent-ink: #151b23; --accent-wash: #2b333d;
  --blush: 143, 176, 205;
  --e1: 0 1px 2px -1px rgba(0,0,0,.5), 0 4px 10px -6px rgba(0,0,0,.5);
  --e2: 0 2px 4px -2px rgba(0,0,0,.5), 0 14px 30px -20px rgba(0,0,0,.7);
  --e3: 0 3px 6px -3px rgba(0,0,0,.55), 0 34px 62px -34px rgba(0,0,0,.85);
  --e4: 0 4px 8px -4px rgba(0,0,0,.55), 0 44px 78px -38px rgba(143,176,205,.4);
}

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

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.68;
  letter-spacing: -.009em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
p { margin: 0 0 1.1rem; }
p:last-child { margin-bottom: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }

.wrap { max-width: var(--shell); margin: 0 auto; padding: 0 2.25rem; }

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

h1 {
  font-size: clamp(2.4rem, 6.1vw, 4.6rem);
  font-weight: 500; line-height: 1.0;
  letter-spacing: -.042em; margin: 0 0 2rem; max-width: 12.2em;
}
h2 {
  font-size: clamp(1.9rem, 4.4vw, 3.05rem);
  font-weight: 500; line-height: 1.06;
  letter-spacing: -.036em; margin: 0 0 1.15rem; max-width: 15em;
}
h1 em, h2 em {
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-style: italic; font-weight: 400; letter-spacing: -.018em;
  color: var(--accent);
}
h1 .dot { color: var(--accent); }

.eyebrow {
  display: flex; align-items: center; gap: .85rem;
  font-size: .69rem; text-transform: uppercase; letter-spacing: .2em;
  font-weight: 600; color: var(--faint); margin: 0 0 1.65rem;
}
.eyebrow::before {
  content: ""; width: 1.9rem; height: 1px; flex: 0 0 auto;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--slow) var(--ease);
}
.eyebrow.in::before, .in > .eyebrow::before, .hero .eyebrow::before { transform: scaleX(1); }

.lede {
  font-size: clamp(1.04rem, 1.5vw, 1.18rem); line-height: 1.62;
  color: var(--muted); max-width: 40rem; margin: 0 0 2.5rem;
}
.lede strong { color: var(--text); font-weight: 600; }
.sectionintro { color: var(--muted); max-width: var(--prose); margin: 0 0 3.25rem; }

/* ---------------------------------------------- top bar */

.topbar {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--mid) ease;
}
.topbar.stuck { border-bottom-color: var(--rule); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 4.5rem; }

.mark { font-size: 1.04rem; font-weight: 600; letter-spacing: -.026em; transition: opacity var(--fast) ease; }
.mark:hover { opacity: .6; }

.navlinks { display: flex; align-items: center; gap: 1.75rem; font-size: .88rem; color: var(--muted); }
.navlinks a { position: relative; padding: .2rem 0; transition: color var(--fast) ease; }
.navlinks a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform var(--mid) var(--ease);
}
.navlinks a:hover { color: var(--text); }
.navlinks a:hover::after { transform: scaleX(1); transform-origin: left; }

/* the section you are reading */
.navlinks a.active { color: var(--text); }
.navlinks a.active::after {
  background: var(--accent);
  transform: scaleX(1);
  transform-origin: left;
}

.themetoggle {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule);
  color: var(--muted);
  border-radius: 999px;
  width: 2.3rem; height: 2.3rem;
  display: grid; place-items: center;
  cursor: pointer; flex: 0 0 auto;
  box-shadow: var(--e1);
  transition: color var(--fast) ease, border-color var(--fast) ease,
              box-shadow var(--mid) var(--ease), transform var(--mid) var(--ease);
}
.themetoggle:hover {
  color: var(--accent);
  border-color: var(--rule-strong);
  box-shadow: var(--e2);
  transform: translateY(-1px);
}
.themetoggle:active { transform: translateY(0) scale(.94); }

/* the sun turns into a moon: rays retract, a bite is taken out of the disc */
.themetoggle svg { display: block; overflow: visible; }

.themetoggle .sun {
  r: 5.2px;
  transition: r .5s var(--ease);
}
.themetoggle .moon {
  cx: 26px;
  transition: cx .5s var(--ease);
}
.themetoggle .rays {
  transform-origin: 12px 12px;
  opacity: 1;
  transition: opacity .35s ease, transform .55s var(--ease);
}

:root[data-theme="dark"] .themetoggle .sun  { r: 8px; }
:root[data-theme="dark"] .themetoggle .moon { cx: 16px; }
:root[data-theme="dark"] .themetoggle .rays { opacity: 0; transform: rotate(-45deg) scale(.4); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .themetoggle .sun  { r: 8px; }
  :root:not([data-theme="light"]) .themetoggle .moon { cx: 16px; }
  :root:not([data-theme="light"]) .themetoggle .rays { opacity: 0; transform: rotate(-45deg) scale(.4); }
}

@media (prefers-reduced-motion: reduce) {
  .themetoggle .sun, .themetoggle .moon, .themetoggle .rays { transition: none; }
}

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

.hero { padding-top: 7rem; padding-bottom: 4rem; }

/* two columns: copy left, portrait right */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(0, .62fr);
  align-items: center;
  gap: 2.5rem;
}
.hero-copy { min-width: 0; }

.hero-portrait {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 21rem;
}

/* the organic shape behind her */
.hero-portrait .blob {
  position: absolute;
  inset: -2% -11% 4% -11%;
  background: var(--accent);
  opacity: .15;
  border-radius: 58% 42% 46% 54% / 46% 50% 50% 54%;
  animation: blobDrift 16s ease-in-out infinite alternate;
}
:root[data-theme="dark"] .hero-portrait .blob,
:root:not([data-theme="light"]) .hero-portrait .blob { opacity: .2; }

@keyframes blobDrift {
  0%   { border-radius: 58% 42% 46% 54% / 46% 50% 50% 54%; transform: rotate(0deg)   scale(1); }
  100% { border-radius: 44% 56% 58% 42% / 55% 44% 56% 45%; transform: rotate(-5deg) scale(1.04); }
}

.hero-portrait img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 22px 34px rgba(16,20,28,.16));
  opacity: 0;
  transform: translateY(18px) scale(.97);
  animation: portraitIn 1.1s var(--ease) .35s forwards;
}
@keyframes portraitIn { to { opacity: 1; transform: none; } }
.herolinks { display: flex; flex-wrap: wrap; gap: .6rem; }

.pill {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid var(--rule); border-radius: 999px;
  background: var(--surface); color: var(--muted);
  padding: .58rem 1.2rem; font-size: .87rem; box-shadow: var(--e1);
  transition: color var(--fast) ease, border-color var(--fast) ease,
              box-shadow var(--mid) var(--ease), transform var(--mid) var(--ease);
}
.pill:hover { color: var(--text); border-color: var(--rule-strong); box-shadow: var(--e2); transform: translateY(-2px); }

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

section { padding: var(--sec-top) 0 var(--sec-pad); }
section + section { border-top: 1px solid var(--rule); }

/* ---------------------------------------------- stat strip */

.stripwrap { padding: 2.5rem 0 0; }
.strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--e2); overflow: hidden;
}
.stat { padding: 2rem 1.6rem; border-left: 1px solid var(--rule); position: relative; }
.stat:first-child { border-left: none; }
.stat b {
  display: block; font-variant-numeric: tabular-nums;
  font-size: clamp(1.5rem, 2.8vw, 2.05rem);
  font-weight: 500; letter-spacing: -.042em; line-height: 1.05; margin-bottom: .35rem;
}
.stat span { font-size: .76rem; color: var(--faint); line-height: 1.45; display: block; }
.stat::after {
  content: ""; position: absolute; inset: 0; background: var(--surface);
  transform-origin: left; transform: scaleX(1);
  transition: transform var(--slow) var(--ease) var(--d, 0s);
}
.strip.in .stat::after { transform: scaleX(0); }

/* ============================================================
   THE CARD
   ============================================================ */

.card, .rolecard, .contactbox {
  position: relative;
  isolation: isolate;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--e2);
  transition: box-shadow var(--slow) var(--ease),
              border-color var(--mid) ease,
              transform var(--slow) var(--ease);
}
.card:hover {
  border-color: var(--rule-strong);
  box-shadow: var(--e4);
  transform: translateY(-3px);
}
.rolecard:hover { border-color: var(--rule-strong); box-shadow: var(--e4); }

/* ---- the blush: a cobalt light that follows the cursor ---- */
.glow {
  position: absolute; inset: 0; z-index: 6;
  border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity var(--mid) ease;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%),
              rgba(var(--blush), .13), rgba(var(--blush), .05) 38%, transparent 66%);
}
.card:hover .glow, .rolecard:hover .glow, .contactbox:hover .glow { opacity: 1; }

/* ---------------------------------------------- work grid */

.work { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.card { padding: 2rem 2.1rem; display: flex; flex-direction: column; }
.card > * { position: relative; z-index: 7; }

.card .num {
  font-family: "Instrument Serif", Georgia, serif; font-style: italic;
  font-size: 1.05rem; color: var(--faint); display: block; margin-bottom: 1rem;
}
.card h3 { font-size: 1.18rem; font-weight: 600; letter-spacing: -.024em; margin: 0 0 .65rem; line-height: 1.28; }
.card p { color: var(--muted); font-size: .95rem; margin: 0 0 1.5rem; }
.card h3 .tag {
  font-size: .6rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 600;
  color: var(--faint); border: 1px solid var(--rule-strong); border-radius: 999px;
  padding: .12rem .5rem; margin-left: .5rem; vertical-align: .2em;
}

.stats, .chips { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: auto 0 0; padding: 0; }
.chips { margin: .35rem 0 1.6rem; gap: .45rem; }
.stats li, .chips li {
  font-size: .755rem; font-weight: 500; color: var(--muted);
  background: var(--bg-2); border: 1px solid var(--rule);
  border-radius: var(--r-sm); padding: .28rem .62rem;
  transition: color var(--fast) ease, border-color var(--fast) ease;
}
.card:hover .stats li, .rolecard:hover .chips li { color: var(--text); border-color: var(--rule-strong); }

/* ---------------------------------------------- role cards + stack */

.rolecard {
  display: grid;
  overflow: hidden;
  box-shadow: var(--e3);
}

.rolecard .dim {
  position: absolute; inset: 0; z-index: 9;
  background: var(--bg); opacity: 0; pointer-events: none;
  transition: opacity .1s linear;
}

/* ---- media, and the cobalt seam between photo and text ---- */
.rolecard-media {
  position: relative; min-height: 300px; overflow: hidden; background: var(--bg-2);
}

/* the seam - anchored to the card so it spans the full height, open or closed */
.rolecard::after {
  content: ""; position: absolute; top: 15.5rem; left: 0; right: 0; height: 3px;
  z-index: 8; pointer-events: none;
  background: linear-gradient(to right,
    rgba(var(--blush), 0) 0%,
    rgba(var(--blush), .55) 20%,
    rgba(var(--blush), .85) 50%,
    rgba(var(--blush), .55) 80%,
    rgba(var(--blush), 0) 100%);
  opacity: .6;
  transition: opacity var(--slow) var(--ease), height var(--slow) var(--ease);
}
.rolecard:hover::after { opacity: 1; height: 4px; }

.rolecard-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.1); transition: transform 1.4s var(--ease);
}
.rolecard.seen .rolecard-media img { transform: scale(1); }
.rolecard.seen:hover .rolecard-media img { transform: scale(1.045); }

.rolecard-media .wipe {
  position: absolute; inset: 0; z-index: 3;
  background: var(--surface);
  transform-origin: bottom; transform: scaleY(1);
  transition: transform 1.15s var(--ease);
  animation: wipeSafety 0s linear 1.4s forwards;
}
@keyframes wipeSafety { to { transform: scaleY(0); } }
.rolecard.seen .rolecard-media .wipe { transform: scaleY(0); }

/* ---- body ---- */
.rolecard-body { padding: 2.4rem 2.5rem; position: relative; z-index: 7; }

.rolecard-body .when {
  font-size: .69rem; text-transform: uppercase; letter-spacing: .2em;
  font-weight: 600; color: var(--faint); margin: 0 0 1rem;
}
.rolecard-body h3 { font-size: 1.18rem; font-weight: 600; letter-spacing: -.03em; margin: 0 0 .3rem; line-height: 1.2; }
.rolecard-body .where { font-size: .9rem; color: var(--muted); margin: 0 0 1.15rem; }
.rolecard-body .context { font-size: .93rem; color: var(--muted); margin: 0 0 1.5rem; max-width: 30rem; }

.rolecard-body > * { opacity: 0; transform: translateY(12px); }
.rolecard.seen .rolecard-body > * {
  opacity: 1; transform: none;
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.rolecard.seen .rolecard-body > *:nth-child(1) { transition-delay: .34s; }
.rolecard.seen .rolecard-body > *:nth-child(2) { transition-delay: .42s; }
.rolecard.seen .rolecard-body > *:nth-child(3) { transition-delay: .49s; }
.rolecard.seen .rolecard-body > *:nth-child(4) { transition-delay: .56s; }
.rolecard.seen .rolecard-body > *:nth-child(5) { transition-delay: .63s; }
.rolecard.seen .rolecard-body > *:nth-child(6) { transition-delay: .70s; }
.rolecard.seen .rolecard-body > .detail { transition-delay: 0s; }

/* ---- expand ---- */
.more {
  display: inline-flex; align-items: center; gap: .55rem;
  background: transparent; border: 1px solid var(--rule); border-radius: 999px;
  color: var(--muted); font: inherit; font-size: .85rem;
  padding: .5rem 1.15rem; cursor: pointer;
  transition: color var(--fast) ease, border-color var(--fast) ease, background var(--fast) ease;
}
.more:hover { color: var(--text); border-color: var(--rule-strong); background: var(--bg-2); }
.more span { font-size: 1.05rem; line-height: 1; transition: transform var(--mid) var(--ease); }
.more[aria-expanded="true"] span { transform: rotate(45deg); }

.detail {
  display: grid; grid-template-rows: 0fr; opacity: 0; margin-top: 0; overflow: hidden;
  transition: grid-template-rows .65s var(--ease), opacity var(--mid) ease, margin-top .65s var(--ease);
}
.detail > * { overflow: hidden; }
.rolecard.open .detail { grid-template-rows: 1fr; opacity: 1; margin-top: 1.75rem; }
.detail-inner { min-height: 0; border-top: 0 solid var(--rule); padding-top: 0; }
.rolecard.open .detail-inner { border-top-width: 1px; padding-top: 1.5rem; }
.detail h4 {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .18em;
  color: var(--faint); font-weight: 600; margin: 1.5rem 0 .6rem;
}
.detail h4:first-child { margin-top: 0; }
.detail ul { margin: 0; padding-left: 1.15rem; }
.detail li { font-size: .92rem; color: var(--muted); margin-bottom: .5rem; }
.detail li::marker { color: var(--rule-strong); }
.detail strong { color: var(--text); font-weight: 600; }

/* ---------------------------------------------- writing */

.posts { display: grid; }
.post {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem;
  padding: 1.35rem 0; border-bottom: 1px solid var(--rule);
}
.post:first-child { border-top: 1px solid var(--rule); }
.post-title { font-size: 1.05rem; transition: color var(--fast) ease; }
.post:hover .post-title { color: var(--accent); }
.post-date { font-size: .82rem; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty {
  border: 1px dashed var(--rule-strong); border-radius: var(--r-lg);
  padding: 2.25rem; color: var(--muted); font-size: .95rem; background: var(--bg-2);
}

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

.contactbox { padding: 3rem 3.25rem; }
.contactbox > * { position: relative; z-index: 7; }
.contact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.75rem; margin-top: 2.5rem;
  border-top: 1px solid var(--rule); padding-top: 2.25rem;
}
.contact-item .k {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .2em;
  color: var(--faint); font-weight: 600; display: block; margin-bottom: .4rem;
}
.contact-item a, .contact-item span.v { font-size: 1rem; }
.contact-item a { border-bottom: 1px solid var(--rule-strong); padding-bottom: 1px; transition: border-color var(--fast) ease, color var(--fast) ease; }
.contact-item a:hover { border-bottom-color: var(--accent); color: var(--accent); }

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

footer {
  border-top: 1px solid var(--rule); padding: 2.5rem 0 4rem;
  color: var(--faint); font-size: .84rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
}

/* ---------------------------------------------- motion primitives */

.reveal { opacity: 0; transform: translateY(20px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity var(--slow) var(--ease) var(--d, 0s),
              transform var(--slow) var(--ease) var(--d, 0s);
}
.w { display: inline-block; opacity: 0; transform: translateY(.42em); }
.w.in { animation: wordUp .82s var(--ease) forwards; }
@keyframes wordUp { to { opacity: 1; transform: none; } }

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

@media (max-width: 60rem) {
  .work { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; gap: 1rem; }
  .hero-figure { max-width: 15rem; justify-self: center; margin-top: 1.5rem; }
  .skills { grid-template-columns: 1fr; }
}

@media (max-width: 52rem) {

  .strip { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

@media (max-width: 40rem) {
  body { font-size: 16px; }
  .wrap { padding: 0 1.4rem; }
  .hero { padding-top: 4.5rem; padding-bottom: 2.5rem; }
  section { padding: var(--sec-top) 0 var(--sec-pad); }
  .card { padding: 1.6rem 1.5rem; }
  .rolecard-body { padding: 1.75rem 1.6rem; }
  .contactbox { padding: 1.75rem 1.6rem; }
  .navlinks { gap: 1.1rem; font-size: .84rem; }
  .navlinks .hide-sm { display: none; }
}

/* ---------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  .reveal, .w, .rolecard-body > * { opacity: 1 !important; transform: none !important; animation: none !important; }
  .hero-portrait img { opacity: 1 !important; transform: none !important; animation: none !important; }
  .hero-portrait .blob { animation: none !important; }
  .rolecard .dim, .rolecard-media .wipe, .glow { display: none; }
  .rolecard-media img { transform: none !important; }
  .stat::after { display: none; }
  .eyebrow::before { transform: scaleX(1) !important; }
  * { transition-duration: .01ms !important; }
}

/* ---------------------------------------------- print */

@media print {
  .topbar, footer, .themetoggle, .rolecard-media, .more, .glow, .hero-portrait { display: none; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .card, .rolecard, .contactbox { box-shadow: none; border: 1px solid #ccc; }
  .detail { grid-template-rows: 1fr !important; opacity: 1 !important; }
  .reveal, .rolecard-body > * { opacity: 1 !important; transform: none !important; }
  section { page-break-inside: avoid; }
}

/* framing for the Bachatt photo - keep the shopkeeper in frame */
.rolecard-media img[src*="bachatt-market"] { object-position: center 55%; }

/* keep the screens centred in the D. E. Shaw crop */
.rolecard-media img[src*="deshaw-floor"]  { object-position: center 46%; }
.rolecard-media img[src*="mof-ipo"]       { object-position: center 58%; }



/* ============================================================
   EXPERIENCE - a centred deck, one card behind the next.
   Square cards: the illustration fills them, text rides a scrim.
   ============================================================ */

.roles-track { position: relative; height: 300vh; }

.roles-pin {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  overflow: hidden;
  padding-top: 4.5rem;      /* clear the sticky header */
}

/* ---- the axis: a hairline, small dots, years beneath ---- */
.roles-axis { width: min(var(--shell), 100%); padding: 0 2.25rem; margin: 0 0 .6rem; }

.axis-rail { position: relative; height: 2.2rem; }

.axis-rail .track {
  position: absolute; left: 0; right: 0; top: 0;
  height: 2px; border-radius: 2px; background: var(--rule);
}

/* the span of the role currently in front */
.axis-rail .band {
  position: absolute; top: 0; left: 0; width: 0%;
  height: 2px; border-radius: 2px; background: var(--accent);
  transition: left .5s var(--ease), width .5s var(--ease);
}

.axis-rail .nodes { list-style: none; margin: 0; padding: 0; }
.axis-rail .nodes li {
  position: absolute; top: 0; left: var(--p);
  transform: translateX(-50%);
  padding-top: .85rem;
  font-size: .68rem; letter-spacing: .06em; color: var(--faint);
  white-space: nowrap;
}
.axis-rail .nodes li:first-child { transform: none; }
.axis-rail .nodes li:last-child  { transform: translateX(-100%); }

.axis-rail .nodes li::before {
  content: ""; position: absolute; top: -3px; left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--rule-strong);
}
.axis-rail .nodes li:first-child::before { left: 0; transform: none; }
.axis-rail .nodes li:last-child::before  { left: auto; right: 0; transform: none; }

.axis-rail .nodes li em { font-style: normal; font-variant-numeric: tabular-nums; }

/* ---- the org plate between axis and deck (swap the span for an <img> logo) ---- */
.roles-logo {
  height: 3.4rem;
  display: grid; place-items: center;
  margin: 1.7rem 0 1.5rem;
}
.roles-logo span {
  font-size: .92rem; font-weight: 500; letter-spacing: 0; color: var(--muted);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.roles-logo img {
  max-height: 2.5rem; max-width: 14rem;
  width: auto; height: auto; display: block;
  object-fit: contain;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
/* the marks are dark artwork; lift them in dark mode */
:root[data-theme="dark"] .roles-logo img,
:root:not([data-theme="light"]) .roles-logo img { filter: invert(1) hue-rotate(180deg) brightness(1.6); }
.roles-logo.swap span, .roles-logo.swap img { opacity: 0; transform: translateY(6px); }

/* ---- the deck ---- */
.roles-row {
  position: relative;
  width: min(clamp(18rem, 32vw, 25rem), 46vh);
  aspect-ratio: 1 / 1.46;
  margin-inline: auto;
  align-self: center;
  flex: 0 0 auto;
}

.roles-row > article {
  position: absolute; inset: 0;
  transform-origin: center center;
  will-change: transform, opacity;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--surface);
  box-shadow:
    0 1px 2px -1px rgba(16,20,28,.10),
    0 26px 54px -30px rgba(16,20,28,.5);
  transition: border-color var(--mid) ease, box-shadow var(--slow) var(--ease);
}
/* the card in front gets the accent edge */
.roles-row > article:not(.front) { filter: saturate(.82) brightness(.97); }
.roles-row > article.front {
  filter: none;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--rule));
  box-shadow:
    0 1px 2px -1px rgba(16,20,28,.12),
    0 36px 74px -32px rgba(var(--blush), .4);
}

/* polaroid: white paper, square image, caption printed below it */
.roles-row .rolecard {
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  padding: .8rem .8rem 0;
  background: var(--surface);
  overflow: hidden;
}
.roles-row .rolecard-media {
  position: relative; inset: auto;
  aspect-ratio: 1 / 1; height: auto; min-height: 0;
  border: none; border-radius: 0; overflow: hidden;
  background: var(--bg-2);
}
.roles-row .rolecard-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* a scrim that deepens toward the bottom, so the text reads */
/* a hairline so the print sits on the paper rather than floating */
.roles-row .rolecard-media::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(16,20,28,.10);
}

/* the seam becomes a hairline where the scrim starts to bite */
.roles-row .rolecard::after { display: none; }

.roles-row .rolecard-body {
  position: relative; z-index: 7;
  padding: .85rem .3rem 1rem;
  color: var(--text);
  display: flex; flex-direction: column; justify-content: flex-start;
  min-height: 0;
}
.roles-row .rolecard-body .when { color: var(--faint); margin-bottom: .4rem; font-size: .64rem; }
.roles-row .rolecard-body h3 { color: var(--text); font-size: 1.06rem; line-height: 1.2; margin-bottom: .18rem; }
.roles-row .rolecard-body .where { color: var(--muted); font-size: .8rem; margin-bottom: .6rem; }
.roles-row .chips { margin: 0; gap: .3rem; }
.roles-row .chips li { font-size: .66rem; padding: .16rem .44rem; }


.roles-row .glow, .roles-row .dim, .roles-row .wipe { display: none; }

/* the deck used to flatten into a list below 52rem; it now keeps stacking on
   every phone, and only collapses on a genuinely tiny screen */
@media (max-width: 20rem) {
  .roles-track { height: auto; }
  .roles-pin { position: static; height: auto; overflow: visible; display: block; }
  .roles-row { position: static; width: auto; max-width: none; aspect-ratio: auto; display: grid; gap: 1.25rem; }
  .roles-row > article {
    position: relative; inset: auto; aspect-ratio: auto;
    transform: none !important; opacity: 1 !important;
  }
  .roles-axis, .roles-logo { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .roles-track { height: auto; }
  .roles-pin { position: static; height: auto; overflow: visible; display: block; }
  .roles-row { position: static; width: auto; aspect-ratio: auto; display: grid; gap: 1.25rem; }
  .roles-row > article { position: relative; inset: auto; aspect-ratio: 1 / 1; transform: none !important; opacity: 1 !important; }
  .roles-axis, .roles-logo { display: none; }
}

@media print {
  .roles-track { height: auto; }
  .roles-pin { position: static; height: auto; display: block; }
  .roles-row { position: static; width: auto; aspect-ratio: auto; display: grid; gap: 1rem; }
  .roles-row > article { position: relative; inset: auto; transform: none !important; opacity: 1 !important; }
  .roles-axis, .roles-logo { display: none; }
}

/* ============================================================
   EXPERIENCE - heading and timeline on the left, polaroids on the right
   ============================================================ */

.roles-pin { align-items: stretch; justify-content: center; }

.exp-split {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 4rem;
  align-items: center;
  width: min(var(--shell), 100%);
  margin: 0 auto;
  padding: 0 2.25rem;
}

.exp-left h2 { margin: 0 0 1rem; max-width: 12em; }
.exp-left .exp-note {
  color: var(--muted); max-width: 26rem; margin: 0 0 2.25rem;
}
.exp-left .roles-axis { width: 100%; padding: 0; margin: 0 0 1.75rem; }
.exp-left .roles-logo {
  height: 2.5rem; display: flex; align-items: center; justify-content: flex-start;
  margin: 0;
}

.exp-right { display: grid; place-items: center; }
.exp-right .roles-row { margin: 0; }

@media (max-width: 62rem) {
  .exp-split { grid-template-columns: 1fr; gap: 2rem; text-align: left; }
  .exp-right { justify-items: start; }
}

/* ============================================================
   WORK - a bento of different shapes and sizes
   ============================================================ */

.work.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(11rem, auto);
  gap: 1.1rem;
}

.work.bento .t-hero { grid-column: span 2; grid-row: span 2; }
.work.bento .t-wide { grid-column: span 2; }
.work.bento .t-tall { grid-column: span 2; grid-row: span 2; }
.work.bento .t-sm   { grid-column: span 2; }

/* the big tile gets more air and a larger title */
.work.bento .t-hero { padding: 2.4rem 2.5rem; }
.work.bento .t-hero h3 { font-size: 1.34rem; line-height: 1.22; }
.work.bento .t-hero p  { font-size: .96rem; }
.work.bento .t-tall h3 { font-size: 1.24rem; }

@media (max-width: 74rem) {
  .work.bento { grid-template-columns: repeat(2, 1fr); }
  .work.bento .t-hero,
  .work.bento .t-tall { grid-column: span 2; grid-row: span 1; }
}
@media (max-width: 46rem) {
  .work.bento { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .work.bento > * { grid-column: span 1 !important; grid-row: span 1 !important; }
}

/* ============================================================
   HAND-DRAWN DEVICES
   A marker underline, doodle annotations and a cut-paper mask.
   Everything is SVG so it stays crisp and can draw itself in.
   ============================================================ */

.hand {
  font-family: "Caveat", "Bradley Hand", cursive;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
}

/* ---- the swash that sits under a heading ---- */
.swash { position: relative; display: inline-block; }
.swash svg {
  position: absolute; left: -2%; right: -2%; bottom: -.42em;
  width: 104%; height: .5em; overflow: visible; pointer-events: none;
}
.swash svg path {
  fill: none; stroke: var(--accent); stroke-width: 5;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: var(--len, 300); stroke-dashoffset: var(--len, 300);
}
.swash.in svg path,
.in .swash svg path,
.reveal.in .swash svg path {
  animation: draw 1.1s cubic-bezier(.4,.05,.2,1) .25s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---- a loose circle drawn round something ---- */
.ringed { position: relative; display: inline-block; }
.ringed svg {
  position: absolute; inset: -34% -12%; width: 124%; height: 168%;
  overflow: visible; pointer-events: none;
}
.ringed svg path {
  fill: none; stroke: var(--accent); stroke-width: 3.2;
  stroke-linecap: round; opacity: .8;
  stroke-dasharray: 460; stroke-dashoffset: 460;
}
.ringed.in svg path, .in .ringed svg path { animation: draw 1.3s cubic-bezier(.4,.05,.2,1) .4s forwards; }

/* ---- scattered marks: arrows, squiggles, sparkles ---- */
.doodle {
  position: absolute; pointer-events: none; z-index: 6;
  color: var(--accent); opacity: 0;
}
.doodle svg { width: 100%; height: 100%; overflow: visible; }
.doodle svg path, .doodle svg line, .doodle svg circle {
  fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.doodle.dash svg path { stroke-dasharray: 7 9; }
.in .doodle, .doodle.in { animation: popIn .7s var(--ease) var(--dd, .5s) forwards; }
@keyframes popIn { from { opacity: 0; transform: translateY(6px) rotate(-3deg) } to { opacity: .9; transform: none } }

/* a slow drift so the marks feel drawn by hand, not printed */
.doodle.drift { animation: popIn .7s var(--ease) var(--dd,.5s) forwards, wob 7s ease-in-out 1.4s infinite alternate; }
@keyframes wob { from { transform: rotate(-1.5deg) translateY(0) } to { transform: rotate(1.5deg) translateY(-4px) } }

/* ---- hand-drawn badge for the skills row ---- */
.badge { text-align: left; }
.badge .disc {
  width: 6.5rem; height: 6.5rem; margin: 0 0 1rem;
  border-radius: 50%; background: var(--accent);
  display: grid; place-items: center;
  transition: transform .4s var(--ease);
}
.badge:hover .disc { transform: rotate(-6deg) scale(1.05); }
.badge .disc svg { width: 70%; height: 70%; overflow: visible; }
.badge .disc svg * { stroke: var(--surface); fill: none; stroke-width: 2.6;
  stroke-linecap: round; stroke-linejoin: round; }

@media (prefers-reduced-motion: reduce) {
  .swash svg path, .ringed svg path { stroke-dashoffset: 0 !important; animation: none !important; }
  .doodle { opacity: .9 !important; animation: none !important; }
}

/* marker lettering, for a heading accent that should look written not set */
h1 em.marker, h2 em.marker {
  font-family: "Caveat", "Bradley Hand", cursive;
  font-style: normal;
  font-weight: 700;
  font-size: 1.32em;
  line-height: .8;
  letter-spacing: 0;
  display: inline-block;
  transform: rotate(-2.2deg);
  padding: 0 .06em;
}

/* ============================================================
   PROOF - small square tiles, dense, scannable
   ============================================================ */

.proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: .7rem;
  margin-top: 1rem;
}

.ptile {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex; flex-direction: column; justify-content: flex-start; gap: .45rem;
  padding: 1.05rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  box-shadow: var(--e1);
  transition: transform .35s var(--ease), box-shadow .5s var(--ease), border-color .3s ease;
  overflow: hidden;
}
.ptile:hover {
  transform: translateY(-3px);
  box-shadow: var(--e3);
  border-color: var(--rule-strong);
}

.ptile b {
  font-size: clamp(1rem, 1.7vw, 1.34rem);
  font-weight: 600; letter-spacing: -.035em; line-height: 1.12;
  font-variant-numeric: normal;
  white-space: nowrap;
}
.ptile span {
  font-size: .7rem; line-height: 1.35; color: var(--muted);
}

/* every few tiles goes solid, so the grid has a rhythm rather than a wall */
.ptile.hot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 1px 2px -1px rgba(16,20,28,.10), 0 16px 30px -20px rgba(var(--blush), .55);
}
.ptile.hot b { color: var(--accent-ink); }
.ptile.hot span { color: color-mix(in srgb, var(--accent-ink) 78%, transparent); }
.ptile.hot:hover { box-shadow: 0 2px 4px -2px rgba(16,20,28,.12), 0 26px 48px -22px rgba(var(--blush), .7); }

@media (max-width: 52rem) {
  .proof-grid { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .55rem; }
  .ptile { padding: .8rem .85rem; }
  .ptile span { font-size: .64rem; }
}

/* the pinned deck supplies its own vertical centring, so the section needs no lid */

/* ============================================================
   SECTION HEADERS - headline left, its intro right, sharing the width
   ============================================================ */

.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 3rem;
  align-items: end;
  margin-bottom: 3.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.sec-head h2 { margin: 0; max-width: 14em; }
.sec-head .sectionintro { margin: 0 0 .35rem; max-width: none; }

@media (max-width: 60rem) {
  .sec-head { grid-template-columns: 1fr; gap: 1.1rem; align-items: start; }
  .sec-head h2 { max-width: none; }
}

/* the writing section carries very little, so it needs less room than the rest */

/* she sits inside the organic shape rather than being cut off by a hard edge */
.hero-portrait img {
  -webkit-mask-image: none; mask-image: none;
  clip-path: none;
  filter: none;
  border-radius: 58% 42% 46% 54% / 46% 50% 50% 54%;
  animation: portraitIn 1.1s var(--ease) .35s forwards, portraitMorph 18s ease-in-out 1.5s infinite alternate;
}

@keyframes portraitMorph {
  to { border-radius: 55% 45% 58% 42% / 48% 56% 44% 52%; }
}

/* one oval, tint and portrait together: she stands in it, feet on its floor */
.hero-portrait {
  border-radius: 63% 37% 44% 56% / 55% 48% 52% 45%;
  overflow: hidden;
  padding-top: 18%;
  background: rgba(var(--blush), .15);
  animation: portraitMorph 20s ease-in-out 1.5s infinite alternate;
}
:root[data-theme="dark"] .hero-portrait,
:root:not([data-theme="light"]) .hero-portrait { background: rgba(var(--blush), .2); }
.hero-portrait .blob { display: none; }
.hero-portrait img {
  border-radius: 0;
  clip-path: none;
  filter: none;
  /* her flat bottom edge sits below the oval floor, so the curve does the cutting */
  margin-bottom: -6%;
  animation: portraitIn 1.1s var(--ease) .35s forwards;
}

/* a section header with no intro: heading left, its one action right */
.sec-head.solo { align-items: center; }
.sec-head.solo:not(:has(.pill)) { grid-template-columns: 1fr; }
.sec-head.solo .pill { justify-self: end; }
@media (max-width: 60rem) {
  .sec-head.solo .pill { justify-self: start; }
}

/* the writing section has no content under its header, so its rule doubled
   up with the section divider - keep the divider, drop the header's own */


/* the bento ran long, so the divider sat a long way below the last tile */

/* the doodles live outside the oval, or its overflow clip eats them */
.hero-figure { position: relative; justify-self: center; width: 100%; max-width: 21rem; }
.hero-portrait { justify-self: stretch; max-width: none; }

/* the hero marker word carries the line on its own, so it runs a size larger */
h1 em.marker { font-size: 1.52em; }


/* ============================================================
   ONE rhythm: the same air above and below every section rule
   ============================================================ */
:root { --sec-pad: 5.5rem; --sec-top: calc(5.5rem - 1.6rem); }
@media (max-width: 60rem) { :root { --sec-pad: 3.75rem; --sec-top: calc(3.75rem - 1.1rem); } }

/* the pinned deck supplies its own top gap, so the section adds none */
#experience { padding-top: 0; }
.roles-pin { justify-content: flex-start; padding-top: var(--sec-top); }

/* writing is a header and nothing else, so the header carries no rule of its own */
/* the writing section carries cards again, so its header keeps its rule */

/* ============================================================
   PROOF TILES - a number is one kind of proof, a document is another
   ============================================================ */

/* an artefact needs room to be read, so it takes two columns and half the height */
.ptile.wide {
  grid-column: span 2;
  aspect-ratio: 2 / 1;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
}

.ptile .kind {
  font-style: normal;
  font-size: .58rem; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--faint);
}

.ptile.wide b {
  font-size: clamp(.92rem, 1.35vw, 1.08rem);
  font-weight: 600; letter-spacing: -.02em; line-height: 1.25;
  white-space: normal;
  font-variant-numeric: normal;
}

.ptile .go {
  font-style: normal;
  font-size: .68rem; font-weight: 600;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: .3rem;
  margin-top: auto;
}
.ptile .go::after {
  content: "→";
  transition: transform .3s var(--ease);
}
.ptile.wide:hover .go::after { transform: translateX(3px); }

.ptile.wide.hot .kind { color: color-mix(in srgb, var(--accent-ink) 62%, transparent); }
.ptile.wide.hot .go { color: var(--accent-ink); }

@media (max-width: 52rem) {
  .ptile .kind { font-size: .52rem; }
  .ptile.wide b { font-size: .86rem; }
}

/* ============================================================
   PRESS - an index, not a card wall: outlet, headline, date
   ============================================================ */

.press { list-style: none; margin: 0; padding: 0; }

.press li { border-top: 1px solid var(--rule); }
.press li:last-child { border-bottom: 1px solid var(--rule); }

.press a {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr) 4.6rem;
  align-items: baseline;
  gap: 1.1rem;
  padding: .72rem .3rem;
  text-decoration: none;
  color: inherit;
  transition: background-color .3s ease, padding-left .3s var(--ease);
}
.press a:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); padding-left: 1rem; }

.press i {
  font-style: normal;
  font-size: .61rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint);
}
.press a:hover i { color: var(--accent); }

/* one line each: a headline that wraps stops being a scannable index */
.press b {
  font-size: clamp(.88rem, 1.1vw, .97rem);
  font-weight: 500; letter-spacing: -.012em; line-height: 1.4;
  display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.press time {
  font-size: .73rem; color: var(--faint);
  text-align: right; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 52rem) {
  .press a { grid-template-columns: 1fr; gap: .4rem; padding: 1rem .2rem; }
  .press time { text-align: left; }
}

/* a press card is the same object as a proof tile, sized for a headline */
.pcard {
  width: 11rem;
  gap: .5rem;
  text-decoration: none; color: inherit;
}

.pcard i {
  font-style: normal;
  font-size: .58rem; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--faint);
}
.pcard:hover i { color: var(--accent); }

.pcard b {
  font-size: .84rem; font-weight: 500;
  letter-spacing: -.01em; line-height: 1.34;
  white-space: normal;
  font-variant-numeric: normal;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 52rem) { .pcard { width: 8.6rem; } .pcard b { font-size: .72rem; } }


/* PRDs and prototypes do not scroll - they are destinations, not decoration */
/* the set will grow, so the grid has to stay legible at six or sixteen */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: .7rem;
  margin-top: 1rem;
}
.doc-grid .ptile.wide {
  grid-column: auto;
  width: auto;
  aspect-ratio: auto;
  min-height: 0;
  padding: 1rem 1.1rem;
  gap: .4rem;
}
.doc-grid .ptile.wide b { font-size: 1rem; }
.doc-grid .ptile.wide span { font-size: .78rem; }
.doc-grid .go { margin-top: .55rem; }

/* press sits still in a square grid, the same module as a proof tile */
/* fixed-width tiles, centred, so a short row does not hang off to one side */
.press-grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .7rem;
  margin-top: 1rem;
}
/* they share the row evenly and grow to the tallest card, so nothing is cut */
.press-grid .pcard {
  flex: 1 1 11.7rem;
  width: auto;
  max-width: 12rem;
  aspect-ratio: auto;
  min-height: 0;
  padding: .85rem .95rem;
  gap: .3rem;
}
/* the highlight is written to fit: hold it on one line */
.press-grid .pcard b {
  display: block;
  -webkit-line-clamp: none;
  overflow: visible;
  white-space: nowrap;
}

@media (max-width: 52rem) {
  .press-grid { gap: .55rem; }
  .press-grid .pcard { flex: 1 1 11.7rem; max-width: none; }
}

/* the pin was a full viewport tall, so the track ended with a screen of nothing */
.roles-pin { height: auto; }

/* the two-row spans left half a tile of empty white under short copy */
.work.bento { grid-auto-rows: auto; }
.work.bento .t-hero,
.work.bento .t-tall { grid-row: span 1; }

/* with the pin sized to its content, its clip started cutting the fanned deck */
.roles-pin { overflow: visible; }
html, body { overflow-x: clip; }

/* the hero links carry a line icon each, drawn rather than filled */
.pill .ico {
  width: 1.02em; height: 1.02em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .8;
  transition: opacity var(--fast) ease, transform var(--mid) var(--ease);
}
.pill:hover .ico { opacity: 1; transform: translateX(1px); }

/* the first link is the one worth pressing */
.pill-solid {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 1px 2px -1px rgba(16,20,28,.12), 0 14px 26px -18px rgba(var(--blush), .6);
}
.pill-solid:hover {
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 2px 5px -2px rgba(16,20,28,.16), 0 22px 40px -20px rgba(var(--blush), .75);
}
.pill-solid .ico { opacity: .95; }

/* a solid logo needs paint, not a stroke */
.pill .ico-fill { fill: currentColor; stroke: none; }

/* the arrow belongs to the button, not to the sentence inside it */
.pill-go { padding-right: 1rem; }
.pill-go::after {
  content: "";
  width: .95em; height: .95em;
  margin-left: .1rem;
  background: currentColor;
  -webkit-mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
          mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
  transition: transform var(--mid) var(--ease);
}
.pill-go:hover::after { transform: translateX(3px); }

/* ============================================================
   CONTACT - each row is a card you can hit, not a label and a link
   ============================================================ */

.contact-grid { gap: .8rem; }

.contact-item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: .85rem;
  row-gap: .1rem;
  align-items: center;
  padding: 1.05rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  box-shadow: var(--e1);
  text-decoration: none;
  color: inherit;
  transition: transform .35s var(--ease), box-shadow .5s var(--ease), border-color .3s ease;
}
.contact-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--e3);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--rule));
}

.contact-item .cico {
  grid-row: 1 / span 2;
  display: grid; place-items: center;
  width: 2.3rem; height: 2.3rem;
  border-radius: 9px;
  background: var(--accent-wash);
  color: var(--accent);
}
.contact-item .cico svg {
  width: 1.1rem; height: 1.1rem;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

.contact-item .k { margin-bottom: 0; }
.contact-item .v {
  font-size: .95rem;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.contact-item:hover .v { color: var(--accent); }

/* ============================================================
   BUTTONS - squared to match the tiles, the capsule read as generic
   ============================================================ */

.pill {
  border-radius: var(--r-md);
  padding: .62rem 1.05rem;
  font-size: .855rem;
  font-weight: 500;
  color: var(--text);
  gap: .55rem;
  letter-spacing: -.005em;
}
.pill:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--rule));
  color: var(--accent);
}
.pill:hover .ico { opacity: 1; transform: none; }

/* the primary keeps its weight without shouting */
.pill-solid,
.pill-solid:hover { color: var(--accent-ink); border-color: var(--accent); }

.herolinks { gap: .5rem; }

/* ============================================================
   COPY - the address is more useful on the clipboard than in a mail client
   ============================================================ */

.pill-split { display: inline-flex; gap: .3rem; }

.copybtn {
  font: inherit;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  position: relative;
}
.copybtn.pill { padding: .62rem .7rem; }

.copybtn .ico { width: 1.02em; height: 1.02em; }
.copybtn .ico svg {
  width: 100%; height: 100%;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
/* both marks share one cell, so the swap does not move anything */
.copybtn .ico-copy, .copybtn .ico-tick { grid-area: 1 / 1; transition: opacity .18s ease, transform .18s var(--ease); }
.copybtn .ico-tick { opacity: 0; transform: scale(.7); }
.copybtn.copied .ico-copy { opacity: 0; transform: scale(.7); }
.copybtn.copied .ico-tick { opacity: 1; transform: none; color: var(--accent); }

/* it says what it did, without a layout shift */
.copybtn::after {
  content: "Copied";
  position: absolute; bottom: calc(100% + .45rem); left: 50%;
  transform: translate(-50%, 4px);
  padding: .2rem .45rem;
  font-size: .66rem; font-weight: 600; letter-spacing: .02em;
  color: var(--accent-ink); background: var(--text);
  border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s var(--ease);
}
.copybtn.copied::after { opacity: 1; transform: translate(-50%, 0); }

/* the bare one lives inside the contact card, so it carries no chrome */
.copybtn-bare {
  grid-column: 3; grid-row: 1 / span 2;
  align-self: center;
  width: 2rem; height: 2rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  transition: color var(--fast) ease, border-color var(--fast) ease, background-color var(--fast) ease;
}
.copybtn-bare:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--rule)); background: var(--accent-wash); }

.contact-item.has-copy { grid-template-columns: auto 1fr auto; column-gap: .85rem; }
.contact-item .v { text-decoration: none; color: var(--text); }
.contact-item a.v:hover { color: var(--accent); }

/* the copy control belongs to the email button, so they share one shell */
.pill-split {
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--e1);
  overflow: hidden;
  transition: border-color var(--fast) ease, box-shadow var(--mid) var(--ease), transform var(--mid) var(--ease);
}
.pill-split:hover {
  transform: translateY(-2px);
  box-shadow: var(--e2);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--rule));
}
.pill-split .pill {
  border: none;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
  transform: none;
}
.pill-split .pill:hover { transform: none; }

.copybtn-joined {
  border: none;
  border-left: 1px solid var(--rule);
  background: var(--bg-2);
  color: var(--muted);
  border-radius: 0;
  padding: .62rem .78rem;
  display: inline-flex; align-items: center; gap: .38rem;
  transition: color var(--fast) ease, background-color var(--fast) ease;
}
.copybtn-joined:hover { color: var(--accent); background: var(--accent-wash); }
.copybtn-joined .lbl { font-size: .78rem; font-weight: 500; }
.copybtn-joined .ico-copy, .copybtn-joined .ico-tick { grid-area: auto; }
.copybtn-joined { display: inline-flex; }
.copybtn-joined .ico { position: relative; }
.copybtn-joined .ico-tick { position: absolute; inset: 0; }

/* the address is the point of the row, so it never truncates */
.contact-grid { grid-template-columns: 1.5fr 1fr 1fr; }
@media (max-width: 62rem) { .contact-grid { grid-template-columns: 1fr; } }
.contact-item .v { white-space: normal; overflow: visible; text-overflow: clip; word-break: break-word; }

/* the old link underline made the address read as a text input */
.contact-item a.v { border-bottom: none; padding-bottom: 0; }

/* the stat figures are set like the marker words, not like UI numbers */
.stat b {
  font-family: "Caveat", "Bradley Hand", cursive;
  font-weight: 700;
  font-size: clamp(2rem, 3.6vw, 2.85rem);
  line-height: .95;
  letter-spacing: 0;
  font-variant-numeric: normal;
  color: var(--accent);
  margin-bottom: .5rem;
}

/* ============================================================
   ONE surface treatment: a pale blue hairline and a blue-tinted shadow,
   instead of grey rules on some things and blush glows on others
   ============================================================ */

:root {
  --rule:        #dde5ee;
  --rule-strong: #c6d3e2;
  --shadow-rgb:  47, 84, 120;

  --e1: 0 1px 2px -1px rgba(var(--shadow-rgb), .07), 0 4px 10px -6px rgba(var(--shadow-rgb), .13);
  --e2: 0 2px 4px -2px rgba(var(--shadow-rgb), .08), 0 14px 30px -20px rgba(var(--shadow-rgb), .22);
  --e3: 0 3px 6px -3px rgba(var(--shadow-rgb), .09), 0 34px 62px -34px rgba(var(--shadow-rgb), .28);
  --e4: 0 4px 8px -4px rgba(var(--shadow-rgb), .10), 0 44px 78px -38px rgba(var(--shadow-rgb), .26);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --rule: #333d4a; --rule-strong: #45505f; --shadow-rgb: 0, 0, 0; }
}
:root[data-theme="dark"] { --rule: #333d4a; --rule-strong: #45505f; --shadow-rgb: 0, 0, 0; }

/* the solid tiles and buttons drop their coloured halo for the same shadow */
.ptile.hot { box-shadow: var(--e1); }
.ptile.hot:hover { box-shadow: var(--e3); }
.pill-solid { box-shadow: var(--e1); }
.pill-solid:hover { box-shadow: var(--e2); }
.roles-row > article.front { box-shadow: var(--e3); }

/* the section intro sits against the right edge, so both columns have one */
.sec-head .sectionintro { text-align: right; }
@media (max-width: 60rem) { .sec-head .sectionintro { text-align: left; } }

/* ============================================================
   LOGOS - the mark on light, the name on dark. Flattening a coloured
   logo to white silhouette destroys marks like Bachatt's.
   ============================================================ */

.roles-logo img { max-height: 1.9rem; max-width: 11rem; }
.roles-logo span { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .roles-logo { background: none; border: 0; box-shadow: none; padding: 0; }
  :root:not([data-theme="light"]) .roles-logo img { display: none; }
  :root:not([data-theme="light"]) .roles-logo span {
    display: block;
    font-size: .96rem; font-weight: 600; letter-spacing: -.01em;
    color: var(--text);
  }
}
:root[data-theme="dark"] .roles-logo { background: none; border: 0; box-shadow: none; padding: 0; }
:root[data-theme="dark"] .roles-logo img { display: none; }
:root[data-theme="dark"] .roles-logo span {
  display: block;
  font-size: .96rem; font-weight: 600; letter-spacing: -.01em;
  color: var(--text);
}

/* six tiles read better as two rows of three than five and a stray */
.press-grid .pcard { flex: 0 1 calc(33.333% - .47rem); max-width: none; }
@media (max-width: 62rem) { .press-grid .pcard { flex: 0 1 calc(50% - .36rem); } }
@media (max-width: 40rem) { .press-grid .pcard { flex: 1 1 100%; } }

/* a header action is a button, not a column-filling bar */
.sec-head .pill { justify-self: end; width: max-content; }

/* three posts, three columns, no orphan gap */
#writing .doc-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 62rem) { #writing .doc-grid { grid-template-columns: 1fr; } }

/* ============================================================
   HERO ORDER - on a phone the portrait sits between the copy and the links
   ============================================================ */

.hero-grid { grid-template-rows: auto auto; align-items: center; }
.hero-copy   { grid-column: 1; grid-row: 1; align-self: end; }
.herolinks   { grid-column: 1; grid-row: 2; align-self: start; margin-top: 2rem; }
.hero-figure { grid-column: 2; grid-row: 1 / span 2; }

@media (max-width: 60rem) {
  .hero-copy, .herolinks, .hero-figure { grid-column: 1; grid-row: auto; }
  .herolinks { margin-top: 1.5rem; }
}

/* the most-read cards are commented out, so the header carries no rule of its own */
#writing .sec-head { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

/* ============================================================
   PROJECT CARDS - an icon plate stands in for the photo the role
   cards carry, so the two sections read as one family
   ============================================================ */

.card .cardicon {
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 12px;
  background: var(--accent-wash);
  color: var(--accent);
  margin-bottom: 1.15rem;
  transition: transform .4s var(--ease), background-color .3s ease;
}
.card .cardicon svg {
  width: 1.6rem; height: 1.6rem;
  fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.card:hover .cardicon { transform: translateY(-2px) rotate(-3deg); }

/* the number is a caption on the plate, not a heading above it */
.card .num {
  position: absolute; top: 2rem; right: 2.1rem;
  margin: 0;
  font-size: .95rem;
}
.card { position: relative; }
.card .cardicon { margin-top: 0; }

@media (max-width: 40rem) {
  .card .num { top: 1.6rem; right: 1.5rem; }
  .card .cardicon { width: 2.7rem; height: 2.7rem; }
  .card .cardicon svg { width: 1.4rem; height: 1.4rem; }
}

/* ============================================================
   PROJECT DECK - the same polaroid as a role, with a drawn icon
   where the photograph sits
   ============================================================ */

.projcard .projicon {
  display: grid;
  place-items: center;
  background: var(--accent-wash);
  /* shorter than a photograph, because the body carries a button too */
  aspect-ratio: 1 / .74;
  color: var(--accent);
}
.projcard .projicon svg {
  width: 62%; height: 62%;
  fill: none; stroke: currentColor;
  stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .6s var(--ease);
}
/* a soft filled shape under the line work, so the mark has weight at size */
.projcard .projicon .dt { fill: currentColor; opacity: .13; stroke: none; }
.projcard.front .projicon svg { transform: scale(1.06); }

/* no photo, so no wipe curtain to reveal */
.projcard .rolecard-media .wipe { display: none; }

.projcard .rolecard-body { display: flex; flex-direction: column; }
.projcard .rolecard-body h3 { margin-top: 0; }
.projcard .chips { margin-bottom: 1.1rem; }

/* the plate under the work axis carries a word, not a logo */
.roles-logo.wordplate span {
  font-size: .72rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--faint);
}

/* the work axis is a progress rail with no years beneath it */
#workAxis .axis-rail { height: 1rem; }

/* a project card can carry its own link once the URLs exist */
/* the chips already carry the numbers, so the link has to out-shout them */
.projlink {
  margin-top: auto;
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  width: 100%;
  padding: .68rem 1rem;
  font-size: .82rem; font-weight: 600;
  text-decoration: none;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--r-md);
  box-shadow: var(--e1);
  transition: transform var(--mid) var(--ease), box-shadow var(--mid) var(--ease);
}
.projlink::after { content: "→"; transition: transform .3s var(--ease); }
.projlink:hover { transform: translateY(-2px); box-shadow: var(--e2); }
.projlink:hover::after { transform: translateX(3px); }

/* projects are a bento again, so the one remaining deck sits on the right */
#experience .exp-split { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); }
#experience .exp-left  { order: 1; }
#experience .exp-right { order: 2; }

/* the project cards have no photo to wait on, so their copy is never hidden */
.projcard .rolecard-body > * { opacity: 1; transform: none; }

/* the pin must not clip: the top card sits above the pin box while it leaves.
   The nav is opaque and sits at a higher layer, so it hides the card on its own. */
.roles-pin { overflow: visible; }

/* the deck sticks below the nav, not under it, so no card is ever sliced */
.roles-pin { top: 4.75rem; padding-top: 0; }
#work, #experience { padding-top: var(--sec-top); }

/* the portrait blob carries its weight low and to the left */
.hero-portrait { border-radius: 58% 42% 38% 62% / 52% 46% 54% 48%; }
@keyframes portraitMorph {
  to { border-radius: 62% 38% 34% 66% / 48% 52% 48% 52%; }
}

/* ============================================================
   MOBILE - the decks become a plain list, and everything gets
   room to breathe at the edges
   ============================================================ */

@media (max-width: 52rem) {
  .wrap { padding: 0 1.35rem; }

  /* the whole nav fits if it is quieter */
  .navlinks { gap: 1rem; font-size: .8rem; }
  .navlinks .hide-sm { display: inline; }

  h1 { font-size: clamp(2.05rem, 9.5vw, 2.9rem); }
  .lede { font-size: 1rem; }

  .hero-figure { max-width: 12.5rem; margin-top: 1.75rem; }
  .herolinks { gap: .45rem; }
  .herolinks .pill { padding: .58rem .85rem; font-size: .82rem; }

  /* the deck still stacks on a phone: copy on top, cards beneath it */
  .roles-pin { top: 6.2rem; padding-top: 0; }
  .exp-split { display: block; padding: 0; width: 100%; }
  .exp-left { margin-bottom: 1.25rem; }
  .exp-right { display: block; }
  #experience .exp-left, #experience .exp-right { order: initial; }

  /* the height comes from JS, from the tallest card in the deck */
  .roles-row { width: 100%; max-width: 21rem; margin-inline: auto; aspect-ratio: auto; }
  .projcard .projicon { aspect-ratio: 1 / .62; }
  .rolecard-body { padding: 1.15rem 1.15rem 1.25rem; }
  .rolecard-body h3 { font-size: 1.02rem; }
  .rolecard-body .where { font-size: .82rem; margin-bottom: .7rem; }
  .rolecard-body .when { margin-bottom: .35rem; }
  .chips li { font-size: .68rem; }
  .projlink { padding: .58rem .9rem; font-size: .78rem; }

  /* the timeline stays: it is how you know where you are in the deck */
  .roles-axis { display: block; width: 100%; padding: 0; margin: .9rem 0 .4rem; }
  #workAxis { margin-bottom: .2rem; }
  .axis-rail .nodes li em { font-size: .62rem; }
  .roles-logo { display: none; }

  /* a photo card needs more height than an icon card, or its body clips */
  #experience .rolecard-media { aspect-ratio: 1 / .62; }

  .doc-grid, #writing .doc-grid { grid-template-columns: 1fr; }
  .press-grid .pcard { flex: 1 1 100%; }
  .contact-grid { grid-template-columns: 1fr; }
  .contactbox { padding: 1.6rem 1.3rem; }

  .sec-head { grid-template-columns: 1fr; gap: .5rem; }
  .sec-head .sectionintro { text-align: left; }
  .sec-head .pill { justify-self: start; }
}

/* on a phone the name takes its own line and the links sit under it */
.mark { white-space: nowrap; }

@media (max-width: 52rem) {
  .topbar .wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    row-gap: .35rem;
    height: auto;
    padding-top: .7rem;
    padding-bottom: .7rem;
  }
  .mark { grid-column: 1; grid-row: 1; }
  .themetoggle { grid-column: 2; grid-row: 1 / span 2; justify-self: end; }
  .navlinks {
    grid-column: 1; grid-row: 2;
    gap: 1.1rem; font-size: .8rem;
  }
  .navlinks .hide-sm { display: inline; }
}

@media (max-width: 52rem) {
  /* the links wrap to two rows on a phone, so the strip needs its own gap */
  .stripwrap { padding-top: 2.25rem; }
  .herolinks { row-gap: .55rem; }
}

@media (max-width: 52rem) {
  /* the heading block is opaque and sits above the deck, so a card leaving
     upward slides behind it instead of over it */
  .exp-left {
    position: relative;
    /* must beat the leaving card, which the deck lifts to z-index n+10 */
    z-index: 40;
    background: var(--bg);
    padding-bottom: .6rem;
  }
  .exp-right { position: relative; z-index: 1; }
}

@media (max-width: 52rem) {
  /* an address broken mid-word reads as a typo, so it shrinks instead */
  .contact-item .v { font-size: .85rem; word-break: normal; overflow-wrap: normal; }
  .contact-item .cico { width: 2.05rem; height: 2.05rem; }
  .contact-item { padding: .9rem 1rem; column-gap: .7rem; }
}

/* ============================================================
   NO DEAD SPACE - the deck is exactly as tall as its tallest card,
   measured in JS, so no card ends in a slab of white
   ============================================================ */

.rolecard { display: grid; grid-template-rows: auto auto; }
.rolecard-media { min-height: 0; }
.projcard .projicon svg { width: min(62%, 11rem); height: auto; aspect-ratio: 1 / 1; }


/* the deck's height is measured from its tallest card, at every width */
.roles-row { aspect-ratio: auto; }

@media (max-width: 52rem) {
  /* .exp-right zeroed the row's margins, which pinned the deck to the left */
  .exp-right .roles-row { margin-inline: auto; }
}

/* ============================================================
   SUB-BLOCKS - proof of work and the press belong to Experience,
   so they sit inside it with a lighter heading and a hairline
   ============================================================ */

.subblock {
  margin-top: 4.5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--rule);
}
.sec-head.subsec { margin-bottom: 2rem; padding-bottom: 1rem; }
.sec-head.subsec h2 { font-size: clamp(1.5rem, 2.6vw, 1.95rem); }
.sec-head.subsec h2 em.marker { font-size: 1.4em; }
.sec-head.subsec .sectionintro { font-size: .9rem; }

@media (max-width: 52rem) {
  .subblock { margin-top: 3rem; padding-top: 2.25rem; }
}

@media (max-width: 52rem) {
  /* the header action drops under the heading, so it needs its own air */
  .sec-head { row-gap: 1.15rem; }
  .sec-head .pill { margin-top: .35rem; }
}

/* ============================================================
   PROJECT BENTO - the same card as the deck used, laid out flat
   ============================================================ */

.work.bento .projcard {
  display: flex;
  flex-direction: column;
  padding: 1.9rem 1.8rem 1.6rem;
}
.work.bento .projcard .cardicon {
  width: 3.4rem; height: 3.4rem;
  border-radius: 14px;
  margin-bottom: 1.15rem;
}
.work.bento .projcard .cardicon svg { width: 1.9rem; height: 1.9rem; stroke-width: 2.4; }
.work.bento .projcard .cardicon .dt { fill: currentColor; opacity: .13; stroke: none; }

.work.bento .kicker {
  font-size: .6rem; font-weight: 600;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--faint);
  margin-bottom: .5rem;
}
.work.bento .projcard h3 { margin-bottom: .5rem; }
.work.bento .projcard p { margin-bottom: 1rem; }
.work.bento .projcard .chips { margin: 0 0 1.15rem; }
.work.bento .projcard .projlink { margin-top: auto; }

/* the deck rules do not apply to a flat card */
.work.bento .projcard .projicon,
.work.bento .projcard .dim { display: none; }

/* on a phone the links come before the portrait */
@media (max-width: 60rem) {
  .hero-copy   { order: 1; }
  .herolinks   { order: 2; margin-top: 1.5rem; }
  .hero-figure { order: 3; margin-top: 1.75rem; }
}

/* three across, not four: a project card needs room for a paragraph */
.work.bento {
  grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
  gap: .9rem;
}
.work.bento > * { grid-column: auto !important; grid-row: auto !important; }
@media (max-width: 60rem) { .work.bento { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); } }
@media (max-width: 46rem) { .work.bento { grid-template-columns: 1fr; } }

@media (max-width: 52rem) {
  /* more scroll per card on a phone, so a flick advances one card, not two */
  .roles-track { height: 460vh; }
}

/* ============================================================
   COPY GLYPH SWAP - both marks share one box, so the tick appears
   exactly where the copy icon was instead of jumping to a corner
   ============================================================ */

.iconswap {
  position: relative;
  display: inline-block;
  width: 1.02em;
  height: 1.02em;
  flex: 0 0 auto;
}
.iconswap .ico {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.copybtn .iconswap .ico-tick { transform: scale(.7); }
.copybtn.copied .iconswap .ico-copy { opacity: 0; transform: scale(.7); }
.copybtn.copied .iconswap .ico-tick { opacity: 1; transform: none; color: var(--accent); }

/* the bare button in the contact card centres its single box */
.copybtn-bare { display: grid; place-items: center; }

/* the lede is two paragraphs now: the first closes up, the last keeps the air */
.lede { margin-bottom: 1rem; }
.lede:last-of-type { margin-bottom: 2.5rem; }
