:root {
  --bg: #14120e;
  --surface: #1b1812;
  --surface-2: #221e16;
  --text: #f2ece0;
  --muted: #948a79;
  --line: rgba(242,236,224,.14);
  --line-strong: rgba(242,236,224,.24);
  --accent: #f2b705;
  --accent-2: #c99204;
  --accent-dim: rgba(242,183,5,.16);
  --teal: #4fd1c0;
  --max: 1480px;
  --r: 3px;
  --r-lg: 6px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--bg); font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; }
button, a { font: inherit; }
a { color: inherit; }
::selection { background: var(--accent); color: #14120e; }
[hidden] { display: none !important; }

/* One native scrollbar system for the page, dialogs and horizontal media rows. */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(242,183,5,.28) rgba(242,236,224,.025);
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: rgba(242,236,224,.025); }
*::-webkit-scrollbar-thumb { background: rgba(242,183,5,.28); border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(242,183,5,.55); }
*::-webkit-scrollbar-thumb:active { background: rgba(242,183,5,.72); }
*::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
*::-webkit-scrollbar-corner { background: transparent; }

/* base texture: everything sits on a faint grain, not a glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: .035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.site-header { position: fixed; inset: 0 0 auto; z-index: 30; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(28px, calc((100vw - var(--max))/2)); background: rgba(20,18,14,.86); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.brand { position: relative; padding-left: 16px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: .015em; text-decoration: none; font-size: .82rem; white-space: nowrap; }
.brand::before { content: ""; position: absolute; left: 0; top: 50%; width: 7px; height: 7px; transform: translateY(-50%); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.nav { display: flex; gap: 30px; font-family: 'IBM Plex Mono', monospace; font-size: .8rem; }
.nav a { color: var(--muted); text-decoration: none; transition: color .15s ease; }
.nav a::before { content: "· "; color: var(--accent); opacity: 0; transition: opacity .15s ease; }
.nav a:hover { color: var(--text); }
.nav a:hover::before { opacity: 1; }

.section-width { width: min(calc(100% - 64px), var(--max)); margin-inline: auto; }
.section-space { padding-top: 96px; padding-bottom: 96px; }
.eyebrow { margin: 0 0 16px; display: flex; align-items: center; gap: 8px; color: var(--accent); font-family: 'IBM Plex Mono', monospace; font-size: .74rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow::before { content: "//"; color: var(--muted); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: 'Space Grotesk', 'Inter', sans-serif; }
h1 { margin-bottom: 24px; font-size: clamp(3.1rem, 5.4vw, 5.6rem); line-height: .97; letter-spacing: -.025em; max-width: 860px; font-weight: 500; }
h1 span { display: inline-block; position: relative; color: var(--accent); font-weight: 700; }
h2 { margin-bottom: 16px; font-size: clamp(2rem, 3.4vw, 3.4rem); line-height: 1.04; letter-spacing: -.02em; font-weight: 500; }
h3 { margin-bottom: 10px; font-size: clamp(1.2rem, 1.7vw, 1.5rem); letter-spacing: -.01em; font-weight: 600; }
p { color: var(--muted); line-height: 1.65; }

/* hero: film-strip / editing-bay feel instead of glow + perspective grid floor */
.hero { position: relative; min-height: 760px; display: grid; align-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-media, .hero-overlay { position: absolute; inset: 0; }
.hero-media { background: linear-gradient(100deg, #100e0b 0%, #17140f 46%, #100e0b 100%); }
.hero-overlay { pointer-events: none; background: linear-gradient(90deg, rgba(20,18,14,.98) 0%, rgba(20,18,14,.9) 38%, rgba(20,18,14,.35) 64%, rgba(20,18,14,.7) 100%); }
.hero-media-grid { position: absolute; inset: 0; opacity: .5; background-image: repeating-linear-gradient(90deg, rgba(242,236,224,.05) 0 1px, transparent 1px 96px); transform: translateX(0); transition: transform .3s ease-out; }
.hero-media-panels { position: absolute; inset: 8% 0 8% 47%; display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); grid-template-rows: repeat(10, minmax(0, 1fr)); gap: 10px; opacity: .8; transform: rotate(-1.2deg); transition: transform .3s ease-out; }
.hero-media-panels span {
  --panel-x: 0px;
  --panel-y: 0px;
  --panel-rotate: 0deg;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background-color: var(--surface);
  background-image: linear-gradient(rgba(20,18,14,.08), rgba(20,18,14,.24)), var(--hero-image);
  background-position: var(--hero-position, 50% 50%);
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: 0 12px 32px rgba(0,0,0,.24);
  transform: translate3d(var(--panel-x), var(--panel-y), 0) rotate(var(--panel-rotate));
  transition: transform 280ms cubic-bezier(.16,1,.3,1), border-color 180ms ease, filter 180ms ease;
  will-change: transform;
}
.hero-media-panels span::before { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(242,236,224,.03); }
.hero-media-panels span::after { content: attr(data-tc); position: absolute; z-index: 2; left: 8px; bottom: 7px; padding: 2px 5px; color: rgba(242,236,224,.62); background: rgba(20,18,14,.46); border-radius: 2px; font-family: 'IBM Plex Mono', monospace; font-size: .58rem; letter-spacing: .04em; }
.hero-media-panels span:hover { z-index: 3; border-color: rgba(242,183,5,.72); filter: brightness(1.08) saturate(1.03); transform: translate3d(var(--panel-x), var(--panel-y), 0) rotate(0deg) scale(1.025); }
.hero-panel-robot { grid-column: 1 / 6; grid-row: 1 / 11; --hero-image: url("assets/posters/ai-avatars/robot.jpg"); --hero-position: 50% 46%; --panel-rotate: -.7deg; }
.hero-panel-brain { grid-column: 6 / 10; grid-row: 1 / 6; --hero-image: url("assets/posters/ai-video-ads/brain-animated.jpg"); --hero-position: 50% 48%; --panel-rotate: .45deg; }
.hero-panel-candle { grid-column: 6 / 10; grid-row: 6 / 11; --hero-image: url("assets/posters/ai-avatars/candle.jpg"); --hero-position: 50% 45%; --panel-rotate: -.45deg; }
.hero-panel-character { grid-column: 10 / 13; grid-row: 1 / 6; --hero-image: url("assets/posters/graphic-motion/simple-character.jpg"); --hero-position: 50% 44%; --panel-rotate: -.35deg; }
.hero-panel-grim { grid-column: 13 / 17; grid-row: 1 / 6; --hero-image: url("assets/posters/graphic-motion/grim-tales.jpg"); --hero-position: 50% 46%; --panel-rotate: .55deg; }
.hero-panel-island { grid-column: 10 / 17; grid-row: 6 / 11; --hero-image: url("assets/posters/creative-lab/island-blender.jpg"); --hero-position: 50% 50%; --panel-rotate: .2deg; }
.hero-inner { position: relative; z-index: 2; padding-top: 128px; padding-bottom: 96px; }
.hero-text { max-width: 620px; margin-bottom: 30px; font-size: clamp(1rem, 1.3vw, 1.2rem); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; text-decoration: none; cursor: pointer; border: 1px solid var(--line-strong); transition: transform .15s ease, border-color .15s ease, background .15s ease; font-family: 'IBM Plex Mono', monospace; font-size: .84rem; letter-spacing: .02em; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: #14120e; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.button-primary:hover { background: #ffcc33; }
.button-secondary { color: var(--text); background: transparent; }
.button-secondary:hover { border-color: var(--accent); color: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); padding-top: 30px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.stats article { padding: 14px 28px; border-right: 1px solid var(--line); }
.stats article:last-child { border-right: 0; }
.stats strong { display: block; margin-bottom: 6px; color: var(--text); font-family: 'Space Grotesk', sans-serif; font-size: clamp(2rem, 3vw, 3.2rem); font-weight: 500; line-height: 1; letter-spacing: -.02em; }
.stats span { color: var(--muted); font-family: 'IBM Plex Mono', monospace; font-size: .78rem; letter-spacing: .03em; text-transform: uppercase; }

.section-head { max-width: 700px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.9rem, 3vw, 3rem); }
.section-head.compact { margin-bottom: 34px; }

.work-row { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 30px; padding: 40px 0; border-top: 1px solid var(--line); }
.row-copy { padding-top: 4px; }
.row-index { display: inline-block; margin-bottom: 14px; padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: var(--r); color: var(--muted); font-family: 'IBM Plex Mono', monospace; font-size: .7rem; letter-spacing: .06em; }
.text-link { position: relative; padding: 0; border: 0; color: var(--accent); background: transparent; cursor: pointer; font-family: 'IBM Plex Mono', monospace; font-size: .84rem; }
.text-link::after { content: " →"; }
.media-strip { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; }
.project-card { position: relative; flex: 0 0 auto; aspect-ratio: 9/16; height: auto; width: clamp(190px, 18vw, 260px); min-height: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; scroll-snap-align: start; background: var(--surface); transition: transform .2s ease, border-color .2s ease; }
.project-card:nth-child(odd) { transform: rotate(-.4deg); }
.project-card:nth-child(even) { transform: rotate(.4deg); }
.project-card:hover { transform: translateY(-4px) rotate(0deg); border-color: var(--accent); }
.project-card::after { content: attr(data-title); position: absolute; top: 10px; left: 10px; padding: 3px 7px; border-radius: 2px; color: rgba(242,236,224,.7); background: rgba(20,18,14,.6); font-family: 'IBM Plex Mono', monospace; font-size: .62rem; letter-spacing: .04em; }
.project-card::before { display: none; }
.tone-a { background: linear-gradient(155deg,#5b3a2c,#181310); }
.tone-b { background: linear-gradient(155deg,#2a3f3c,#131715); }
.tone-c { background: linear-gradient(155deg,#4a3520,#151210); }
.tone-d { background: linear-gradient(155deg,#565027,#17150f); }
.tone-e { background: linear-gradient(155deg,#603a22,#181210); }
.tone-f { background: linear-gradient(155deg,#2f4550,#12161a); }
.tone-g { background: linear-gradient(155deg,#5c2f26,#171110); }
.tone-h { background: radial-gradient(circle at 60% 35%,#a1501f,#14120e 68%); }
.tone-i { background: linear-gradient(155deg,#455c34,#131711); }
.tone-j { background: radial-gradient(circle at 45% 45%,#3f6e64,#12160f 62%); }
.tone-k { background: linear-gradient(155deg,#1f5560,#11151a); }
.tone-l { background: linear-gradient(155deg,#5a3f22,#161310); }
.tone-m { background: linear-gradient(155deg,#2e5c50,#101715); }
.tone-n { background: linear-gradient(155deg,#634426,#171310); }

.localization { border-top: 1px solid var(--line); }
.localization-demo { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; align-items: start; padding-top: 8px; }
.localization-langs { padding-top: 4px; }
.lang-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; font-family: 'IBM Plex Mono', monospace; }
.lang-tabs button { min-width: 42px; padding: 9px 13px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: var(--r); background: transparent; cursor: pointer; font-size: .8rem; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.lang-tabs button:hover:not(.active) { border-color: var(--accent); color: var(--text); }
.lang-tabs button.active { color: #14120e; border-color: var(--accent); background: var(--accent); }
.lang-more-count { min-width: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 13px; color: var(--accent); border: 1px solid var(--accent); border-radius: var(--r); font-family: 'IBM Plex Mono', monospace; font-size: .8rem; }
.video-frame { position: relative; width: min(300px, 100%); aspect-ratio: 9 / 16; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--r); background: linear-gradient(160deg,#26301f,#151812 70%); }
.video-fade { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: #14120e; opacity: 0; transition: opacity .18s ease; }
.video-fade.is-fading { opacity: 1; }
.video-lang-code { position: absolute; left: 12px; bottom: 12px; z-index: 3; width: max-content; padding: 5px 9px; border-radius: 2px; background: var(--accent); color: #14120e; font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: .72rem; }
.localization-caption { color: var(--muted); font-family: 'IBM Plex Mono', monospace; font-size: .82rem; }

.toolkit { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toolkit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tool-card { min-height: 220px; display: flex; flex-direction: column; padding: 26px; background: var(--surface); }
.tool-card h3 { color: var(--text); }
.tool-card .tools { color: var(--accent); font-family: 'IBM Plex Mono', monospace; font-size: .78rem; letter-spacing: .01em; }
.tool-card p:last-child { margin-top: auto; margin-bottom: 0; }

.about { display: grid; grid-template-columns: .68fr 1.32fr; gap: 54px; align-items: center; }
.about-visual { position: relative; min-height: 380px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: linear-gradient(rgba(20,18,14,.3), rgba(20,18,14,.3)), url("assets/images/about.jpg") 50% 34% / cover no-repeat; }
.about-visual::before, .about-visual::after { content: ""; position: absolute; z-index: 2; width: 22px; height: 22px; border: 2px solid var(--accent); opacity: .8; }
.about-visual::before { left: 18px; top: 18px; border-right: 0; border-bottom: 0; }
.about-visual::after { right: 18px; bottom: 18px; border-left: 0; border-top: 0; }
.about-visual > span { display: none; }
.about-visual img { width: 100%; height: 100%; min-height: 380px; display: block; object-fit: cover; object-position: 50% 34%; filter: brightness(.7) saturate(.78) contrast(1.06) sepia(.08); transform: scale(1.025); transform-origin: center; transition: transform 280ms cubic-bezier(.16,1,.3,1); will-change: transform; }
.about-copy h2 { max-width: 780px; font-size: clamp(1.9rem, 3.4vw, 3.2rem); }
.about-copy p:not(.eyebrow) { max-width: 640px; }

.contact { border-top: 1px solid var(--line); background: var(--bg); }
.contact-shell { display: grid; grid-template-columns: .85fr 1.15fr; gap: 64px; }
.contact-intro h2 { font-size: clamp(2.4rem, 4.6vw, 4.6rem); }
.contact-intro p { max-width: 460px; }
.contact-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-group { padding: 22px; border: 1px solid var(--line); border-radius: var(--r); }
.group-label { color: var(--accent); font-family: 'IBM Plex Mono', monospace; font-size: .72rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.contact-group a { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; text-decoration: none; border-top: 1px solid var(--line); transition: color .15s ease, padding-left .15s ease; }
.contact-group a:hover { color: var(--accent); padding-left: 5px; }
.footer { display: flex; justify-content: space-between; padding-top: 24px; padding-bottom: 24px; color: var(--muted); border-top: 1px solid var(--line); font-family: 'IBM Plex Mono', monospace; font-size: .8rem; }

.dialog { width: min(1200px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto; color: var(--text); background: #100e0b; border: 1px solid var(--line-strong); border-radius: var(--r-lg); }
.dialog::backdrop { background: rgba(10,9,7,.82); backdrop-filter: blur(6px); }
.dialog-close { position: absolute; z-index: 3; right: 16px; top: 14px; width: 40px; height: 40px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 50%; background: rgba(20,18,14,.86); cursor: pointer; font-size: 1.3rem; }
.dialog-close:hover { border-color: var(--accent); color: var(--accent); }
.project-layout { min-height: 660px; display: grid; grid-template-columns: 1fr; }
.project-viewer { padding: 28px; background: #100e0b; }
.viewer-frame { position: relative; min-height: 560px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); transition: width .25s ease, aspect-ratio .25s ease; font-family: 'IBM Plex Mono', monospace; font-size: .84rem; }
.viewer-frame.format-916 { width: 44%; margin-inline: auto; aspect-ratio: 9/16; min-height: 0; }
.viewer-frame.format-45 { width: 62%; margin-inline: auto; aspect-ratio: 4/5; min-height: 0; }
.project-thumbs { display: flex; gap: 8px; margin-top: 16px; }
.project-thumbs button { width: 68px; height: 48px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); cursor: pointer; }
.project-thumbs button.active { border-color: var(--accent); }
.viewer-format-controls { display: flex; justify-content: center; margin-top: 16px; }
.format-switch { display: flex; gap: 6px; font-family: 'IBM Plex Mono', monospace; }
.format-switch button { padding: 9px 15px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: var(--r); background: transparent; cursor: pointer; font-size: .82rem; }
.format-switch button.active { color: #14120e; border-color: var(--accent); background: var(--accent); }
.single-format-label { padding: 7px 12px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: var(--r); font-family: 'IBM Plex Mono', monospace; font-size: .76rem; }
.creative-lab-details { width: min(100%, 920px); margin: 30px auto 2px; padding-top: 26px; border-top: 1px solid var(--line); }
.creative-lab-details .eyebrow { margin-bottom: 12px; }
.creative-lab-details h2 { margin-bottom: 12px; font-size: clamp(1.55rem, 2.6vw, 2.35rem); }
.creative-lab-description { max-width: 820px; margin-bottom: 18px; font-size: .96rem; }
.creative-lab-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 0; font-family: 'IBM Plex Mono', monospace; font-size: .76rem; line-height: 1.5; }
.creative-lab-tools span:first-child { color: var(--accent); font-weight: 600; letter-spacing: .06em; }
.simple-dialog { width: min(820px, calc(100% - 32px)); }
.showreel-placeholder, .cv-placeholder { min-height: 480px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 12px; padding: 58px; }
.showreel-placeholder strong { font-family: 'Space Grotesk', sans-serif; font-size: clamp(3.2rem,7vw,6rem); letter-spacing: -.02em; }

@media (max-width: 1050px) {
  .hero { min-height: 700px; }
  .hero-media-panels { inset: 8% 1% 8% 41%; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .stats article:nth-child(2) { border-right: 0; }
  .stats article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .work-row, .localization-demo, .about, .contact-shell, .project-layout { grid-template-columns: 1fr; }
  .row-copy { max-width: 580px; }
  .toolkit-grid { grid-template-columns: repeat(2,1fr); }
  .project-info { border-left: 0; border-top: 1px solid var(--line); }
  .viewer-frame.format-916 { width: 38%; }
  .viewer-frame.format-45 { width: 54%; }
}
@media (max-width: 680px) {
  .site-header { height: auto; min-height: 60px; padding: 12px 20px; gap: 14px; }
  .brand { font-size: .66rem; }
  .nav { gap: 12px; font-size: .74rem; }
  .section-width { width: min(calc(100% - 28px), var(--max)); }
  .section-space { padding-top: 64px; padding-bottom: 64px; }
  .hero { min-height: 640px; }
  .hero-inner { padding-top: 108px; padding-bottom: 70px; }
  h1 { font-size: clamp(2.6rem,14vw,4rem); }
  .hero-media-panels { inset: 34% -8% 8% 44%; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; opacity: .54; }
  .hero-panel-robot { grid-column: 1 / 5; grid-row: 1 / 11; }
  .hero-panel-brain { grid-column: 5 / 9; grid-row: 1 / 6; }
  .hero-panel-island { grid-column: 5 / 9; grid-row: 6 / 11; }
  .hero-panel-candle, .hero-panel-character, .hero-panel-grim { display: none; }
  .stats { grid-template-columns: 1fr; }
  .stats article { border-right: 0; border-bottom: 1px solid var(--line); }
  .stats article:last-child { border-bottom: 0; }
  .work-row { gap: 18px; }
  .project-card { width: clamp(160px, 42vw, 200px); }
  .video-frame { width: min(260px, 78vw); }
  .toolkit-grid, .contact-groups { grid-template-columns: 1fr; }
  .tool-card { min-height: 190px; }
  .about-visual { min-height: 260px; }
  .about-visual img { min-height: 260px; }
  .viewer-frame.format-916, .viewer-frame.format-45 { width: 84%; }
  .project-viewer { padding: 20px; }
  .creative-lab-details { margin-top: 24px; padding-top: 22px; }
  .project-info { padding: 64px 22px 26px; }
  .footer { gap: 12px; flex-direction: column; }
}

.category-dialog { width: min(1080px, calc(100% - 32px)); }
.category-dialog-inner { padding: 58px 30px 34px; }
.category-dialog-inner h2 { margin-bottom: 8px; }
.category-dialog-note { margin-bottom: 26px; font-family: 'IBM Plex Mono', monospace; font-size: .84rem; }
.category-dialog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.category-project-card { width: 100%; aspect-ratio: 9 / 16; min-height: 0; position: relative; overflow: hidden; color: var(--text); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; text-align: left; }
.category-project-card::before { display: none; }
@media (max-width: 820px) { .category-dialog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .category-dialog-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .category-dialog-inner { padding: 56px 16px 22px; } }

/* pipeline: the toolkit is a genuine ordered process — numbers + left-to-right order communicate the sequence, no extra connectors needed */
.pipeline-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
}
.step-label { display: inline-flex; align-items: center; width: fit-content; margin-bottom: 20px; padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: 2px; color: var(--accent); font-family: 'IBM Plex Mono', monospace; font-size: .68rem; letter-spacing: .08em; }
.step-label::before { content: "STEP "; color: var(--muted); }
@media (max-width: 760px) {
  .pipeline-grid { grid-template-columns: 1fr; }
}


/* Final localization treatment: a compact work-row, not a standalone hero section. */
.localization-row { align-items: start; }
.localization-row .row-copy { position: relative; z-index: 3; }
.localization-row .lang-tabs { margin-top: 22px; margin-bottom: 0; }
.localization-inline { display: flex; align-items: flex-start; gap: 18px; min-width: 0; }
.localization-inline .video-frame { width: clamp(190px, 18vw, 260px); flex: 0 0 auto; }
.localization-inline .localization-caption { margin: 4px 0 0; max-width: 190px; font-family: 'IBM Plex Mono', monospace; font-size: .72rem; line-height: 1.5; }
.video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.localization-inline .video-frame video {
  transform: translate(var(--localization-shift-x, 0), var(--localization-shift-y, 0)) scale(1.025);
  transition: transform 220ms cubic-bezier(.16,1,.3,1);
  will-change: transform;
}
.localization-instruction { margin: 18px 0 -8px; color: var(--text); font-family: 'IBM Plex Mono', monospace; font-size: .72rem; line-height: 1.55; }
.localization-action {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: max-content;
  max-width: calc(100% - 28px);
  transform: translate(-50%, -50%);
  display: grid;
  gap: 4px;
  padding: 10px 13px;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 3px;
  background: rgba(8,7,5,.76);
  box-shadow: 0 12px 32px rgba(0,0,0,.25);
  font-family: 'IBM Plex Mono', monospace;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.localization-action strong { font-size: .75rem; font-weight: 600; }
.localization-action small { color: var(--muted); font-size: .62rem; }
.localization-inline .video-frame:hover .localization-action,
.localization-inline .video-frame:focus-visible .localization-action { border-color: var(--accent); }
.contact-groups { grid-template-columns: minmax(280px, 560px); justify-content: end; }
@media (max-width: 920px) {
  .localization-inline { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .localization-inline { flex-direction: column; }
  .localization-inline .video-frame { width: min(240px, 72vw); }
}

.about-cv-button {
  margin-top: 1.25rem;
}

/* Release-candidate hardening */
section[id] { scroll-margin-top: 78px; }
.button-disabled { opacity: .58; cursor: not-allowed; pointer-events: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.category-project-card { transform: none !important; }
.project-card::after { content: attr(data-meta); }
.project-card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.video-lang-line { unicode-bidi: plaintext; }
@media (max-width: 390px) {
  .site-header { align-items: flex-start; }
  .nav { gap: 9px; font-size: .68rem; flex-wrap: wrap; justify-content: flex-end; }
  .brand { max-width: 128px; white-space: normal; line-height: 1.15; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Real media cards and native Creative Lab formats */
.project-card.square { aspect-ratio: 1 / 1; width: clamp(220px, 24vw, 320px); }
.project-card.wide { aspect-ratio: 16 / 9; width: clamp(300px, 38vw, 500px); }
.project-card.feed { aspect-ratio: 4 / 5; width: clamp(210px, 24vw, 300px); }
.project-card video { background: var(--surface); }
.project-card video::-webkit-media-controls { display: none !important; }

.viewer-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #080705; }
.viewer-frame.format-square { width: 72%; min-height: 0; aspect-ratio: 1 / 1; margin-inline: auto; }
.viewer-frame.format-wide { width: 100%; min-height: 0; aspect-ratio: 16 / 9; margin-inline: auto; }
.viewer-fallback { position: relative; z-index: 1; }
.viewer-fallback[hidden], .viewer-frame video[hidden] { display: none; }

.category-project-card.square { aspect-ratio: 1 / 1; }
.category-project-card.wide { aspect-ratio: 16 / 9; grid-column: span 2; }
.category-project-card.feed { aspect-ratio: 4 / 5; }
.category-project-card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 680px) {
  .project-card.square { width: 210px; }
  .project-card.wide { width: 310px; }
  .project-card.feed { width: 190px; }
  .viewer-frame.format-square, .viewer-frame.format-wide { width: 100%; }
}

/* Calm media previews: poster first, muted playback only while hovered/focused. */
.project-card {
  color: var(--text);
  background-image: var(--card-poster);
  background-size: cover;
  background-position: var(--poster-x, 50%) var(--poster-y, 50%);
  background-repeat: no-repeat;
  transition: background-position .18s ease, transform .18s ease, border-color .18s ease;
}
.project-card video {
  display: none;
}

.localization-inline { overflow: visible; }
.localization-inline .video-frame { cursor: pointer; }
.localization-sound {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  padding: 6px 9px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: rgba(20,18,14,.78);
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.localization-sound:hover,
.localization-sound[aria-pressed="true"] {
  color: #14120e;
  border-color: var(--accent);
  background: var(--accent);
}

/* === Hero Proof Line === */
.hero-proof {
  margin-top: 18px;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: .82rem;
  letter-spacing: .02em;
}

/* === Motion System === */
.reveal-target {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 450ms cubic-bezier(.16,1,.3,1), transform 450ms cubic-bezier(.16,1,.3,1);
}
.reveal-target.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children within strips */
.media-strip .project-card {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 450ms cubic-bezier(.16,1,.3,1) var(--stagger, 0ms),
              transform 450ms cubic-bezier(.16,1,.3,1) var(--stagger, 0ms),
              border-color 180ms ease;
}
.media-strip .project-card:nth-child(1) { --stagger: 0ms; }
.media-strip .project-card:nth-child(2) { --stagger: 60ms; }
.media-strip .project-card:nth-child(3) { --stagger: 120ms; }
.media-strip .project-card:nth-child(4) { --stagger: 180ms; }

.work-row.is-revealed .media-strip .project-card {
  opacity: 1;
  transform: translateY(0);
}

/* Preserve odd/even rotation after reveal */
.work-row.is-revealed .media-strip .project-card:nth-child(odd) {
  transform: rotate(-.4deg);
}
.work-row.is-revealed .media-strip .project-card:nth-child(even) {
  transform: rotate(.4deg);
}
.work-row.is-revealed .media-strip .project-card:hover {
  transform: translateY(-4px) rotate(0deg);
}

/* Hero entrance */
.hero-inner > * {
  opacity: 0;
  transform: translateY(20px);
  animation: heroReveal 800ms cubic-bezier(.16,1,.3,1) forwards;
}
.hero-inner > *:nth-child(1) { animation-delay: 0ms; }
.hero-inner > *:nth-child(2) { animation-delay: 100ms; }
.hero-inner > *:nth-child(3) { animation-delay: 200ms; }
.hero-inner > *:nth-child(4) { animation-delay: 300ms; }
.hero-inner > *:nth-child(5) { animation-delay: 400ms; }

@keyframes heroReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* Stats entrance */
.stats article {
  opacity: 0;
  transform: translateY(12px);
  animation: statsReveal 450ms cubic-bezier(.16,1,.3,1) forwards;
}
.stats article:nth-child(1) { animation-delay: 0ms; }
.stats article:nth-child(2) { animation-delay: 60ms; }
.stats article:nth-child(3) { animation-delay: 120ms; }
.stats article:nth-child(4) { animation-delay: 180ms; }

@keyframes statsReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* Toolkit cards stagger */
.toolkit-grid .tool-card {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 450ms cubic-bezier(.16,1,.3,1) var(--stagger, 0ms),
              transform 450ms cubic-bezier(.16,1,.3,1) var(--stagger, 0ms);
}
.toolkit-grid .tool-card:nth-child(1) { --stagger: 0ms; }
.toolkit-grid .tool-card:nth-child(2) { --stagger: 60ms; }
.toolkit-grid .tool-card:nth-child(3) { --stagger: 120ms; }
.toolkit-grid .tool-card:nth-child(4) { --stagger: 180ms; }
.toolkit-grid .tool-card:nth-child(5) { --stagger: 240ms; }
.toolkit-grid .tool-card:nth-child(6) { --stagger: 300ms; }

.toolkit.is-revealed .tool-card,
.toolkit .tool-card.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Micro interactions */
.button, .text-link, .lang-tabs button, .dialog-close, .localization-sound {
  transition: transform 180ms cubic-bezier(.16,1,.3,1),
              border-color 180ms ease,
              background 180ms ease,
              color 180ms ease,
              opacity 180ms ease;
}

/* Viewer smooth resize */
.viewer-frame {
  transition: width 450ms cubic-bezier(.16,1,.3,1),
              aspect-ratio 450ms cubic-bezier(.16,1,.3,1),
              min-height 450ms cubic-bezier(.16,1,.3,1);
}

/* Tone classes — ensure poster takes priority over gradient */
.project-card[class*="tone-"] {
  background-image: var(--card-poster, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Selected project loader. No card video is downloaded before a click. */
.viewer-loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  place-items: center;
  padding: 24px;
  color: var(--text);
  background: rgba(8, 7, 5, .78);
  font-family: 'IBM Plex Mono', monospace;
  font-size: .78rem;
  text-align: center;
  pointer-events: none;
}
.viewer-frame.is-loading .viewer-loader { display: grid; }
.viewer-frame.has-error .viewer-loader { color: var(--accent); }


/* Persistent dialog scroll areas reserve their scrollbar without shifting content. */
.category-dialog,
.project-dialog { scrollbar-gutter: stable; }

/* Keep close button visible while scrolling */
.category-dialog .dialog-close {
  position: fixed;
  top: 24px;
  right: max(24px, calc((100vw - min(1080px, calc(100% - 32px))) / 2 + 16px));
  z-index: 10;
}
.project-dialog .dialog-close {
  position: fixed;
  top: 24px;
  right: max(24px, calc((100vw - min(1200px, calc(100% - 32px))) / 2 + 16px));
  z-index: 10;
}

/* === Creative Lab Card Alignment === */
/* Main page: Creative Lab cards */
#creative-lab .project-card,
#work > .work-row:last-child .project-card {
  height: 320px;
  width: auto;
  aspect-ratio: unset;
}
#creative-lab .project-card.square,
#work > .work-row:last-child .project-card.square {
  aspect-ratio: 1 / 1;
  height: 320px;
}
#creative-lab .project-card.wide,
#work > .work-row:last-child .project-card.wide {
  aspect-ratio: 16 / 9;
  height: 320px;
}
#creative-lab .project-card.feed,
#work > .work-row:last-child .project-card.feed {
  aspect-ratio: 4 / 5;
  height: 320px;
}
#creative-lab .project-card.portrait,
#work > .work-row:last-child .project-card.portrait {
  aspect-ratio: 9 / 16;
  height: 320px;
}

/* Video inside Creative Lab: contain instead of cover */
#creative-lab .project-card video,
#work > .work-row:last-child .project-card video {
  object-fit: contain;
}

/* Category dialog: when showing Creative Lab cards */
/* The category dialog clones cards, so we need to handle .category-project-card */
.category-dialog-grid .category-project-card.square,
.category-dialog-grid .category-project-card.wide,
.category-dialog-grid .category-project-card.feed {
  height: 280px;
  width: 100%;
  aspect-ratio: unset;
}
.category-dialog-grid .category-project-card.square {
  aspect-ratio: 1 / 1;
}
.category-dialog-grid .category-project-card.wide {
  aspect-ratio: 16 / 9;
}
.category-dialog-grid .category-project-card.feed {
  aspect-ratio: 4 / 5;
}

/* Remove grid-column span from wide cards in dialog */
.category-dialog-grid .category-project-card.wide {
  grid-column: auto;
}

/* Video in category dialog: contain */
.category-dialog-grid .category-project-card video {
  object-fit: contain;
}

/* Ensure metadata label doesn't overflow */
.category-dialog-grid .category-project-card::after {
  max-width: calc(100% - 20px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Browse-only static ads gallery */
.static-gallery-card { background-color: var(--surface); }
.static-gallery-dialog { width: min(1100px, calc(100% - 32px)); scrollbar-gutter: stable; }
.static-gallery-dialog .dialog-close {
  position: fixed;
  top: 24px;
  right: max(24px, calc((100vw - min(1100px, calc(100% - 32px))) / 2 + 16px));
  z-index: 10;
}
.static-gallery-layout { padding: 68px 28px 28px; }
.static-gallery-stage {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 14px;
  min-height: min(72vh, 760px);
  touch-action: pan-y;
}
.static-viewer-frame {
  position: relative;
  justify-self: center;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #080705;
  transition: width 300ms cubic-bezier(.16,1,.3,1), aspect-ratio 300ms cubic-bezier(.16,1,.3,1);
}
.static-viewer-frame.format-916 { width: min(100%, 405px, 37.125vh); aspect-ratio: 9 / 16; }
.static-viewer-frame.format-45 { width: min(100%, 560px, 52.8vh); aspect-ratio: 4 / 5; }
.static-viewer-frame img { width: 100%; height: 100%; display: block; object-fit: contain; opacity: 1; user-select: none; -webkit-user-drag: none; transition: opacity 180ms ease; }
.static-gallery-loader {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--text);
  background: rgba(8,7,5,.78);
  opacity: 0;
  visibility: hidden;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .78rem;
  text-align: center;
  transition: opacity 160ms ease, visibility 160ms ease;
}
.static-viewer-frame.is-loading .static-gallery-loader,
.static-viewer-frame.has-error .static-gallery-loader { opacity: 1; visibility: visible; }
.static-viewer-frame.is-loading img { opacity: .36; }
.static-gallery-arrow {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(20,18,14,.86);
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.15rem;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}
.static-gallery-arrow:hover { color: #14120e; border-color: var(--accent); background: var(--accent); transform: translateY(-2px); }
.static-gallery-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 18px; }
.static-gallery-counter { color: var(--muted); font-family: 'IBM Plex Mono', monospace; font-size: .78rem; letter-spacing: .04em; }
.static-gallery-hint { margin: 12px 0 0; text-align: center; font-family: 'IBM Plex Mono', monospace; font-size: .72rem; }

/* Creative Lab cards and viewer keep each video's native ratio. */
.category-dialog[data-category="Creative Lab"] .category-project-card {
  width: 100%;
  height: auto;
  align-self: start;
}
.category-dialog[data-category="Creative Lab"] .category-project-card.square { aspect-ratio: 1 / 1; }
.category-dialog[data-category="Creative Lab"] .category-project-card.wide { aspect-ratio: 16 / 9; }
.category-dialog[data-category="Creative Lab"] .category-project-card.feed { aspect-ratio: 4 / 5; }
.category-dialog[data-category="Creative Lab"] .category-project-card.portrait { aspect-ratio: 9 / 16; }
.category-dialog-grid .category-project-card video { object-fit: cover; }
.category-dialog[data-category="Creative Lab"] .category-project-card video { object-fit: contain; }

@media (max-width: 680px) {
  .static-gallery-layout { padding: 64px 12px 22px; }
  .static-gallery-stage { grid-template-columns: 38px minmax(0, 1fr) 38px; gap: 4px; min-height: min(66vh, 640px); }
  .static-gallery-arrow { width: 34px; height: 34px; font-size: .95rem; }
  .static-gallery-controls { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-media-panels, .hero-media-panels span, .hero-media-panels span:hover {
    transform: none;
    transition: none;
  }
  .reveal-target, .hero-inner > *, .stats article, .toolkit-grid .tool-card {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }
  .media-strip .project-card {
    opacity: 1;
    transform: translateY(0);
    transition: border-color 180ms ease, transform 180ms ease;
  }
  .media-strip .project-card:nth-child(odd) { transform: rotate(-.4deg); }
  .media-strip .project-card:nth-child(even) { transform: rotate(.4deg); }
  .about-visual img { transform: none; }
}
