/* H mockups (round 5): split-flap text + project rows. Sits on top of r.css and g.css. */

/* ---------- split-flap text (shared/h-flap.js) ---------- */
.fl { display: inline-flex; align-items: flex-start; white-space: nowrap; --fh: 1.16em; --flbg: transparent; --flshade: 0, 0, 0; }
.fl-c { position: relative; flex: none; display: block; height: var(--fh); perspective: 3.4em; }
.fl-s { position: absolute; left: 0; top: 0; visibility: hidden; white-space: pre; pointer-events: none; }
.fl-h { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; backface-visibility: hidden; }
.fl-ft, .fl-fb { background: var(--flbg); }
.fl-h i { display: block; font-style: inherit; height: var(--fh); line-height: var(--fh); text-align: center; white-space: pre; }
.fl-t, .fl-ft { top: 0; } .fl-b, .fl-fb { top: 50%; }
.fl-b i, .fl-fb i { transform: translateY(-50%); }
.fl-ft { transform-origin: 50% 100%; z-index: 2; } .fl-fb { transform-origin: 50% 0; z-index: 2; }
.fl-ft::after, .fl-fb::after { content: ''; position: absolute; inset: 0; background: rgba(var(--flshade), var(--sh, 0)); pointer-events: none; }
/* no tiles: letters only. The flap's shadow sits at the hinge, on the paper */
.fl-bare { --flbg: var(--bg, #fff); }
.fl-bare .fl-c { margin: 0 -.02em; padding: 0 .02em; box-sizing: content-box; }
.fl-bare .fl-ft::after { background: linear-gradient(rgba(0,0,0,0) 30%, rgba(var(--flshade), calc(var(--sh, 0) * .55))); }
.fl-bare .fl-fb::after { background: linear-gradient(rgba(var(--flshade), calc(var(--sh, 0) * .7)), rgba(0,0,0,0) 75%); }
.fl-bare .fl-c { transition: width .16s cubic-bezier(.3, .7, .2, 1); }
/* tiles (boards) */
.fl-tile { gap: .09em; --fh: 1.42em; }
.fl-tile .fl-c { width: .86em; border-radius: .07em; background: var(--tile, #17171a); color: var(--tink, #fff); box-shadow: 0 .05em .09em rgba(0,0,0,.28); }
.fl-tile .fl-h { background: var(--tile, #17171a); }
.fl-tile .fl-t, .fl-tile .fl-ft { border-radius: .07em .07em 0 0; background: linear-gradient(var(--tile2, #232327), var(--tile, #17171a)); }
.fl-tile .fl-b, .fl-tile .fl-fb { border-radius: 0 0 .07em .07em; }
.fl-tile .fl-c::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: max(1px, .028em); margin-top: calc(max(1px, .028em) / -2); background: var(--hinge, #000); z-index: 3; }
/* one card per word */
.fl-word { gap: .14em; --fh: 1.3em; }
.fl-word .fl-c { border-radius: .06em; transition: width .2s cubic-bezier(.3, .7, .2, 1), opacity .2s ease, margin .2s ease; }
.fl-word .fl-s { padding: 0 .2em; }
.fl-word .fl-h { background: var(--tile, #f1f0ec); }
.fl-word .fl-t, .fl-word .fl-ft { border-radius: .06em .06em 0 0; } .fl-word .fl-b, .fl-word .fl-fb { border-radius: 0 0 .06em .06em; }
.fl-word .fl-c::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: max(1px, .02em); background: var(--hinge, #fff); z-index: 3; }
.fl-word .fl-c.fl-empty { opacity: 0; margin-left: -.14em; }
/* rolling drum */
.fl-roll .fl-c { overflow: hidden; perspective: none; transition: width .16s cubic-bezier(.3, .7, .2, 1); }
.fl-roll .fl-w { position: absolute; left: 0; right: 0; top: 0; height: 200%; will-change: transform; }
.fl-roll .fl-w i { display: block; font-style: inherit; height: 50%; line-height: var(--fh); text-align: center; white-space: pre; }
.fl-roll.fl-tile .fl-c::before { display: none; }

/* ---------- flap lab (flap.html) ---------- */
.lab { min-height: 100dvh; padding: 26px var(--pad) 40px; display: grid; gap: 14px; grid-template-columns: repeat(6, 1fr); align-content: start; }
.lab-top { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.lab-top h1 { font: 400 22px/1 var(--serif); letter-spacing: -.01em; } .lab-top h1 i { font-style: italic; }
.lab-top button { font-size: 13px; padding: 6px 14px; border-radius: 999px; background: var(--ink); color: #fff; transition: transform .35s var(--ease); }
.lab-top button:active { transform: scale(.94); }
.lab-p { position: relative; grid-column: span 3; min-height: clamp(170px, 24vh, 270px); border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; padding: 40px 20px 22px; overflow: hidden; }
.lab-c { grid-column: 1 / -1; } .lab-d, .lab-e, .lab-f { grid-column: span 2; }
.lab-p > b { position: absolute; left: 16px; top: 14px; font: 400 12px/1 var(--sans); letter-spacing: 0; color: var(--mute); }
.lab-p > b span { color: var(--ink); margin-right: 8px; }
.lab-rows { display: grid; gap: .1em; justify-items: start; }
.lab-a { background: #ecebe7; border-color: transparent; font: 500 clamp(22px, 3.1vw, 50px)/1 var(--sans); }
.lab-b { background: #0b0b0c; border-color: transparent; font: 700 clamp(20px, 2.9vw, 46px)/1 var(--sans); }
.lab-b > b { color: #8a8a8e; } .lab-b > b span { color: #fff; }
.lab-b .fl { --tile: #141416; --tile2: #1c1c1f; --tink: #ffd21f; --hinge: #000; --pin: #2a2a2e; }
.lab-c { font: 400 clamp(34px, 5.4vw, 92px)/1 var(--serif); letter-spacing: -.03em; }
.lab-c .lab-rows { display: flex; gap: 0; }
.lab-d { font: 400 clamp(24px, 3vw, 50px)/1 var(--serif); letter-spacing: -.02em; }
.lab-e { font: 400 clamp(28px, 3.6vw, 60px)/1 var(--serif); letter-spacing: -.03em; }
.lab-e .lab-rows { display: flex; gap: 0; }
.lab-f { font: 400 clamp(24px, 3vw, 50px)/1 var(--serif); letter-spacing: -.02em; }
.lab-f .fl { --tile: #17171a; --tile2: #232327; --tink: #fff; }
.lab-f .fl-c { width: .66em; }
@media (max-width: 700px) {
  .lab { grid-template-columns: 1fr; }
  .lab-p { grid-column: auto; min-height: 190px; }
  .lab-a { font-size: 7.6vw; } .lab-b { font-size: 7.4vw; } .lab-c { font-size: 13.5vw; } .lab-d { font-size: 9vw; } .lab-e { font-size: 12vw; } .lab-f { font-size: 9vw; }
}

/* ---------- H pages ---------- */
.fl-inline { vertical-align: top; margin-block: calc((1lh - var(--fh)) / 2); }
/* the wordmark: starts big in the middle, ends as the nav's own */
.h-mark { position: fixed; left: 0; top: 0; z-index: 31; white-space: nowrap; transform-origin: 0 0; opacity: 0; pointer-events: none; transition: none; will-change: transform; }
.h-intro .r-nav .r-mark { opacity: 0; transition: none; }
.r-links { transition: opacity .7s ease; } .h-intro .r-links { opacity: 0; }
.still .h-mark { display: none; }
/* headline variants */
.h-you { font-style: italic; margin-left: .2em; }
.h-you .fl-c { margin: 0 -.06em; padding: 0 .06em; }
.h-both .g-head { font-size: min(7.7vw, 15vh); }
.h-both .g-l1 { top: 37vh; } .h-both .g-l2 { top: calc(37vh + 1.12em); }
.h-board .g-head { font-size: min(4.5vw, 8.4vh); }
.h-board .g-l1 { top: 35vh; }
.h-brd .m { display: grid; gap: .11em; font: 500 1em/1 var(--sans); letter-spacing: 0; }
/* project rows: one project per row, one large picture + the title */
.h-row { position: relative; display: grid; grid-template-columns: auto 1fr; align-content: center; align-items: end; column-gap: clamp(24px, 4vw, 72px); min-height: 92dvh; padding: 84px var(--pad) 40px; }
.h-row1 { position: absolute; inset: 0; z-index: 2; min-height: 0; pointer-events: none; }
.h-row1.on { pointer-events: auto; }
.h-rows { position: relative; z-index: 5; background: var(--bg); }
.h-pic { display: block; width: min(64vw, calc((100dvh - 200px) * 16 / 9)); aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; background: #ecebe7; transition: transform .5s var(--ease); }
.h-row1 .h-pic { background: none; }
.h-pic img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.h-row1 .h-pic img { opacity: 0; } .h-row1.h-landed .h-pic img { opacity: 1; }
.h-row.h-out .h-pic img { opacity: 0; } .h-row.h-out .h-pic { background: none; }
@media (hover: hover) { .h-pic:hover img { transform: scale(1.025); } }
.h-pic:active { transform: scale(.985); }
.h-pic:focus-visible { outline: 1px solid var(--ink); outline-offset: 6px; }
.h-title { font: 400 clamp(44px, 6.3vw, 112px)/.92 var(--serif); letter-spacing: -.03em; text-wrap: balance; margin-bottom: -.08em;
  opacity: 0; transform: translate3d(0, 22px, 0); transition: opacity .7s ease, transform .9s var(--ease); }
.h-row.on .h-title { opacity: 1; transform: none; }
.h-flip { grid-template-columns: 1fr auto; } .h-flip .h-pic { order: 2; } .h-flip .h-title { text-align: right; }
/* "You." closing the page (H2) */
.h-closer { position: relative; z-index: 5; background: var(--bg); min-height: 86dvh; display: grid; place-items: center; padding: 10vh var(--pad); }
.h-hit { font: italic 400 clamp(120px, 27vw, 460px)/1 var(--serif); letter-spacing: -.04em; }
.h-hit .fl-c { margin: 0 -.06em; padding: 0 .06em; }
/* a project, opened in place */
.h-proj { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 64px var(--pad) 40px; background: rgba(255,255,255,0); transition: background-color .5s ease; color: var(--ink); }
.h-proj[hidden] { display: none; }
.h-proj.on { background: #fff; }
.h-proj-in { display: grid; gap: clamp(14px, 2.2vh, 26px); justify-items: start; }
.h-proj-pic { width: min(100vw - 2 * var(--pad), calc((100dvh - 230px) * 16 / 9)); aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; transform-origin: 0 0; transition: transform .62s var(--ease); will-change: transform; }
.h-proj-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.h-proj-title { font: 400 clamp(40px, 5.4vw, 92px)/.95 var(--serif); letter-spacing: -.03em; opacity: 0; transform: translate3d(0, 16px, 0); transition: opacity .3s ease, transform .5s var(--ease); }
.h-proj.on .h-proj-title { opacity: 1; transform: none; transition: opacity .6s ease .22s, transform .8s var(--ease) .22s; }
.h-proj-x { opacity: 0; transition: opacity .4s ease; } .h-proj.on .h-proj-x { opacity: 1; }
@media (max-width: 700px) {
  .h-you { position: absolute; left: 0; top: 16dvh; margin-left: 0; }
  .h-both .g-head { font-size: 10.4vw; } .h-both .g-l1 { top: 33dvh; } .h-both .g-l2 { top: calc(33dvh + 1.2em); }
  .h-board .g-head { font-size: 8.9vw; } .h-board .g-l1 { top: 27dvh; }
  .h-row, .h-flip { display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 14px; min-height: 0; padding: 26px var(--pad); }
  .h-row1 { padding-top: 84px; }
  .h-rows { padding-bottom: 30px; }
  .h-pic, .h-flip .h-pic { width: 100%; order: 0; }
  .h-title, .h-flip .h-title { font-size: 13vw; text-align: left; }
  .h-closer { min-height: 70dvh; } .h-hit { font-size: 40vw; }
  .h-proj-title { font-size: 12vw; }
}
@media (prefers-reduced-motion: reduce) { .h-title, .h-proj, .h-proj-pic, .h-proj-title, .h-pic, .h-pic img, .fl-c { transition: none !important; } }
.still .h-title, .still .h-proj, .still .h-proj-pic, .still .h-proj-title, .still .h-proj-x { transition: none !important; }
