@import url(/fonts.css);

/* Same palette and type as the 3D portfolio: cyan for systems, orange for generations, lavender as the neutral.
   Panels are dark and thin-lined with a light blur; Tektur is used for numbers only. No WebGL. */
:root {
  --bg: #030208;
  --ink: #ece8ff;
  --dim: rgba(226, 220, 255, 0.64);
  --faint: rgba(226, 220, 255, 0.38);
  --line: rgba(180, 164, 255, 0.16);
  --line-strong: rgba(180, 164, 255, 0.34);
  --lav: #b4a4ff;
  --sys: #5fd0ff;
  --gen: #ff9248;
  --hot: #ffcf8a;
  --acc: var(--lav);
  --card: rgba(12, 9, 30, 0.62);
  --display: 'Unbounded', 'Bahnschrift', system-ui, sans-serif;
  --digits: 'Tektur', 'Unbounded', system-ui, sans-serif;
  --brand: 'Michroma', 'Unbounded', system-ui, sans-serif;
  --body: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Consolas', ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(18px, 4vw, 48px);
  --r: 8px;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); }
body {
  margin: 0; font-family: var(--body); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased;
  background: var(--bg);
}
/* The glow sits on its own fixed layer: background-attachment: fixed repaints the whole page on every scroll step. */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 12% -10%, rgba(95, 208, 255, 0.07), transparent 70%),
    radial-gradient(60vw 60vh at 100% 30%, rgba(255, 146, 72, 0.06), transparent 70%),
    radial-gradient(80vw 60vh at 50% 110%, rgba(120, 90, 255, 0.08), transparent 70%);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.mono { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; }
::selection { background: rgba(180, 164, 255, 0.35); }
:focus-visible { outline: 1px solid var(--lav); outline-offset: 3px; }

#waves { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }

/* ---------------------------------------------------------------- panels: dark glass, one thin top highlight, an accent hairline */
.glass {
  position: relative; border-radius: var(--r); border: 1px solid var(--line); background: rgba(12, 9, 30, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.35s;
}
.glass::before { content: ''; position: absolute; left: 22px; top: -1px; width: 36px; height: 1px; background: var(--acc); z-index: 3; }
.glass:hover { border-color: color-mix(in srgb, var(--acc) 45%, transparent); }

/* A short RGB split on headings when a view opens: two tinted copies, two or three frames. */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: none; -webkit-text-fill-color: currentColor;
}
.glitch::before { color: var(--sys); }
.glitch::after { color: var(--gen); }
.view.is-active .glitch::before { animation: split-a 0.26s steps(1) 0.05s both; }
.view.is-active .glitch::after { animation: split-b 0.26s steps(1) 0.05s both; }
@keyframes split-a {
  0% { opacity: 0.7; transform: translate(-3px, 0); clip-path: inset(15% 0 55% 0); }
  35% { transform: translate(2px, 0); clip-path: inset(60% 0 10% 0); }
  70% { transform: translate(-1px, 0); clip-path: inset(35% 0 40% 0); }
  100% { opacity: 0; }
}
@keyframes split-b {
  0% { opacity: 0.7; transform: translate(3px, 0); clip-path: inset(55% 0 20% 0); }
  35% { transform: translate(-2px, 0); clip-path: inset(10% 0 65% 0); }
  70% { transform: translate(1px, 0); clip-path: inset(70% 0 5% 0); }
  100% { opacity: 0; }
}

/* ---------------------------------------------------------------- top bar */
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px var(--pad); background: #030208;
  border-bottom: 1px solid var(--line);
}
.bar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand svg { width: 28px; height: 28px; color: var(--lav); filter: drop-shadow(0 0 8px rgba(180, 164, 255, 0.5)); transition: transform 0.8s var(--ease-out); }
.brand:hover svg { transform: rotate(60deg); }
.brand-name { font-family: var(--brand); font-size: 15px; letter-spacing: 0.22em; line-height: 1.1; display: flex; flex-direction: column; }
.brand-name small { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.18em; color: var(--faint); margin-top: 5px; }
.bar-right { display: flex; align-items: center; gap: 10px; }
.pill, .back, .link-chip {
  border: 1px solid var(--line); border-radius: 40px; background: rgba(8, 6, 20, 0.35);
  transition: border-color 0.3s, background 0.3s;
}
.pill { height: 36px; padding: 0 16px; display: inline-flex; align-items: center; white-space: nowrap; }
.pill:hover, .back:hover { border-color: var(--line-strong); background: rgba(180, 164, 255, 0.07); }
.pill-hot { color: var(--hot); border-color: rgba(255, 207, 138, 0.35); }
.pill-hot:hover { border-color: rgba(255, 207, 138, 0.7); background: rgba(255, 207, 138, 0.08); }
.lang { position: relative; display: inline-flex; height: 36px; padding: 3px; border: 1px solid var(--line); border-radius: 40px; background: rgba(8, 6, 20, 0.35); }
.lang button { position: relative; z-index: 1; width: 40px; border-radius: 30px; color: var(--faint); font-size: 10.5px; letter-spacing: 0.16em; transition: color 0.35s; }
.lang button:hover, .lang button.is-active { color: var(--ink); }
.lang-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: 40px; border-radius: 30px;
  background: radial-gradient(circle, rgba(180, 164, 255, 0.28), rgba(180, 164, 255, 0.08));
  box-shadow: 0 0 14px rgba(180, 164, 255, 0.35), inset 0 0 0 1px rgba(180, 164, 255, 0.45); transition: transform 0.55s var(--ease-out);
}
.lang[data-active="en"] .lang-thumb { transform: translateX(40px); }
.back { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 8px; color: var(--ink); }
.back svg { width: 20px; height: 20px; transition: transform 0.4s var(--ease-out); }
.back:hover svg { transform: translateX(-3px); }
body[data-view="gate"] .back { display: none; }
body[data-view="systems"] .back { border-color: rgba(95, 208, 255, 0.4); }
body[data-view="generations"] .back { border-color: rgba(255, 146, 72, 0.4); }

/* ---------------------------------------------------------------- layout and views */
main { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 var(--pad) 40px; }
body[data-view="generations"] main { max-width: 1360px; }
.view { display: none; }
.view.is-active { display: block; animation: view-in 0.6s var(--ease-out) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(12px); } }
.view-sys, .view-gen { padding-top: clamp(36px, 7vh, 64px); }
.notice {
  margin: 24px 0 0; padding: 14px 18px; border: 1px solid rgba(255, 207, 138, 0.35); border-radius: 4px; color: var(--hot);
  background: rgba(255, 207, 138, 0.06); line-height: 1.7; letter-spacing: 0.08em;
}
.label { color: var(--faint); margin: 0 0 12px; }

/* ---------------------------------------------------------------- start screen */
.hero { display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 32px; padding: clamp(28px, 5vh, 56px) 0 22px; }
.eyebrow { color: var(--faint); margin: 0 0 16px; }
.eyebrow span { color: var(--hot); }
.name {
  font-family: var(--brand); font-weight: 400; font-size: clamp(48px, 7.5vw, 104px); line-height: 0.95; letter-spacing: 0.04em; margin: 0;
  background: linear-gradient(100deg, #fff 10%, var(--lav) 55%, var(--hot) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.role { font-family: var(--display); font-weight: 400; font-size: clamp(16px, 1.8vw, 21px); letter-spacing: -0.01em; margin: 18px 0 0; }
.role-sub { margin: 6px 0 0; color: var(--dim); font-size: 15px; }
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; }
.facts li { padding: 7px 12px; border: 1px solid var(--line); border-radius: 30px; color: var(--dim); }
.facts .is-open { color: #9ff0c4; border-color: rgba(159, 240, 196, 0.35); display: inline-flex; align-items: center; gap: 8px; }
.facts .is-open i { width: 6px; height: 6px; border-radius: 50%; background: #6ff0a8; box-shadow: 0 0 8px #6ff0a8; animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.contacts { grid-column: 2; grid-row: 1 / span 6; align-self: end; display: flex; flex-direction: column; gap: 8px; }
.contact { --c: var(--lav); --r: 40px; display: flex; align-items: center; gap: 12px; padding: 9px 20px 9px 9px; transition: border-color 0.3s, box-shadow 0.3s; }
.contact::before { display: none; }
.contact:hover { border-color: var(--c); box-shadow: 0 0 24px -6px var(--c); }
.c-tg { --c: #6cc4ff; } .c-mail { --c: var(--hot); } .c-gh { --c: var(--lav); }
.c-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); color: var(--c); font-family: var(--display); }
.c-icon svg { width: 15px; height: 15px; fill: currentColor; }
.contact > span:last-child { display: flex; flex-direction: column; line-height: 1.15; gap: 3px; }
.contact small { font-size: 9px; color: var(--faint); }
.contact b { font-family: var(--display); font-weight: 400; font-size: 13px; }

.pick { color: var(--faint); margin: 0 0 12px; }
.doors { display: flex; gap: 16px; height: clamp(380px, calc(100vh - 430px), 600px); }
.door {
  flex: 1 1 0; min-width: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px;
  padding: clamp(22px, 3vw, 36px); isolation: isolate;
  transition: flex-grow 0.8s var(--ease-out), border-color 0.4s, box-shadow 0.5s, opacity 0.35s;
}
.door::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.6; transition: opacity 0.5s;
  background: radial-gradient(120% 80% at 0% 100%, color-mix(in srgb, var(--acc) 14%, transparent), transparent 60%);
}
.doors:hover .door { flex-grow: 0.85; }
.doors .door:hover, .doors .door:focus-visible { flex-grow: 1.3; border-color: color-mix(in srgb, var(--acc) 55%, transparent); box-shadow: 0 0 60px -22px var(--acc); }
.door:hover::after { opacity: 1; }
.door.is-leaving { opacity: 0; }
.door.is-chosen { opacity: 0; transition: opacity 0.2s; }
body.is-opening .view-gate > :not(.doors), body.is-opening .foot { opacity: 0; transition: opacity 0.16s; }
.door h2 { font-family: var(--display); font-weight: 500; font-size: clamp(34px, 4.6vw, 60px); letter-spacing: -0.03em; line-height: 1; margin: 0; }
.door-head { display: grid; gap: 12px; }
/* Both feet share one height, so the two titles sit on the same line. */
.door-foot { min-height: 156px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; }
.door-tag { margin: 0; color: var(--dim); max-width: 42ch; font-size: 15px; line-height: 1.5; min-height: 3em; }
.door-schema { position: absolute; inset: 0 0 auto; width: 100%; height: 54%; z-index: -1; opacity: 0.5; transition: opacity 0.6s;
  -webkit-mask: linear-gradient(#000 55%, transparent); mask: linear-gradient(#000 55%, transparent); }
.door-sys:hover .door-schema { opacity: 0.85; }
.ds-links path { fill: none; stroke: rgba(95, 208, 255, 0.28); stroke-width: 1; }
.ds-route { fill: none; stroke: var(--sys); stroke-width: 1.4; stroke-dasharray: 0.06 0.94; stroke-dashoffset: 1; opacity: 0; filter: drop-shadow(0 0 4px var(--sys)); }
.door-sys:hover .ds-route { opacity: 1; animation: ds-run 2.4s linear infinite; }
@keyframes ds-run { to { stroke-dashoffset: 0; } }
.ds-nodes rect { fill: rgba(8, 10, 24, 0.9); stroke: rgba(95, 208, 255, 0.35); }
.ds-nodes text { fill: rgba(170, 230, 255, 0.75); font: 6.5px var(--mono); letter-spacing: 0.08em; text-anchor: middle; }
.door-list { margin: 4px 0 0; color: var(--faint); letter-spacing: 0.1em; }
.door-go { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--acc); }
.door-go i { font-style: normal; transition: transform 0.5s var(--ease-out); }
.door:hover .door-go i { transform: translateX(6px); }
.door-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 10px; max-width: 540px; }
.door-metrics div { padding-top: 8px; border-top: 1px solid var(--line); }
.door-metrics span { display: block; font-size: 12px; color: var(--dim); line-height: 1.35; margin-top: 4px; }
.door-scan { display: none; }
.door-mosaic { position: absolute; inset: 0; z-index: -2; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; gap: 3px; }
.door-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.42; filter: saturate(0.85); transition: opacity 0.6s, transform 1.6s var(--ease-out), filter 0.6s; }
.door-mosaic::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3, 2, 8, 0.35) 0%, rgba(3, 2, 8, 0.55) 45%, rgba(3, 2, 8, 0.94) 100%); }
.door-gen:hover .door-mosaic img { opacity: 0.7; filter: saturate(1.1); transform: scale(1.06); }

/* Opening a door: a panel grows from the door to the whole screen, then fades into the section (cv.js). */
.expand {
  position: fixed; z-index: 60; pointer-events: none; border: 1px solid color-mix(in srgb, var(--acc) 55%, transparent); border-radius: var(--r);
  background: radial-gradient(120% 80% at 0% 100%, color-mix(in srgb, var(--acc) 12%, transparent), transparent 60%), #08061a;
  box-shadow: 0 0 80px -20px var(--acc);
}
.expand::before { content: ''; position: absolute; left: 0; top: -1px; width: 100%; height: 1px; background: linear-gradient(90deg, transparent, var(--acc), transparent); transform: scaleX(0); animation: expand-line 0.5s var(--ease-out) forwards; }
@keyframes expand-line { to { transform: scaleX(1); } }

/* ---------------------------------------------------------------- numbers: Tektur with a soft glow */
.metric b, .door-metrics b, .case-metrics b {
  display: block; font-family: var(--digits); font-weight: 600; letter-spacing: 0; color: var(--acc); line-height: 1.1; white-space: nowrap;
  text-shadow: 0 0 18px color-mix(in srgb, var(--acc) 50%, transparent);
}
.door-metrics b { font-size: clamp(18px, 1.9vw, 26px); }

/* ---------------------------------------------------------------- section heads */
.sec-head { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 24px; padding-bottom: 18px; margin-bottom: 24px; border-bottom: 1px solid var(--line); position: relative; }
.sec-head::after { content: ''; position: absolute; left: 0; bottom: -1px; width: 120px; height: 1px; background: var(--acc); box-shadow: 0 0 10px var(--acc); }
.sec-head .mono { grid-column: 1 / -1; color: var(--faint); margin-bottom: 10px; }
.sec-head h2 { font-family: var(--display); font-weight: 500; font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.02em; margin: 0; line-height: 1; }
.sec-head p { margin: 0; color: var(--dim); justify-self: end; text-align: right; max-width: 52ch; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.chips li { font-size: 12px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 3px; color: var(--dim); background: rgba(180, 164, 255, 0.04); }
.summary { margin: 0; font-size: 17px; line-height: 1.65; color: var(--ink); }

/* ---------------------------------------------------------------- systems */
.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 4vw, 56px); margin-bottom: 28px; align-items: start; }
.skills { padding: 16px 20px; }
.skill { display: grid; grid-template-columns: 82px 1fr; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.skill:last-child { border-bottom: 0; }
.skill > .mono { color: var(--acc); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pair { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { display: grid; gap: 18px; padding: 22px; }
.card-wide { grid-column: 1 / -1; grid-template-columns: 1fr 1.15fr; gap: 32px; }
.card:not(.card-wide) { grid-template-rows: auto 1fr; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-head h3 { font-family: var(--display); font-weight: 500; font-size: 21px; letter-spacing: -0.015em; margin: 0; line-height: 1.15; }
.card-feature .card-head h3 { font-size: 26px; }
.tag { flex: none; padding: 4px 9px; border: 1px solid color-mix(in srgb, var(--acc) 40%, transparent); color: var(--acc); border-radius: 30px; font-size: 9.5px; white-space: nowrap; }
.tag-link:hover { background: color-mix(in srgb, var(--acc) 12%, transparent); }
.tag-client { color: #9ff0c4; border-color: rgba(159, 240, 196, 0.45); }
.kicker { color: var(--faint); margin: 8px 0 0; line-height: 1.6; letter-spacing: 0.1em; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.metric { padding-top: 10px; border-top: 1px solid var(--line); }
.metric b { font-size: clamp(19px, 2vw, 26px); }
.metric span { display: block; font-size: 12px; color: var(--dim); margin-top: 6px; line-height: 1.35; }
.card-feature .metric b { font-size: clamp(21px, 2.3vw, 29px); }
.card-feature .metrics { gap: 18px; }
.points { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.points li { position: relative; padding-left: 18px; color: rgba(236, 232, 255, 0.8); font-size: 14px; line-height: 1.55; }
.points li::before { content: ''; position: absolute; left: 2px; top: 0.62em; width: 6px; height: 1px; background: var(--acc); }
.card-repos { grid-template-columns: 1fr; gap: 0; }
.repos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.repo { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 4px; transition: border-color 0.3s, background 0.3s; }
.repo:hover { border-color: color-mix(in srgb, var(--acc) 50%, transparent); background: rgba(95, 208, 255, 0.04); }
.repo-name { color: var(--ink); letter-spacing: 0.04em; text-transform: none; font-size: 12.5px; }
.repo-name i { font-style: normal; color: var(--acc); }
.repo-text { color: var(--dim); font-size: 13.5px; line-height: 1.5; }
.repo-stack { color: var(--faint); letter-spacing: 0.08em; text-transform: none; font-size: 10.5px; }

/* ---------------------------------------------------------------- generations */
.gen-intro { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.gen-intro .chips { justify-content: flex-end; }
/* Showreel and the order strip: the first screen of the gallery. */
.reel { margin: 36px 0 0; overflow: hidden; }
.reel-video { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 64vh; object-fit: contain; background: #07060f; border-radius: var(--r) var(--r) 0 0; }
.reel figcaption { padding: 10px 16px; color: var(--faint); border-top: 1px solid var(--line); }
.cta { margin-top: 16px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.cta p { margin: 0; color: var(--dim); max-width: 62ch; }
.cta p b { color: var(--ink); font-weight: 500; margin-right: 6px; }
.group-under + .cta { margin-top: 40px; }
.cta-btn, .pl-cta {
  flex: none; height: 40px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 40px; white-space: nowrap;
  color: var(--gen); border: 1px solid color-mix(in srgb, var(--gen) 55%, transparent); background: color-mix(in srgb, var(--gen) 8%, transparent); transition: background 0.3s, border-color 0.3s;
}
.cta-btn:hover, .pl-cta:hover { background: color-mix(in srgb, var(--gen) 16%, transparent); border-color: var(--gen); }
.cta-btn svg, .pl-cta svg { width: 15px; height: 15px; fill: currentColor; }
.cta-btn i, .pl-cta i { font-style: normal; }
.pl-cta { margin-top: auto; }
.pl-cta + .pl-nav { margin-top: 0; padding-top: 14px; }
.group { margin-top: 72px; }
.group-head { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.group-head::after { content: ''; position: absolute; left: 0; bottom: -1px; width: 48px; height: 1px; background: var(--acc); }
.group-head h3 { font-family: var(--display); font-weight: 500; font-size: 20px; letter-spacing: -0.015em; margin: 0; }
.group-head p { margin: 0; color: var(--faint); }
.works { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.work { display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.work.is-full { grid-column: 1 / -1; }
.work.is-flash { animation: flash 1.6s var(--ease-out); }
@keyframes flash { 0%, 30% { border-color: var(--acc); box-shadow: 0 0 50px -12px var(--acc); } }

/* Media never crops: the clip is contained, a blurred copy of the poster fills the rest. */
.work-media { position: relative; display: block; width: 100%; height: clamp(320px, 31vw, 460px); overflow: hidden; background: #000; border-radius: var(--r) var(--r) 0 0; }
.work.is-full .work-media { height: auto; aspect-ratio: 16 / 9; max-height: 80vh; }
/* Calm fill around a contained clip: a dark field with a faint accent glow (no blurred copies: they cost a repaint and look busy). */
.work-media { background: radial-gradient(70% 90% at 50% 50%, color-mix(in srgb, var(--acc) 7%, transparent), transparent 70%), #07050f; }
.work-poster, .work-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.work-poster { transition: filter 0.4s; }
.work-media:hover .work-poster { filter: brightness(1.08); }
.work-preview { opacity: 0; transition: opacity 0.5s; z-index: 1; }
.work-preview.is-on { opacity: 1; }
.clip-btn {
  position: absolute; z-index: 2; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(3, 2, 8, 0.62); border: 1px solid rgba(255, 255, 255, 0.4); transition: transform 0.4s var(--ease-out), border-color 0.3s, opacity 0.4s;
}
.clip-btn svg { width: 20px; height: 20px; fill: #fff; margin-left: 3px; }
.work-media:hover .clip-btn { transform: scale(1.1); border-color: var(--acc); }
.work-media:has(.work-preview.is-on) .clip-btn { opacity: 0; }
.work-media:hover:has(.work-preview.is-on) .clip-btn { opacity: 1; }
.work-count { position: absolute; z-index: 2; right: 12px; top: 12px; padding: 4px 8px; border-radius: 3px; background: rgba(3, 2, 8, 0.65); color: var(--ink); font-size: 9px; }
.work-body { padding: 18px 20px 20px; }
.work-body h3 { font-size: 18px; }
.text { margin: 12px 0 0; color: rgba(236, 232, 255, 0.84); font-size: 14.5px; line-height: 1.6; }
.work-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.work-links > .mono { color: var(--faint); margin-right: 2px; }
.link-chip { height: 30px; padding: 0 13px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 10px; }
.link-chip:hover { border-color: color-mix(in srgb, var(--acc) 60%, transparent); background: color-mix(in srgb, var(--acc) 8%, transparent); }
.link-chip i { font-style: normal; color: var(--acc); transition: transform 0.4s var(--ease-out); }
.link-chip:hover i { transform: translateX(3px); }

/* The spotlight: the trailer plays while on screen, the title sits on the picture, HUD corners frame it. */
.work.is-spot .work-media { max-height: 82vh; }
.work.is-spot .work-media::after {
  content: ''; position: absolute; inset: 16px; z-index: 2; pointer-events: none; opacity: 0.8;
  background:
    linear-gradient(var(--acc), var(--acc)) left top / 18px 1px no-repeat, linear-gradient(var(--acc), var(--acc)) left top / 1px 18px no-repeat,
    linear-gradient(var(--acc), var(--acc)) right top / 18px 1px no-repeat, linear-gradient(var(--acc), var(--acc)) right top / 1px 18px no-repeat,
    linear-gradient(var(--acc), var(--acc)) left bottom / 18px 1px no-repeat, linear-gradient(var(--acc), var(--acc)) left bottom / 1px 18px no-repeat,
    linear-gradient(var(--acc), var(--acc)) right bottom / 18px 1px no-repeat, linear-gradient(var(--acc), var(--acc)) right bottom / 1px 18px no-repeat;
}
.spot-over {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left;
  padding: clamp(28px, 3.4vw, 48px); background: linear-gradient(transparent, rgba(3, 2, 8, 0.85)); pointer-events: none;
}
.spot-badge { color: var(--acc); padding: 0 0 0 14px; position: relative; }
.spot-badge::before { content: ''; position: absolute; left: 0; top: 50%; width: 8px; height: 1px; background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.spot-title { font-family: var(--display); font-weight: 500; font-size: clamp(34px, 5vw, 72px); line-height: 1; letter-spacing: -0.03em; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6); }
.spot-kicker { color: var(--dim); }
.work.is-spot .clip-btn { left: auto; top: auto; right: clamp(28px, 3.4vw, 48px); bottom: clamp(28px, 3.4vw, 48px); margin: 0; width: 62px; height: 62px; }
.spot-body { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.spot-body .text { margin: 0; font-size: 15px; max-width: 80ch; }

/* A case without video: a training-curve board. */
.case-board {
  position: relative; height: clamp(320px, 31vw, 460px); padding: 26px; display: flex; flex-direction: column; justify-content: space-between; border-bottom: 1px solid var(--line);
  background: linear-gradient(rgba(180, 164, 255, 0.05) 1px, transparent 1px) 0 0 / 100% 28px, linear-gradient(90deg, rgba(180, 164, 255, 0.05) 1px, transparent 1px) 0 0 / 28px 100%;
}
.case-board svg { width: 100%; height: 55%; }
.cb-grid line { stroke: rgba(180, 164, 255, 0.2); stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.cb-line { fill: none; stroke: var(--acc); stroke-width: 2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px var(--acc)); }
.case-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.case-metrics div { padding-top: 10px; border-top: 1px solid var(--line); }
.case-metrics b { font-size: clamp(22px, 2.4vw, 34px); }
.case-metrics span { display: block; font-size: 12px; color: var(--dim); margin-top: 4px; line-height: 1.35; }
.work.is-case .points { margin: 14px 0 0; }

/* ---------------------------------------------------------------- player dialog */
.player {
  width: 96vw; height: 94vh; max-width: none; max-height: none; padding: 0; color: var(--ink); overflow: visible;
  border: 1px solid var(--line-strong); border-radius: 10px; background: #06040f;
  display: none; grid-template-columns: minmax(0, 1fr) 330px; grid-template-rows: minmax(0, 1fr);
}
.player[open] { display: grid; animation: pl-in 0.45s var(--ease-out); }
@keyframes pl-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.player::backdrop { background: #030208; }
/* While a clip plays nothing else is rendered: the page, the blurred bar and the dot grid are hidden under the player. */
body.pl-open main, body.pl-open .bar, body.pl-open #waves, body.pl-open .foot { visibility: hidden; }
/* Nothing is drawn over the video and nothing clips it, so the browser can hand it straight to the GPU overlay. */
.pl-stage { position: relative; background: #000; min-width: 0; min-height: 0; height: 100%; }
.pl-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
/* Loading ring over the poster while the clip buffers. */
.pl-load { display: none; position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; pointer-events: none; }
.pl-load::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.15); border-top-color: var(--gen); animation: spin 0.9s linear infinite; }
.pl-stage.is-loading .pl-load { display: grid; }
@keyframes spin { to { transform: rotate(360deg); } }
.vdebug { position: absolute; left: 10px; top: 10px; z-index: 5; padding: 8px 10px; background: rgba(0, 0, 0, 0.75); white-space: pre; text-transform: none; letter-spacing: 0; font-size: 12px; line-height: 1.5; pointer-events: none; }
.pl-info { padding: 28px 24px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--line); }
.pl-group { color: var(--gen); margin: 0 0 6px; }
.pl-info h3 { font-family: var(--display); font-weight: 500; font-size: 20px; letter-spacing: -0.015em; line-height: 1.2; margin: 0 40px 0 0; }
.pl-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.pl-thumb { position: relative; aspect-ratio: 9 / 14; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); transition: border-color 0.3s; }
.pl-thumb.is-wide { grid-column: 1 / -1; aspect-ratio: 16 / 7; }
.pl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.6; transition: opacity 0.3s; }
.pl-thumb span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; font-size: 8.5px; letter-spacing: 0.1em; text-align: left; background: linear-gradient(transparent, rgba(3, 2, 8, 0.9)); }
.pl-thumb:hover img { opacity: 0.9; }
.pl-thumb.is-on { border-color: var(--gen); box-shadow: inset 0 0 0 1px var(--gen); }
.pl-thumb.is-on img { opacity: 1; }
.pl-nav { margin-top: auto; padding-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pl-nav > span { color: var(--faint); }
.pl-nav .pill { height: 32px; padding: 0 12px; }
.pl-close {
  position: absolute; right: 12px; top: 12px; z-index: 4; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-strong); background: rgba(3, 2, 8, 0.6); transition: border-color 0.3s, transform 0.4s var(--ease-out);
}
.pl-close svg { width: 18px; height: 18px; }
.pl-close:hover { border-color: var(--gen); transform: rotate(90deg); }

/* ---------------------------------------------------------------- footer */
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; margin-top: 72px; padding-top: 24px; border-top: 1px solid var(--line); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; font-family: var(--display); font-size: 13px; }
.foot-links a:hover { color: var(--hot); }
.foot-right { text-align: right; }
.foot-right .foot-links { justify-content: flex-end; }
.foot-date { color: var(--faint); margin: 14px 0 0; }
.print-only, .print-note { display: none; }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .contacts { grid-column: auto; grid-row: auto; flex-direction: row; flex-wrap: wrap; margin-top: 22px; }
  .doors { flex-direction: column; height: auto; }
  .door, .doors:hover .door, .doors .door:hover { flex: none; min-height: 320px; }
  .about, .card-wide, .gen-intro { grid-template-columns: 1fr; }
  .gen-intro .chips { justify-content: flex-start; }
  .sec-head { grid-template-columns: 1fr; }
  .sec-head p { justify-self: start; text-align: left; margin-top: 10px; }
  .player { grid-template-columns: 1fr; grid-template-rows: auto; width: 100vw; height: 100dvh; border-radius: 0; border: 0; overflow-y: auto; }
  .player[open] { display: block; }
  .pl-stage { height: 70dvh; }
  .player[data-wide="1"] .pl-stage { height: auto; aspect-ratio: 16 / 9; }
  .pl-info { border-left: 0; border-top: 1px solid var(--line); }
  .pl-strip { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 700px) {
  .works, .grid, .pair, .repos { grid-template-columns: 1fr; }
  .work-media, .case-board { height: 420px; }
  .work.is-full .work-media { height: auto; }
  .spot-body { flex-direction: column; align-items: flex-start; }
  .bar { padding: 12px 14px; }
  .brand-name small { display: none; }
  .bar-right { gap: 6px; }
  .pill { padding: 0 11px; }
  .back-label { display: none; }
  .back { padding: 0 8px; }
  .contact { width: 100%; }
  .metrics, .door-metrics, .case-metrics { gap: 8px; }
  .foot-right { text-align: left; }
  .foot-right .foot-links { justify-content: flex-start; }
}
@media (max-width: 400px) { #to-3d { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .view.is-active, .view.is-active .glitch::before, .view.is-active .glitch::after { animation: none; }
}

/* ---------------------------------------------------------------- print / PDF: light, compact, both sections, no media */
@media print {
  @page { size: A4; margin: 9mm 11mm; }
  :root { --ink: #14121c; --dim: #3d3a4a; --faint: #77738a; --line: #dcd8e8; --line-strong: #c4bfd8; --card: #fff; --sys: #0a7fae; --gen: #c4561a; --hot: #b06a1c; --acc: #c4561a; }
  .sec-sys { --acc: #0a7fae !important; }
  .sec-gen { --acc: #c4561a !important; }
  html, body { background: #fff !important; color: var(--ink); font-size: 9.5pt; }
  #waves, .bar, .notice, .doors, .pick, .player, .reel, .cta, .work-media, .case-board, .clip-btn, .eyebrow, .gen-intro .chips, .work-links, .foot { display: none !important; }
  .view { display: block !important; animation: none !important; }
  .glass { background: none !important; box-shadow: none !important; backdrop-filter: none !important; border: 1px solid var(--line); border-radius: 6px; }
  .glass::before, .glass::after, .glitch::before, .glitch::after { display: none !important; }
  main { max-width: none !important; padding: 0; }
  .hero { display: block; padding: 0 0 10px; }
  .name { font-size: 34pt; background: none; color: var(--ink); -webkit-text-fill-color: var(--ink); filter: none; }
  .role { margin-top: 6px; font-size: 13pt; }
  .role-sub { font-size: 9.5pt; }
  .facts { margin-top: 8px; }
  .facts li { padding: 2px 8px; background: none; }
  .facts .is-open { color: #1e8a50; border-color: #9fd9b8; }
  .facts .is-open i { background: #1e8a50; box-shadow: none; animation: none; }
  .contacts { flex-direction: row; margin-top: 10px; gap: 6px; }
  .contact { padding: 3px 10px 3px 3px; }
  .c-icon { width: 22px; height: 22px; }
  .c-icon svg { width: 10px; height: 10px; }
  .view-sys, .view-gen { padding-top: 12px; }
  .sec-head { padding-bottom: 6px; margin-bottom: 8px; break-after: avoid; }
  .sec-head::after { box-shadow: none; }
  .sec-head h2 { font-size: 17pt; }
  .summary { font-size: 10pt; }
  .about { grid-template-columns: 1.05fr 1fr; gap: 18px; margin-bottom: 10px; }
  .skills { padding: 6px 10px; }
  .skill { padding: 3px 0; grid-template-columns: 64px 1fr; }
  .skill .chips li { box-shadow: none; padding: 0; background: none; font-size: 8.5pt; }
  .skill .chips li:not(:last-child)::after { content: '\00a0·\00a0'; color: var(--faint); }
  .sec .grid, .group .grid { display: block; }
  .sec .grid > * + *, .group .grid > * + * { margin-top: 8px; }
  .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .card { padding: 10px 12px; gap: 10px; break-inside: avoid; }
  .card-wide { grid-template-columns: 1fr 1.15fr; gap: 18px; }
  .card-repos { grid-template-columns: 1fr; }
  .card-head h3, .card-feature .card-head h3 { font-size: 12pt; }
  .metrics { margin-top: 8px; gap: 8px; }
  .metric b, .card-feature .metric b { font-size: 13pt; text-shadow: none; }
  .metric span { font-size: 8pt; }
  .points { gap: 3px; margin-bottom: 8px; }
  .points li, .text, .repo-text { font-size: 9pt; line-height: 1.45; color: var(--dim); }
  .points li::before { box-shadow: none; }
  .repos { margin-top: 8px; gap: 6px; }
  .repo { padding: 6px 8px; break-inside: avoid; box-shadow: inset 0 0 0 1px var(--line); }
  .repo-stack { display: none; }
  .view-gen { padding-top: 14px !important; }
  /* The pipelines card repeats what the systems half and the LoRA case already say. */
  .group-under { display: none !important; }
  .group-head p { font-size: 7.5pt; }
  /* Two-piece groups sit side by side so the gallery fits on the second page. */
  .view-gen.is-active, .view-gen { display: grid !important; grid-template-columns: 1fr 1fr; column-gap: 12px; grid-auto-flow: dense; align-items: start; }
  .view-gen > :not(.group-brand):not(.group-client) { grid-column: 1 / -1; }
  .group-brand .works, .group-client .works { grid-template-columns: 1fr 1fr; }
  .group-brand .group-head p, .group-client .group-head p { display: none; }
  .gen-intro .summary { display: none; }
  .work.is-case .points { display: none; }
  .work .text { font-size: 8.5pt; margin-top: 4px; }
  .group { margin-top: 10px; break-inside: avoid; }
  .group-head { margin-bottom: 6px; }
  .group-head h3 { font-size: 11pt; }
  .works { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .work.is-full { grid-column: auto; }
  .work-body, .spot-body { padding: 8px 10px; display: block; }
  .work-body h3 { font-size: 10pt; }
  .work.is-spot .work-body::before { content: 'The Last Signal'; font-family: var(--display); font-weight: 600; font-size: 10pt; }
  .tag { box-shadow: inset 0 0 0 1px var(--line-strong); background: none; }
  a { color: inherit; }
}
