/* Work page v2: featured z-pattern chapters, then the full index. Built by tools/build_work.py. */
.work2 .sec .head p { color: var(--ink-2); font-size: 18px; max-width: 36em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- discipline label: a pip plus words, so colour never carries the meaning alone ---- */
.disc { display: inline-flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.disc i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }

/* ---- featured chapters: media and copy trade sides each time (the z), media pins while the copy scrolls ---- */
.chapters { display: grid; gap: clamp(72px, 12vh, 160px); padding: 24px 6vw 0; max-width: 1320px; margin: 0 auto; }
.ch { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.ch:nth-child(even) .ch-media { order: 2; }
.ch-media { position: sticky; top: 12vh; }
.frame { position: relative; aspect-ratio: 4 / 3; border-radius: 28px; overflow: hidden; border: 1px solid var(--line); isolation: isolate;
  background: radial-gradient(120% 90% at 30% 20%, color-mix(in srgb, var(--c) 18%, transparent), transparent 60%), linear-gradient(150deg, #11101c, #07080d 60%, #0b1418);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .07); }
.frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); }
.frame > img, .frame > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.strip { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.strip img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); }
.ai-tag { position: absolute; left: 14px; bottom: 14px; z-index: 2; padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  background: rgba(5, 6, 8, .82); color: var(--ink); border: 1px solid rgba(244, 241, 234, .25); }
.ch-copy { position: relative; padding-top: clamp(0px, 8vh, 96px); padding-bottom: clamp(0px, 10vh, 120px); }
.ch-n { display: block; font: 400 clamp(72px, 8vw, 120px)/.8 var(--serif); color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--c) 70%, #fff); opacity: .9; margin-bottom: 26px; }
.ch-copy h3 { font: 400 clamp(38px, 4vw, 58px)/1.02 var(--serif); letter-spacing: -.01em; margin: 18px 0 10px; text-wrap: balance; }
.ch-copy .ch-title { color: var(--ink); font-weight: 600; font-size: 15px; letter-spacing: .02em; margin: 0 0 18px; }
.ch-copy p { color: var(--ink-2); font-size: 17px; line-height: 1.6; max-width: 32em; margin: 0 0 22px; }
.tech { list-style: none; padding: 0; margin: 0 0 30px; display: flex; flex-wrap: wrap; gap: 8px; }
.tech li { font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); background: rgba(244, 241, 234, .04); }

/* the media reveals as it scrolls in, where the browser can tie animation to scroll */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .ch .frame { animation: unveil linear both; animation-timeline: view(); animation-range: entry 0% cover 35%; }
    @keyframes unveil { from { clip-path: inset(18% 12% 18% 12% round 28px); transform: scale(.94); filter: saturate(.4); } to { clip-path: inset(0 round 28px); transform: none; filter: none; } }
  }
}

/* ---- the evolution under the digital twins: four stages, face to full reel ---- */
.evo { padding-top: clamp(8px, 2vh, 24px); }
.evo-head h3 { font: 400 clamp(32px, 3.2vw, 46px)/1.05 var(--serif); margin: 14px 0 10px; }
.evo-head p { color: var(--ink-2); max-width: 36em; margin: 0 0 28px; }
.evo-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; position: relative; }
.evo-frame { position: relative; aspect-ratio: 4 / 5; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #0b0c12; }
.evo-frame > img, .evo-frame > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.evo-step:nth-child(1) .evo-frame > img { object-position: 0% 30%; }
.evo-step:nth-child(2) .evo-frame > img { object-position: 20% 40%; }
.evo-n { margin: 14px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.evo-n b { font: 400 22px/1 var(--serif); letter-spacing: 0; margin-right: 8px; color: var(--pink); }
.evo-line { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.hear { position: absolute; right: 12px; bottom: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(244, 241, 234, .3); background: rgba(5, 6, 8, .82); color: var(--ink); font: 600 13px Inter, sans-serif; cursor: pointer; }
.hear i { font-size: 17px; }
.hear[aria-pressed="true"] { background: var(--ink); color: #050608; }
.evo-frame .ai-tag { left: 12px; bottom: auto; top: 12px; }

/* ---- live visuals (SVG / canvas), drawn by work.js ---- */
.viz { position: absolute; inset: 0; }
.viz svg, .viz canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.viz .d { stroke-dasharray: var(--len, 1200); stroke-dashoffset: var(--len, 1200); animation: draw 2.6s cubic-bezier(.5, 0, .2, 1) forwards; }
.viz .p { animation: pulse 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.viz .f { animation: floaty 6s ease-in-out infinite; transform-box: fill-box; }
.viz .spin { animation: spin 6s linear infinite; transform-box: view-box; transform-origin: 200px 150px; }
.viz .x { animation: explode 6s cubic-bezier(.6, 0, .2, 1) infinite; }
.viz.paused * { animation-play-state: paused !important; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse { 0%, 100% { opacity: .45; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes explode { 0%, 12%, 88%, 100% { transform: translate(0, 0); } 40%, 60% { transform: translate(var(--dx), var(--dy)); } }

/* ---- the exploded view between the chapters and the index: plays once as it comes into view ---- */
.fx-divider { position: relative; height: clamp(300px, 44vw, 620px); margin-top: clamp(72px, 10vh, 140px); overflow: hidden; }
.fx-divider video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; object-position: center; cursor: pointer; }
.fx-divider::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(var(--bg), rgba(5,6,8,0) 22%, rgba(5,6,8,0) 78%, var(--bg)); }

/* ---- the index ---- */
.idx-sec { position: relative; }
.idx-tools { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; margin-bottom: 28px; }
.find { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px; border-radius: 999px; border: 1px solid var(--line); background: rgba(244, 241, 234, .04); min-width: min(320px, 100%); }
.find:focus-within { border-color: var(--cyan); }
.find i { font-size: 18px; color: var(--ink-2); }
.find input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink); font: inherit; font-size: 15px; }
.find input::placeholder { color: rgba(244, 241, 234, .62); }
.find kbd { font: 600 12px Inter, sans-serif; color: var(--ink-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--ink-2); font: 500 14px Inter, sans-serif; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.chip b { font-weight: 600; color: var(--ink); opacity: .8; }
.chip:hover { color: var(--ink); border-color: rgba(244, 241, 234, .35); }
.chip[aria-pressed="true"] { color: #050608; background: var(--ink); border-color: var(--ink); }
.chip[aria-pressed="true"] b { color: #050608; }

.idx { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.row { border-bottom: 1px solid var(--line); }
.row[hidden] { display: none; }
.row-h { margin: 0; font: inherit; }
.row-h button { width: 100%; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto 28px; gap: 20px; align-items: center; padding: 24px 6px; background: none; border: 0; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.row .n { font: 400 22px/1 var(--serif); color: var(--ink-2); }
.row .tt { display: flex; align-items: baseline; gap: 18px; min-width: 0; }
.row .nm { font: 400 clamp(26px, 2.6vw, 36px)/1.05 var(--serif); white-space: nowrap; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.row .hk { color: var(--ink-2); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.row .feat.none { border: 0; padding: 0; }
.row .disc { justify-self: start; }
.row .feat { justify-self: end; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; }
.row .pm { font-size: 20px; color: var(--ink-2); transition: transform .3s ease; justify-self: end; }
.row-h button:hover .nm { transform: translateX(8px); }
.row-h button[aria-expanded="true"] .pm { transform: rotate(45deg); color: var(--ink); }
.row-h button[aria-expanded="true"] .hk { visibility: hidden; }
.row .cnt { display: inline-flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.row .cnt i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }
/* the builds a group holds, named under its head while it's closed */
.row-names { margin: -14px 0 0; padding: 0 40px 22px 82px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.row.open .row-names { display: none; }
.row-b { display: block; padding: 6px 6px 44px 82px; }
.subs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 36px; }
.sub[hidden] { display: none; }
.sub { display: grid; gap: 16px; align-content: start; scroll-margin-top: 90px; }
.sub h4 { font: 400 28px/1.1 var(--serif); margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sub .rb-hook { font: 600 16px/1.45 Inter, sans-serif; color: var(--ink); margin: 0 0 8px; }
.sub-copy p { color: var(--ink-2); font-size: 15px; line-height: 1.6; margin: 0 0 16px; }
.sub-copy .tech { margin-bottom: 20px; }
/* browsers that can search inside closed rows keep them as zero-height boxes; the rest hide them outright */
html:not(.uf) .row-b[hidden] { display: none; }
.uf .row-b[hidden] { padding: 0; }
.row.open .row-b { animation: rowin .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes rowin { from { opacity: 0; transform: translateY(-8px); } }
.rb-media { position: relative; aspect-ratio: 16 / 10; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(150deg, #11101c, #07080d 60%, #0b1418); }
.rb-media > img, .rb-media > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rb-copy .rb-hook { font: 400 30px/1.1 var(--serif); color: var(--ink); margin: 0 0 14px; }
.rb-copy p { color: var(--ink-2); font-size: 16px; line-height: 1.6; margin: 0 0 20px; max-width: 34em; }
.rb-copy .tech { margin-bottom: 24px; }
.cta.sm { padding: 12px 20px; }
.idx-none { color: var(--ink-2); padding: 28px 6px; }
.idx-none a { color: var(--ink); }

/* cursor preview: desktop with a fine pointer only, decorative */
.peek { position: fixed; left: 0; top: 0; z-index: 5; width: 300px; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(.9);
  border: 1px solid rgba(244, 241, 234, .2); background: #0b0c12; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); transition: opacity .25s ease, transform .25s ease; }
.peek.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.peek > img, .peek > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 1100px) {
  .row .hk { display: none; }
}
@media (max-width: 900px) {
  .evo-steps { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; margin: 0 -16px; padding: 0 16px 8px; }
  .evo-step { flex: 0 0 72%; scroll-snap-align: start; }
  .ch { grid-template-columns: 1fr; gap: 26px; }
  .ch:nth-child(even) .ch-media { order: 0; }
  .ch-media { position: relative; top: 0; }
  .ch-copy { padding: 0; }
  .ch-n { font-size: 64px; margin-bottom: 14px; }
  .row-h button { grid-template-columns: 36px minmax(0, 1fr) 24px; gap: 12px; padding: 20px 2px; }
  .row-h .disc, .row .feat { display: none; }
  .row .nm { white-space: normal; font-size: 26px; }
  .row-b { padding: 0 2px 32px; }
  .subs { grid-template-columns: 1fr; gap: 36px; }
  .row-names { padding: 0 2px 18px 50px; margin-top: -10px; }
  .row-h .cnt { display: none; }
  .peek { display: none; }
}
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) { .peek { display: none; } }
@media (prefers-reduced-motion: reduce) { .viz *, .row.open .row-b { animation: none !important; stroke-dashoffset: 0 !important; } }
