/* RT Fitout, 20 Nov 2026: the stage-by-stage story of a service, the project tiles, and the fifth service. */

/* ── services: five cards, each one opens its story ── */
.cards { grid-template-columns: repeat(5, 1fr); }
.card { cursor: pointer; padding-inline: 24px; }
.card:focus-visible { outline: 2px solid var(--brass-d); outline-offset: -2px; }
.card .go { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; font: 500 .68rem/1 var(--f); letter-spacing: .26em; text-transform: uppercase; color: var(--brass-d); }
.card .go i { width: 26px; height: 1px; background: currentColor; transition: width .5s var(--ease); }
.card:hover .go i, .card:focus-visible .go i { width: 46px; }
@media (max-width: 1180px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .card { border-bottom: 1px solid rgba(40, 34, 22, .3); }
  .card:nth-child(3) { border-inline-end: 0; }
  .card:nth-child(n+4) { border-bottom: 0; }
}
@media (max-width: 1000px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .card:nth-child(n) { border-inline-end: 1px solid rgba(40, 34, 22, .3); border-bottom: 1px solid rgba(40, 34, 22, .3); }
  .card:nth-child(2n) { border-inline-end: 0; }
  .card:last-child { border-bottom: 0; grid-column: 1 / -1; border-inline-end: 0; }
  .card:last-child .sk { max-width: 260px; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .card:nth-child(n) { border-inline-end: 0; }
}

/* ── projects: two site records that play from the first day to the handover ── */
.projects { border-top: 1px solid rgba(236, 208, 154, .16); }
.projects + .studies { border-top: 1px solid rgba(236, 208, 154, .16); }
.pj { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.pjt { position: relative; display: block; width: 100%; padding: 0; border: 1px solid rgba(236, 208, 154, .26); background: #0f0f10; color: inherit; font: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.pjt .ph { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper2); }
.pjt .ph canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pjt .md, .story .vis .mode { position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(15, 15, 16, .72); color: #fff; font: 400 .92rem/1 var(--h); transition: color .5s; }
.pjt .md { right: 20px; top: 12px; }
.pjt .md::before, .story .vis .mode::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; transition: background .5s, box-shadow .5s; }
.pjt .md.real, .story .vis .mode.real { color: var(--brass-l); }
.pjt .md.real::before, .story .vis .mode.real::before { background: var(--brass-l); box-shadow: 0 0 10px var(--brass-l); }
.story .vis .mode { left: 18px; bottom: 16px; opacity: 0; transition: opacity .4s, color .5s; }
.story .vis .mode.on { opacity: 1; }
.pjt .ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(15, 15, 16, .92), transparent 46%), linear-gradient(180deg, rgba(15, 15, 16, .5), transparent 24%); }
.pjt .stg { position: absolute; left: 20px; top: 18px; z-index: 2; display: flex; align-items: center; gap: 12px; font: 500 .7rem/1 var(--f); letter-spacing: .3em; text-transform: uppercase; color: var(--brass-l); }
.pjt .stg b { font-weight: 500; color: #fff; }
.pjt .bars { position: absolute; left: 20px; right: 20px; bottom: 86px; z-index: 2; display: flex; gap: 6px; }
.pjt .bars i { flex: 1; height: 2px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.pjt .bars i::after { content: ""; display: block; height: 100%; background: var(--brass-l); transform: scaleX(0); transform-origin: 0 50%; }
.pjt .bars i.done::after { transform: none; }
.pjt .bars i.run::after { transform: none; transition: transform var(--dur, 3.6s) linear; }
.pjt .cap { position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 2; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pjt .cap b { font: 500 1.2rem/1.1 var(--f); letter-spacing: .14em; text-transform: uppercase; }
.pjt .cap span { font: 500 .68rem/1 var(--f); letter-spacing: .26em; text-transform: uppercase; color: var(--brass-l); white-space: nowrap; padding-bottom: 4px; border-bottom: 1px solid currentColor; }
.pjt:hover .cap span, .pjt:focus-visible .cap span { color: #fff; }
.pjt:focus-visible { outline: 2px solid var(--brass-l); outline-offset: 3px; }
.pjt .corner { position: absolute; inset: 10px; z-index: 2; width: calc(100% - 20px); height: calc(100% - 20px); pointer-events: none; fill: none; stroke: rgba(236, 208, 154, .55); stroke-width: 1; }
@media (max-width: 820px) { .pj { grid-template-columns: 1fr; } }

/* ── the story: one sheet over the page, stage by stage ── */
.story { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(10, 10, 11, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; visibility: hidden; transition: opacity .5s, visibility 0s .5s; }
.story.open { opacity: 1; visibility: visible; transition: opacity .5s; }
.story .sh { position: relative; width: min(1120px, 100%); max-height: calc(100svh - 40px); display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); background: var(--paper); color: var(--ink); border: 1px solid rgba(236, 208, 154, .5); box-shadow: 0 50px 120px -40px #000; overflow: hidden; translate: 0 26px; transition: translate .7s var(--ease); }
.story.open .sh { translate: none; }
.story .vis { position: relative; min-height: 560px; background: #111; overflow: hidden; }
.story .vis .bg { position: absolute; inset: -30px; background-size: cover; background-position: 50% 50%; filter: blur(26px) brightness(.5); transition: background-image .6s; }
.story .vis canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .5s ease; }
.story .vis canvas.on { opacity: 1; }
.story .vis .draw { position: absolute; inset: 0; display: grid; place-items: center; padding: 12%; opacity: 0; transition: opacity .6s; background:
  linear-gradient(rgba(60, 50, 30, .08) 1px, transparent 1px) 0 0 / 100% 32px, linear-gradient(90deg, rgba(60, 50, 30, .08) 1px, transparent 1px) 0 0 / 32px 100%, var(--paper2); }
.story .vis .draw.on { opacity: 1; }
.story .vis .draw svg { width: 100%; height: auto; overflow: visible; }
.story .vis .draw svg * { fill: none; stroke: var(--graphite); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.story .vis .draw svg .g { stroke: var(--brass-d); }
.story .vis .draw.on svg * { stroke-dashoffset: 0; transition: stroke-dashoffset 1.2s cubic-bezier(.4, 0, .2, 1) var(--d, 0s); }
.story .vis .tag { position: absolute; left: 18px; top: 16px; z-index: 3; padding: 8px 12px; background: rgba(15, 15, 16, .72); color: var(--brass-l); font: 500 .66rem/1 var(--f); letter-spacing: .28em; text-transform: uppercase; }
.story .vis .cnt { position: absolute; right: 18px; bottom: 16px; z-index: 3; padding: 8px 12px; background: rgba(15, 15, 16, .72); color: #fff; font: 400 .9rem/1 var(--h); }
.story .txt { display: flex; flex-direction: column; padding: 34px 34px 28px; overflow: auto; }
.story .txt > small { font: 500 .7rem/1 var(--f); letter-spacing: .32em; text-transform: uppercase; color: var(--brass-d); }
.story .txt h2 { margin: 12px 0 6px; font-size: clamp(1.8rem, 3vw, 2.5rem); }
.story .txt .way { margin: 0 0 22px; font: 400 1rem/1.3 var(--h); color: var(--brass-d); }
.story ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(40, 34, 22, .28); }
.story li { position: relative; border-bottom: 1px solid rgba(40, 34, 22, .28); }
.story li button { display: grid; grid-template-columns: 34px 1fr; gap: 4px 10px; width: 100%; padding: 13px 0 13px 2px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; opacity: .5; transition: opacity .4s; }
.story li button:hover, .story li.cur button { opacity: 1; }
.story li button:focus-visible { outline: 2px solid var(--brass-d); outline-offset: 2px; }
.story li small { font: 500 .7rem/1.9 var(--f); letter-spacing: .2em; color: var(--brass-d); }
.story li b { font: 500 .84rem/1.6 var(--f); letter-spacing: .22em; text-transform: uppercase; }
.story li p { grid-column: 2; margin: 0; font-size: .95rem; line-height: 1.55; color: #3d3a34; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); }
.story li p span { overflow: hidden; }
.story li.cur p { grid-template-rows: 1fr; }
.story li::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 100%; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: 0 50%; }
.story li.cur.run::after { transform: none; transition: transform var(--dur, 4.2s) linear; }
.story .ctl { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 20px; }
.story .ctl button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(40, 34, 22, .45); background: none; color: var(--ink); cursor: pointer; transition: background .3s, color .3s; }
.story .ctl button:hover { background: var(--ink); color: var(--paper); }
.story .ctl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.story .ctl .src { margin: 0 0 0 auto; font-size: .78rem; line-height: 1.4; opacity: .62; text-align: right; max-width: 230px; }
.story .x { position: absolute; right: 12px; top: 12px; z-index: 5; width: 42px; height: 42px; display: grid; place-items: center; border: 0; background: rgba(15, 15, 16, .06); color: var(--ink); cursor: pointer; }
.story .x:hover { background: var(--ink); color: var(--paper); }
.story .x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
body.story-on { overflow: hidden; }
@media (max-width: 860px) {
  .story { padding: 0; }
  .story .sh { grid-template-columns: 1fr; grid-template-rows: auto 1fr; width: 100%; height: 100svh; max-height: none; border: 0; }
  .story .vis { min-height: 0; height: 44svh; }
  .story .txt { padding: 22px 20px 18px; }
  .story .x { background: rgba(15, 15, 16, .7); color: #fff; }
  .story .ctl .src { max-width: 170px; }
}

/* the hero stage, written in the title block */
#stage { transition: color .6s; }
#stage.done { color: var(--brass-l); }

@media (prefers-reduced-motion: reduce) {
  .story, .story .sh, .story .vis canvas, .story li p { transition: none; }
  .story .vis .draw svg * { stroke-dashoffset: 0; transition: none; }
  .story li.cur.run::after, .pjt .bars i.run::after { transition: none; }
}
/* site videos inside the stage sheet (24 Nov) */
.story .vis video.vv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #121110; display: none; z-index: 2; }
.story .vis video.vv.on { display: block; }
.story .vis .tag, .story .vis .mode, .story .vis .cnt { z-index: 3; pointer-events: none; }
