:root {
  color-scheme: light;
  --ink: #1f1b18;
  --paper: #fff7e5;
  --paper-2: #f7e1ba;
  --red: #e64d39;
  --mint: #22bfa8;
  --blue: #2f7de1;
  --yellow: #f8c43c;
  --orange: #f47d2b;
  --black: #101010;
  --line: rgba(31, 27, 24, 0.16);
  --shadow: 0 22px 70px rgba(31, 27, 24, 0.18);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  background:
    linear-gradient(90deg, rgba(232, 66, 50, 0.08) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(180deg, rgba(79, 39, 23, 0.08) 1px, transparent 1px) 0 0 / 36px 36px,
    var(--paper);
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 247, 229, 0.95), rgba(255, 247, 229, 0.76) 42%, rgba(247, 225, 186, 0.88)),
    repeating-linear-gradient(90deg, rgba(79, 39, 23, 0.045) 0 1px, transparent 1px 8px);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.15;
  background-image:
    radial-gradient(circle at 15% 24%, #4f2717 0 1px, transparent 1px),
    radial-gradient(circle at 84% 72%, #1f1b18 0 1px, transparent 1px);
  background-size: 18px 18px, 23px 23px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

img,
video {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 247, 229, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--paper);
  background: var(--red);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  margin-top: 2px;
  color: rgba(31, 27, 24, 0.62);
  font-size: 11px;
  text-transform: uppercase;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

nav a {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(31, 27, 24, 0.72);
  font-size: 13px;
}

nav a:hover,
nav a:focus-visible {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
  outline: none;
}

.section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(68px, 8vw, 108px) 0;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(520px, 0.86fr) minmax(520px, 1.14fr);
  gap: clamp(32px, 4vw, 64px);
  align-items: center;
  min-height: calc(100svh - 72px);
  overflow: hidden;
  padding-top: clamp(30px, 5vw, 58px);
  padding-bottom: clamp(46px, 5vw, 70px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: clamp(18px, 3vw, 42px);
  pointer-events: none;
  border: 1px solid rgba(31, 27, 24, 0.08);
  border-radius: 14px;
  opacity: 0.7;
}

.hero-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.82;
}

.hero-copy,
.hero-duo {
  position: relative;
  z-index: 1;
}

.kicker {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 620px;
  margin-bottom: 22px;
  font-size: clamp(48px, 5.2vw, 78px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 span {
  display: block;
  white-space: nowrap;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1.04;
  font-weight: 920;
  letter-spacing: 0;
  text-wrap: balance;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.lead,
.section-note {
  color: rgba(31, 27, 24, 0.72);
  line-height: 1.86;
}

.lead {
  max-width: 560px;
  margin-bottom: 28px;
  font-size: clamp(15px, 1.35vw, 17px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-weight: 850;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.button.primary {
  color: var(--paper);
  background: var(--ink);
}

.button.ghost {
  background: #fff;
}

.hero-duo {
  display: grid;
  grid-template-columns: minmax(180px, 0.62fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: center;
}

.device-card {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow), 7px 7px 0 var(--ink);
  transform: translate3d(
      calc(var(--base-x, 0px) + var(--px, 0px)),
      calc(var(--base-y, 0px) + var(--py, 0px)),
      0
    )
    rotate(var(--r, 0deg));
  transition: transform 180ms ease-out;
  will-change: transform;
}

.device-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.console-hero {
  --base-y: 36px;
  --r: -1deg;
}

.console-hero img {
  aspect-ratio: 1 / 0.92;
  object-fit: contain;
  padding: 16px;
  background: #fff;
}

.robot-hero img {
  aspect-ratio: 1.02 / 1;
}

.device-card figcaption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #fff;
  background: rgba(16, 16, 16, 0.76);
  backdrop-filter: blur(12px);
}

.device-card figcaption span {
  display: block;
  margin-bottom: 5px;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 950;
}

.device-card figcaption strong {
  line-height: 1.5;
}

.section-heading {
  max-width: 860px;
  margin-bottom: 34px;
}

.section-heading.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.38fr);
  gap: 28px;
  align-items: end;
  max-width: none;
}

.section-note {
  margin-bottom: 0;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.role-card,
.console-preview,
.lcd,
.spec-list,
.video-frame,
.role-card,
.face-display,
.relation-card,
.relation-flow,
.game-device,
.robot-response,
.demo-card {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 5px 5px 0 rgba(31, 27, 24, 0.92);
}

.role-card {
  min-height: 210px;
  padding: 20px;
}

.role-card.active {
  color: var(--paper);
  background: var(--ink);
}

.role-card span {
  display: inline-block;
  margin-bottom: 36px;
  color: var(--red);
  font-weight: 950;
}

.role-card.active span {
  color: var(--yellow);
}

.role-card p,
.spec-list dd,
.relation-card p,
.demo-card p,
.response-copy p {
  margin-bottom: 0;
  color: rgba(31, 27, 24, 0.72);
  line-height: 1.75;
}

.role-card.active p {
  color: rgba(255, 247, 229, 0.78);
}

.console-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.4fr);
  gap: 18px;
  align-items: stretch;
}

.console-preview {
  display: grid;
  min-height: 540px;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 24%, rgba(248, 196, 60, 0.24), transparent 34%),
    #fff;
}

.console-preview img {
  width: min(92%, 820px);
  max-height: 520px;
  object-fit: contain;
}

.console-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lcd {
  min-height: 170px;
  padding: 20px;
  color: #d6ffe4;
  background:
    linear-gradient(transparent 50%, rgba(255, 255, 255, 0.05) 50%) 0 0 / 100% 6px,
    #101812;
  box-shadow: inset 0 0 26px rgba(33, 185, 154, 0.18), 5px 5px 0 var(--ink);
}

.lcd span {
  display: block;
  margin-bottom: 16px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.lcd strong {
  display: block;
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.4;
}

.lcd p {
  margin: 0;
  color: rgba(214, 255, 228, 0.78);
  line-height: 1.7;
}

.palette-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.palette,
.command,
.face-chip,
.flavor {
  cursor: pointer;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.palette {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.palette span {
  width: 24px;
  height: 24px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--c);
}

.palette:hover,
.palette:focus-visible,
.command:hover,
.command:focus-visible,
.face-chip:hover,
.face-chip:focus-visible,
.flavor:hover,
.flavor:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
  outline: none;
}

.palette.active,
.command.active,
.face-chip.active,
.flavor.active {
  color: var(--paper);
  background: var(--red);
}

.spec-list {
  margin: 0;
  padding: 18px;
}

.spec-list div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.spec-list div:last-child {
  border-bottom: 0;
}

.spec-list dt {
  color: var(--red);
  font-weight: 950;
}

.spec-list dd {
  margin: 0;
}

.model-lab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.38fr);
  gap: 18px;
  align-items: stretch;
}

.model-stage {
  position: relative;
  min-height: 580px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 76%, rgba(248, 196, 60, 0.28), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(247, 225, 186, 0.42));
  box-shadow: var(--shadow), 7px 7px 0 var(--ink);
}

model-viewer {
  width: 100%;
  height: 580px;
  --poster-color: transparent;
  --progress-bar-color: var(--red);
  --progress-bar-height: 4px;
}

.model-file-warning {
  display: none;
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 78px;
  z-index: 3;
  max-width: 560px;
  padding: 18px 20px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  color: var(--paper);
  background: rgba(22, 24, 22, 0.9);
  box-shadow: 8px 8px 0 rgba(31, 27, 24, 0.16);
}

.model-file-warning span {
  display: block;
  margin-bottom: 6px;
  color: var(--mint);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.model-file-warning strong {
  display: block;
  font-size: clamp(1rem, 1.4vw, 1.4rem);
  line-height: 1.45;
}

.model-file-warning p {
  margin: 8px 0 0;
  color: rgba(255, 250, 236, 0.78);
  font-weight: 700;
  line-height: 1.7;
}

body.file-preview .model-file-warning {
  display: block;
}

.model-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.model-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.model-button {
  min-height: 58px;
  cursor: pointer;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.model-button:hover,
.model-button:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
  outline: none;
}

.model-button.active {
  color: var(--paper);
  background: var(--red);
}

.model-notes {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 5px 5px 0 rgba(31, 27, 24, 0.92);
  list-style: none;
}

.model-notes li {
  position: relative;
  padding-left: 20px;
  color: rgba(31, 27, 24, 0.74);
  line-height: 1.55;
  font-weight: 800;
}

.model-notes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 2px var(--ink);
}

.console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 18px;
  align-items: stretch;
}

.video-frame {
  position: relative;
  overflow: hidden;
  background: var(--black);
  box-shadow: var(--shadow);
}

.video-frame video {
  width: 100%;
  height: 100%;
  min-height: 420px;
  max-height: 680px;
  object-fit: contain;
  background: var(--black);
}

.video-status {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  color: #fff;
  background: rgba(16, 16, 16, 0.72);
  backdrop-filter: blur(12px);
}

.video-status span {
  color: var(--mint);
  font-size: 12px;
  font-weight: 950;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.command {
  min-height: 54px;
  font-weight: 900;
}

.link-lab {
  display: grid;
  grid-template-columns: minmax(280px, 0.44fr) 120px minmax(320px, 0.56fr);
  gap: 18px;
  align-items: center;
}

.relation-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1.05fr) minmax(240px, 0.58fr);
  gap: 18px;
  align-items: stretch;
}

.relation-card,
.relation-flow {
  padding: 18px;
}

.relation-card.main {
  background: rgba(255, 255, 255, 0.78);
}

.relation-card span,
.relation-flow span {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
}

.relation-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  margin-bottom: 18px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
}

.relation-card.main img {
  object-fit: cover;
  background: #111;
}

.relation-flow {
  color: var(--paper);
  background: var(--ink);
}

.relation-flow span {
  color: var(--yellow);
}

.relation-flow ol {
  display: grid;
  gap: 14px;
  margin: 0;
  padding-left: 22px;
}

.relation-flow li {
  line-height: 1.65;
  font-weight: 800;
}

.game-device {
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(244, 125, 43, 0.14), transparent),
    rgba(255, 255, 255, 0.76);
}

.device-screen {
  min-height: 220px;
  padding: 22px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  color: #f4f7f5;
  background:
    linear-gradient(transparent 50%, rgba(255, 255, 255, 0.04) 50%) 0 0 / 100% 7px,
    #363a3c;
}

.device-screen span {
  display: block;
  margin-bottom: 18px;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 950;
}

.device-screen strong {
  display: block;
  margin-bottom: 18px;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.25;
}

.device-screen small {
  color: rgba(244, 247, 245, 0.72);
  line-height: 1.6;
}

.flavor-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.flavor {
  min-height: 64px;
  font-size: 18px;
  font-weight: 950;
}

.flavor[data-flavor="sweet"] {
  background: #f7c5bd;
}

.flavor[data-flavor="sour"] {
  background: #b9d7ff;
}

.flavor[data-flavor="salty"] {
  background: #bdeed7;
}

.flavor[data-flavor="spicy"] {
  background: #ffe792;
}

.flavor.active {
  color: var(--paper);
  background: var(--red);
}

.signal-rail {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: rgba(31, 27, 24, 0.7);
  font-size: 12px;
  font-weight: 950;
  text-align: center;
}

.signal-rail span {
  width: 12px;
  height: 88px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(var(--blue), var(--mint), var(--red), var(--yellow));
  box-shadow: 0 0 18px rgba(34, 191, 168, 0.42);
}

.robot-response {
  display: grid;
  grid-template-columns: minmax(180px, 0.5fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  padding: 16px;
}

.robot-response img {
  width: 100%;
  min-height: 300px;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #111;
}

.response-copy {
  align-self: center;
}

.response-copy span,
.demo-card span {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--red);
  font-weight: 950;
}

.response-copy h3 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
}

.mini-led {
  grid-column: 1 / -1;
  height: 18px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: rgba(16, 16, 16, 0.86);
}

.mini-led i {
  display: block;
  width: 36%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--mint), var(--red), var(--yellow));
  box-shadow: 0 0 22px var(--mint);
  transform: translateX(var(--led-pos, 0));
  transition: transform 360ms ease;
}

.face-lab {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(260px, 0.38fr);
  gap: 18px;
  align-items: stretch;
}

.face-display {
  position: relative;
  overflow: hidden;
  background: var(--black);
  box-shadow: var(--shadow);
}

.face-display img {
  width: 100%;
  height: 520px;
  object-fit: cover;
}

.face-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  color: #fff;
  background: rgba(16, 16, 16, 0.74);
  backdrop-filter: blur(12px);
}

.face-caption span {
  display: block;
  margin-bottom: 6px;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.face-caption strong {
  line-height: 1.6;
}

.face-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.face-chip {
  min-height: 52px;
  font-weight: 900;
}

.timer-bar {
  height: 10px;
  margin-top: 20px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-2);
}

.timer-bar span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--mint);
  transform-origin: left;
  animation: timer 5s linear infinite;
}

@keyframes timer {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.demo-card {
  overflow: hidden;
}

.demo-card video {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #111;
}

.demo-card div {
  padding: 20px;
}

.credits-section {
  padding-top: clamp(40px, 6vw, 78px);
}

.credits-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 18px;
}

.credit-card {
  padding: 22px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 5px 5px 0 rgba(31, 27, 24, 0.92);
}

.credit-card span {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
}

.name-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.name-list li {
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 850;
}

.credit-card p {
  margin-bottom: 0;
  color: rgba(31, 27, 24, 0.72);
  line-height: 1.8;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 26px clamp(18px, 4vw, 52px);
  border-top: 1px solid var(--line);
  color: rgba(31, 27, 24, 0.64);
}

.site-footer strong {
  color: var(--ink);
}

.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero,
  .hero-duo,
  .console-showcase,
  .model-lab,
  .console,
  .link-lab,
  .relation-grid,
  .face-lab,
  .section-heading.split {
    grid-template-columns: 1fr;
  }

  .console-hero {
    --base-y: 0px;
    --r: 0deg;
  }

  h1 {
    max-width: 760px;
    font-size: clamp(44px, 10vw, 76px);
  }

  .role-grid,
  .demo-grid,
  .credits-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signal-rail {
    grid-template-columns: 1fr auto 1fr;
  }

  .signal-rail span {
    width: 100%;
    height: 12px;
  }

  .video-frame video,
  .face-display img {
    min-height: 0;
    height: auto;
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 640px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .section {
    width: min(100% - 24px, 1180px);
    padding: 58px 0;
  }

  h1 {
    font-size: clamp(42px, 13vw, 62px);
    line-height: 1.04;
  }

  .role-grid,
  .demo-grid,
  .credits-grid,
  .palette-controls,
  .model-switch,
  .command-grid,
  .face-controls,
  .flavor-buttons,
  .robot-response {
    grid-template-columns: 1fr;
  }

  .console-preview {
    min-height: 360px;
  }

  .model-stage {
    min-height: 420px;
  }

  model-viewer {
    height: 420px;
  }

  .role-card {
    min-height: 0;
  }

  .spec-list div {
    grid-template-columns: 1fr;
  }

  .device-card figcaption,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
