/* Shared theme + phone layout. Colors are tokens; [data-dark] marks areas that sit on photos. */
:root{
  --bg:#F6F1E9; --bg-rgb:246,241,233; --bg2:#EDE6DA; --bg3:#E3DACB;
  --ink:#1D1B18; --ink-rgb:29,27,24; --accent:#BF5419;
  color-scheme:light;
}
[data-dark]{
  --bg:#0A0A0A; --bg-rgb:10,10,10; --bg2:#121212; --bg3:#1A1A1A;
  --ink:#F2EDE4; --ink-rgb:242,237,228; --accent:#FF8A3D;
  color:var(--ink);
}
html body{background:var(--bg)!important}
::selection{background:var(--accent);color:#fff}

/* side rail and prev/next bar sit over both photos and paper */
.rail{text-shadow:none!important;mix-blend-mode:difference}
.rail a,.rail a.cur{color:#fff!important}
.rail a.cur{font-weight:500}

/* ---------- home ---------- */
.yf-home{height:100vh;height:100svh!important}
.yf-home .breathe{-webkit-mask-image:linear-gradient(to right,#000 51%,transparent 57%);mask-image:linear-gradient(to right,#000 51%,transparent 57%);filter:saturate(1.08) brightness(1.08)}
.yf-home .band.on .breathe{-webkit-mask-image:none;mask-image:none}
.yf-home .band.dim .breathe{filter:brightness(.75) saturate(.8)!important}
.yf-home #readout,.yf-home header button{text-shadow:none!important}
.yf-home .logo{text-shadow:0 1px 10px rgba(0,0,0,.5)}
.yf-home .logo,.yf-home .spec{--ink:#F2EDE4;--ink-rgb:242,237,228;color:#F2EDE4}

/* ---------- ventures card grid: keep the hairlines, drop the gray frame ---------- */
.vgrid{background-clip:content-box!important}

/* ---------- phones ---------- */
@media (max-width:760px){
  /* header: one-line logo, just the menu button */
  header .logo, header a[href="index.html"]{font-size:18px!important;white-space:nowrap}
  header > div > span, header button[aria-pressed]{display:none!important}

  /* home: full-width photo, everything reads light on it */
  .yf-home{min-height:560px!important}
  .yf-home .breathe{-webkit-mask-image:linear-gradient(to right,#000 62%,transparent 82%);mask-image:linear-gradient(to right,#000 62%,transparent 82%)}
  .yf-home .mem{background-position:28% center!important}
  .yf-home .logo,.yf-home .spec{--ink:#1D1B18;--ink-rgb:29,27,24;color:#1D1B18;text-shadow:none}
  .yf-home #idle{display:none}
  .yf-home > div[aria-hidden][style*="width: 22px"]{display:none}
  .yf-home nav[aria-label="Sections"]{top:88px!important;bottom:64px!important}
  .yf-home .band:first-child .lab{top:50%!important}
  .yf-home .band .lab{left:20px!important}
  .yf-home .bname{font-size:40px!important}
  /* iOS Safari: keep the six image strips light on memory so none drop out */
  .yf-home .breathe{animation:none!important;transform:none!important;filter:none!important;transition:none!important}
  .yf-home .band.dim .breathe{filter:none!important}
  /* no sideways slide-in of the strips on phones: it shows a gap at the edge */
  .yf-home .enter{animation:yfFade .5s ease both!important;animation-delay:0s!important;transform:none!important}
  /* a lighter copy of the photo for phones, and a dark fill underneath so no strip ever shows blank */
  .yf-home .mem{background-image:url(../images/membrane-glow-m.jpg)!important;background-color:#6b1f1a}

  /* content pages: comfortable side gutters */
  #yf-page section{padding-left:20px!important;padding-right:20px!important}
  #yf-page section.hero,#yf-page section:first-of-type[style*="display: flex"]{padding-left:0!important;padding-right:0!important}
  #yf-page h1{font-size:clamp(56px,17vw,120px)!important}
  #yf-page h2[style*="font-size: 84px"]{font-size:48px!important}
  #yf-page h2[style*="font-size: 72px"]{font-size:52px!important}
  #yf-page p[style*="font-size: 56px"]{font-size:36px!important}
  #yf-page section.hero > div[style*="bottom"]{left:20px!important;right:20px!important}

  /* prizes list: year + name stacked with description under the name */
  .prize{grid-template-columns:52px minmax(0,1fr)!important;gap:6px 16px!important}
  .prize>span:nth-child(2){font-size:26px!important}
  .prize>span:nth-child(3){grid-column:2}

  /* talks */
  .hero-img{min-height:118vw!important;flex-basis:100%!important}
  .latest{padding:20px!important;gap:20px!important}
  .latest>div:first-child{flex:1 1 100%!important}
  .latest>div:last-child{flex:1 1 100%!important}
  .latest span[style*="font-size: 52px"]{font-size:34px!important}
  .row{grid-template-columns:44px minmax(0,1fr) 16px!important;gap:6px 14px!important}
  .row>span:nth-child(2){display:none}

  /* about */
  .hero-img + div{padding:40px 20px 48px!important}
  .subj{left:20px!important}

  /* ventures */
  .vgrid article{padding:36px 0!important}
  dl{grid-template-columns:96px minmax(0,1fr)!important}

  /* next/prev bar: a normal footer row instead of a floating overlay */
  .pn{position:static!important;background:none!important;padding:24px 20px 32px!important;border-top:1px solid rgba(var(--ink-rgb),.15)}
  .pn-sp{display:none}
  nav[aria-label="Next section"] a{padding:40px 20px!important;flex-wrap:wrap}
  nav[aria-label="Next section"] a span[style*="font-size: 72px"],nav[aria-label="Next section"] a span[style*="font-size: 48px"]{font-size:44px!important}
}

/* small fixes */
header button[aria-pressed]{text-shadow:none!important}
div[style*="minmax(240px, 1fr)"][style*="gap: 1px"]{background:transparent!important;gap:0!important}
div[style*="minmax(240px, 1fr)"][style*="gap: 1px"]>div{box-shadow:0 0 0 .5px rgba(var(--ink-rgb),.18)}

/* ---------- quiet, smoother navigation (version 2) ---------- */
#yf-page{transition:opacity .5s cubic-bezier(.2,.7,.1,1)!important}
#yf-page.yf-out{opacity:0;transition:opacity .24s cubic-bezier(.4,0,1,1)!important}
#yf-page.yf-pre{opacity:0;transition:none!important}
#yf-bar{position:fixed;top:0;left:0;height:2px;width:0;background:var(--accent);z-index:50;opacity:0;pointer-events:none}
#yf-bar.go{opacity:1;width:70%;transition:width .6s cubic-bezier(.2,.7,.1,1)}
#yf-bar.done{opacity:0;width:100%;transition:width .2s ease,opacity .4s ease .15s}
a,button{-webkit-tap-highlight-color:transparent}
a:active,button:active{opacity:.65;transition:opacity .08s}
.band:active .lab{opacity:.6}
:focus-visible{outline:1px solid var(--accent);outline-offset:3px}
@media (prefers-reduced-motion:reduce){#yf-bar{display:none}}

/* One way to move around: the menu plus the big "next layer" link at the end of each page */
.rail,.pn,.pn-sp{display:none!important}

@keyframes yfFade{from{opacity:0}to{opacity:1}}

/* Safari (Mac and iPhone) sometimes leaves the lower home strips blank: keep the strips static
   and give them a dark fill under the photo so they never show white */
.yf-home .breathe{animation:none!important;transform:none!important}
.yf-home .mem{background-color:#6b1f1a;-webkit-backface-visibility:hidden;backface-visibility:hidden}
/* Safari: keep each masked strip layer the size of its strip, and fade in instead of sliding */
.yf-home .breathe{overflow:hidden;contain:paint}
.yf-home .enter{animation-name:yfFade!important;animation-duration:.7s!important;animation-timing-function:ease!important;transform:none!important}
/* Home hover: keep the description clear of the stripe label on the left */
@media (min-width:761px){
  .yf-home .act{padding-left:430px!important}
  .yf-home .act .fade{min-width:0}
  .yf-home .act .fade>span.hideS{flex:0 1 280px;min-width:0}
  .yf-home .act .bname{font-size:clamp(40px,6.2vw,104px)!important}
}
@media (min-width:761px) and (max-width:1320px){.yf-home .act .fade>span.hideS{display:none}}
/* Home: bottom text steps aside while a stripe is open */
.yf-home .gut-b{transition:opacity .35s ease}
.yf-home:has(.band.on) .gut-b{opacity:0;pointer-events:none!important}
.yf-home:has(.band.on) .gut-b *{pointer-events:none!important}
.yf-home>div[aria-hidden][style*="width: 22px"]{transition:opacity .35s ease}
.yf-home:has(.band.on)>div[aria-hidden][style*="width: 22px"]{opacity:0}
/* Phone home: photo runs edge to edge, no pale band on the right */
@media (max-width:760px){
  .yf-home .breathe{-webkit-mask-image:none!important;mask-image:none!important}
  .yf-home .mem{background-position:12% center!important}
}
/* Phone home: bring the headline back, above the stripes */
@media (max-width:760px){
  .yf-home #idle{display:block!important}
  .yf-home #idle .fade{left:20px!important;right:20px!important;top:84px!important;text-align:left!important;font-size:50px!important;line-height:1!important;display:flex;flex-wrap:wrap;align-items:baseline;column-gap:.2em;row-gap:2px}
  .yf-home #idle .mt-br{display:block;flex-basis:100%;height:0}
  .yf-home #idle .mt-s{font-size:.7em;line-height:1}
  .yf-home nav[aria-label="Sections"]{top:206px!important}
}
@media (max-width:760px){
  .yf-home #idle .fade{top:100px!important}
  .yf-home nav[aria-label="Sections"]{top:224px!important}
  .yf-home .mem{background-size:auto max(100%,156vw)!important}
}
@media (max-width:760px){.yf-home #idle .mt-s{margin-left:auto}}
