/* Fallback fonts sized to match Plus Jakarta Sans and IBM Plex Mono, so text barely moves when the web fonts arrive */
@font-face{font-family:'Jakarta Fallback';src:local('Arial'),local('ArialMT'),local('Liberation Sans');font-weight:200 500;size-adjust:105.07%;ascent-override:98.79%;descent-override:21.13%;line-gap-override:0%}
@font-face{font-family:'Jakarta Fallback';src:local('Arial Bold'),local('Arial-BoldMT'),local('Liberation Sans Bold');font-weight:600;size-adjust:99.15%;ascent-override:104.69%;descent-override:22.39%;line-gap-override:0%}
@font-face{font-family:'Jakarta Fallback';src:local('Arial Bold'),local('Arial-BoldMT'),local('Liberation Sans Bold');font-weight:700 800;size-adjust:100.13%;ascent-override:103.67%;descent-override:22.17%;line-gap-override:0%}
@font-face{font-family:'Plex Fallback';src:local('Courier New'),local('CourierNewPSMT'),local('Liberation Mono');size-adjust:99.98%;ascent-override:102.52%;descent-override:27.5%;line-gap-override:0%}
:root{--font-body:'Plus Jakarta Sans','Jakarta Fallback',Arial,sans-serif;--font-display:'Plus Jakarta Sans','Jakarta Fallback',Arial,sans-serif;--font-mono:'IBM Plex Mono','Plex Fallback',monospace}

/* the typing cursor takes no room, so it can never push a word onto the next line */
.hero-copy h2 .hero-type-caret{margin-right:-.165em}

/* inner pages: the hero is a full first screen from the first paint, before js/scenes.js turns it into the reveal stage */
@media(prefers-reduced-motion:no-preference){main .editorial-hero:has(>.shell h1.editorial-title,h1.editorial-title){min-height:100svh;box-sizing:border-box}}

/* Scroll scenes: hero reveal through the headline, Selected Work openings, quiet openings elsewhere.
   Everything here is laid out in its finished state first. js/scenes.js adds .is-scrolly and drives
   the motion from scroll position, so no-JS and reduced-motion visitors see the full compositions. */

/* ---------- Hero: type-led opening ---------- */
.hero-reveal.front-hero{padding:0;position:relative}
.hero-reveal .hero-reveal-stage{position:relative;background:var(--paper,#f2f0e9)}
.hero-reveal .hero-reveal-shell{display:flex;flex-direction:column;padding-top:calc(var(--nav-h) + 22px);padding-bottom:18px}
.hero-reveal .front-meta{margin-bottom:0}
.hero-reveal .hero-carousel-track{height:auto;flex:1;align-items:center;padding-block:clamp(14px,3svh,40px)}
.hero-reveal .hero-slide{display:block;align-self:center}
.hero-reveal .hero-copy{padding-block:0;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:3rem;align-items:end}
.hero-reveal .hero-copy .hero-slide-label,.hero-reveal .hero-copy h2{grid-column:1/-1}
.hero-reveal .hero-copy .hero-slide-label{margin-bottom:clamp(10px,2svh,22px)}
.hero-reveal .hero-copy h2{font-size:min(13.2vw,23svh,calc(86vw / (var(--chars,8) * .68)));line-height:.94;letter-spacing:-.065em;min-height:1.88em;margin:0 0 clamp(14px,3svh,30px);text-wrap:nowrap}
.hero-reveal .hero-copy h2>span{display:block;width:fit-content;max-width:100%;color:#a64916;background:linear-gradient(#a6491673,#7a2f0a73),var(--fill,none) var(--fill-pos,50% 50%)/cover no-repeat #a64916;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;padding-right:.04em}
.word-fill.is-filled.on-dark{color:#ff9d45;background-image:linear-gradient(#ff9d45a6,#f58220a6),var(--fill);background-color:#ff9d45}
.hero-reveal .hero-copy>p:not(.hero-slide-label){max-width:44ch;min-height:0;font-size:.95rem}
.hero-reveal .hero-actions{margin-top:0;justify-content:flex-end}
.hero-reveal .hero-slide[data-scene=desk]{--fill:url(../assets/scenes/hero-desk-fill.webp)}
.hero-reveal .hero-slide[data-scene=web]{--fill:url(../assets/scenes/hero-web-fill.webp)}
.hero-reveal .hero-slide[data-scene=connect]{--fill:url(../assets/scenes/hero-connect-fill.webp)}
.hero-reveal .hero-slide[data-scene=create]{--fill:url(../assets/scenes/hero-create-fill.webp)}
.hero-reveal .hero-carousel-controls{padding-top:14px;opacity:var(--ctl,1)}

/* The scene: finished composition by default */
.hero-scene{position:relative;aspect-ratio:3/2;max-height:82svh;width:100%;overflow:hidden;background:#2a2620;isolation:isolate}
.hero-scene-set{position:absolute;inset:0;opacity:0;visibility:hidden;transition:opacity .5s ease,visibility .5s}
.hero-scene-set.is-active{opacity:1;visibility:visible}
/* inactive slides' photographs are not fetched until their slide is shown */
.hero-scene-set:not(.is-active){display:none}
.hero-layer{position:absolute;inset:0;display:block;transform-origin:var(--fx,50%) var(--fy,50%);backface-visibility:hidden}
.hero-layer img{display:block;width:100%;height:100%;object-fit:cover;object-position:var(--fx,50%) var(--fy,50%)}
.hero-scene-shade{position:absolute;inset:0;z-index:2;pointer-events:none;opacity:var(--shade,0);background:linear-gradient(90deg,#14110cb3 0,#14110c66 30%,transparent 60%),linear-gradient(0deg,#14110cb8,transparent 34%)}
.hero-scene-note{position:absolute;z-index:3;right:clamp(18px,4vw,56px);bottom:22px;margin:0;display:flex;flex-direction:column;align-items:flex-end;gap:2px;color:#f4f1e8;font-family:var(--font-mono);font-size:.5rem;line-height:1.6;letter-spacing:.04em;text-transform:uppercase;text-align:right;text-shadow:0 1px 12px #000a;opacity:var(--note,1)}
.hero-scene-note>span:last-child{opacity:.8}
.hero-scene-copy{display:none}

/* Scroll-driven mode */
.hero-reveal.is-scrolly{height:calc(100svh + var(--travel,105vh))}
.hero-reveal.is-scrolly .hero-reveal-stage{position:sticky;top:0;height:100svh;min-height:560px;overflow:hidden;overflow:clip}
.hero-reveal.is-scrolly .hero-reveal-shell{height:100%}
.hero-reveal.is-scrolly .hero-scene{position:absolute;left:0;right:0;top:var(--nav-h);bottom:0;aspect-ratio:auto;max-height:none;width:auto;z-index:3;pointer-events:none;clip-path:inset(50% 50% 50% 50%);will-change:transform,clip-path;background:none}
.hero-reveal.is-scrolly .hero-layer{will-change:transform}
.hero-reveal.is-scrolly .hero-scene-set{transition:none}
.hero-reveal.is-scrolly .hero-scene-set.is-leaving{display:block;opacity:1;visibility:visible;z-index:0}
.hero-reveal.is-scrolly .hero-scene-set.is-entering{z-index:1;animation:scene-in .85s cubic-bezier(.22,.7,.2,1) both}
@keyframes scene-in{from{opacity:0}to{opacity:1}}
.hero-reveal.is-scrolly .hero-scene-copy{display:block;position:absolute;z-index:4;left:0;top:0;color:#f4f1e8;will-change:transform}
.page-home .hero-scene-copy .hero-copy .hero-slide-label,.page-home .hero-scene-copy .hero-copy h2,.page-home .hero-scene-copy .hero-copy>p:not(.hero-slide-label),.page-home .hero-scene-copy .hero-actions{opacity:1;transform:none;transition:none}
.page-home .hero-scene-copy .hero-copy h2{color:#f7f3ea;transform-origin:0 100%;transform:scale(calc(1 - var(--k,0) * .56))}
.page-home .hero-scene-copy .hero-copy .hero-slide-label{opacity:calc(1 - var(--k,0))}
.hero-scene-copy .hero-copy h2>span{background:none;-webkit-text-fill-color:currentColor;color:#ff9d45}
.hero-scene-copy .hero-copy .hero-slide-label,.hero-scene-copy .hero-copy>p:not(.hero-slide-label){color:#f0ebdf}
.hero-scene-copy .hero-slide-label>span{color:#ff9d45}
.hero-scene-copy .btn.btn-primary{background:#f58220;color:#1a1208;border-color:#f58220}
.hero-scene-copy .hero-secondary{color:#f7f3ea;border-color:#f7f3ea99}
.hero-scene-copy .is-focus{outline:2px solid #fff;outline-offset:3px}

@media(max-width:760px){
  .hero-reveal .hero-reveal-shell{padding-top:calc(var(--nav-h) + 14px);padding-bottom:10px}
  .hero-reveal .hero-carousel-track{padding-block:12px;align-items:start}
  .hero-reveal .hero-slide{align-self:start}
  .hero-reveal .hero-copy{display:flex;flex-direction:column;align-items:flex-start}
  .hero-reveal .hero-copy>p:not(.hero-slide-label){order:4;margin-top:16px}
  .hero-reveal .hero-copy h2{font-size:min(17svh,calc(88vw / (var(--chars,8) * .68)));margin-bottom:14px}
  .hero-reveal .hero-copy>p:not(.hero-slide-label){font-size:.82rem;line-height:1.7;min-height:4.2em}
  .hero-reveal .hero-actions{justify-content:flex-start;margin-top:2px}
  .hero-scene{aspect-ratio:872/960;max-height:none}
  .hero-reveal.is-scrolly .hero-scene{top:var(--nav-h);bottom:0;height:auto}
  .hero-scene-shade{background:linear-gradient(180deg,#14110cc4 0,#14110c9e 46%,#14110c52 72%,#14110cb3 100%)}
  .hero-scene-set{--fy:36%!important}
  .hero-scene-note{left:16px;right:auto;bottom:14px;align-items:flex-start;text-align:left;font-size:.42rem}
  .hero-reveal.is-scrolly{height:calc(100svh + var(--travel,90svh))}
}
@media(max-width:560px){.hero-reveal .hero-carousel-controls{row-gap:8px;padding-top:8px}}
@media(max-height:620px) and (max-width:760px){.hero-reveal .hero-copy>p:not(.hero-slide-label){display:none}}

/* ---------- Selected Work: a slim crop opens into the frame ---------- */
.work-scenes{display:grid;gap:clamp(3.5rem,9vw,8rem);margin-top:clamp(2.5rem,6vw,5rem)}
.work-scene{--o:1;display:grid;grid-template-columns:minmax(0,4fr) minmax(0,7fr);gap:clamp(1.5rem,5vw,5rem);align-items:center}
@media(min-width:901px){.work-scene:nth-child(even){grid-template-columns:minmax(0,7fr) minmax(0,4fr)}}
.work-scene:nth-child(even) .work-scene-head{order:2}
.work-scene-index{display:flex;gap:12px;font-family:var(--font-mono);font-size:.56rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin:0 0 1.2rem}
.work-scene-index>span{color:#a64c13}
.work-scene h3{font-size:clamp(2.1rem,4.4vw,4.4rem);line-height:.98;letter-spacing:-.055em;margin:0 0 1.6rem}
.work-scene h3 a{color:inherit;text-decoration:none}
.work-scene h3 a:hover{color:#a64916}
.work-scene-facts{display:grid;gap:.9rem;margin:0 0 1.8rem;padding-top:1.1rem;border-top:1px solid var(--line-strong)}
.work-scene-facts>div{display:grid;grid-template-columns:11.5em 1fr;gap:1rem;align-items:baseline}
.work-scene-facts dt{font-family:var(--font-mono);font-size:.52rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.work-scene-facts dd{margin:0;font-size:.92rem}
.work-scene-link{display:inline-flex;align-items:center;gap:.8rem;min-height:44px;font-size:.8rem;font-weight:600;border-bottom:1px solid currentColor;transition:gap .3s,color .25s}
.work-scene-link:hover{gap:1.2rem;color:#a64916}
.work-scene-frame{position:relative;display:block;aspect-ratio:3/2;overflow:hidden;background:#d8d3c6;clip-path:inset(calc((1 - var(--o)) * 44%) 0 round 3px);box-shadow:0 30px 60px -40px #191a1566}
.work-scene-media{position:absolute;inset:0;display:block}
.work-scene-media img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 0}
.work-scene-frame .work-scene-media.feature-cover{aspect-ratio:auto;min-height:0;padding:clamp(18px,3vw,36px);transform:none!important;transition:none!important}
.work-scene-frame .work-scene-media.feature-cover{display:flex;flex-direction:column;justify-content:space-between}
.work-scene-frame .feature-cover>span{display:block}
.work-scene-frame .feature-cover .feature-name{font-size:clamp(2.4rem,5.4vw,5.6rem);max-width:9ch}
.work-scene-frame .feature-cover::before{display:none}
.work-scene-frame .cover-familytree::before{display:block;inset:0;border:0;background:url('../assets/projects/myfamilytree-project.svg') center/cover no-repeat;opacity:.6}
.work-scene-tag{position:absolute;left:14px;bottom:14px;z-index:2;padding:6px 10px;background:#191a15e6;color:#f4f1e8;font-family:var(--font-mono);font-size:.48rem;letter-spacing:.08em;text-transform:uppercase;opacity:var(--o)}
.work-scene-frame:focus-visible{outline:2px solid #a64916;outline-offset:4px}
.is-scrolly-ready .work-scene-frame,.is-scrolly-ready .work-scene-media{will-change:clip-path,transform}
@media(max-width:900px){
  .work-scene{grid-template-columns:1fr;gap:1.6rem}
  .work-scene:nth-child(even) .work-scene-head{order:0}
  .work-scene h3{margin-bottom:1.1rem}
  .work-scene-facts{margin-bottom:1rem}
}
@media(max-width:760px){
  .work-scene-frame:has(.feature-cover){aspect-ratio:1}
  .work-scene-facts>div{grid-template-columns:1fr;gap:.2rem}
}

/* ---------- Site-wide: openings, colour and headings, all tied to scroll ---------- */
/* section photographs open like the page heroes: out of a small rounded window into their full frame
   (lg = large section photos, sm = card photos); the photograph itself is never zoomed */
[data-open=quiet],[data-open=frame]{--o:1;--wy:40%;--wx:34%;clip-path:inset(calc((1 - var(--o)) * var(--wy)) calc((1 - var(--o)) * var(--wx)) round calc((1 - var(--o)) * 600px))}
[data-open-size=sm]{--wy:22%;--wx:18%}
[data-open=frame] img{scale:1;translate:none}
/* section headings: the section's photograph through the last word (js/scenes.js) */
.word-fill.is-filled{color:#a64916;background:linear-gradient(#b4501cb0,#7a2f0ab8),var(--fill) 50% calc(20% + var(--pan,.5) * 60%)/cover no-repeat #a64916;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;padding-right:.04em}
[data-tone]{--c:1}
[data-cut]{--t:1;clip-path:inset(-.15em calc((1 - var(--t)) * 100%) -.3em -.1em);translate:calc((1 - var(--t)) * -3%) 0}
[data-cut=r]{clip-path:inset(-.15em -.1em -.3em calc((1 - var(--t)) * 100%));translate:calc((1 - var(--t)) * 3%) 0}
.work-scene-facts{border-top-color:transparent;background:linear-gradient(90deg,#a64c13 calc(var(--o) * 100%),var(--line-strong) 0) 0 0/100% 1px no-repeat}
.editorial-title .type-fill{color:#a64916;background:linear-gradient(#a6491673,#7a2f0a73),var(--fill) 50% calc(30% + var(--pan,0) * 45%)/cover no-repeat #a64916;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}

/* ---------- Inner pages: the title opens into the page's photograph (js/scenes.js) ---------- */
.title-reveal{position:relative}
.title-reveal.is-scrolly>.title-reveal-stage{position:sticky;top:var(--stick,0px);min-height:100svh;box-sizing:border-box;overflow:clip;isolation:isolate}
.title-scene{position:absolute;inset:0;z-index:6;pointer-events:none;clip-path:inset(50%);opacity:0;background:#1d1a15;will-change:clip-path}
.title-reveal:not(.is-scrolly) .title-scene{display:none}
.title-scene>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 40%}
.title-scene-shade{position:absolute;inset:0;opacity:var(--shade,0);background:linear-gradient(90deg,#14110cd9 0,#14110c99 42%,#14110c4d 75%),linear-gradient(0deg,#14110c99,transparent 40%)}
.title-scene-twin{position:absolute;margin:0!important;color:#f4f1e8}
.title-scene-twin>*{width:100%!important;margin:0!important}
.title-scene-twin,.title-scene-twin *{color:#f4f1e8!important;-webkit-text-fill-color:currentColor!important;border-color:#f4f1e84d!important;text-shadow:0 1px 18px #0006}
.title-scene-twin .type-fill,.title-scene-twin .editorial-title span{background:none!important;color:#ff9d45!important}
.title-scene-twin .btn-primary,.title-scene-twin .btn:not(.btn-ghost){background:#f58220!important;color:#1a1208!important;-webkit-text-fill-color:#1a1208!important;text-shadow:none}
.title-scene-twin [data-words] .sw,.title-scene-twin .ink-word{opacity:1!important}
.title-scene-twin [data-cut]{clip-path:none!important;translate:none!important}

/* statements: each word waits dimmed, then lights in reading order (js/scenes.js adds the spans) */
[data-words] .sw{opacity:.16;transition:opacity .35s ease}
[data-words] .sw.is-lit{opacity:1}

/* footer invitation: a photograph opens between the words on every page */
.footer-invite>a{--g:1}
.footer-invite>a>.invite-pill{position:relative;right:auto;top:auto;font-size:1em;display:inline-block;vertical-align:middle;height:.72em;width:calc(var(--g) * 2.4em);margin-inline:calc(var(--g) * .14em) 0;translate:0 -.07em;border-radius:999px;overflow:hidden;background:#3a3127}
.invite-pill img{display:block;width:100%;height:100%;object-fit:cover}
@media(max-width:760px){.footer-invite>a>.invite-pill{width:calc(var(--g) * 1.7em)}}

@media(prefers-reduced-motion:reduce){
  .title-scene{display:none}
  [data-words] .sw{opacity:1!important;transition:none}
  .footer-invite>a{--g:1!important}
  .hero-reveal.is-scrolly .hero-scene-set.is-entering{animation:none}
  .work-scene,[data-open]{--o:1!important}
  [data-open=frame] img{scale:1!important;translate:none!important}
  [data-cut]{--t:1!important}
  [data-tone]{--c:1!important}
  .hero-scene-set{transition:none}
}
