:root {
  color-scheme: light;
  --video-background: #d6c3b2;
  --ink: #35271f;
  --muted-ink: #756257;
  --panel: rgba(250, 246, 240, 0.74);
  --panel-border: rgba(75, 53, 41, 0.13);
  --accent: #674838;
  --accent-soft: #b9957e;
  --gilded: #9b6b32;
  --gilded-light: #d3ad68;
  --gilded-shadow: #67421f;
  background: var(--video-background);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--video-background);
}

body {
  display: grid;
  place-items: center;
  color: var(--ink);
}

#bone-cursor-layer {
  position: fixed;
  z-index: 100;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

#bone-cursor-layer canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

body.bone-cursor-ready,
body.bone-cursor-ready * {
  cursor: none !important;
}

button,
input {
  font: inherit;
}

.mobile-menu-toggle,
.mobile-drawer-backdrop,
.mobile-drawer-header,
.motion-control {
  display: none;
}

.stage {
  position: relative;
  width: min(100vw, 177.777778vh);
  height: min(100vh, 56.25vw);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--video-background);
  cursor: ew-resize;
  user-select: none;
  isolation: isolate;
  container-type: size;
}

#dog-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  background: var(--video-background);
  pointer-events: none;
}

.brand-lockup {
  position: absolute;
  z-index: 4;
  top: clamp(20px, 2.5vw, 36px);
  left: clamp(24px, 3.4vw, 52px);
  display: flex;
  align-items: center;
  gap: 0;
  pointer-events: none;
}

.brand-lockup::after {
  width: clamp(30px, 5vw, 76px);
  height: 1px;
  margin-left: 14px;
  content: "";
  background:
    radial-gradient(circle, var(--gilded-light) 0 1.5px, transparent 1.8px)
      left center / 7px 7px no-repeat,
    linear-gradient(
      90deg,
      rgba(155, 107, 50, 0.6),
      rgba(211, 173, 104, 0.28) 62%,
      transparent
    );
}

.brand-mark {
  position: relative;
  display: block;
  width: clamp(34px, 3vw, 42px);
  aspect-ratio: 1;
  border: 1px solid rgba(155, 107, 50, 0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 250, 242, 0.48), transparent 62%),
    rgba(214, 195, 178, 0.36);
  box-shadow:
    inset 0 0 0 4px rgba(211, 173, 104, 0.08),
    0 5px 18px rgba(103, 66, 31, 0.1);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  left: 50%;
  width: 1px;
  height: 6px;
  content: "";
  background: linear-gradient(var(--gilded-light), var(--gilded-shadow));
  transform: translateX(-50%);
}

.brand-mark::before {
  top: -4px;
}

.brand-mark::after {
  bottom: -4px;
}

.brand-mark i::before,
.brand-mark i::after {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 9px;
  content: "";
  border: 1px solid var(--gilded);
  border-radius: 50%;
}

.brand-mark i::before {
  left: 7px;
  transform: translateY(-50%) rotate(18deg);
}

.brand-mark i::after {
  right: 7px;
  transform: translateY(-50%) rotate(-18deg);
}

.brand-copy {
  position: relative;
  display: grid;
  margin-left: 13px;
  padding-left: 14px;
  border-left: 1px solid rgba(155, 107, 50, 0.34);
  gap: 4px;
}

.brand-copy::before,
.brand-copy::after {
  position: absolute;
  left: -3px;
  width: 5px;
  height: 5px;
  content: "";
  border: 1px solid rgba(155, 107, 50, 0.48);
  background: rgba(214, 195, 178, 0.88);
  transform: rotate(45deg);
}

.brand-copy::before {
  top: 2px;
}

.brand-copy::after {
  bottom: 2px;
}

.brand-copy strong {
  color: #4b3023;
  font-family:
    "STZhongsong", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC",
    "STSong", "SimSun", serif;
  font-size: clamp(19px, 1.75vw, 25px);
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1.03;
  background: linear-gradient(180deg, #271912 5%, #69452b 50%, #2c1c15 94%);
  background-clip: text;
  text-shadow:
    0 1px rgba(255, 250, 242, 0.72),
    0 7px 18px rgba(75, 47, 28, 0.14);
  -webkit-background-clip: text;
  -webkit-text-stroke: 0.28px rgba(61, 38, 26, 0.42);
  -webkit-text-fill-color: transparent;
}

.brand-copy small {
  color: rgba(76, 51, 38, 0.72);
  font-family:
    Bahnschrift, "Aptos Narrow", "Arial Narrow", "Helvetica Neue", sans-serif;
  font-size: clamp(8px, 0.66vw, 10px);
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

body.bone-cursor-ready .brand-mark {
  box-shadow:
    inset 0 0 0 4px rgba(211, 173, 104, 0.1),
    0 0 18px rgba(211, 173, 104, 0.2);
}

.side-grid {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  width: 29%;
  opacity: 0.18;
  background-image:
    radial-gradient(
      circle at 25% 50%,
      transparent 0 74px,
      rgba(155, 107, 50, 0.34) 75px 76px,
      transparent 77px 107px,
      rgba(211, 173, 104, 0.22) 108px 109px,
      transparent 110px
    ),
    repeating-conic-gradient(
      from 45deg at 25% 50%,
      transparent 0 11.7deg,
      rgba(155, 107, 50, 0.2) 11.9deg 12.2deg,
      transparent 12.4deg 30deg
    ),
    radial-gradient(circle, rgba(103, 66, 31, 0.62) 0 1px, transparent 1.4px),
    repeating-linear-gradient(
      58deg,
      transparent 0 23px,
      rgba(155, 107, 50, 0.18) 23px 24px
    ),
    repeating-linear-gradient(
      -58deg,
      transparent 0 23px,
      rgba(155, 107, 50, 0.18) 23px 24px
    );
  background-size: 100% 100%, 100% 100%, 34px 34px, auto, auto;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

.side-grid::before,
.side-grid::after {
  position: absolute;
  content: "";
  opacity: 0.72;
}

.side-grid::before {
  top: 11%;
  bottom: 11%;
  left: 18%;
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(155, 107, 50, 0.7) 0 5px,
    transparent 5px 17px
  );
  box-shadow: 9px 0 rgba(211, 173, 104, 0.18);
}

.side-grid::after {
  top: 50%;
  left: 7%;
  width: 56%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(155, 107, 50, 0.62) 22%,
    rgba(211, 173, 104, 0.2) 74%,
    transparent
  );
  box-shadow:
    0 -18vh rgba(155, 107, 50, 0.22),
    0 18vh rgba(211, 173, 104, 0.18);
}

.side-grid--left {
  left: 0;
  mask-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.8), transparent 88%),
    linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  -webkit-mask-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.8), transparent 88%),
    linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

.side-grid--right {
  right: 0;
  transform: scaleX(-1);
  mask-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.8), transparent 88%),
    linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  -webkit-mask-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.8), transparent 88%),
    linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

.aviary-frame {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 50%;
  height: 100%;
  aspect-ratio: 828 / 1108;
  border-right: 1px solid rgba(103, 66, 31, 0.72);
  border-left: 1px solid rgba(103, 66, 31, 0.72);
  box-shadow:
    inset 9px 0 14px -14px rgba(103, 66, 31, 0.6),
    inset -9px 0 14px -14px rgba(103, 66, 31, 0.6),
    -1px 0 rgba(211, 173, 104, 0.62),
    1px 0 rgba(211, 173, 104, 0.62);
  pointer-events: none;
  transform: translateX(-50%);
}

.aviary-frame__rail {
  position: absolute;
  top: 4.5%;
  bottom: 4.5%;
  width: 14px;
  opacity: 0.84;
  background:
    radial-gradient(
        circle,
        var(--gilded-light) 0 1.4px,
        var(--gilded-shadow) 1.6px 2.2px,
        transparent 2.4px
      )
      center top / 8px 29px repeat-y,
    linear-gradient(
        to right,
        transparent 0 3px,
        rgba(211, 173, 104, 0.82) 3px 4px,
        rgba(103, 66, 31, 0.72) 4px 5px,
        transparent 5px 9px,
        rgba(155, 107, 50, 0.58) 9px 10px,
        transparent 10px
      )
      center / 100% 100% no-repeat;
  filter: drop-shadow(0 3px 3px rgba(103, 66, 31, 0.13));
}

.aviary-frame__rail--left {
  left: -14px;
}

.aviary-frame__rail--right {
  right: -14px;
  transform: scaleX(-1);
}

.aviary-frame__rail::before,
.aviary-frame__rail::after {
  position: absolute;
  left: 1px;
  width: 12px;
  height: 12px;
  content: "";
  border: 1px solid rgba(155, 107, 50, 0.8);
  background: rgba(214, 195, 178, 0.72);
  box-shadow:
    inset 0 0 0 3px rgba(211, 173, 104, 0.16),
    0 2px 5px rgba(103, 66, 31, 0.12);
  transform: rotate(45deg);
}

.aviary-frame__rail::before {
  top: -7px;
}

.aviary-frame__rail::after {
  bottom: -7px;
}

.aviary-frame__rail i {
  position: absolute;
  top: 50%;
  left: 1px;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(155, 107, 50, 0.86);
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--gilded-light) 0 2px, transparent 2.3px),
    rgba(214, 195, 178, 0.76);
  box-shadow:
    0 0 0 3px rgba(211, 173, 104, 0.13),
    0 2px 6px rgba(103, 66, 31, 0.16);
  transform: translateY(-50%);
}

.aviary-frame__arch {
  position: absolute;
  right: -20px;
  left: -20px;
  height: 30px;
  opacity: 0.68;
}

.aviary-frame__arch::before {
  position: absolute;
  inset: 0;
  content: "";
  border-color: rgba(155, 107, 50, 0.66);
  border-style: solid;
  border-width: 1px 0 0;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  box-shadow: inset 0 1px rgba(211, 173, 104, 0.48);
}

.aviary-frame__arch::after {
  position: absolute;
  left: 50%;
  width: 11px;
  height: 11px;
  content: "";
  border: 1px solid rgba(155, 107, 50, 0.76);
  border-radius: 50%;
  background: var(--video-background);
  box-shadow:
    inset 0 0 0 3px rgba(211, 173, 104, 0.15),
    0 2px 5px rgba(103, 66, 31, 0.12);
  transform: translateX(-50%);
}

.aviary-frame__arch--top {
  top: 13px;
}

.aviary-frame__arch--top::after {
  top: -6px;
}

.aviary-frame__arch--bottom {
  bottom: 13px;
  transform: scaleY(-1);
}

.aviary-frame__arch--bottom::after {
  top: -6px;
}

.intro-panel {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: clamp(218px, 15.5vw, 260px);
  width: min(20vw, 248px);
  transform: translateY(-50%);
  pointer-events: none;
}

.intro-panel::before {
  position: absolute;
  top: -36px;
  bottom: -36px;
  left: -18px;
  width: 1px;
  content: "";
  background:
    radial-gradient(circle, var(--gilded-light) 0 2px, transparent 2.4px)
      center top / 7px 7px no-repeat,
    radial-gradient(circle, var(--gilded-light) 0 2px, transparent 2.4px)
      center bottom / 7px 7px no-repeat,
    linear-gradient(
      to bottom,
      transparent,
      rgba(155, 107, 50, 0.56) 18%,
      rgba(155, 107, 50, 0.18) 82%,
      transparent
    );
}

.intro-panel::after {
  position: absolute;
  top: 50%;
  left: -22px;
  width: 9px;
  height: 9px;
  content: "";
  border: 1px solid rgba(155, 107, 50, 0.68);
  background: var(--video-background);
  box-shadow: 0 0 0 3px rgba(211, 173, 104, 0.1);
  transform: translateY(-50%) rotate(45deg);
}

.model-link-status {
  position: absolute;
  z-index: 3;
  bottom: clamp(20px, 2.4vw, 34px);
  left: clamp(24px, 3.4vw, 52px);
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(75, 51, 38, 0.66);
  font-size: clamp(8px, 0.72vw, 10px);
  font-weight: 650;
  letter-spacing: 0.06em;
  pointer-events: none;
  --model-progress: 0%;
}

.model-link-status::before,
.model-link-status::after {
  position: absolute;
  bottom: -9px;
  left: 0;
  height: 1px;
  content: "";
}

.model-link-status::after {
  width: 100%;
  background: rgba(103, 72, 56, 0.13);
}

.model-link-status::before {
  z-index: 1;
  width: var(--model-progress);
  background: linear-gradient(90deg, var(--gilded), var(--gilded-light));
  box-shadow: 0 0 8px rgba(211, 173, 104, 0.24);
  transition: width 180ms ease;
}

.model-link-status small {
  margin-left: 5px;
  padding-left: 9px;
  border-left: 1px solid rgba(103, 66, 31, 0.2);
  color: rgba(103, 72, 56, 0.45);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.model-link-status__dot {
  width: 6px;
  height: 6px;
  border: 1px solid rgba(103, 66, 31, 0.46);
  border-radius: 50%;
  background: rgba(155, 107, 50, 0.22);
}

.model-link-status.is-online .model-link-status__dot {
  border-color: rgba(116, 118, 58, 0.72);
  background: #8c8e4c;
  box-shadow: 0 0 0 4px rgba(140, 142, 76, 0.12);
  animation: status-pulse 2.4s ease-in-out infinite;
}

.model-link-status.is-error .model-link-status__dot {
  border-color: rgba(142, 78, 56, 0.58);
  background: #a76d55;
  box-shadow: 0 0 0 4px rgba(167, 109, 85, 0.1);
}

@keyframes status-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(140, 142, 76, 0.1);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(140, 142, 76, 0.03);
  }
}

.eyebrow,
.control-kicker {
  margin: 0 0 12px;
  color: var(--muted-ink);
  font-size: clamp(9px, 0.8vw, 11px);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.intro-panel h1 {
  max-width: 230px;
  margin: 0;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(28px, 3.15vw, 46px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.intro-copy {
  margin: clamp(14px, 1.6vw, 22px) 0 0;
  color: var(--muted-ink);
  font-size: clamp(11px, 1vw, 14px);
  line-height: 1.75;
}

.mouse-hint {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: clamp(20px, 2.5vw, 34px);
  color: rgba(53, 39, 31, 0.64);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.mouse-hint__line {
  position: relative;
  display: block;
  height: 1px;
  background: rgba(53, 39, 31, 0.28);
}

.mouse-hint__line::before,
.mouse-hint__line::after {
  position: absolute;
  top: -3px;
  width: 6px;
  height: 6px;
  content: "";
  border-top: 1px solid rgba(53, 39, 31, 0.46);
}

.mouse-hint__line::before {
  left: 0;
  border-left: 1px solid rgba(53, 39, 31, 0.46);
  transform: rotate(-45deg);
}

.mouse-hint__line::after {
  right: 0;
  border-right: 1px solid rgba(53, 39, 31, 0.46);
  transform: rotate(45deg);
}

.mouse-hint__line i {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(53, 39, 31, 0.55);
  border-radius: 50%;
  background: var(--video-background);
  transform: translateX(-50%);
}

.control-panel {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: clamp(20px, 2.8vw, 42px);
  width: min(24vw, 292px);
  padding: clamp(16px, 1.65vw, 24px);
  transform: translateY(-50%);
  border: 1px solid var(--panel-border);
  border-radius: clamp(16px, 1.6vw, 22px);
  background:
    linear-gradient(90deg, rgba(211, 173, 104, 0.65), transparent) 18px 12px /
      48px 1px no-repeat,
    linear-gradient(180deg, rgba(211, 173, 104, 0.65), transparent) 12px 18px /
      1px 48px no-repeat,
    linear-gradient(270deg, rgba(155, 107, 50, 0.46), transparent)
      calc(100% - 18px) calc(100% - 12px) / 48px 1px no-repeat,
    linear-gradient(0deg, rgba(155, 107, 50, 0.46), transparent)
      calc(100% - 12px) calc(100% - 18px) / 1px 48px no-repeat,
    radial-gradient(circle at 100% 0, rgba(211, 173, 104, 0.1), transparent 28%),
    var(--panel);
  box-shadow:
    inset 0 0 0 1px rgba(255, 250, 242, 0.28),
    0 18px 55px rgba(75, 53, 41, 0.11);
  cursor: default;
  backdrop-filter: blur(18px) saturate(112%);
  -webkit-backdrop-filter: blur(18px) saturate(112%);
  max-height: calc(100% - 24px);
  overflow-y: auto;
  scrollbar-width: none;
}

.control-panel::-webkit-scrollbar {
  display: none;
}

.control-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.control-panel__header .control-kicker {
  margin-bottom: 5px;
}

.control-panel h2 {
  margin: 0;
  font-size: clamp(17px, 1.45vw, 21px);
  font-weight: 650;
  letter-spacing: -0.035em;
}

.status-pill {
  min-width: 48px;
  padding: 6px 9px;
  border: 1px solid rgba(103, 72, 56, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.position-meter {
  margin-top: clamp(15px, 1.5vw, 21px);
}

.position-meter__track {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: rgba(103, 72, 56, 0.14);
}

.position-meter__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--head-position, 50%);
  border-radius: inherit;
  background: var(--accent);
}

.position-meter__thumb {
  position: absolute;
  top: 50%;
  left: var(--head-position, 50%);
  width: 12px;
  height: 12px;
  border: 3px solid #f8f2eb;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(53, 39, 31, 0.2);
  transform: translate(-50%, -50%);
}

.position-meter__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: rgba(53, 39, 31, 0.56);
  font-size: 9px;
}

.position-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: clamp(14px, 1.4vw, 20px);
}

.position-option,
.reset-button {
  border: 1px solid rgba(103, 72, 56, 0.14);
  color: var(--ink);
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.position-option {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: clamp(48px, 4.6vw, 62px);
  padding: 7px 4px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.34);
  font-size: clamp(10px, 0.85vw, 12px);
}

.position-option__icon {
  font-size: 17px;
  line-height: 1;
}

.position-option:hover,
.position-option:focus-visible,
.reset-button:hover,
.reset-button:focus-visible {
  border-color: rgba(103, 72, 56, 0.4);
  outline: none;
  transform: translateY(-1px);
}

.position-option[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fffaf5;
}

.position-option:disabled,
.reset-button:disabled,
#sensitivity:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.position-option:disabled:hover,
.reset-button:disabled:hover {
  border-color: rgba(103, 72, 56, 0.14);
  transform: none;
}

.reset-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 11px;
  background: transparent;
  font-size: clamp(10px, 0.9vw, 12px);
  font-weight: 650;
}

.sensitivity-control {
  display: block;
  margin-top: clamp(16px, 1.5vw, 21px);
  cursor: default;
}

.sensitivity-control__header,
.sensitivity-control__labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cursor-lab {
  margin-top: clamp(16px, 1.5vw, 21px);
  padding-top: clamp(14px, 1.4vw, 19px);
  border-top: 1px solid rgba(103, 72, 56, 0.1);
}

.cursor-lab__heading,
.cursor-size-control__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cursor-lab__heading .control-kicker {
  margin-bottom: 4px;
}

.cursor-lab h3 {
  margin: 0;
  font-size: clamp(13px, 1.15vw, 16px);
  letter-spacing: -0.02em;
}

.cursor-lab__code {
  position: relative;
  padding: 4px 7px;
  border: 1px solid rgba(155, 107, 50, 0.2);
  border-radius: 999px;
  color: var(--gilded);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.cursor-lab__code::before,
.cursor-lab__code::after {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(155, 107, 50, 0.44));
}

.cursor-lab__code::before {
  right: calc(100% + 6px);
}

.cursor-lab__code::after {
  left: calc(100% + 6px);
  transform: scaleX(-1);
}

.cursor-size-control {
  display: block;
  margin-top: 13px;
}

.cursor-size-control__header,
.trail-control__label {
  font-size: clamp(10px, 0.9vw, 12px);
  font-weight: 650;
}

.cursor-size-control output {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

#cursor-size {
  width: 100%;
  height: 4px;
  margin: 12px 0 4px;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(
    to right,
    var(--accent) 0 41.7%,
    rgba(103, 72, 56, 0.14) 41.7% 100%
  );
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

#cursor-size::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  border: 3px solid #f8f2eb;
  border-radius: 50%;
  background: var(--gilded);
  box-shadow: 0 2px 7px rgba(53, 39, 31, 0.18);
  appearance: none;
  -webkit-appearance: none;
}

#cursor-size::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 3px solid #f8f2eb;
  border-radius: 50%;
  background: var(--gilded);
  box-shadow: 0 2px 7px rgba(53, 39, 31, 0.18);
}

.trail-control {
  margin-top: 13px;
}

.trail-control__label {
  display: block;
  margin-bottom: 8px;
}

.trail-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.trail-options button {
  min-height: 30px;
  padding: 5px 3px;
  border: 1px solid rgba(103, 72, 56, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.28);
  color: var(--muted-ink);
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.trail-options button[aria-pressed="true"] {
  border-color: rgba(155, 107, 50, 0.58);
  background: rgba(211, 173, 104, 0.18);
  color: #604124;
}

.trail-options button:hover,
.trail-options button:focus-visible {
  border-color: rgba(155, 107, 50, 0.48);
  outline: none;
  transform: translateY(-1px);
}

.cursor-burst {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 9px;
  padding: 9px 11px;
  border: 1px solid rgba(155, 107, 50, 0.28);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(211, 173, 104, 0.2), rgba(255, 255, 255, 0.24));
  color: #614126;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.cursor-burst:hover,
.cursor-burst:focus-visible {
  border-color: rgba(155, 107, 50, 0.55);
  outline: none;
  box-shadow: 0 7px 18px rgba(103, 66, 31, 0.09);
  transform: translateY(-1px);
}

#cursor-size:disabled,
.trail-options button:disabled,
.cursor-burst:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
}

.trail-options button:disabled:hover,
.cursor-burst:disabled:hover {
  border-color: rgba(103, 72, 56, 0.13);
  box-shadow: none;
  transform: none;
}

.position-option:focus-visible,
.reset-button:focus-visible,
.trail-options button:focus-visible,
.cursor-burst:focus-visible {
  outline: 2px solid rgba(126, 79, 43, 0.78);
  outline-offset: 2px;
}

#sensitivity:focus-visible,
#cursor-size:focus-visible {
  outline: 2px solid rgba(126, 79, 43, 0.78);
  outline-offset: 4px;
}

.sensitivity-control__header {
  font-size: clamp(10px, 0.95vw, 12px);
  font-weight: 650;
}

.sensitivity-control__header output {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

#sensitivity {
  width: 100%;
  height: 4px;
  margin: 13px 0 8px;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(
    to right,
    var(--accent) 0 60%,
    rgba(103, 72, 56, 0.14) 60% 100%
  );
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

#sensitivity::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  border: 3px solid #f8f2eb;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 7px rgba(53, 39, 31, 0.18);
  appearance: none;
  -webkit-appearance: none;
}

#sensitivity::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 3px solid #f8f2eb;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 7px rgba(53, 39, 31, 0.18);
}

.sensitivity-control__labels {
  color: rgba(53, 39, 31, 0.5);
  font-size: 9px;
}

.control-note {
  margin: clamp(13px, 1.3vw, 18px) 0 0;
  padding-top: clamp(11px, 1.1vw, 15px);
  border-top: 1px solid rgba(103, 72, 56, 0.1);
  color: rgba(53, 39, 31, 0.55);
  font-size: clamp(9px, 0.78vw, 11px);
  line-height: 1.55;
}

@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  html,
  body {
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body {
    display: block;
    touch-action: none;
  }

  body.bone-cursor-ready,
  body.bone-cursor-ready * {
    cursor: auto !important;
  }

  .stage {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    aspect-ratio: auto;
    cursor: default;
    touch-action: none;
  }

  #dog-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .brand-lockup,
  .side-grid,
  .aviary-frame,
  .intro-panel,
  .model-link-status,
  #bone-cursor-layer {
    display: none !important;
  }

  .mobile-menu-toggle {
    position: fixed;
    z-index: 20;
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    display: grid;
    width: 46px;
    height: 46px;
    place-content: center;
    gap: 5px;
    padding: 0;
    border: 1px solid rgba(75, 53, 41, 0.16);
    border-radius: 50%;
    background: rgba(250, 246, 240, 0.76);
    box-shadow: 0 9px 28px rgba(75, 53, 41, 0.13);
    color: var(--ink);
    cursor: pointer;
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
  }

  .mobile-menu-toggle span {
    display: block;
    width: 18px;
    height: 1.5px;
    border-radius: 999px;
    background: currentColor;
  }

  .mobile-menu-toggle:focus-visible,
  .mobile-menu-close:focus-visible,
  .motion-button:focus-visible {
    outline: 2px solid rgba(126, 79, 43, 0.78);
    outline-offset: 3px;
  }

  .mobile-drawer-backdrop {
    position: fixed;
    z-index: 28;
    inset: 0;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(53, 39, 31, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .mobile-drawer-open .mobile-drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .control-panel {
    position: fixed;
    z-index: 30;
    top: 0;
    right: 0;
    width: min(88vw, 370px);
    height: 100vh;
    height: 100dvh;
    max-height: none;
    padding:
      max(18px, env(safe-area-inset-top))
      max(18px, env(safe-area-inset-right))
      max(24px, env(safe-area-inset-bottom))
      20px;
    overflow-y: auto;
    border-width: 0 0 0 1px;
    border-radius: 0;
    background: rgba(248, 243, 236, 0.96);
    box-shadow: -18px 0 55px rgba(53, 39, 31, 0.16);
    transform: translate3d(105%, 0, 0);
    transition:
      transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 280ms;
    overscroll-behavior: contain;
    touch-action: pan-y;
    visibility: hidden;
  }

  .control-panel.is-open {
    transform: translate3d(0, 0, 0);
    transition-delay: 0s;
    visibility: visible;
  }

  .mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(103, 72, 56, 0.12);
  }

  .mobile-drawer-header p {
    margin: 0 0 4px;
    color: var(--gilded);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .mobile-drawer-header strong {
    font-family:
      "STZhongsong", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC",
      serif;
    font-size: 21px;
    letter-spacing: 0.12em;
  }

  .mobile-menu-close {
    position: relative;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid rgba(103, 72, 56, 0.13);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.42);
    color: var(--ink);
  }

  .mobile-menu-close span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 17px;
    height: 1.5px;
    border-radius: 999px;
    background: currentColor;
  }

  .mobile-menu-close span:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .mobile-menu-close span:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  .motion-control {
    display: block;
    margin: 18px 0;
    padding: 0 0 18px;
    border-bottom: 1px solid rgba(103, 72, 56, 0.12);
  }

  .motion-control__copy {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .motion-control .control-kicker {
    margin-bottom: 4px;
  }

  .motion-control h3 {
    margin: 0;
    font-size: 17px;
    letter-spacing: 0;
  }

  .motion-indicator {
    width: 9px;
    height: 9px;
    margin-top: 9px;
    border: 1px solid rgba(103, 72, 56, 0.32);
    border-radius: 50%;
    background: rgba(103, 72, 56, 0.12);
  }

  .motion-indicator[data-state="waiting"] {
    border-color: rgba(155, 107, 50, 0.58);
    background: var(--gilded-light);
  }

  .motion-indicator[data-state="active"] {
    border-color: rgba(116, 118, 58, 0.72);
    background: #8c8e4c;
    box-shadow: 0 0 0 5px rgba(140, 142, 76, 0.1);
  }

  .motion-status {
    margin: 11px 0 12px;
    color: var(--muted-ink);
    font-size: 12px;
    line-height: 1.6;
  }

  .motion-button {
    display: none;
  }

  .motion-button:disabled {
    opacity: 0.46;
  }

  .control-panel__header {
    margin-top: 0;
  }

  .control-panel h2 {
    font-size: 18px;
    letter-spacing: 0;
  }

  .position-meter,
  .position-options,
  .sensitivity-control {
    margin-top: 18px;
  }

  .position-option {
    min-height: 58px;
    font-size: 12px;
  }

  .reset-button {
    min-height: 42px;
    font-size: 12px;
  }

  .sensitivity-control__header {
    font-size: 12px;
  }

  .cursor-lab,
  .control-note {
    display: none;
  }
}

@media (min-width: 701px) and (max-width: 900px) {
  .intro-copy,
  .mouse-hint,
  .control-note {
    display: none;
  }

  .intro-panel {
    display: none;
  }

  .intro-panel h1 {
    font-size: clamp(22px, 4vw, 34px);
  }

  .brand-lockup {
    left: 20px;
  }

  .brand-copy small {
    display: none;
  }

  .brand-lockup::after {
    display: none;
  }

  .model-link-status {
    left: 22px;
  }

  .control-panel {
    right: 16px;
    width: 27vw;
    padding: 13px;
  }

  .side-grid::after,
  .intro-panel::before,
  .intro-panel::after {
    display: none;
  }

  .position-meter,
  .sensitivity-control {
    margin-top: 12px;
  }
}

@media (min-width: 701px) and (max-height: 520px) {
  .control-note,
  .mouse-hint {
    display: none;
  }

  .control-panel {
    padding: 12px 14px;
  }

  .brand-lockup {
    top: 14px;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .brand-copy small,
  .model-link-status small,
  .cursor-lab__heading .control-kicker {
    display: none;
  }

  .cursor-lab {
    margin-top: 10px;
    padding-top: 10px;
  }

  .position-meter,
  .position-options,
  .sensitivity-control {
    margin-top: 10px;
  }

  .position-option {
    min-height: 44px;
  }
}

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

  .model-link-status.is-online .model-link-status__dot {
    animation: none;
  }
}

/* Companion upgrade: translucent glass surfaces and an on-scene pixel dialogue. */
:root {
  --panel: rgba(255, 250, 245, 0.42);
  --panel-border: rgba(255, 255, 255, 0.56);
  --glass-light: rgba(255, 255, 255, 0.3);
  --glass-deep: rgba(103, 72, 56, 0.1);
  --pet-mint: #748d75;
  --pet-rose: #b76863;
}

.control-panel {
  border-color: rgba(255, 255, 255, 0.57);
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.46), rgba(255, 248, 240, 0.2) 44%, rgba(211, 173, 104, 0.13)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.6), transparent 28%) 18px 12px / 48px 1px no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent 28%) 12px 18px / 1px 48px no-repeat,
    linear-gradient(270deg, rgba(211, 173, 104, 0.62), transparent) calc(100% - 18px) calc(100% - 12px) / 48px 1px no-repeat,
    linear-gradient(0deg, rgba(211, 173, 104, 0.62), transparent) calc(100% - 12px) calc(100% - 18px) / 1px 48px no-repeat;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 0 0 1px rgba(103, 72, 56, 0.04),
    0 24px 70px rgba(75, 53, 41, 0.16);
  backdrop-filter: blur(26px) saturate(135%);
  -webkit-backdrop-filter: blur(26px) saturate(135%);
}

.position-option,
.trail-options button,
.feed-option,
.dog-chat-form {
  border-color: rgba(255, 255, 255, 0.52);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.15));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 0 8px 20px rgba(75, 53, 41, 0.05);
  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
}

.position-option[aria-pressed="true"],
.trail-options button[aria-pressed="true"] {
  border-color: rgba(155, 107, 50, 0.55);
  background: linear-gradient(135deg, rgba(155, 107, 50, 0.88), rgba(116, 77, 53, 0.78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 9px 20px rgba(103, 66, 31, 0.18);
}

.dog-dialogue {
  position: absolute;
  z-index: 2;
  top: clamp(18px, 5vw, 72px);
  left: calc(50% + clamp(62px, 10vw, 148px));
  width: min(224px, 19vw);
  padding: 13px 15px 14px;
  border: 3px solid #5b4132;
  border-radius: 4px;
  background: rgba(255, 250, 241, 0.88);
  color: #463126;
  box-shadow:
    5px 5px 0 rgba(91, 65, 50, 0.24),
    0 12px 28px rgba(75, 53, 41, 0.17);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.96);
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dog-dialogue::before,
.dog-dialogue::after {
  position: absolute;
  width: 7px;
  height: 7px;
  content: "";
  background: #5b4132;
}

.dog-dialogue::before {
  top: 4px;
  left: 4px;
  box-shadow: calc(100% + 3px) 0 #5b4132, 0 calc(100% + 3px) #5b4132, calc(100% + 3px) calc(100% + 3px) #5b4132;
}

.dog-dialogue::after {
  right: 4px;
  bottom: 4px;
  box-shadow: calc(-100% - 3px) 0 #5b4132, 0 calc(-100% - 3px) #5b4132, calc(-100% - 3px) calc(-100% - 3px) #5b4132;
}

.dog-dialogue.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.dog-dialogue.is-feeding {
  animation: dialogue-pop 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dog-dialogue__signal {
  display: block;
  margin-bottom: 6px;
  color: #9b6b32;
  font-family: "Courier New", monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.dog-dialogue p {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: "Courier New", "Microsoft YaHei", monospace;
  font-size: clamp(11px, 0.93vw, 13px);
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 1.55;
}

.dog-dialogue__tail {
  position: absolute;
  left: 18px;
  bottom: -13px;
  width: 17px;
  height: 17px;
  border-right: 3px solid #5b4132;
  border-bottom: 3px solid #5b4132;
  background: rgba(255, 250, 241, 0.88);
  transform: rotate(45deg);
}

@keyframes dialogue-pop {
  0% { transform: translateY(-5px) scale(0.95); }
  55% { transform: translateY(0) scale(1.035); }
  100% { transform: translateY(0) scale(1); }
}

.pet-care,
.companion-chat {
  margin-top: clamp(16px, 1.5vw, 21px);
  padding-top: clamp(14px, 1.4vw, 19px);
  border-top: 1px solid rgba(103, 72, 56, 0.12);
}

.pet-care__heading,
.companion-chat__heading,
.satiety-meter__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pet-care__heading .control-kicker,
.companion-chat__heading .control-kicker {
  margin-bottom: 4px;
}

.pet-care h3,
.companion-chat h3 {
  margin: 0;
  font-size: clamp(14px, 1.2vw, 17px);
  letter-spacing: -0.025em;
}

.pet-mood,
.companion-chat__online {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.57);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  color: var(--pet-mint);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.satiety-meter {
  margin-top: 13px;
  padding: 11px 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.satiety-meter__header {
  color: var(--muted-ink);
  font-size: 10px;
  font-weight: 700;
}

.satiety-meter__header output {
  color: var(--pet-mint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.satiety-meter__track {
  position: relative;
  height: 7px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(103, 72, 56, 0.13);
}

.satiety-meter__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--satiety, 68%);
  border-radius: inherit;
  background: linear-gradient(90deg, #89a48b, #c0c07a);
  box-shadow: 0 0 12px rgba(116, 141, 117, 0.34);
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1), background 220ms ease;
}

.satiety-meter.is-hungry .satiety-meter__fill {
  background: linear-gradient(90deg, #c77062, #d2a061);
  box-shadow: 0 0 12px rgba(183, 104, 99, 0.3);
}

.satiety-meter__pulse {
  position: absolute;
  top: 0;
  left: calc(var(--satiety, 68%) - 7px);
  width: 14px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  filter: blur(2px);
}

.hunger-hint {
  margin: 8px 0 0;
  color: rgba(53, 39, 31, 0.57);
  font-size: 9px;
  line-height: 1.45;
}

.feed-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.feed-option {
  display: grid;
  min-height: 62px;
  place-items: center;
  gap: 3px;
  padding: 7px 4px;
  border-radius: 11px;
  color: var(--ink);
  cursor: pointer;
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.feed-option:hover,
.feed-option:focus-visible {
  border-color: rgba(155, 107, 50, 0.58);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 10px 20px rgba(103, 66, 31, 0.12);
  transform: translateY(-2px);
}

.feed-option.is-fed {
  animation: feed-tap 360ms ease;
}

.feed-option__icon {
  color: var(--gilded);
  font-size: 17px;
  line-height: 1;
}

.feed-option__copy {
  display: grid;
  gap: 1px;
  justify-items: center;
}

.feed-option__copy strong {
  font-size: 10px;
}

.feed-option__copy small {
  color: var(--pet-mint);
  font-size: 9px;
  font-weight: 800;
}

@keyframes feed-tap {
  35% { transform: translateY(1px) scale(0.95); }
  70% { transform: translateY(-2px) scale(1.03); }
}

.companion-chat__online {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-ink);
}

.companion-chat__online i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pet-mint);
  box-shadow: 0 0 0 3px rgba(116, 141, 117, 0.11);
}

.dog-chat-form {
  display: grid;
  grid-template-columns: 1fr 34px;
  align-items: center;
  gap: 4px;
  margin-top: 11px;
  padding: 4px;
  border-radius: 12px;
}

.dog-chat-form input {
  width: 100%;
  min-width: 0;
  padding: 7px 5px 7px 8px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 10px;
}

.dog-chat-form input::placeholder {
  color: rgba(53, 39, 31, 0.43);
}

.dog-chat-form button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--gilded), var(--accent));
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(103, 66, 31, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.dog-chat-form button:hover,
.dog-chat-form button:focus-visible {
  outline: none;
  box-shadow: 0 7px 14px rgba(103, 66, 31, 0.25);
  transform: translateY(-1px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  .dog-dialogue {
    z-index: 10;
    top: max(18px, env(safe-area-inset-top));
    left: 50%;
    width: min(232px, 68vw);
    transform: translate(-50%, -8px) scale(0.96);
  }

  .dog-dialogue.is-visible {
    transform: translate(-50%, 0) scale(1);
  }

  .dog-dialogue__tail {
    right: auto;
    left: 50%;
    transform: translateX(50%) rotate(45deg);
  }

  .control-panel {
    background: linear-gradient(155deg, rgba(255, 250, 245, 0.83), rgba(246, 237, 226, 0.7));
    backdrop-filter: blur(28px) saturate(138%);
    -webkit-backdrop-filter: blur(28px) saturate(138%);
  }

  .pet-care,
  .companion-chat {
    display: block;
  }

  .feed-option {
    min-height: 66px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dog-dialogue.is-feeding,
  .feed-option.is-fed {
    animation: none;
  }
}

/* 4T interaction layer. The source video is a single plate, so the idle
   motion stays deliberately subtle to keep the frame and body coherent. */
.brand-companion {
  position: relative;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 6px;
  margin-left: clamp(12px, 1.5vw, 20px);
  padding: 5px 8px 5px 10px;
  border: 1px solid rgba(211, 173, 104, 0.62);
  border-radius: 3px;
  background: linear-gradient(135deg, rgba(255, 250, 241, 0.45), rgba(211, 173, 104, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52), 0 5px 16px rgba(103, 66, 31, 0.09);
  color: var(--accent);
}

.brand-companion::before,
.brand-companion::after {
  position: absolute;
  width: 4px;
  height: 4px;
  content: "";
  border: 1px solid var(--gilded-light);
  background: var(--video-background);
  transform: rotate(45deg);
}

.brand-companion::before {
  top: -3px;
  left: -3px;
}

.brand-companion::after {
  right: -3px;
  bottom: -3px;
}

.brand-companion i,
.brand-companion small {
  color: rgba(103, 72, 56, 0.62);
  font-size: 7px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
}

.brand-companion i {
  grid-column: 1 / -1;
}

.brand-companion strong {
  font-family: "Courier New", monospace;
  font-size: clamp(15px, 1.4vw, 20px);
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.brand-companion small {
  color: var(--pet-mint);
}

.dog-interaction {
  position: absolute;
  z-index: 1;
  top: 10%;
  left: 50%;
  width: min(31vw, 390px);
  height: 80%;
  padding: 0;
  border: 0;
  border-radius: 46%;
  background: transparent;
  cursor: pointer;
  transform: translateX(-50%);
}

.dog-interaction::after {
  display: none;
}

.dog-interaction:focus-visible {
  outline: none;
}

.stage.is-idle #dog-video {
  animation: dog-idle-sway 4.8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  transform-origin: 50% 88%;
  will-change: transform;
}

.stage.is-engaging #dog-video {
  animation: dog-interaction-bob 520ms cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: 50% 88%;
}

@keyframes dog-idle-sway {
  0%,
  100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  26% { transform: translate3d(-1.5px, 1px, 0) rotate(-0.16deg); }
  58% { transform: translate3d(1.5px, 0, 0) rotate(0.18deg); }
  79% { transform: translate3d(0.5px, 1px, 0) rotate(0.06deg); }
}

@keyframes dog-interaction-bob {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  35% { transform: translate3d(0, 2px, 0) scale(0.998); }
  68% { transform: translate3d(0, -1px, 0) scale(1.002); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

.pet-care {
  position: relative;
  isolation: isolate;
  margin-top: clamp(18px, 1.7vw, 24px);
  padding: clamp(16px, 1.5vw, 20px);
  overflow: hidden;
  border: 1px solid rgba(211, 173, 104, 0.64);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0, rgba(255, 255, 255, 0.64), transparent 23%),
    radial-gradient(circle at 88% 100%, rgba(211, 173, 104, 0.28), transparent 30%),
    linear-gradient(140deg, rgba(255, 250, 241, 0.44), rgba(155, 107, 50, 0.11));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    inset 0 0 0 4px rgba(255, 255, 255, 0.12),
    0 14px 32px rgba(103, 66, 31, 0.13);
}

.pet-care::before,
.pet-care::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.pet-care::before {
  inset: 7px;
  border: 1px solid rgba(211, 173, 104, 0.34);
  border-radius: 13px;
  background:
    linear-gradient(90deg, rgba(211, 173, 104, 0.72), transparent 36%) left top / 72px 1px no-repeat,
    linear-gradient(180deg, rgba(211, 173, 104, 0.72), transparent 38%) left top / 1px 62px no-repeat,
    linear-gradient(270deg, rgba(211, 173, 104, 0.72), transparent 36%) right bottom / 72px 1px no-repeat,
    linear-gradient(0deg, rgba(211, 173, 104, 0.72), transparent 38%) right bottom / 1px 62px no-repeat;
}

.pet-care::after {
  top: 10px;
  right: 13px;
  width: 54px;
  height: 22px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.5px) 0 4px / 14px 14px repeat-x,
    radial-gradient(circle, rgba(211, 173, 104, 0.84) 0 1.5px, transparent 2px) 7px 12px / 18px 18px repeat-x;
  opacity: 0.8;
}

.pet-care .control-kicker,
.pet-care h3,
.pet-care .pet-mood,
.pet-care .satiety-meter,
.pet-care .feed-options {
  position: relative;
  z-index: 1;
}

.pet-care .satiety-meter {
  background: rgba(255, 255, 255, 0.27);
}

.pet-care .feed-option {
  border-color: rgba(211, 173, 104, 0.4);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.48), rgba(255, 247, 234, 0.18));
}

.pet-care .feed-option:hover,
.pet-care .feed-option:focus-visible {
  border-color: rgba(155, 107, 50, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 22px rgba(155, 107, 50, 0.19);
}

@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  .brand-companion {
    display: none;
  }

  .dog-interaction {
    top: 13%;
    width: 66vw;
    height: 73%;
  }

  .pet-care {
    padding: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage.is-idle #dog-video,
  .stage.is-engaging #dog-video {
    animation: none;
  }
}

/* Click interaction video: it shares the same framing as the head-turn plate
   and crossfades from the centred turn frame instead of hard-cutting. */
#dog-video {
  transition: opacity 260ms ease;
}

#dog-click-video {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  opacity: 0;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.stage.is-click-effect #dog-video {
  opacity: 0;
}

.stage.is-click-effect #dog-click-video {
  opacity: 1;
}

@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  #dog-click-video {
    object-fit: cover;
  }
}

@media (prefers-reduced-motion: reduce) {
  #dog-video,
  #dog-click-video {
    transition-duration: 0.01ms;
  }
}

.mobile-companion-dock {
  display: none;
}

.mobile-companion-toggle {
  display: none;
}

.dog-interaction {
  touch-action: manipulation;
}

@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  .mobile-companion-dock:not([hidden]) {
    position: fixed;
    z-index: 19;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    display: grid;
    gap: 8px;
    max-height: min(43dvh, 340px);
    overflow-y: auto;
    padding: 0 2px;
    overscroll-behavior: contain;
    touch-action: pan-y;
    scrollbar-width: none;
  }

  .mobile-companion-dock:not([hidden]):not(.is-open) {
    left: auto;
    width: min(184px, calc(100vw - 20px));
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .mobile-companion-dock::-webkit-scrollbar {
    display: none;
  }

  .mobile-companion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, 0.66);
    border-radius: 15px;
    background:
      linear-gradient(135deg, rgba(255, 252, 247, 0.88), rgba(222, 193, 150, 0.55)),
      rgba(255, 250, 243, 0.64);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.76),
      0 10px 26px rgba(75, 53, 41, 0.16);
    color: var(--ink);
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    backdrop-filter: blur(20px) saturate(132%);
    -webkit-backdrop-filter: blur(20px) saturate(132%);
  }

  .mobile-companion-toggle__title::before {
    margin-right: 7px;
    color: var(--gilded);
    content: "✦";
  }

  #mobile-companion-toggle-state {
    color: var(--pet-mint);
    font-size: 10px;
  }

  .mobile-companion-toggle:focus-visible {
    outline: 2px solid rgba(126, 79, 43, 0.78);
    outline-offset: 3px;
  }

  .mobile-companion-dock:not(.is-open) .pet-care,
  .mobile-companion-dock:not(.is-open) .companion-chat {
    display: none;
  }

  .mobile-companion-dock .pet-care,
  .mobile-companion-dock .companion-chat {
    display: block;
    margin: 0;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255, 250, 243, 0.78), rgba(226, 205, 177, 0.48));
    box-shadow: 0 12px 30px rgba(75, 53, 41, 0.16);
    backdrop-filter: blur(20px) saturate(130%);
    -webkit-backdrop-filter: blur(20px) saturate(130%);
  }

  .mobile-companion-dock .pet-care {
    padding: 12px;
  }

  .mobile-companion-dock .companion-chat {
    padding: 11px 12px 12px;
    border: 1px solid rgba(255, 255, 255, 0.55);
  }

  .mobile-companion-dock .pet-care__heading .control-kicker,
  .mobile-companion-dock .companion-chat__heading .control-kicker {
    margin-bottom: 2px;
  }

  .mobile-companion-dock .pet-care h3,
  .mobile-companion-dock .companion-chat h3 {
    font-size: 15px;
  }

  .mobile-companion-dock .satiety-meter {
    margin-top: 8px;
    padding: 8px 9px;
  }

  .mobile-companion-dock .hunger-hint {
    display: none;
  }

  .mobile-companion-dock .feed-options {
    gap: 5px;
    margin-top: 7px;
  }

  .mobile-companion-dock .feed-option {
    min-height: 50px;
    padding: 5px 3px;
  }

  .mobile-companion-dock .feed-option__icon {
    font-size: 14px;
  }

  .mobile-companion-dock .companion-chat__heading {
    align-items: flex-start;
  }

  .mobile-companion-dock .dog-chat-form {
    margin-top: 7px;
  }
}
