/* ---------- SIDE RAIL (anchors) ---------- */
.rail { display: none; }
@media (min-width: 1100px) {
  body.has-rail { padding-left: var(--rail-w); }
  body.has-rail > header, body.has-rail > footer { margin-left: calc(-1 * var(--rail-w)); }
  body.has-rail > header .wrap, body.has-rail > footer .wrap { max-width: none; padding-left: 32px; padding-right: 32px; }
  .rail { display: block; position: fixed; left: 32px; top: 50%; transform: translateY(-50%); z-index: 30; width: 110px; font-family: 'RF Dewi', monospace; font-size: 11px; letter-spacing: .06em; }
  .rail ul { list-style: none; position: relative; padding-left: 16px; display: flex; flex-direction: column; gap: 14px; }
  .rail ul::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
  .rail .bar { position: absolute; left: 0; top: 4px; width: 1px; height: 0; background: var(--accent); transition: height .15s linear; }
  .rail a { display: flex; gap: 8px; color: var(--gray); text-transform: uppercase; transition: color .25s, transform .25s; }
  .rail a i { font-style: normal; opacity: .6; }
  .rail a:hover { color: var(--ink); transform: translateX(4px); }
  .rail a.on { color: var(--ink); }
  .rail a.on::before { content: ''; position: absolute; left: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 3px; animation: pop .35s ease; }
  @keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
}
/* ---------- MOTION (only when JS runs, and motion is OK) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }
.js .split .ch { display: inline-block; overflow: hidden; vertical-align: top; }
.js .split .ch > span { display: inline-block; transform: translateY(110%); transition: transform .9s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--i) * 35ms + .1s); }
.js .split.in .ch > span { transform: none; }
.js .photo-hero { clip-path: inset(0 0 100% 0); transition: clip-path 1.2s cubic-bezier(.7,0,.2,1); }
.js .photo-hero.in { clip-path: inset(0 0 0 0); }
.js .photo-hero img, .js .photo-hero canvas#portraitCanvas { transform: scale(1.12); transition: transform 1.6s cubic-bezier(.2,.7,.2,1); will-change: transform; }
.js .photo-hero.in img, .js .photo-hero.in canvas#portraitCanvas { transform: scale(1); }
.work-row { transition: padding-left .35s cubic-bezier(.2,.7,.2,1), background .3s; position: relative; }
.work-row:hover { padding-left: 14px; }
.work-row:hover .num { color: var(--accent); }
.work-row .title { background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat; transition: background-size .45s cubic-bezier(.2,.7,.2,1); display: inline; }
.work-row:hover .title { background-size: 100% 1px; }
.talk-card { transition: transform .4s cubic-bezier(.2,.7,.2,1), background .3s; }
.talk-card:hover { transform: translateY(-6px); }
.magnet { display: inline-block; transition: transform .3s cubic-bezier(.2,.7,.2,1); will-change: transform; }
.cursor { position: fixed; left: 0; top: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--accent); pointer-events: none; z-index: 100; mix-blend-mode: multiply; transition: width .25s, height .25s, margin .25s, opacity .3s; opacity: 0; }
.cursor.on { opacity: 1; }
.cursor.big { width: 44px; height: 44px; margin: -22px 0 0 -22px; opacity: .35; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal], .js .split .ch > span, .js .photo-hero, .js .photo-hero img, .js .photo-hero canvas#portraitCanvas { transition: none !important; opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .cursor { display: none; }
}

/* ---------- CORNER ANCHORS: all four corners of the frame carry something ---------- */
header { position: sticky; top: 0; z-index: 35; background: rgba(244,242,236,.92); backdrop-filter: blur(8px); }
.hud { position: fixed; z-index: 34; font-family: 'RF Dewi', monospace; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #fff; mix-blend-mode: difference; pointer-events: none; line-height: 1.6; }
.hud-bl { left: 32px; bottom: 22px; }
.hud-br { right: 32px; bottom: 22px; text-align: right; }
.hud b { font-weight: 400; display: block; }
.hud .live { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #fff; margin-right: 8px; animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .15; } }
@media (max-width: 700px) { .hud-bl { left: 16px; bottom: 14px; } .hud-br { right: 16px; bottom: 14px; } }
@media (prefers-reduced-motion: reduce) { .hud .live { animation: none; } }
