:root {
  --night: #101922;
  --night-soft: #172630;
  --cream: #fff2cb;
  --paper: #f3ead5;
  --yellow: #ffd24a;
  --orange: #ff7a2f;
  --cyan: #76d5de;
  --pink: #f2a6be;
  --green: #87b45d;
  --ink: #19232a;
  --line: #263945;
  --muted: #66737a;
  --page-pad: clamp(18px, 3.2vw, 56px);
  --content: 1440px;
  --pixel-font: "Courier New", "Noto Sans Mono CJK SC", "Microsoft YaHei", monospace;
  --pixel-shadow: 7px 7px 0 rgba(12, 21, 27, .82);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 104px; }
body { margin: 0; overflow-x: clip; background: var(--paper); color: var(--ink); font-family: var(--pixel-font); }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button, input, textarea { font: inherit; }

/* Game menu */
.game-menu {
  position: fixed;
  z-index: 100;
  top: 18px;
  left: 50%;
  width: min(1500px, calc(100% - 32px));
  min-height: 64px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(270px, .72fr) 1.6fr;
  border: 3px solid var(--cream);
  outline: 3px solid var(--night);
  background: rgba(13, 22, 29, .94);
  color: var(--cream);
  box-shadow: 7px 7px 0 rgba(9, 15, 20, .78);
}
.game-menu::before { content: ""; position: absolute; inset: 4px; border: 1px dashed rgba(255, 242, 203, .28); pointer-events: none; }
.player-name {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 15px 22px;
  border-right: 2px solid rgba(255, 242, 203, .35);
  font-size: clamp(15px, 1.25vw, 21px);
  font-weight: 900;
  letter-spacing: .04em;
  white-space: nowrap;
  cursor: default;
  user-select: none;
}
.player-name::before { content: "ZL"; margin-right: 12px; padding: 4px 6px; background: var(--yellow); color: var(--night); }
.menu-actions { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); }
.game-option {
  position: relative;
  min-height: 58px;
  display: grid;
  place-items: center;
  padding: 12px 8px;
  border-left: 1px solid rgba(255, 242, 203, .18);
  font-size: clamp(12px, .95vw, 16px);
  font-weight: 700;
  text-align: center;
  transition: color .12s steps(2), background .12s steps(2), transform .12s steps(2), box-shadow .12s steps(2);
}
.game-option::before { content: "▶"; margin-right: 6px; color: transparent; }
.game-option:hover,
.game-option:focus-visible,
.game-option.is-active {
  z-index: 2;
  color: var(--night);
  background: var(--yellow);
  transform: translate(-3px, -3px);
  box-shadow: 5px 5px 0 var(--orange);
  outline: none;
}
.game-option:hover::before,
.game-option:focus-visible::before,
.game-option.is-active::before { color: var(--night); }

/* Shared components */
.pixel-window { border: 3px solid var(--ink); outline: 2px solid rgba(255,255,255,.55); box-shadow: var(--pixel-shadow); }
.pixel-section { position: relative; padding: clamp(92px, 10vw, 150px) var(--page-pad); }
.pixel-section > * { width: min(100%, var(--content)); margin-inline: auto; }
.grid-paper {
  background-color: var(--paper);
  background-image: linear-gradient(rgba(25,35,42,.085) 1px, transparent 1px), linear-gradient(90deg, rgba(25,35,42,.085) 1px, transparent 1px);
  background-size: 24px 24px;
}
.grid-paper-dark {
  background-color: var(--night);
  background-image: linear-gradient(rgba(118,213,222,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(118,213,222,.08) 1px, transparent 1px);
  background-size: 24px 24px;
}
.section-heading { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: clamp(24px, 5vw, 80px); align-items: end; margin-bottom: clamp(42px, 6vw, 84px); }
.section-heading .section-code { grid-column: 1 / -1; margin-bottom: -10px; }
.section-heading h2 { margin: 0; max-width: 1000px; font-size: clamp(36px, 5.3vw, 78px); line-height: 1.02; letter-spacing: -.06em; text-wrap: balance; }
.section-code { margin: 0; color: var(--orange); font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.section-intro { margin: 0; max-width: 600px; color: #4a585f; font-size: clamp(14px, 1.15vw, 18px); line-height: 1.85; }
.console-title { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 9px 14px; border-bottom: 3px solid var(--ink); background: var(--yellow); color: var(--ink); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.pixel-button {
  width: max-content;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  border: 3px solid var(--ink);
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--ink);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  transition: transform .12s steps(2), box-shadow .12s steps(2), background .12s steps(2);
}
.pixel-button:hover, .pixel-button:focus-visible { background: var(--cyan); transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); outline: none; }
.pixel-button.is-disabled { opacity: .55; background: #cbd0cc; cursor: not-allowed; }
.wide-button { margin-top: 38px; width: 100%; }
.reveal-item { opacity: 0; transform: translateY(18px); transition: opacity .35s steps(5), transform .35s steps(5); }
.reveal-item.is-visible { opacity: 1; transform: none; }

/* Home hero */
.world-hero { position: relative; min-height: 100svh; overflow: hidden; background: #6fc6ef; }
.world-gif { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; image-rendering: pixelated; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,17,22,.23) 0%, transparent 32%, transparent 61%, rgba(9,17,22,.8) 100%); }
.hero-hud {
  position: absolute;
  z-index: 2;
  left: var(--page-pad);
  bottom: clamp(72px, 8vh, 110px);
  width: min(760px, calc(100% - 2 * var(--page-pad)));
  padding: clamp(16px, 2vw, 28px);
  background: rgba(14,24,31,.86);
  color: var(--cream);
}
.hero-hud h1 { margin: 12px 0 16px; font-size: clamp(25px, 3.1vw, 54px); line-height: 1.18; letter-spacing: -.04em; text-wrap: balance; }
.hero-hud > p:last-child { margin: 0; color: var(--cyan); font-size: clamp(11px, 1vw, 15px); line-height: 1.7; }
.status-chip { margin: 0; display: flex; align-items: center; gap: 9px; color: var(--yellow); font-size: 11px; letter-spacing: .08em; }
.status-dot { width: 10px; height: 10px; background: var(--green); box-shadow: 0 0 0 3px rgba(135,180,93,.2); animation: blink 1s steps(2) infinite; }
.scroll-command { position: absolute; z-index: 2; right: var(--page-pad); bottom: 32px; padding: 10px 14px; border: 2px solid var(--night); background: var(--yellow); box-shadow: 4px 4px 0 var(--night); font-size: 12px; font-weight: 900; }
.scroll-command span { display: inline-block; animation: bounce 1s steps(3) infinite; }

/* Profile */
.profile-layout { display: grid; grid-template-columns: 1.12fr .88fr; gap: 28px; align-items: stretch; }
.profile-console, .skill-console { background: #f9f1df; }
.profile-console { min-height: 530px; }
.profile-data { margin: 0; padding: 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; background: var(--ink); }
.profile-data div { min-height: 88px; padding: 14px; background: var(--cream); }
.profile-data dt { margin-bottom: 8px; color: var(--orange); font-size: 11px; font-weight: 900; }
.profile-data dd { margin: 0; font-size: 14px; font-weight: 900; line-height: 1.45; }
.profile-copy { padding: 22px; }
.profile-copy p { margin: 0 0 16px; font-size: 15px; line-height: 1.85; }
.skill-console { align-self: start; }
.skill-row { display: grid; grid-template-columns: 110px 1fr 34px; gap: 12px; align-items: center; padding: 17px 18px; border-bottom: 2px dashed rgba(25,35,42,.2); font-size: 13px; font-weight: 900; }
.skill-row i { height: 15px; border: 2px solid var(--ink); background: linear-gradient(90deg, var(--orange) var(--level), transparent var(--level)); }
.skill-row b { text-align: right; }
.tool-list { margin: 0; padding: 20px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.maker-vignette { position: relative; grid-column: 2; min-height: 260px; margin-top: -120px; margin-left: 28px; display: flex; align-items: end; padding: 28px; overflow: hidden; border: 3px solid var(--ink); background: #9fdbe0; box-shadow: var(--pixel-shadow); }
.maker-vignette::before { content: ""; position: absolute; inset: auto 0 0; height: 42%; background: #547c62; border-top: 4px solid var(--ink); }
.spool-house { position: relative; z-index: 2; width: 58%; min-width: 250px; border: 4px solid var(--ink); background: #f0c46b; }
.spool-roof { height: 54px; display: flex; align-items: center; justify-content: center; gap: 12px; border-bottom: 4px solid var(--ink); background: var(--orange); }
.spool-roof span { width: 44px; height: 44px; border: 6px solid var(--ink); border-radius: 50%; background: var(--yellow); box-shadow: inset 0 0 0 8px var(--cream); }
.spool-room { position: relative; height: 112px; }
.tiny-printer { position: absolute; left: 20px; bottom: 16px; width: 82px; height: 76px; border: 6px solid var(--ink); background: #263945; }
.tiny-printer::before { content: ""; position: absolute; inset: 10px; border: 3px solid var(--cyan); background: #101922; }
.tiny-printer i { position: absolute; z-index: 2; left: 25px; top: 17px; width: 21px; height: 16px; background: var(--orange); box-shadow: 0 32px 0 var(--cream); }
.room-window { position: absolute; right: 20px; bottom: 16px; width: 78px; height: 65px; border: 5px solid var(--ink); background: linear-gradient(90deg, transparent 47%, var(--ink) 47% 54%, transparent 54%), linear-gradient(transparent 47%, var(--ink) 47% 54%, transparent 54%), #ddf1df; }
.tool-rack { position: relative; z-index: 2; width: 34%; height: 170px; margin-left: 18px; border-bottom: 12px solid var(--ink); }
.pen, .knife { position: absolute; bottom: 10px; width: 18px; border: 4px solid var(--ink); transform-origin: bottom; }
.pen::after, .knife::after { content: ""; position: absolute; left: 1px; bottom: -17px; border: 5px solid transparent; border-top-color: var(--ink); }
.pen-a { left: 18px; height: 128px; background: var(--pink); transform: rotate(-8deg); }
.pen-b { left: 58px; height: 145px; background: var(--yellow); transform: rotate(5deg); }
.knife { left: 99px; height: 118px; background: #cbd0cc; transform: rotate(12deg); }
.ruler { position: absolute; z-index: 4; right: 20px; bottom: 14px; width: calc(100% - 40px); height: 24px; display: flex; justify-content: space-between; padding: 4px 7px; border: 2px solid var(--ink); background: var(--yellow); font-size: 9px; font-weight: 900; }
.ruler::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 17px, var(--ink) 17px 19px); opacity: .35; }
.ruler span { position: relative; z-index: 1; background: var(--yellow); }
.experience-track { margin-top: 38px; display: grid; grid-template-columns: repeat(3, 1fr); border: 3px solid var(--ink); box-shadow: var(--pixel-shadow); }
.experience-track article { min-height: 210px; padding: 22px; background: var(--cream); border-right: 3px solid var(--ink); }
.experience-track article:last-child { border-right: 0; }
.experience-track span { color: var(--orange); font-size: 12px; font-weight: 900; }
.experience-track h3 { margin: 14px 0 12px; font-size: 19px; }
.experience-track p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }

/* Ruler and projects */
.ruler-divider { height: 52px; display: flex; align-items: end; justify-content: space-between; padding: 0 var(--page-pad) 7px; border-block: 3px solid var(--ink); background: var(--yellow); background-image: repeating-linear-gradient(90deg, transparent 0 39px, var(--ink) 39px 41px); color: var(--ink); font-size: 10px; font-weight: 900; }
.ruler-divider span { padding: 2px 4px; background: var(--yellow); }
.work-section { background: #f7f0df; }
.split-heading { grid-template-columns: 1.1fr .7fr; }
.split-heading .section-code { grid-column: auto; }
.split-heading h2 { margin-top: 12px; }
.project-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project-slot { position: relative; display: grid; grid-template-rows: auto 220px 1fr auto; min-height: 550px; border: 3px solid var(--ink); background: var(--cream); box-shadow: var(--pixel-shadow); transition: transform .14s steps(2), box-shadow .14s steps(2); }
.project-slot:hover, .project-slot:focus-visible { transform: translate(-4px, -4px); box-shadow: 12px 12px 0 var(--orange); outline: none; }
.slot-top { display: flex; justify-content: space-between; padding: 10px 12px; border-bottom: 3px solid var(--ink); background: var(--night); color: var(--cream); font-size: 10px; letter-spacing: .08em; }
.slot-ready { color: var(--green); }
.slot-art { position: relative; overflow: hidden; display: grid; place-items: center; border-bottom: 3px solid var(--ink); }
.slot-art::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 22px, rgba(25,35,42,.12) 22px 24px); }
.slot-art-1 { background: #83cdd3; }
.slot-art-2 { background: #f0aa95; }
.slot-art-3 { background: #a5bc6a; }
.slot-art strong { position: absolute; right: 14px; bottom: 8px; color: rgba(25,35,42,.45); font-size: 68px; line-height: 1; }
.mini-spool { position: relative; width: 126px; height: 126px; border: 15px solid var(--ink); border-radius: 50%; background: var(--yellow); box-shadow: inset 0 0 0 16px var(--cream); }
.mini-spool::before, .mini-spool::after { content: ""; position: absolute; left: 38px; width: 20px; height: 24px; background: var(--ink); }
.mini-spool::before { top: -27px; }
.mini-spool::after { bottom: -27px; }
.mini-spool i { position: absolute; inset: 37px; border: 5px solid var(--ink); border-radius: 50%; background: var(--orange); }
.slot-copy { padding: 22px 20px 14px; }
.slot-kicker { color: var(--orange); font-size: 11px; font-weight: 900; line-height: 1.5; }
.slot-copy h3 { margin: 12px 0; font-size: clamp(20px, 2vw, 29px); line-height: 1.18; }
.slot-copy p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.slot-open { margin: 0 18px 18px; padding: 12px; border: 2px solid var(--ink); background: var(--yellow); font-size: 12px; font-weight: 900; text-align: center; }

/* Research */
.research-section { color: var(--cream); }
.research-section .section-intro { color: #bcd2d2; }
.research-heading { grid-template-columns: 1.1fr .72fr; }
.research-lab { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding-bottom: 110px; }
.process-card { position: relative; z-index: 2; min-height: 240px; padding: 24px; border: 3px solid var(--cream); background: var(--night-soft); box-shadow: 6px 6px 0 var(--cyan); }
.process-card > span { display: inline-grid; place-items: center; width: 46px; height: 46px; border: 3px solid var(--cream); background: var(--orange); color: var(--night); font-weight: 900; }
.process-card h3 { margin: 24px 0 12px; color: var(--yellow); font-size: 23px; }
.process-card p { margin: 0; color: #bdcfce; font-size: 13px; line-height: 1.8; }
.extruder-line { position: absolute; left: 10%; right: 10%; bottom: 28px; height: 58px; border: 4px solid var(--cream); border-top: 0; }
.extruder-line::before { content: ""; position: absolute; left: -8%; right: -8%; bottom: -20px; height: 22px; border: 4px solid var(--cream); background: var(--yellow); }
.extruder-line i { position: absolute; left: calc(50% - 28px); top: -36px; width: 56px; height: 50px; border: 4px solid var(--cream); background: var(--orange); }
.extruder-line b { position: absolute; left: calc(50% - 6px); top: 14px; width: 12px; height: 42px; background: var(--cyan); }
.inverse-button { color: var(--night); border-color: var(--cream); box-shadow: 5px 5px 0 var(--cream); }

/* Contact */
.contact-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, .65fr); gap: clamp(40px, 8vw, 120px); align-items: center; padding: clamp(80px, 10vw, 150px) var(--page-pad); background: var(--orange); border-top: 4px solid var(--ink); }
.contact-copy h2 { margin: 14px 0 22px; font-size: clamp(38px, 6vw, 88px); line-height: .98; letter-spacing: -.06em; }
.contact-copy p:last-child { margin: 0; font-size: 14px; font-weight: 900; }
.contact-cartridge { position: relative; min-height: 210px; display: flex; flex-direction: column; justify-content: center; padding: 30px; border: 5px solid var(--ink); background: var(--cream); box-shadow: 12px 12px 0 var(--ink); transition: transform .15s steps(2), background .15s steps(2); }
.contact-cartridge::before, .contact-cartridge::after { content: ""; position: absolute; top: 24px; width: 22px; height: 44px; background: var(--ink); }
.contact-cartridge::before { left: -12px; }
.contact-cartridge::after { right: -12px; }
.contact-cartridge span { color: var(--orange); font-size: 11px; font-weight: 900; }
.contact-cartridge strong { margin: 16px 0; font-size: clamp(24px, 3vw, 42px); }
.contact-cartridge small { overflow-wrap: anywhere; line-height: 1.5; }
.contact-cartridge:hover { background: var(--cyan); transform: translate(5px, 5px); }

/* Footer */
.pixel-footer { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px var(--page-pad); border-top: 3px solid var(--ink); background: var(--cream); font-size: 11px; font-weight: 900; }
.pixel-footer a { text-decoration: underline; text-underline-offset: 4px; }
.dark-footer { border-color: var(--cream); background: var(--night); color: var(--cream); }

/* New portfolio page */
.portfolio-world { background: var(--night); }
.portfolio-hero { position: relative; min-height: 100svh; overflow: hidden; background: #75c7e6; }
.portfolio-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; filter: saturate(.82) contrast(1.05); }
.portfolio-hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12,21,27,.84) 0 33%, rgba(12,21,27,.18) 55%, rgba(12,21,27,.75) 100%); }
.portfolio-title { position: absolute; z-index: 2; top: clamp(140px, 18vh, 190px); left: var(--page-pad); width: min(570px, calc(100% - 2 * var(--page-pad))); padding: clamp(20px, 3vw, 38px); background: rgba(16,25,34,.9); color: var(--cream); }
.portfolio-title h1 { margin: 18px 0; color: var(--yellow); font-size: clamp(42px, 7vw, 98px); line-height: .88; letter-spacing: -.08em; }
.portfolio-title > p:last-child { margin: 0; color: #c6d9d6; font-size: 14px; line-height: 1.8; }
.portfolio-selector { position: absolute; z-index: 3; right: var(--page-pad); bottom: clamp(42px, 7vh, 88px); width: min(560px, calc(100% - 2 * var(--page-pad))); background: rgba(16,25,34,.94); color: var(--cream); }
.portfolio-selector nav { display: grid; }
.archive-option { position: relative; display: grid; grid-template-columns: 56px 1fr; align-items: center; min-height: 74px; border-bottom: 2px solid rgba(255,242,203,.25); transition: background .12s steps(2), color .12s steps(2), padding .12s steps(2); }
.archive-option:last-child { border-bottom: 0; }
.archive-option span { display: grid; place-items: center; align-self: stretch; border-right: 2px solid rgba(255,242,203,.25); color: var(--yellow); font-weight: 900; }
.archive-option strong { padding: 12px 16px; font-size: 14px; line-height: 1.35; }
.archive-option:hover, .archive-option:focus-visible { padding-left: 7px; background: var(--yellow); color: var(--night); outline: none; }
.archive-option:hover span, .archive-option:focus-visible span { color: var(--night); border-color: var(--night); }
.archive-gate { min-height: 430px; display: grid; grid-template-columns: 220px 1fr 260px; gap: clamp(28px, 5vw, 72px); align-items: center; padding: clamp(80px, 9vw, 140px) var(--page-pad); border-block: 4px solid var(--ink); background-color: var(--paper); }
.archive-gate h2 { margin: 16px 0 0; max-width: 900px; font-size: clamp(32px, 4.5vw, 64px); line-height: 1.06; letter-spacing: -.05em; }
.spool-totem { position: relative; height: 210px; display: grid; place-items: center; }
.spool-totem i { position: absolute; width: 130px; height: 130px; border: 15px solid var(--ink); border-radius: 50%; background: var(--yellow); box-shadow: inset 0 0 0 16px var(--cream); }
.spool-totem i:nth-child(1) { transform: translate(-35px, 35px); }
.spool-totem i:nth-child(2) { transform: translate(35px, 35px); background: var(--cyan); }
.spool-totem i:nth-child(3) { transform: translateY(-40px); background: var(--orange); }
.spool-totem b { position: absolute; z-index: 2; width: 42px; height: 42px; border: 8px solid var(--ink); border-radius: 50%; background: var(--paper); }
.archive-tools { position: relative; height: 240px; border-bottom: 12px solid var(--ink); }
.long-pen, .long-knife { position: absolute; bottom: 8px; width: 36px; border: 6px solid var(--ink); transform-origin: bottom; }
.long-pen { left: 55px; height: 210px; background: var(--pink); transform: rotate(-14deg); }
.long-knife { right: 55px; height: 190px; background: #bfc8ca; transform: rotate(12deg); }
.long-pen::after, .long-knife::after { content: ""; position: absolute; left: 4px; bottom: -28px; border: 8px solid transparent; border-top-color: var(--ink); }

.project-case { scroll-margin-top: 104px; padding: clamp(78px, 9vw, 140px) var(--page-pad); border-bottom: 5px solid var(--ink); color: var(--ink); }
.project-case > * { width: min(100%, var(--content)); margin-inline: auto; }
.case-tone-1 { background: #83cdd3; }
.case-tone-2 { background: #efac98; }
.case-tone-3 { background: #a9bf71; }
.case-header { display: grid; grid-template-columns: 190px minmax(0, 1fr) minmax(280px, .55fr); background: var(--cream); }
.case-code { display: flex; flex-direction: column; justify-content: space-between; min-height: 260px; padding: 20px; border-right: 3px solid var(--ink); background: var(--night); color: var(--cream); }
.case-code span { color: var(--yellow); font-size: 11px; letter-spacing: .1em; }
.case-code strong { font-size: 92px; line-height: .8; }
.case-title { display: flex; flex-direction: column; justify-content: center; padding: clamp(24px, 4vw, 56px); border-right: 3px solid var(--ink); }
.case-title h2 { margin: 14px 0; font-size: clamp(30px, 4.2vw, 62px); line-height: 1.04; letter-spacing: -.055em; text-wrap: balance; }
.case-title h3 { margin: 0; max-width: 760px; color: var(--muted); font-size: clamp(14px, 1.45vw, 21px); line-height: 1.55; font-weight: 700; }
.case-description { display: flex; align-items: center; margin: 0; padding: clamp(24px, 3vw, 42px); font-size: 14px; line-height: 1.9; }
.case-measure { position: relative; height: 46px; display: flex; align-items: end; justify-content: space-between; margin-top: 30px !important; padding: 0 8px 6px; border: 3px solid var(--ink); background: var(--yellow); background-image: repeating-linear-gradient(90deg, transparent 0 28px, var(--ink) 28px 30px); font-size: 10px; font-weight: 900; }
.case-measure span { padding: 2px 4px; background: var(--yellow); }
.case-content { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 26px; margin-top: 26px !important; }
.case-media { background: var(--cream); }
.media-stage { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; background: #e0ddcf; }
.media-stage::after { content: ""; position: absolute; inset: 10px; border: 2px dashed rgba(25,35,42,.25); pointer-events: none; }
.media-stage img, .media-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-stage > strong { z-index: 2; margin-top: 65px; font-size: clamp(16px, 2vw, 24px); }
.media-stage > span { z-index: 2; margin-top: -70px; color: var(--muted); font-size: 11px; }
.empty-printer { position: absolute; top: 18%; left: 50%; width: 210px; height: 145px; transform: translateX(-50%); border: 10px solid var(--ink); border-bottom-width: 18px; background: rgba(118,213,222,.35); }
.empty-gantry { position: absolute; left: 17px; right: 17px; top: 22px; height: 9px; background: var(--ink); }
.empty-nozzle { position: absolute; left: calc(50% - 17px); top: 30px; width: 34px; height: 43px; background: var(--orange); clip-path: polygon(0 0,100% 0,100% 72%,65% 72%,50% 100%,35% 72%,0 72%); }
.empty-bed { position: absolute; left: 22px; right: 22px; bottom: 18px; height: 12px; background: var(--ink); box-shadow: 0 9px 0 var(--yellow); }
.case-side { min-height: 100%; padding: 24px; border: 3px solid var(--ink); background: var(--night); color: var(--cream); box-shadow: var(--pixel-shadow); }
.case-side p { margin: 18px 0 24px; color: #bfd0cf; font-size: 13px; line-height: 1.8; }
.case-side .pixel-button { width: 100%; margin-top: 24px; text-align: center; }
.filament-swatch { display: flex; gap: 10px; padding-block: 22px; border-block: 2px dashed rgba(255,242,203,.25); }
.filament-swatch i { width: 54px; height: 54px; border: 8px solid var(--cream); border-radius: 50%; background: var(--orange); box-shadow: inset 0 0 0 7px var(--night); }
.filament-swatch i:nth-child(2) { background: var(--cyan); }
.filament-swatch i:nth-child(3) { background: var(--yellow); }
.website-module { display: grid; grid-template-columns: minmax(250px, .38fr) minmax(0, 1fr); gap: 28px; margin-top: 28px !important; padding: 28px; border: 3px solid var(--ink); background: var(--cream); box-shadow: var(--pixel-shadow); }
.website-heading { padding: 10px; align-self: center; }
.website-heading h3 { margin: 18px 0; font-size: clamp(26px, 3vw, 45px); line-height: 1.08; }
.website-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.pixel-browser { border: 3px solid var(--ink); background: #dfe2d8; }
.browser-bar { min-height: 42px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 16px; padding: 8px 12px; border-bottom: 3px solid var(--ink); background: var(--night); color: var(--cream); font-size: 10px; }
.browser-lights { color: var(--orange); }
.browser-url { overflow: hidden; padding: 5px 9px; background: #2d3a41; text-overflow: ellipsis; white-space: nowrap; }
.browser-view { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; background-color: #e4e0cf; background-image: linear-gradient(rgba(25,35,42,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(25,35,42,.1) 1px, transparent 1px); background-size: 20px 20px; }
.browser-view iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.browser-view > strong { z-index: 2; margin-top: 60px; font-size: 18px; }
.browser-view > span:last-child { z-index: 2; margin-top: -55px; color: var(--muted); font-size: 11px; text-align: center; }
.model-placeholder { position: absolute; top: 20%; left: 50%; width: 160px; height: 110px; transform: translateX(-50%); }
.model-cube { position: absolute; width: 58px; height: 58px; border: 5px solid var(--ink); background: var(--yellow); transform: rotate(45deg); box-shadow: 7px 7px 0 rgba(25,35,42,.25); }
.cube-one { left: 10px; top: 28px; }
.cube-two { left: 54px; top: 2px; background: var(--orange); }
.cube-three { left: 98px; top: 30px; background: var(--cyan); }

@keyframes blink { 50% { opacity: .35; } }
@keyframes bounce { 50% { transform: translateY(4px); } }

@media (max-width: 1050px) {
  .profile-layout { grid-template-columns: 1fr 1fr; }
  .maker-vignette { grid-column: 1 / -1; margin: 0; min-height: 320px; }
  .project-slots { grid-template-columns: 1fr; }
  .project-slot { grid-template-columns: 180px minmax(0, 1fr) auto; grid-template-rows: auto 1fr; min-height: 280px; }
  .slot-top { grid-column: 1 / -1; }
  .slot-art { grid-row: 2; border-bottom: 0; border-right: 3px solid var(--ink); }
  .slot-copy { grid-column: 2; grid-row: 2; align-self: center; }
  .slot-open { grid-column: 3; grid-row: 2; align-self: center; margin: 18px; }
  .archive-gate { grid-template-columns: 180px 1fr; }
  .archive-tools { display: none; }
  .case-header { grid-template-columns: 150px 1fr; }
  .case-description { grid-column: 1 / -1; border-top: 3px solid var(--ink); }
  .case-content { grid-template-columns: 1fr; }
  .case-side { min-height: 0; }
}

@media (max-width: 900px) {
  html { scroll-padding-top: 154px; }
  .game-menu { top: 10px; grid-template-columns: 1fr; width: calc(100% - 20px); }
  .player-name { min-height: 44px; padding: 9px 12px; border-right: 0; border-bottom: 2px solid rgba(255,242,203,.35); }
  .menu-actions { grid-template-columns: repeat(4, 1fr); }
  .game-option { min-height: 50px; padding-inline: 4px; font-size: 11px; }
  .game-option::before { display: none; }
  .world-hero { min-height: 780px; }
  .hero-hud { bottom: 86px; }
  .section-heading, .split-heading, .research-heading { grid-template-columns: 1fr; }
  .section-heading .section-code { grid-column: auto; }
  .profile-layout { grid-template-columns: 1fr; }
  .maker-vignette { grid-column: auto; }
  .experience-track { grid-template-columns: 1fr; }
  .experience-track article { border-right: 0; border-bottom: 3px solid var(--ink); }
  .experience-track article:last-child { border-bottom: 0; }
  .research-lab { grid-template-columns: 1fr; padding-bottom: 50px; }
  .extruder-line { display: none; }
  .contact-section { grid-template-columns: 1fr; }
  .portfolio-hero { min-height: 960px; }
  .portfolio-hero-overlay { background: linear-gradient(180deg, rgba(12,21,27,.78), rgba(12,21,27,.25) 48%, rgba(12,21,27,.86)); }
  .portfolio-title { top: 160px; }
  .portfolio-selector { left: var(--page-pad); right: auto; bottom: 48px; }
  .archive-gate { grid-template-columns: 1fr; text-align: center; }
  .spool-totem { transform: scale(.8); }
  .case-header { grid-template-columns: 110px 1fr; }
  .case-code { min-height: 220px; }
  .case-code strong { font-size: 62px; }
  .case-title { border-right: 0; }
  .website-module { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  html { scroll-padding-top: 160px; }
  .menu-actions { grid-template-columns: repeat(2, 1fr); }
  .world-hero { min-height: 820px; }
  .world-gif { object-position: 54% center; }
  .hero-hud h1 { font-size: 28px; }
  .scroll-command { right: 14px; }
  .profile-data { grid-template-columns: 1fr; }
  .maker-vignette { min-height: 300px; padding: 16px; }
  .spool-house { width: 76%; min-width: 0; }
  .tool-rack { width: 24%; margin-left: 8px; }
  .pen-a { left: 4px; }
  .pen-b { left: 31px; }
  .knife { left: 58px; }
  .project-slot { display: grid; grid-template-columns: 1fr; grid-template-rows: auto 190px auto auto; min-height: 0; }
  .slot-top, .slot-art, .slot-copy, .slot-open { grid-column: auto; grid-row: auto; }
  .slot-art { border-right: 0; border-bottom: 3px solid var(--ink); }
  .slot-open { margin: 0 18px 18px; }
  .pixel-footer { align-items: flex-start; flex-direction: column; }
  .portfolio-hero { min-height: 980px; }
  .portfolio-title { top: 176px; }
  .portfolio-selector { bottom: 30px; }
  .archive-gate { padding-block: 70px; }
  .case-header { grid-template-columns: 1fr; }
  .case-code { min-height: 110px; flex-direction: row; align-items: end; border-right: 0; border-bottom: 3px solid var(--ink); }
  .case-code strong { font-size: 58px; }
  .case-title { padding: 24px; }
  .case-description { padding: 24px; }
  .case-measure { background-image: repeating-linear-gradient(90deg, transparent 0 18px, var(--ink) 18px 20px); }
  .empty-printer { width: 160px; height: 110px; border-width: 8px; }
  .website-module { padding: 16px; }
  .browser-view > span:last-child { width: 80%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =========================================================
   Pixel cartoon world pass
   All lower sections behave like connected 2D game levels.
   ========================================================= */

.profile-section,
.work-section,
.research-section,
.contact-section,
.project-case {
  isolation: isolate;
  overflow: hidden;
}
.home-portfolio-cases .project-case { scroll-margin-top: 0; }

.profile-section > *,
.work-section > *,
.research-section > *,
.contact-section > *,
.project-case > *:not(.level-scenery) {
  position: relative;
  z-index: 3;
}

/* Home level 01 — character workshop */
.profile-section {
  background-color: #bde6e7;
  background-image:
    linear-gradient(180deg, #87d1e4 0 34%, #c9edf0 34% 68%, #8db369 68% 100%);
}
.profile-section::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 110px;
  left: 7%;
  width: 84px;
  height: 26px;
  background: #fff6d7;
  box-shadow:
    28px -20px 0 #fff6d7,
    58px 0 0 #fff6d7,
    620px 44px 0 #fff6d7,
    655px 22px 0 #fff6d7,
    700px 44px 0 #fff6d7,
    1050px -10px 0 rgba(255,246,215,.8),
    1090px -30px 0 rgba(255,246,215,.8),
    1130px -10px 0 rgba(255,246,215,.8);
}
.profile-section::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 92px;
  border-top: 5px solid var(--ink);
  background:
    repeating-linear-gradient(90deg, transparent 0 44px, rgba(25,35,42,.2) 44px 48px),
    repeating-linear-gradient(0deg, #d49655 0 20px, #b8733f 20px 24px);
}
.profile-section .section-heading {
  padding: 28px;
  border: 4px solid var(--ink);
  background: rgba(255,242,203,.94);
  box-shadow: 9px 9px 0 var(--ink);
}
.profile-section .section-heading h2 { text-shadow: 3px 3px 0 #fff; }
.profile-console,
.skill-console {
  border-width: 5px;
  background: #fff3d2;
  box-shadow: 9px 9px 0 var(--ink);
}
.profile-console::before,
.skill-console::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 18px;
  right: 18px;
  height: 15px;
  border: 3px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--orange) 0 28px, var(--cream) 28px 56px);
}
.profile-console,
.skill-console { position: relative; margin-top: 18px; }
.profile-data div { position: relative; }
.profile-data div::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: 9px;
  height: 9px;
  background: var(--orange);
  box-shadow: 12px 0 0 var(--cyan), 24px 0 0 var(--yellow);
}
.experience-track {
  gap: 24px;
  border: 0;
  box-shadow: none;
}
.experience-track article {
  position: relative;
  border: 4px solid var(--ink) !important;
  background: #fff2cb;
  box-shadow: 8px 8px 0 var(--ink);
}
.experience-track article::before {
  content: "!";
  position: absolute;
  top: -24px;
  right: 18px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 4px solid var(--ink);
  background: var(--yellow);
  font-size: 24px;
  font-weight: 900;
}

/* Home level 02 — save houses */
.work-section {
  background:
    linear-gradient(180deg, #f6b4c4 0 34%, #ffddb0 34% 68%, #8db369 68% 100%);
}
.work-section::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 135px;
  border-top: 5px solid var(--ink);
  background:
    repeating-linear-gradient(90deg, transparent 0 68px, rgba(255,255,255,.16) 68px 73px),
    #4e6570;
  box-shadow: inset 0 22px 0 #71838a, inset 0 28px 0 var(--ink);
}
.work-section::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 180px;
  right: -30px;
  width: 360px;
  height: 170px;
  background: #71935b;
  clip-path: polygon(0 100%, 20% 62%, 35% 75%, 58% 28%, 75% 54%, 100% 0, 100% 100%);
  box-shadow: -900px 40px 0 #82a764;
}
.work-section .section-heading {
  padding: 26px;
  border: 4px solid var(--ink);
  background: rgba(255,242,203,.95);
  box-shadow: 9px 9px 0 var(--ink);
}
.project-slots { gap: 34px; align-items: stretch; }
.project-slot {
  margin-top: 26px;
  border-width: 5px;
  background: #fff1ce;
  box-shadow: 10px 10px 0 var(--ink);
}
.project-slot::before {
  content: "";
  position: absolute;
  z-index: 4;
  top: -28px;
  left: -5px;
  right: -5px;
  height: 25px;
  border: 5px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--orange) 0 30px, var(--cream) 30px 60px);
}
.project-slot::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: -17px;
  height: 13px;
  border: 4px solid var(--ink);
  background: #9c603e;
}
.slot-top { background: #182932; }
.slot-art { border-bottom-width: 5px; }
.slot-art::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: 18px;
  height: 15px;
  border: 4px solid var(--ink);
  background: #96704b;
  box-shadow: 0 9px 0 var(--yellow);
}
.slot-copy { background-image: linear-gradient(rgba(25,35,42,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(25,35,42,.06) 1px, transparent 1px); background-size: 16px 16px; }
.slot-open { border-width: 3px; box-shadow: 4px 4px 0 var(--ink); }

/* Home level 03 — research night workshop */
.research-section {
  background:
    linear-gradient(180deg, #172630 0 46%, #294653 46% 70%, #24382c 70% 100%);
}
.research-section::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 100px 0 auto;
  height: 230px;
  background:
    linear-gradient(90deg,
      transparent 0 5%, var(--yellow) 5% 5.5%, transparent 5.5% 17%,
      var(--cyan) 17% 17.5%, transparent 17.5% 31%,
      var(--pink) 31% 31.5%, transparent 31.5% 49%,
      var(--yellow) 49% 49.5%, transparent 49.5% 71%,
      var(--cyan) 71% 71.5%, transparent 71.5% 89%,
      var(--pink) 89% 89.5%, transparent 89.5%);
}
.research-section::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 115px;
  border-top: 5px solid var(--cream);
  background: repeating-linear-gradient(90deg, #9c603e 0 74px, #75462f 74px 80px);
}
.research-heading {
  padding: 28px;
  border: 4px solid var(--cream);
  background: rgba(16,25,34,.92);
  box-shadow: 9px 9px 0 var(--cyan);
}
.process-card {
  margin-top: 28px;
  border-width: 5px;
  background: #20343e;
}
.process-card::before {
  content: "";
  position: absolute;
  top: -32px;
  left: -5px;
  right: -5px;
  height: 28px;
  border: 5px solid var(--cream);
  background: repeating-linear-gradient(90deg, var(--orange) 0 24px, var(--yellow) 24px 48px);
}
.process-card::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: 18px;
  width: 34px;
  height: 34px;
  border: 7px solid var(--cream);
  border-radius: 50%;
  background: var(--orange);
  box-shadow: inset 0 0 0 6px #20343e;
}

/* Home final level */
.contact-section {
  background:
    linear-gradient(180deg, #ff9c65 0 32%, #f2a6be 32% 60%, #8f7b61 60% 100%);
}
.contact-section::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 68px;
  right: 10%;
  width: 96px;
  height: 96px;
  background: var(--yellow);
  clip-path: polygon(20% 0,80% 0,80% 10%,100% 10%,100% 80%,80% 80%,80% 100%,20% 100%,20% 90%,0 90%,0 20%,20% 20%);
  box-shadow: 0 0 0 8px rgba(255,242,203,.45);
}
.contact-section::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 82px;
  border-top: 5px solid var(--ink);
  background: repeating-linear-gradient(90deg, #394b52 0 58px, #2c3d44 58px 64px);
}
.contact-copy,
.contact-cartridge { position: relative; z-index: 2; }
.contact-copy {
  padding: 24px;
  border: 4px solid var(--ink);
  background: rgba(255,242,203,.92);
  box-shadow: 8px 8px 0 var(--ink);
}

/* Portfolio project levels */
.project-case {
  position: relative;
  min-height: 1500px;
  padding-top: clamp(150px, 14vw, 220px);
  padding-bottom: clamp(160px, 15vw, 230px);
  border-bottom: 8px solid var(--ink);
  background-image: none;
}
.case-tone-1 { background: linear-gradient(180deg, #74cae0 0 42%, #c9eef0 42% 68%, #7ea45f 68% 100%); }
.case-tone-2 { background: linear-gradient(180deg, #f2a6be 0 38%, #f8d8b8 38% 68%, #7eaa68 68% 100%); }
.case-tone-3 { background: linear-gradient(180deg, #8ed0e0 0 40%, #d7eccb 40% 68%, #a8be70 68% 100%); }
.project-case::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 130px;
  border-top: 6px solid var(--ink);
  background:
    repeating-linear-gradient(90deg, transparent 0 62px, rgba(255,255,255,.16) 62px 68px),
    #4c626b;
  box-shadow: inset 0 25px 0 #75858a, inset 0 31px 0 var(--ink);
}
.project-case::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 3%;
  right: 3%;
  bottom: 130px;
  height: 46px;
  border: 5px solid var(--ink);
  background: repeating-linear-gradient(90deg, #d59455 0 48px, #bd7542 48px 53px);
}
.level-scenery { position: absolute; z-index: 0; inset: 0; pointer-events: none; overflow: hidden; }
.scene-cloud {
  position: absolute;
  width: 80px;
  height: 28px;
  background: #fff4d4;
  box-shadow: 28px -22px 0 #fff4d4, 62px 0 0 #fff4d4, 92px 0 0 #fff4d4;
}
.cloud-one { top: 95px; left: 8%; }
.cloud-two { top: 180px; right: 15%; transform: scale(.78); opacity: .82; }
.scene-sun {
  position: absolute;
  top: 86px;
  right: 6%;
  width: 72px;
  height: 72px;
  background: var(--yellow);
  clip-path: polygon(18% 0,82% 0,82% 10%,100% 10%,100% 82%,82% 82%,82% 100%,18% 100%,18% 90%,0 90%,0 18%,18% 18%);
  box-shadow: 0 0 0 8px rgba(255,242,203,.5);
}
.scene-tree {
  position: absolute;
  z-index: 1;
  bottom: 175px;
  width: 28px;
  height: 106px;
  border: 5px solid var(--ink);
  background: #9c603e;
}
.scene-tree::before {
  content: "";
  position: absolute;
  left: -42px;
  top: -78px;
  width: 100px;
  height: 86px;
  border: 5px solid var(--ink);
  background: #5e8f55;
  box-shadow: 26px -30px 0 #5e8f55, -25px -20px 0 #6ea35e;
}
.tree-one { left: 6%; }
.tree-two { right: 7%; transform: scale(.8); transform-origin: bottom; }
.scene-character {
  position: absolute;
  z-index: 2;
  right: 14%;
  bottom: 161px;
  width: 28px;
  height: 48px;
  border: 4px solid var(--ink);
  background: var(--orange);
  box-shadow: -12px 42px 0 -7px var(--ink), 16px 42px 0 -7px var(--ink);
}
.scene-character::before {
  content: "";
  position: absolute;
  left: 1px;
  top: -30px;
  width: 20px;
  height: 22px;
  border: 4px solid var(--ink);
  background: #e9bb8c;
  box-shadow: 0 -8px 0 var(--ink);
}
.scene-character::after {
  content: "?";
  position: absolute;
  left: -7px;
  top: -76px;
  width: 36px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 4px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

/* Dialogue instead of a presentation header */
.project-case .case-header {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}
.project-case .case-code {
  position: relative;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  padding: 18px;
  border: 5px solid var(--ink);
  background: #172630;
  box-shadow: 9px 9px 0 var(--ink);
}
.project-case .case-code::before {
  content: "";
  position: absolute;
  top: 38px;
  left: 50%;
  width: 76px;
  height: 70px;
  transform: translateX(-50%);
  border: 6px solid var(--cream);
  background:
    linear-gradient(90deg, transparent 0 18px, var(--ink) 18px 28px, transparent 28px 48px, var(--ink) 48px 58px, transparent 58px),
    linear-gradient(transparent 0 40px, var(--orange) 40px 51px, transparent 51px),
    var(--yellow);
  box-shadow: 7px 7px 0 var(--orange);
}
.project-case .case-code span { color: var(--cyan); }
.project-case .case-code strong { color: var(--cream); font-size: 56px; line-height: 1; }
.project-case .case-title {
  position: relative;
  min-height: 230px;
  display: flex;
  justify-content: center;
  padding: clamp(26px, 4vw, 52px);
  border: 5px solid var(--ink);
  background: #fff2cb;
  box-shadow: 10px 10px 0 var(--ink);
}
.project-case .case-title::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 52px;
  width: 24px;
  height: 34px;
  background: var(--ink);
  clip-path: polygon(0 50%,100% 0,100% 100%);
}
.project-case .case-title::after {
  content: "";
  position: absolute;
  left: -14px;
  top: 59px;
  width: 16px;
  height: 20px;
  background: #fff2cb;
  clip-path: polygon(0 50%,100% 0,100% 100%);
}
.project-case .case-title h2 {
  margin-block: 12px;
  max-width: 930px;
  font-size: clamp(30px, 4vw, 58px);
  text-shadow: 3px 3px 0 #fff;
}
.project-case .case-description {
  grid-column: 2;
  position: relative;
  min-height: 0;
  align-items: start;
  margin: -6px 80px 0 30px;
  padding: 22px 26px;
  border: 4px solid var(--ink);
  background: #fff8e3;
  box-shadow: 7px 7px 0 var(--ink);
}
.project-case .case-description::before {
  content: "项目说明";
  position: absolute;
  top: -20px;
  right: 18px;
  padding: 6px 10px;
  border: 3px solid var(--ink);
  background: var(--orange);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}
.project-case .case-measure {
  margin-top: 56px !important;
  border-width: 5px;
  box-shadow: 7px 7px 0 var(--ink);
}

/* The video is now inside a giant printer building */
.project-case .case-content {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 34px;
  align-items: start;
  margin-top: 78px !important;
}
.project-case .case-media {
  position: relative;
  margin-top: 50px;
  border: 8px solid var(--ink);
  outline: 0;
  background: #263945;
  box-shadow: 14px 14px 0 var(--ink);
}
.project-case .case-media::before {
  content: "";
  position: absolute;
  z-index: 5;
  top: -62px;
  left: 34px;
  width: 48px;
  height: 48px;
  border: 9px solid var(--ink);
  border-radius: 50%;
  background: var(--orange);
  box-shadow:
    inset 0 0 0 7px var(--cream),
    72px 0 0 -9px var(--yellow),
    72px 0 0 0 var(--ink),
    72px 0 0 7px var(--cyan),
    144px 0 0 -9px var(--pink),
    144px 0 0 0 var(--ink),
    144px 0 0 7px var(--yellow);
}
.project-case .case-media::after {
  content: "";
  position: absolute;
  z-index: 4;
  left: 20px;
  right: 20px;
  bottom: -34px;
  height: 24px;
  border: 6px solid var(--ink);
  background: #95623f;
}
.project-case .case-media .console-title {
  min-height: 52px;
  border-bottom: 7px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--orange) 0 42px, var(--yellow) 42px 84px);
}
.project-case .media-stage {
  border: 12px solid #263945;
  background-color: #cfe6df;
  background-image:
    linear-gradient(rgba(25,35,42,.1) 2px, transparent 2px),
    linear-gradient(90deg, rgba(25,35,42,.1) 2px, transparent 2px);
  background-size: 24px 24px;
}
.project-case .media-stage::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  width: 12px;
  height: 12px;
  background: var(--green);
  box-shadow: 20px 0 0 var(--yellow), 40px 0 0 var(--orange);
}

/* Inventory backpack */
.project-case .case-side {
  position: relative;
  margin-top: 50px;
  min-height: 430px;
  padding: 28px;
  border: 6px solid var(--ink);
  background: #243741;
  box-shadow: 11px 11px 0 var(--ink);
}
.project-case .case-side::before {
  content: "";
  position: absolute;
  top: -28px;
  left: 38px;
  right: 38px;
  height: 24px;
  border: 6px solid var(--ink);
  border-bottom: 0;
  background: var(--orange);
}
.project-case .case-side::after {
  content: "";
  position: absolute;
  right: -19px;
  top: 92px;
  width: 16px;
  height: 110px;
  border: 6px solid var(--ink);
  background: var(--yellow);
}
.project-case .case-side .section-code { color: var(--yellow); }
.project-case .filament-swatch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.project-case .filament-swatch i { width: 100%; aspect-ratio: 1; height: auto; }

/* Interactive site becomes a pixel storefront */
.project-case .website-module {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, .38fr) minmax(0, 1fr);
  gap: 42px;
  align-items: center;
  margin-top: 150px !important;
  padding: 0 0 60px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.project-case .website-module::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -3%;
  right: -3%;
  bottom: 0;
  height: 58px;
  border: 5px solid var(--ink);
  background: repeating-linear-gradient(90deg, #a56d43 0 60px, #845235 60px 66px);
}
.project-case .website-heading {
  position: relative;
  padding: 28px;
  border: 5px solid var(--ink);
  background: var(--yellow);
  box-shadow: 9px 9px 0 var(--ink);
}
.project-case .website-heading::after {
  content: "OPEN";
  position: absolute;
  right: 16px;
  bottom: -44px;
  padding: 8px 12px;
  border: 4px solid var(--ink);
  background: var(--cream);
  font-size: 12px;
  font-weight: 900;
  transform: rotate(4deg);
}
.project-case .pixel-browser {
  position: relative;
  margin-top: 48px;
  border: 8px solid var(--ink);
  background: #dfe2d8;
  box-shadow: 14px 14px 0 var(--ink);
}
.project-case .pixel-browser::before {
  content: "";
  position: absolute;
  z-index: 6;
  top: -48px;
  left: -8px;
  right: -8px;
  height: 40px;
  border: 8px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--orange) 0 44px, var(--cream) 44px 88px);
}
.project-case .pixel-browser::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -34px;
  height: 26px;
  border: 5px solid var(--ink);
  background: #5e8f55;
  box-shadow: 20px 8px 0 #6aa45d, -18px 7px 0 #7cac65;
}

@media (max-width: 1050px) {
  .project-case { min-height: 1650px; }
  .project-case .case-content { grid-template-columns: 1fr; }
  .project-case .case-side { min-height: 0; margin-top: 64px; }
  .project-case .website-module { grid-template-columns: 1fr; }
  .project-case .website-heading { width: min(620px, 100%); }
}

@media (max-width: 900px) {
  .profile-section::before { opacity: .55; }
  .project-case { padding-top: 170px; }
  .project-case .case-header { grid-template-columns: 130px 1fr; }
  .project-case .case-code { min-height: 210px; }
  .project-case .case-code::before { width: 60px; height: 56px; }
  .project-case .case-description { grid-column: 1 / -1; margin: 8px 28px 0; }
}

@media (max-width: 650px) {
  .profile-section .section-heading,
  .work-section .section-heading,
  .research-heading,
  .contact-copy { padding: 20px; }
  .project-slot { margin-top: 34px; }
  .project-case { min-height: 1400px; padding-top: 140px; }
  .cloud-two, .tree-two { display: none; }
  .scene-sun { right: -12px; transform: scale(.72); }
  .project-case .case-header { grid-template-columns: 1fr; }
  .project-case .case-code { min-height: 150px; flex-direction: row; justify-content: space-between; padding-left: 112px; }
  .project-case .case-code::before { left: 56px; top: 36px; transform: none; }
  .project-case .case-title { min-height: 0; }
  .project-case .case-title::before,
  .project-case .case-title::after { display: none; }
  .project-case .case-description { grid-column: auto; margin: 10px 0 0; }
  .project-case .case-measure { margin-top: 34px !important; }
  .project-case .case-content { margin-top: 68px !important; }
  .project-case .case-media::before { transform: scale(.72); transform-origin: left bottom; }
  .project-case .case-side { padding: 22px; }
  .project-case .website-module { margin-top: 110px !important; }
  .scene-character { right: 24%; }
}

/* Frame-aware generated pixel sprites
   The real video and inventory remain live beneath a transparent art layer. */
.project-case .level-scenery { display: none; }
.project-case .case-content {
  position: relative;
  display: block;
  width: min(100%, var(--content));
  aspect-ratio: 1624 / 940;
  margin-top: 72px !important;
  overflow: hidden;
  border: 6px solid var(--ink);
  background: #172c37;
  box-shadow: 12px 12px 0 color-mix(in srgb, var(--ink) 82%, transparent);
}
.frame-backdrop {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  image-rendering: pixelated;
  pointer-events: none;
  user-select: none;
}
.project-case .case-media {
  position: absolute;
  z-index: 4;
  top: 13%;
  left: 3.6%;
  width: 66.5%;
  margin: 0;
  border: 6px solid var(--ink);
  box-shadow: none;
}
.project-case .case-side {
  position: absolute;
  z-index: 4;
  top: 13%;
  left: 74.2%;
  width: 20.7%;
  min-height: 52%;
  margin: 0;
  padding: clamp(16px, 1.7vw, 28px);
  border: 5px solid var(--ink);
  background: #243741;
  opacity: 1;
  box-shadow: none;
}
.project-case .case-media::before,
.project-case .case-media::after,
.project-case .case-side::before,
.project-case .case-side::after { display: none; }
.frame-decoration {
  position: absolute;
  z-index: 8;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  image-rendering: pixelated;
  mix-blend-mode: multiply;
  pointer-events: none;
  user-select: none;
}
.project-case .case-side .pixel-button {
  position: relative;
  z-index: 10;
  padding-inline: 10px;
  font-size: clamp(10px, .9vw, 13px);
}
.project-case .case-side p {
  font-size: clamp(10px, .9vw, 13px);
  line-height: 1.65;
}
.project-case .case-side .section-code { font-size: clamp(9px, .75vw, 11px); }
.project-case .filament-swatch { padding-block: clamp(12px, 1.5vw, 22px); }

@media (max-width: 1050px) and (min-width: 701px) {
  .project-case .case-content { aspect-ratio: 1624 / 1040; }
  .project-case .case-side { min-height: 58%; }
}

@media (max-width: 700px) {
  .project-case .case-content {
    display: grid;
    aspect-ratio: auto;
    gap: 72px;
    overflow: visible;
    padding: 92px 16px 42px;
    background-position: center;
    box-shadow: 8px 8px 0 var(--ink);
  }
  .project-case .case-media,
  .project-case .case-side {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 0;
  }
  .project-case .case-media {
    border-width: 6px;
    box-shadow: 8px 8px 0 var(--ink);
  }
  .project-case .case-side { box-shadow: 8px 8px 0 var(--ink); }
  .frame-backdrop {
    opacity: .34;
    object-fit: cover;
  }
  .frame-decoration { display: none; }
}

/* Visible project art + game-like interaction feedback */
a[href], button, [role="button"], .pixel-button { cursor: pointer; }

.portfolio-selector {
  width: min(650px, calc(100% - 2 * var(--page-pad)));
  transition: transform .14s steps(2), box-shadow .14s steps(2);
}
.portfolio-selector:hover,
.portfolio-selector:focus-within {
  transform: translate(-4px, -4px);
  box-shadow: 12px 12px 0 rgba(9, 15, 20, .9);
}
.archive-option {
  grid-template-columns: 48px 122px minmax(0, 1fr) 34px;
  gap: 0;
  min-height: 92px;
  padding: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: color .12s steps(2), background .12s steps(2), transform .12s steps(2), box-shadow .12s steps(2);
}
.archive-option > .archive-number {
  display: grid;
  place-items: center;
  align-self: stretch;
  border-right: 0;
  color: var(--yellow);
  font-weight: 900;
}
.archive-thumb {
  width: 112px;
  height: 68px;
  border: 3px solid var(--cream);
  object-fit: cover;
  image-rendering: pixelated;
  filter: saturate(.88) brightness(.82);
  transition: filter .12s steps(2), transform .12s steps(2), border-color .12s steps(2);
}
.archive-option > .archive-label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  align-self: stretch;
  padding: 8px 14px;
  border: 0;
  color: inherit;
}
.archive-label strong {
  padding: 0;
  font-size: 13px;
  line-height: 1.35;
}
.archive-label small {
  color: var(--cyan);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
}
.archive-arrow {
  color: transparent;
  font-size: 18px;
  transform: translateX(-10px);
  transition: color .12s steps(2), transform .12s steps(2);
}
.archive-option:hover,
.archive-option:focus-visible {
  padding: 8px;
  color: var(--night);
  background: var(--yellow);
  transform: translate(-4px, -4px);
  box-shadow: 6px 6px 0 var(--orange);
}
.archive-option:hover > .archive-number,
.archive-option:focus-visible > .archive-number { color: var(--night); }
.archive-option:hover .archive-thumb,
.archive-option:focus-visible .archive-thumb {
  filter: saturate(1.12) brightness(1.08);
  border-color: var(--night);
  transform: scale(1.06);
}
.archive-option:hover .archive-label small,
.archive-option:focus-visible .archive-label small { color: #284a57; }
.archive-option:hover .archive-arrow,
.archive-option:focus-visible .archive-arrow {
  color: var(--night);
  transform: translateX(0);
}
.archive-option:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--orange);
}

.slot-art { overflow: hidden; isolation: isolate; }
.slot-preview {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  filter: saturate(.9) brightness(.86);
  transition: filter .14s steps(2), transform .14s steps(2);
}
.slot-art::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(9, 17, 22, .62));
  pointer-events: none;
}
.slot-art .mini-spool,
.slot-art > strong { position: relative; z-index: 2; }
.project-slot:hover .slot-preview,
.project-slot:focus-visible .slot-preview {
  filter: saturate(1.12) brightness(1.04);
  transform: scale(1.035);
}

.game-option,
.project-slot,
.contact-cartridge,
.pixel-footer a,
.pixel-button { -webkit-tap-highlight-color: transparent; }
.game-option:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--orange);
}
.project-slot:active {
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0 var(--orange);
}
.pixel-button:not(.is-disabled):active,
.contact-cartridge:active {
  transform: translate(5px, 5px);
  box-shadow: 0 0 0 var(--ink);
}
.pixel-footer a {
  padding: 8px 10px;
  transition: color .1s steps(2), background .1s steps(2), transform .1s steps(2);
}
.pixel-footer a:hover,
.pixel-footer a:focus-visible {
  color: var(--night);
  background: var(--yellow);
  transform: translateY(-3px);
  outline: 3px solid var(--orange);
}
.pixel-footer a:active { transform: translateY(2px); }

.frame-backdrop,
.frame-decoration { transition: filter .16s steps(3), transform .16s steps(3); }
.project-case .case-content:hover .frame-backdrop,
.project-case .case-content:focus-within .frame-backdrop {
  filter: saturate(1.08) brightness(1.04);
}
.project-case .case-content:hover .frame-decoration,
.project-case .case-content:focus-within .frame-decoration {
  transform: translateY(-3px);
}

@media (max-width: 900px) {
  .archive-option { grid-template-columns: 44px 100px minmax(0, 1fr) 28px; }
  .archive-thumb { width: 92px; height: 58px; }
}

@media (max-width: 560px) {
  .archive-option { grid-template-columns: 38px 76px minmax(0, 1fr); min-height: 82px; }
  .archive-thumb { width: 70px; height: 48px; }
  .archive-arrow, .archive-label small { display: none; }
}

/* Professional pixel interface */
body {
  -webkit-font-smoothing: none;
  text-rendering: geometricPrecision;
}

.profile-section .section-heading,
.work-section .section-heading,
.research-section .section-heading,
.profile-console,
.skill-console,
.project-slot,
.process-card {
  border-radius: 0;
  background-color: var(--cream);
  background-image:
    linear-gradient(rgba(25,35,42,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25,35,42,.055) 1px, transparent 1px);
  background-size: 16px 16px;
}

.section-heading h2,
.case-title h2,
.research-heading h2 {
  text-shadow: 3px 3px 0 rgba(255,255,255,.78);
}

.focus-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: focus;
}
.focus-list li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 86px;
  padding: 14px 18px;
  border-bottom: 3px solid var(--ink);
  background: rgba(255,242,203,.92);
}
.focus-list li:nth-child(even) { background: rgba(118,213,222,.2); }
.focus-list li > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  background: var(--orange);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 11px;
  font-weight: 900;
}
.focus-list li:nth-child(2) > span { background: var(--cyan); }
.focus-list li:nth-child(3) > span { background: var(--yellow); }
.focus-list li:nth-child(4) > span { background: var(--pink); }
.focus-list li div { min-width: 0; }
.focus-list strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}
.focus-list small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.home-portfolio-cases {
  position: relative;
  background: var(--paper);
}
.home-portfolio-cases .project-case:first-child { border-top: 8px solid var(--ink); }
.home-portfolio-cases .project-case { scroll-margin-top: 104px; }

.project-case .case-media,
.project-case .case-side {
  opacity: 1;
  isolation: isolate;
}
.project-case .case-side {
  color: var(--cream);
  background-color: #243741;
  background-image: none;
}
.project-case .case-side .pixel-button.is-disabled {
  color: #35434a;
  background: #cbd0cc;
}

@media (max-width: 700px) {
  .focus-list li { grid-template-columns: 44px minmax(0, 1fr); padding-inline: 14px; }
  .home-portfolio-cases .project-case { scroll-margin-top: 164px; }
}

/* Layered project scenes: background art → live preview → foreground sprites */
.project-case .case-content {
  aspect-ratio: 1648 / 954;
  overflow: hidden;
  border: 5px solid var(--ink);
  background: #172c37;
  box-shadow: 10px 10px 0 var(--ink);
}

.project-case .case-media {
  position: absolute;
  z-index: 2;
  inset: auto;
  display: block;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  outline: 0;
  background: #fff8e8;
  color: var(--ink);
  box-shadow: none;
  appearance: none;
  transition: filter .14s steps(3), transform .14s steps(3), box-shadow .14s steps(3);
}

.case-scene-1 .case-media { left: 17.35%; top: 25.05%; width: 43.75%; height: 49.1%; }
.case-scene-2 .case-media { left: 7.75%; top: 19.55%; width: 57.65%; height: 53.25%; }
.case-scene-3 .case-media { left: 9.05%; top: 22%; width: 55.5%; height: 53.45%; }

.project-case .media-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  display: grid;
  place-items: center;
  border: 0;
  background-color: #fff8e8;
  background-image:
    linear-gradient(rgba(25,35,42,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25,35,42,.045) 1px, transparent 1px);
  background-size: 18px 18px;
}
.project-case .media-stage::before,
.project-case .media-stage::after { display: none; }
.project-case .media-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-prompt {
  position: relative;
  z-index: 2;
  width: min(250px, 58%);
  min-height: 124px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 4px 16px;
  margin: 0 !important;
  padding: 20px;
  border: 4px solid var(--ink);
  background: var(--cream);
  box-shadow: 7px 7px 0 var(--ink);
  color: var(--ink) !important;
  text-align: left;
}
.media-play {
  grid-row: 1 / 3;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--orange);
  box-shadow: inset 0 0 0 7px var(--cream);
  color: var(--ink);
  font-style: normal;
  font-size: 17px;
  text-indent: 3px;
}
.media-prompt strong { font-size: clamp(13px, 1.2vw, 18px); line-height: 1.25; }
.media-prompt small { color: var(--muted); font-size: clamp(9px, .75vw, 11px); }
.project-case .case-media:hover,
.project-case .case-media:focus-visible {
  z-index: 3;
  filter: brightness(1.04) saturate(1.06);
  box-shadow: inset 0 0 0 6px var(--orange);
}
.project-case .case-media:hover .media-prompt,
.project-case .case-media:focus-visible .media-prompt {
  transform: translate(-3px, -3px);
  background: var(--yellow);
  box-shadow: 10px 10px 0 var(--ink);
}
.project-case .case-media:active .media-prompt {
  transform: translate(4px, 4px);
  box-shadow: 3px 3px 0 var(--ink);
}

.project-case .case-side {
  position: absolute;
  z-index: 3;
  inset: auto;
  min-height: 0;
  margin: 0;
  padding: clamp(13px, 1.25vw, 20px);
  overflow: hidden;
  border: 4px solid var(--ink);
  background: #243741;
  box-shadow: 6px 6px 0 rgba(25,35,42,.85);
}
.case-scene-1 .case-side { left: 72.55%; top: 25.15%; width: 18.15%; height: 40.5%; }
.case-scene-2 .case-side { left: 72.35%; top: 19.25%; width: 17.25%; height: 34.5%; }
.case-scene-3 .case-side { left: 71.2%; top: 18.45%; width: 14.1%; height: 39.5%; }
.project-case .case-side p { margin: clamp(10px, 1vw, 16px) 0; font-size: clamp(8px, .78vw, 12px); line-height: 1.55; }
.project-case .case-side .section-code { font-size: clamp(8px, .68vw, 10px); }
.project-case .filament-swatch {
  gap: clamp(5px, .7vw, 10px);
  padding-block: clamp(8px, 1vw, 14px);
}
.project-case .filament-swatch i { border-width: clamp(4px, .55vw, 7px); box-shadow: inset 0 0 0 clamp(4px, .55vw, 7px) var(--night); }
.project-case .case-side .pixel-button {
  min-height: 38px;
  margin-top: clamp(8px, 1vw, 14px);
  padding: 8px 7px;
  font-size: clamp(8px, .72vw, 11px);
  box-shadow: 4px 4px 0 var(--ink);
}

.foreground-sprite {
  position: absolute;
  z-index: 6;
  display: block;
  max-width: none;
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(4px 5px 0 rgba(12,21,27,.28));
}
.foreground-ai-left { left: .2%; bottom: -1.2%; width: 26.5%; }
.foreground-ai-right { right: -.6%; bottom: -2.3%; width: 19.8%; }

/* Project video modal */
body.modal-open { overflow: hidden; }
.video-modal[hidden] { display: none; }
.video-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 64px);
  background: rgba(8,15,20,.86);
  backdrop-filter: blur(2px);
}
.video-modal-shell {
  width: min(1180px, 100%);
  max-height: calc(100svh - 32px);
  overflow: auto;
  border-width: 5px;
  background: var(--night);
  color: var(--cream);
  box-shadow: 14px 14px 0 var(--orange);
}
.video-modal-bar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 14px 10px 20px;
  border-bottom: 5px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--orange) 0 48px, var(--yellow) 48px 96px);
  color: var(--ink);
}
.video-modal-bar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-modal-close {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 7px 12px;
  border: 3px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 900;
  cursor: pointer;
}
.video-modal-close:hover,
.video-modal-close:focus-visible { background: var(--cyan); transform: translate(-2px, -2px); outline: 3px solid var(--cream); }
.video-modal-body { aspect-ratio: 16 / 9; display: grid; place-items: center; background: #071016; }
.video-modal-body video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.modal-empty { width: min(560px, calc(100% - 32px)); display: grid; justify-items: center; gap: 16px; padding: 34px; border: 4px solid var(--cream); background: #243741; text-align: center; box-shadow: 8px 8px 0 var(--cyan); }
.modal-empty-icon { width: 64px; height: 64px; display: grid; place-items: center; border: 4px solid var(--cream); border-radius: 50%; background: var(--orange); color: var(--night); font-size: 22px; text-indent: 4px; }
.modal-empty strong { color: var(--yellow); font-size: clamp(18px, 2vw, 28px); }
.modal-empty p { margin: 0; max-width: 420px; color: #c3d3d2; font-size: 13px; line-height: 1.7; }

/* Calm, ordered pixel profile: remove the former overlap between panels */
.profile-section { background-size: 24px 24px; }
.profile-layout { grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr); align-items: start; gap: 28px; }
.profile-console { min-height: 0; }
.skill-console { width: 100%; align-self: stretch; }
.maker-vignette {
  grid-column: 1 / -1;
  min-height: 245px;
  margin: 0;
  padding: 28px;
  align-items: end;
  background-color: #9fdbe0;
  background-image:
    linear-gradient(rgba(25,35,42,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25,35,42,.055) 1px, transparent 1px);
  background-size: 16px 16px;
}
.maker-vignette .spool-house { max-width: 450px; }
.maker-vignette .tool-rack { max-width: 220px; }
.experience-track { margin-top: 28px; }

@media (max-width: 1050px) {
  .project-case .case-side p { line-height: 1.4; }
  .project-case .case-side .pixel-button { margin-top: 7px; }
  .profile-layout { grid-template-columns: 1fr; }
  .maker-vignette { grid-column: 1; }
}

@media (max-width: 700px) {
  .project-case .case-content {
    display: grid;
    aspect-ratio: auto;
    min-height: 0;
    gap: 18px;
    padding: calc(58% + 18px) 14px 24px;
    overflow: hidden;
  }
  .frame-backdrop { inset: 0 0 auto; height: auto; opacity: 1; object-fit: fill; object-position: center top; }
  .project-case .case-media,
  .project-case .case-side { position: relative; inset: auto; width: 100%; height: auto; }
  .project-case .case-media { aspect-ratio: 16 / 9; }
  .project-case .case-side { padding: 16px; }
  .project-case .case-side p { display: block; }
  .project-case .case-side .section-code { display: block; margin-bottom: 8px; }
  .project-case .filament-swatch { grid-template-columns: repeat(3, 1fr); gap: 8px; padding-block: 12px; }
  .project-case .case-side .pixel-button { min-height: 40px; padding: 8px; font-size: 10px; }
  .media-prompt { width: min(190px, 76%); min-height: 92px; grid-template-columns: 42px 1fr; padding: 12px; gap: 3px 10px; }
  .media-play { width: 40px; height: 40px; border-width: 3px; box-shadow: inset 0 0 0 5px var(--cream); font-size: 13px; }
  .foreground-ai-left { left: 0; top: 43vw; bottom: auto; width: 33%; }
  .foreground-ai-right { right: -1%; top: 37vw; bottom: auto; width: 25%; }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-data { grid-template-columns: 1fr; }
  .maker-vignette { grid-column: 1; min-height: 310px; padding: 16px; }
  .maker-vignette .spool-house { width: 70%; min-width: 210px; }
  .maker-vignette .tool-rack { width: 27%; margin-left: 10px; }
}

/* Final usability pass */
.profile-section .section-heading h2 {
  max-width: 880px;
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

.mini-spool {
  position: absolute;
  z-index: 3;
  right: 12px;
  top: 12px;
  width: 66px;
  height: 66px;
  border-width: 8px;
  box-shadow: inset 0 0 0 8px var(--cream), 4px 4px 0 rgba(25,35,42,.75);
}
.mini-spool::before,
.mini-spool::after { display: none; }
.mini-spool i { inset: 20px; border-width: 3px; }

.research-section .section-heading {
  padding: clamp(24px, 3.4vw, 48px);
  border: 3px solid var(--cream);
  background-color: rgba(16,25,34,.96);
  background-image:
    linear-gradient(rgba(118,213,222,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118,213,222,.07) 1px, transparent 1px);
  background-size: 18px 18px;
  color: var(--cream);
  box-shadow: 7px 7px 0 var(--cyan);
}
.research-section .section-heading h2 {
  color: var(--cream);
  font-size: clamp(34px, 4.8vw, 66px);
  line-height: 1.08;
  text-shadow: none;
}
.research-section .section-heading .section-intro { color: #bfd2d1; }

.project-case {
  min-height: 0;
  scroll-margin-top: 0;
  padding-top: clamp(42px, 4.5vw, 64px);
  padding-bottom: clamp(180px, 15vw, 220px);
}
.project-case .case-code,
.project-case .case-title { min-height: 170px; }
.project-case .case-code::before { top: 28px; width: 66px; height: 60px; }
.project-case .case-code strong { font-size: 46px; }
.project-case .case-title { padding: clamp(22px, 3vw, 38px); }
.project-case .case-title h2 { font-size: clamp(28px, 3.45vw, 50px); }
.project-case .case-description {
  margin: -6px 56px 0 24px;
  padding: 17px 22px;
  font-size: 13px;
  line-height: 1.7;
}
.project-case .case-measure { height: 34px; margin-top: 24px !important; }
.project-case .case-content { margin-top: 24px !important; }
.project-case .website-module { margin-top: 96px !important; }

@media (min-width: 901px) {
  .project-case .case-header {
    grid-template-columns: 142px minmax(0, 1fr) minmax(260px, .43fr);
    gap: 18px;
    align-items: stretch;
  }
  .project-case .case-code { grid-column: 1; grid-row: 1; }
  .project-case .case-title { grid-column: 2; grid-row: 1; }
  .project-case .case-description {
    grid-column: 3;
    grid-row: 1;
    min-height: 170px;
    align-items: center;
    margin: 0;
    padding: 20px;
  }
  .project-case .case-title h2 { font-size: clamp(27px, 3vw, 43px); }
  .project-case .case-description::before { top: -17px; right: 12px; padding: 5px 8px; }
}

.video-modal-shell {
  width: min(1180px, 100%, calc((100svh - 150px) * 16 / 9));
  max-height: calc(100svh - 32px);
  overflow: hidden;
}
.video-modal-body {
  width: 100%;
  max-height: calc(100svh - 130px);
}

@media (max-width: 900px) {
  .profile-section .section-heading h2 { font-size: clamp(32px, 7vw, 52px); }
  .project-case .case-header { grid-template-columns: 130px minmax(0, 1fr); gap: 18px; }
  .project-case .case-description { margin-right: 20px; }
}

@media (max-width: 700px) {
  .project-case { padding-top: 54px; padding-bottom: 160px; }
  .project-case .case-header { grid-template-columns: 1fr; }
  .project-case .case-code { min-height: 118px; }
  .project-case .case-title { min-height: 0; }
  .project-case .case-description { margin: 14px 0 0; }
  .project-case .case-measure { margin-top: 26px !important; }
  .project-case .case-content { margin-top: 30px !important; }
  .video-modal { padding: 10px; }
  .video-modal-shell { width: 100%; max-height: calc(100svh - 20px); }
  .video-modal-bar { min-height: 50px; padding-left: 12px; font-size: 11px; }
  .video-modal-body { max-height: calc(100svh - 82px); }
}
