/* Registered so theme changes animate smoothly everywhere they are used. */
@property --accent { syntax: "<color>"; inherits: true; initial-value: #d23a46; }
@property --tint { syntax: "<color>"; inherits: true; initial-value: #17202b; }

:root {
  --tint: #17202b;
  transition: --accent .6s ease, --tint .9s ease;
  --bg: #0b0e12;
  --bg-2: #121820;
  --panel: rgba(18, 24, 32, 0.78);
  --panel-solid: #141b24;
  --line: rgba(190, 215, 232, 0.14);
  --line-2: rgba(190, 215, 232, 0.28);
  --ice: #d7e7f1;
  --text: #dfe8ee;
  --dim: #7f8e9a;
  --accent: #d23a46;
  --red-dk: #7c1d25;
  --wide: "Michroma", "Arial Black", sans-serif;
  --heavy: "Unbounded", "Arial Black", sans-serif;
  --mono: "Share Tech Mono", ui-monospace, Consolas, monospace;
  --gut: clamp(16px, 3vw, 44px);
}
/* Hovering a main-nav tab (or opening that page) recolors the site. */
:root[data-theme="work"]    { --accent: #ff3d52; --tint: #3b0c16; }
:root[data-theme="about"]   { --accent: #3fe0cf; --tint: #0a3036; }
:root[data-theme="contact"] { --accent: #b18cff; --tint: #251344; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(120% 90% at 70% 40%, var(--tint) 0%, var(--bg) 62%) fixed, var(--bg);
  color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.mono { font-family: var(--mono); letter-spacing: 0.02em; }
.dim { color: var(--dim); }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 1px dashed var(--ice); outline-offset: 3px; }

/* ---------- background layers ---------- */
.bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; transition: opacity .6s, filter .6s; }
#glass { opacity: 0; }
#glass.on { opacity: 1; }
body:not(.at-home) .bg-canvas { opacity: .35; filter: blur(1px); }
.tint {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(38% 45% at 68% 44%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}
.grid-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  background-position: -1px -1px;
  mask-image: radial-gradient(120% 100% at 60% 40%, #000 30%, transparent 85%);
  opacity: .55;
}
.vignette {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55));
}

/* ---------- boot ---------- */
#boot {
  position: fixed; inset: 0; z-index: 50; background: #000;
  display: grid; place-items: center; cursor: pointer;
  transition: opacity .5s;
}
#boot.out { opacity: 0; pointer-events: none; }
#boot-log { font: 13px/1.8 var(--mono); color: var(--ice); min-width: min(360px, 86vw); margin: 0; }
#boot-log::after { content: "_"; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.view { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; }
body:not(.ready) .view { opacity: 0; }
.view { transition: opacity .4s ease; }

/* ---------- HOME ---------- */
#view-home { display: grid; grid-template-rows: auto 1fr auto; padding: var(--gut); }
.home-top { display: flex; gap: 12px; align-items: flex-start; }
.user-box {
  width: 54px; height: 54px; border: 1px solid var(--line-2); padding: 3px;
  background: rgba(0,0,0,.3); transition: border-color .2s;
}
.user-box:hover { border-color: var(--accent); }
.user-box svg { display: block; width: 100%; height: 100%; overflow: visible; }
.mark-shard { fill: var(--accent); transition: transform .35s cubic-bezier(.2,.9,.3,1.5); }
.user-box:hover .mark-shard { transform: translate(3px, -3px) rotate(8deg); transform-origin: 40px 10px; }
.user-box:hover .mark-shard.s2 { transform: translate(5px, -1px); }
.user-meta { display: flex; flex-direction: column; font-size: 12px; line-height: 1.5; padding-top: 2px; }

/* Updates: shows two entries; hover (or tap) expands it, enables scrolling and dims the page. */
.updates {
  --item: 52px;
  position: absolute; top: var(--gut); right: var(--gut); z-index: 6;
  width: min(300px, 40vw); display: grid; grid-template-columns: 16px 1fr 8px; gap: 6px;
  transition: width .35s ease;
}
.updates-label {
  writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; color: var(--dim);
  text-align: right; border-right: 1px solid var(--line-2); padding-right: 2px; cursor: default;
}
.updates-label b { font-weight: 400; color: var(--accent); }
.updates-list {
  display: grid; grid-auto-rows: var(--item); gap: 6px;
  max-height: calc(var(--item) * 2 + 6px); overflow: hidden;
  scrollbar-width: none; overscroll-behavior: contain;
  transition: max-height .45s cubic-bezier(.2,.8,.2,1);
}
.updates-list::-webkit-scrollbar { display: none; }
.updates:hover, .updates:focus-within, .updates.open { width: min(360px, 86vw); }
.updates:hover .updates-list, .updates:focus-within .updates-list, .updates.open .updates-list {
  max-height: calc(var(--item) * 4 + 18px); overflow-y: auto;
}
.update {
  display: flex; flex-direction: column; justify-content: center; min-width: 0;
  padding: 6px 10px; border: 1px solid var(--line-2);
  background: var(--panel); backdrop-filter: blur(6px);
  transition: border-color .2s, background .2s;
}
.update:hover { border-color: var(--accent); background: rgba(40,52,66,.85); }
.update b, .update > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.update b { font: 400 12px/1.4 var(--wide); text-transform: uppercase; letter-spacing: .02em; }
.update > span { font-size: 11px; color: var(--dim); }
.update .new { font: 10px var(--mono); color: var(--accent); margin-right: 6px; vertical-align: 1px; }
.updates-scroll { border: 1px solid var(--line-2); position: relative; }
.updates-scroll span { position: absolute; left: 1px; right: 1px; top: 1px; height: 40%; background: var(--ice); opacity: .8; transition: top .1s, height .3s; }

.dimmer {
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  background: rgba(4, 6, 9, .68); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .35s ease;
}
#view-home:has(.updates:hover, .updates:focus-within, .updates.open) .dimmer { opacity: 1; }

.home-main { align-self: end; padding-bottom: clamp(24px, 6vh, 64px); max-width: 900px; }

.logo {
  position: relative; margin: 0 0 4px; color: transparent;
  font: 900 clamp(64px, 15vw, 210px)/0.9 var(--heavy); letter-spacing: -0.02em;
  user-select: none;
  /* Chrome clips background-clip:text at the box edge, and the last glyph's
     outline overhangs it; pad the box so the hatching covers the whole N. */
  width: fit-content; padding: 0 0.08em 0.04em 0;
}
.logo::before {
  content: attr(data-text); position: absolute; inset: 0; padding: inherit;
  -webkit-text-stroke: 1.5px var(--ice);
  background: repeating-linear-gradient(135deg, rgba(215,231,241,.55) 0 1.5px, transparent 1.5px 6px);
  -webkit-background-clip: text; background-clip: text;
}

.tagline { margin: 10px 0 22px; font-size: 13px; color: var(--dim); text-transform: lowercase; }
.tagline .sep { color: var(--accent); }

.main-nav { display: flex; flex-wrap: wrap; gap: 0 clamp(16px, 3vw, 40px); }
.main-nav a {
  position: relative; padding: 2px 0 2px 18px;
  font: 400 clamp(22px, 3.6vw, 40px)/1.2 var(--wide); letter-spacing: .04em;
  border-left: 2px solid var(--ice); transition: color .2s, padding .25s, border-color .2s;
}
.main-nav a:hover { color: #fff; padding-left: 26px; border-color: var(--accent); }
.main-nav a::after {
  content: ""; position: absolute; left: 18px; right: 0; bottom: 2px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.main-nav a:hover::after { transform: scaleX(1); left: 26px; }

.socials { display: flex; gap: 16px; margin-top: 22px; align-items: center; }
.socials a { color: var(--ice); opacity: .8; transition: opacity .2s, color .2s, transform .2s; }
.socials a:hover { opacity: 1; color: var(--accent); transform: translateY(-2px); }
.socials svg { display: block; }

.status {
  justify-self: end; font-size: 11px; padding: 3px 8px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ice);
}

/* ---------- OS windows (work / about / contact) ---------- */
.os { display: flex; flex-direction: column; padding: var(--gut); height: 100vh; height: 100dvh; }
.os-head {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "title title" "back module";
  gap: 12px 14px; align-items: center; margin-bottom: 18px;
}
.os-title { grid-area: title; display: flex; align-items: baseline; gap: 10px; }
.os-badge {
  font: 800 26px/1 var(--heavy); text-transform: lowercase; letter-spacing: -0.01em;
  padding: 3px 12px 6px; border: 1.5px solid var(--ice); border-radius: 12px;
  background: repeating-linear-gradient(135deg, rgba(215,231,241,.12) 0 1px, transparent 1px 5px);
}
.os-sub { font: 400 20px/1 var(--wide); color: var(--dim); letter-spacing: .04em; }
.back {
  grid-area: back; font-size: 12px; padding: 6px 14px; border: 1px solid var(--line-2);
  background: var(--panel); letter-spacing: .25em; transition: border-color .2s, color .2s;
}
.back:hover { border-color: var(--accent); color: #fff; }
.module {
  grid-area: module; display: flex; justify-content: space-between; gap: 12px;
  font-size: 11.5px; padding: 6px 14px; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--panel); color: var(--ice); white-space: nowrap; overflow: hidden;
}
.module b { color: var(--accent); font-weight: 400; }

.os-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; }
.os-body.single { grid-template-columns: 1fr; align-items: start; max-width: 1060px; width: 100%; margin: 0 auto; }
.os-body.single .panel { max-height: 100%; }

.panel {
  min-height: 0; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line-2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.panel-head {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-bottom: 1px solid var(--line); font-size: 13px; text-transform: uppercase;
}
.list-panel .panel-head { font-size: 14px; letter-spacing: .1em; }
.x {
  font: 12px/1 var(--mono); padding: 5px 14px; color: #fff;
  background: linear-gradient(#e0505b, var(--red-dk)); border: 1px solid #000;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
}
.x:hover { filter: brightness(1.2); }
.path { font-size: 16px; text-transform: none; color: var(--ice); }

.proj-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: var(--ice) transparent; }
.proj-list a {
  display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding: 6px; align-items: center;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.proj-list a:hover { background: rgba(215,231,241,.06); border-color: var(--line); }
.proj-list a.active { border-color: var(--accent); background: rgba(210,58,70,.08); }
.thumb { aspect-ratio: 16/9; overflow: hidden; border: 1px solid var(--line); background: #000; }
.thumb img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8); transition: transform .3s, filter .3s; }
.proj-list a:hover .thumb img, .proj-list a.active .thumb img { transform: scale(1.06); filter: none; }
.meta { min-width: 0; display: flex; flex-direction: column; }
.idx { font-size: 10px; color: var(--accent); }
.meta .t { font: 800 13px/1.2 var(--heavy); text-transform: uppercase; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.meta .s { font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.viewer-body { flex: 1; overflow-y: auto; padding: clamp(14px, 2.4vw, 28px); scrollbar-width: thin; scrollbar-color: var(--ice) transparent; }

.grid-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card { position: relative; display: block; aspect-ratio: 16/10; overflow: hidden; border: 1px solid var(--line-2); background: #000; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s, opacity .3s; opacity: .85; }
.card:hover img { transform: scale(1.05); opacity: 1; }
.card:hover { border-color: var(--accent); }
.card-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 10px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  display: flex; flex-direction: column;
}
.card-cap b { font: 800 14px/1.2 var(--heavy); text-transform: uppercase; }
.card-cap span { font-size: 11px; color: var(--dim); }

.project { max-width: 900px; margin: 0 auto; display: grid; gap: 22px; }
.project header p { margin: 0; font-size: 12px; }
.project h2 { margin: 4px 0 10px; font: 900 clamp(26px, 4.4vw, 48px)/1 var(--heavy); text-transform: uppercase; letter-spacing: -0.02em; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.tags li { font-size: 11px; padding: 1px 8px; border: 1px solid var(--line-2); color: var(--ice); }
.video { position: relative; aspect-ratio: 16/9; border: 1px solid var(--line-2); background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.text h3 { margin: 0 0 6px; font-size: 13px; font-weight: 400; color: var(--accent); text-transform: uppercase; letter-spacing: .2em; }
.text p { margin: 0 0 10px; color: #c8d3db; }
/* labelled lines under each description: My part / Tools / Song / Credit / ... */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.facts dt { font: 11px/1.9 var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .15em; }
.facts dd { margin: 0; color: #c8d3db; }
@media (max-width: 600px) { .facts { grid-template-columns: 1fr; gap: 0; } .facts dd { margin-bottom: 8px; } }
.text a { color: var(--ice); border-bottom: 1px solid var(--line-2); }
.text a:hover { color: var(--accent); }
.gallery { display: grid; gap: 10px; }
.gallery.n2 { grid-template-columns: 1fr 1fr; }
.gallery.n3 { grid-template-columns: repeat(3, 1fr); }
.gallery img, .gallery video, .hero-img img { display: block; width: 100%; border: 1px solid var(--line); background: #000; }
.gallery { align-items: start; }
.pending { text-align: center; color: var(--dim); margin: 0; }
.pn { display: flex; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; }
.pn a { color: var(--ice); }
.pn a:hover { color: var(--accent); }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: clamp(18px, 3vw, 40px); padding: clamp(16px, 3vw, 36px); overflow-y: auto; }
.about-mark {
  margin: 0; border: 1px solid var(--line-2); padding: 8%; align-self: start;
  background: radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 65%), rgba(0,0,0,.3);
}
.about-mark svg { display: block; width: 100%; aspect-ratio: 1; overflow: visible; }
.about-mark .mark-shard { filter: drop-shadow(0 0 1.5px var(--accent)); }
.about-mark:hover .mark-shard { transform: translate(2px, -2px) rotate(8deg); transform-origin: 40px 10px; }
.about-mark:hover .mark-shard.s2 { transform: translate(3.5px, -.5px); }
.about-text h2 { margin: 0 0 14px; font: 900 clamp(36px, 6vw, 64px)/1 var(--heavy); letter-spacing: -0.02em; }
.about-text p { color: #c8d3db; max-width: 62ch; }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0 0 18px; font-size: 13px; }
.specs dt { color: var(--accent); }
.specs dd { margin: 0; color: var(--ice); }

/* ---------- contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(18px, 3vw, 44px); padding: clamp(16px, 3vw, 36px); overflow-y: auto; }
.contact-intro h2 { margin: 0 0 10px; font: 900 clamp(28px, 4vw, 44px)/1.05 var(--heavy); text-transform: uppercase; letter-spacing: -0.02em; }
.contact-intro p { color: #c8d3db; }
.contact-form { display: flex; flex-direction: column; }
.contact-form label { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .15em; margin: 0 0 4px; }
.contact-form input, .contact-form textarea {
  font: 15px/1.5 var(--mono); color: var(--text); background: rgba(0,0,0,.35);
  border: 1px solid var(--line-2); padding: 10px 12px; margin-bottom: 16px; resize: vertical; width: 100%;
  transition: border-color .2s, background .2s;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--ice); background: rgba(0,0,0,.5); }
.contact-form ::placeholder { color: #55626d; }
.send {
  align-self: flex-start; cursor: pointer; font: 400 16px/1 var(--wide); letter-spacing: .1em; color: #fff;
  padding: 14px 26px; border: 1px solid var(--accent); background: linear-gradient(rgba(210,58,70,.35), rgba(124,29,37,.5));
  transition: background .2s, transform .2s;
}
.send:hover { background: var(--accent); transform: translateX(3px); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .os { height: auto; min-height: 100dvh; }
  .os-body { grid-template-columns: 1fr; }
  .list-panel { display: none; } /* the card grid + prev/next cover navigation on small screens */
  .viewer-body { overflow: visible; }
  .about, .contact { grid-template-columns: 1fr; }
  .about-mark { max-width: 220px; }
  .module .date { display: none; }
}
@media (max-width: 600px) {
  .updates { position: static; width: auto; margin-top: 18px; grid-row: 2; align-self: start; }
  #view-home { grid-template-rows: auto auto 1fr auto; }
  .home-main { grid-row: 3; }
  .status { grid-row: 4; }
  .os-head { grid-template-columns: 1fr; grid-template-areas: "title" "back" "module"; }
  .back { justify-self: start; }
  .gallery.n3 { grid-template-columns: 1fr 1fr; }
  .grid-index { grid-template-columns: 1fr; }
}
/* Reduced motion: effects stay, but gentler (see js/fx.js for the JS side). */
@media (prefers-reduced-motion: reduce) {
  #boot-log::after { animation: none; }
  .cursor-ring::before { animation-duration: 14s; }
}

/* ---------- custom cursor (see js/cursor.js) ---------- */
.has-cursor, .has-cursor * { cursor: none !important; }
.has-cursor input, .has-cursor textarea, .has-cursor select, .has-cursor [contenteditable] { cursor: text !important; }
.cursor, .cursor-ring {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none;
  opacity: 0; transition: opacity .2s;
}
.cursor-on .cursor, .cursor-on .cursor-ring { opacity: 1; }
.cursor-text .cursor, .cursor-text .cursor-ring { opacity: 0; }
.cursor svg {
  display: block; width: 22px; height: 22px; margin: -2px 0 0 -2px; /* tip sits on the hotspot */
  overflow: visible; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 55%, transparent));
  transform-origin: 2px 2px; transition: transform .25s cubic-bezier(.2,.9,.3,1.4);
}
.cursor path { fill: var(--accent); stroke: var(--ice); stroke-width: 1.2; stroke-linejoin: round; }
.cursor path.facet { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 1; }
.cursor-ring::before {
  content: ""; position: absolute; left: -17px; top: -17px; width: 34px; height: 34px;
  border: 1px solid color-mix(in srgb, var(--ice) 45%, transparent); border-radius: 50%;
  border-top-color: var(--accent);
  animation: ring-spin 3s linear infinite;
  transition: width .25s, height .25s, left .25s, top .25s, border-color .25s;
}
.cursor-ring::after { /* centre tick */
  content: ""; position: absolute; left: -1px; top: -1px; width: 2px; height: 2px;
  background: var(--ice); opacity: .6; border-radius: 50%;
}
@keyframes ring-spin { to { transform: rotate(360deg); } }
.cursor-link .cursor svg { transform: scale(.8) rotate(-12deg); }
.cursor-link .cursor-ring::before {
  left: -24px; top: -24px; width: 48px; height: 48px;
  border: 1px dashed var(--accent); animation-duration: 6s;
}
.cursor-down .cursor svg { transform: scale(.7); }
.cursor-down .cursor-ring::before { left: -11px; top: -11px; width: 22px; height: 22px; }

/* ---------- effects (see js/fx.js) ---------- */
/* window open/close: the page floats above the one behind while it animates */
.win-anim {
  position: fixed !important; inset: 0; z-index: 30; overflow: hidden;
  transform-origin: 0 0; background: rgba(11, 14, 18, .97);
  outline: 1px solid var(--line-2); will-change: transform, opacity;
}
.win-sweep {
  position: absolute; left: 0; right: 0; top: 0; height: 40vh; pointer-events: none; z-index: 5;
  background: linear-gradient(transparent, color-mix(in srgb, var(--ice) 16%, transparent), transparent);
}

/* glitch wipe over the project viewer */
.viewer { position: relative; overflow: hidden; }
@media (max-width: 860px) { .viewer { overflow: visible; } } /* the page scrolls there, not the panel */
.gl { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.gl-tear { inset: auto 0 auto 0; mix-blend-mode: screen; background: color-mix(in srgb, var(--accent) 70%, #fff); box-shadow: 0 0 12px var(--accent); }
.gl-scan { background: repeating-linear-gradient(0deg, rgba(255,255,255,.07) 0 1px, transparent 1px 3px); }
.gl-load {
  inset: auto auto auto auto; left: 14px; top: 48px; z-index: 11;
  font-size: 12px; color: var(--accent); background: rgba(0,0,0,.75); padding: 2px 8px;
}

/* gallery reveal */
.rev { position: relative; overflow: hidden; opacity: 0; transform: translateY(28px) scale(.98);
  transition: opacity .6s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.rev::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.3) 50%, transparent 65%); transform: translateX(-120%); }
.rev.in { opacity: 1; transform: none; }
.rev.in::after { transition: transform .9s ease .15s; transform: translateX(120%); }
.gallery .rev > img, .gallery .rev > video { margin: 0; }
.rm .rev { transform: none; transition: opacity .35s ease; }
.rm .rev::after { display: none; }

/* hover previews */
.pv-frame { position: relative; overflow: hidden; }
.pv-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; z-index: 1; }
.pv-on .pv-video { opacity: 1; }
.card .card-cap { z-index: 2; }
.pv-live {
  position: absolute; top: 8px; left: 8px; z-index: 3; font-size: 10px; color: #fff;
  background: var(--accent); padding: 0 6px; opacity: 0; transition: opacity .2s;
}
.pv-on .pv-live { opacity: 1; }
.pv-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px; z-index: 3;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
}
.pv-on.card { border-color: var(--accent); }

/* text scramble */
.glyph { color: var(--accent); }
.main-nav a { display: inline-block; }

/* click-to-play cover over the YouTube player */
.yt-cover { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: #000; display: block; overflow: hidden; }
.yt-cover img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.72) saturate(.9); transition: transform .5s ease, filter .3s; }
.yt-cover:hover img { transform: scale(1.03); filter: brightness(.9); }
.yt-play {
  position: absolute; left: 50%; top: 50%; width: 74px; height: 74px; margin: -37px 0 0 -37px;
  display: grid; place-items: center; border: 1.5px solid var(--ice); border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 35%, rgba(0,0,0,.4)); backdrop-filter: blur(4px);
  transition: transform .25s cubic-bezier(.2,.9,.3,1.4), background .2s, border-color .2s;
}
.yt-play svg { width: 30px; height: 30px; margin-left: 4px; fill: var(--ice); }
.yt-cover:hover .yt-play { transform: scale(1.1); background: var(--accent); border-color: #fff; }
.yt-label {
  position: absolute; left: 12px; bottom: 10px; font-size: 11px; letter-spacing: .15em; color: var(--ice);
  background: rgba(0,0,0,.6); padding: 2px 8px; border-left: 2px solid var(--accent);
}
.yt-catch { position: absolute; inset: 0; z-index: 2; } /* see cursor.js */

/* Work viewer: back arrow to the project grid (only shown on a project) */
.to-grid {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 12px 3px 6px;
  font-size: 12px; letter-spacing: .15em; text-transform: lowercase; color: var(--ice);
  border: 1px solid var(--line-2); background: rgba(0,0,0,.3);
  transition: border-color .2s, color .2s, background .2s;
}
.to-grid svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s cubic-bezier(.2,.9,.3,1.4); }
.to-grid:hover { color: #fff; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.to-grid:hover svg { transform: translateX(-3px); }
body:not(.has-project) .to-grid { display: none; }
