:root {
  color-scheme: light;
  --bg: #f3efe7;
  --bg-strong: #e9e3d8;
  --panel: rgba(255, 253, 248, 0.66);
  --text: #11100f;
  --muted: #6f6a62;
  --line: rgba(17, 16, 15, 0.18);
  --line-strong: rgba(17, 16, 15, 0.55);
  --accent: #ff4bdd;
  --accent-soft: rgba(255, 75, 221, 0.14);
  --signal: #c7ff32;
  --shadow: rgba(30, 24, 18, 0.14);
  --mark-filter: none;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11110f;
  --bg-strong: #1a1916;
  --panel: rgba(27, 26, 23, 0.75);
  --text: #f3efe7;
  --muted: #a9a39a;
  --line: rgba(243, 239, 231, 0.18);
  --line-strong: rgba(243, 239, 231, 0.56);
  --accent-soft: rgba(255, 75, 221, 0.17);
  --shadow: rgba(0, 0, 0, 0.42);
  --mark-filter: invert(1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 88% 7%, rgba(255, 75, 221, 0.06), transparent 23rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-stretch: normal;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

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

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  transform: translateY(-150%);
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
main,
.site-footer {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 92px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: max-content;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand img {
  width: 31px;
  height: 31px;
  object-fit: contain;
  filter: var(--mark-filter);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.7rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-nav a {
  transition: opacity 180ms ease;
}

.main-nav a:hover {
  opacity: 0.5;
}

.main-nav a[aria-current="page"] {
  padding-bottom: 0.28rem;
  border-bottom: 1px solid var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 45px;
  padding: 0.75rem 1.15rem;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-2px);
}

.button:focus-visible,
.icon-button:focus-visible,
.state-button:focus-visible,
.size-button:focus-visible,
.webpet-pet:focus-visible,
.button-reset:focus-visible,
.text-link:focus-visible,
.main-nav a:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.button-primary {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.button-primary:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #11100f;
}

.button-small {
  min-height: 38px;
  padding-inline: 0.9rem;
  font-size: 0.62rem;
}

.button-block {
  width: 100%;
}

.button-muted {
  border-color: var(--line);
  color: var(--muted);
}

.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-color: var(--line);
  border-radius: 50%;
  font-size: 0.9rem;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(270px, 0.7fr);
  gap: 4vw;
  align-items: center;
  min-height: 770px;
  padding: 8rem 0 7rem;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.panel-index,
.object-label,
.release-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0.3rem 0 0;
  font-size: clamp(6rem, 13vw, 11rem);
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 0.82;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: min(34rem, 100%);
  margin-top: 1.7rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
}

.hero-kicker-line {
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}

.hero-statement {
  max-width: 680px;
  margin: 3.6rem 0 0;
  font-size: clamp(2.1rem, 4.6vw, 4.8rem);
  font-weight: 530;
  letter-spacing: -0.025em;
  line-height: 0.98;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.6rem;
}

.hero-object {
  position: relative;
  min-height: 470px;
  padding: 1rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--panel);
  background-size: 28px 28px;
  box-shadow: 0 28px 70px var(--shadow);
  transform: rotate(1.5deg);
}

.object-label {
  position: absolute;
  right: 1rem;
  left: 1rem;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.object-label-top {
  top: 1rem;
}

.object-label-bottom {
  bottom: 1rem;
}

.object-label i,
.connection-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 4px rgba(199, 255, 50, 0.16);
}

.pet-field {
  position: absolute;
  inset: 3.5rem 1.25rem;
  display: grid;
  place-items: center;
}

.pet-mark {
  position: relative;
  z-index: 1;
  width: 87%;
  filter: var(--mark-filter);
  animation: pet-float 3.4s ease-in-out infinite;
}

.pet-shadow {
  position: absolute;
  bottom: 14%;
  width: 50%;
  height: 8%;
  border-radius: 50%;
  background: rgba(17, 16, 15, 0.18);
  filter: blur(12px);
  animation: shadow-breathe 3.4s ease-in-out infinite;
}

.signal,
.mini-signal {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--text);
  border-radius: 50%;
  background: var(--signal);
  color: #11100f;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 900;
  animation: signal-pop 2.1s steps(2) infinite;
}

.signal-left {
  top: 19%;
  left: 10%;
}

.signal-right {
  top: 11%;
  right: 8%;
  animation-delay: -1s;
}

.thesis {
  max-width: 950px;
  padding: 9rem 0 10rem;
}

.accent-label {
  display: inline-block;
  padding: 0.45rem 0.6rem;
  background: var(--accent);
  color: #11100f;
}

.thesis h2,
.section-heading h2,
.closing h2 {
  margin: 2.2rem 0 0;
  font-size: clamp(2.7rem, 6vw, 6rem);
  font-weight: 560;
  letter-spacing: -0.035em;
  line-height: 0.97;
}

.thesis > p:last-child {
  max-width: 710px;
  margin: 3rem 0 0 auto;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.5;
}

.chapters {
  border-top: 1px solid var(--line);
}

.chapter {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 210px;
  gap: 2rem;
  align-items: start;
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--line);
}

.chapter-number {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.chapter-copy h3,
.wallet-panel h3,
.pet-panel h3,
.desktop-option h3 {
  margin: 0.65rem 0 1rem;
  font-size: clamp(1.75rem, 3vw, 2.7rem);
  font-weight: 560;
  letter-spacing: -0.02em;
}

.chapter-copy > p:last-child {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.chapter-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.2rem;
  padding-top: 1.45rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 24px;
  padding: 0.25rem 0.48rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.status-pending {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.status-selected {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.text-link {
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.8;
  text-transform: uppercase;
}

.button-reset {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.app-shell,
.desktop-lab {
  padding: 9rem 0;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 4rem;
  align-items: end;
  margin-bottom: 4.5rem;
}

.section-heading h2 {
  margin-top: 0.8rem;
  font-size: clamp(3.1rem, 6vw, 6.1rem);
}

.section-heading > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 1rem;
}

.wallet-panel,
.pet-panel,
.desktop-option {
  border: 1px solid var(--line);
  background: var(--panel);
}

.wallet-panel,
.pet-panel {
  min-height: 510px;
  padding: clamp(1.35rem, 3vw, 2.3rem);
}

.wallet-panel {
  display: flex;
  flex-direction: column;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.panel-head h3 {
  margin-top: 0.5rem;
}

.panel-index {
  color: var(--muted);
}

.connection-dot {
  margin: 0.35rem 0 0;
  background: #8d8981;
  box-shadow: none;
}

.connection-dot.is-connected {
  background: var(--signal);
  box-shadow: 0 0 0 4px rgba(199, 255, 50, 0.16);
}

.wallet-state {
  display: grid;
  place-content: center start;
  flex: 1;
  min-height: 220px;
  margin: 1.2rem 0;
  padding: 1.4rem;
  border: 1px dashed var(--line);
}

.wallet-status {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wallet-address {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: clamp(0.82rem, 1.8vw, 1.15rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contract-note span {
  color: var(--muted);
}

.contract-note strong {
  text-align: right;
}

.pet-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--panel);
  background-size: 34px 34px;
}

.mini-pet-stage {
  position: relative;
  display: grid;
  place-items: center;
  height: 310px;
}

.mini-pet-stage img {
  width: min(440px, 78%);
  filter: var(--mark-filter);
  animation: pet-float 3.4s ease-in-out infinite;
}

.mini-signal-a {
  top: 17%;
  left: 17%;
}

.mini-signal-b {
  top: 7%;
  right: 14%;
  animation-delay: -1s;
}

.pet-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.pet-stats div {
  min-width: 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.pet-stats span,
.pet-stats strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-stats span {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.54rem;
  letter-spacing: 0.08em;
}

.pet-stats strong {
  font-size: 0.82rem;
}

.pet-use-button {
  margin-top: 1.5rem;
}

.desktop-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.desktop-option {
  display: flex;
  flex-direction: column;
  min-height: 470px;
  padding: clamp(1.6rem, 4vw, 3rem);
}

.desktop-option-featured {
  border-color: var(--text);
  box-shadow: inset 0 7px 0 var(--accent);
}

.desktop-option > p:not(.panel-index):not(.release-note) {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.desktop-option ul {
  display: grid;
  gap: 0.65rem;
  margin: 2rem 0 2.4rem;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.desktop-option li::before {
  margin-right: 0.7rem;
  color: var(--accent);
  content: "●";
}

.desktop-option .button-block,
.download-row,
.release-note {
  margin-top: auto;
}

.download-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding-top: 2rem;
}

.release-note {
  padding-top: 1rem;
  color: var(--muted);
}

.closing {
  display: grid;
  justify-items: center;
  padding: 11rem 0;
  text-align: center;
}

.closing h2 {
  margin-bottom: 3.2rem;
}

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 200px;
  padding: 3rem 0;
  border-top: 1px solid var(--line);
}

.footer-brand {
  margin-bottom: 1rem;
}

.site-footer p,
.footer-meta {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-meta {
  display: flex;
  gap: 1.5rem;
}

.ambient-cards {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ambient-card {
  position: absolute;
  width: 95px;
  padding: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.45);
  opacity: 0.18;
  filter: blur(0.7px);
}

.ambient-card-a {
  top: 11rem;
  left: -2.2rem;
  transform: rotate(-12deg);
}

.ambient-card-b {
  top: 37rem;
  right: -2.3rem;
  transform: rotate(13deg);
}

.ambient-card-c {
  top: 97rem;
  left: 2.5%;
  transform: rotate(8deg) scale(0.78);
}

.ambient-card-d {
  top: 163rem;
  right: 1.5%;
  transform: rotate(-9deg) scale(0.9);
}

.fallback-dialog {
  position: fixed;
  width: min(440px, calc(100% - 32px));
  padding: 2.5rem;
  border: 1px solid var(--text);
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.fallback-dialog::backdrop {
  background: rgba(17, 16, 15, 0.55);
  backdrop-filter: blur(4px);
}

.fallback-dialog img {
  width: 230px;
  margin: 0 auto 1rem;
  filter: var(--mark-filter);
  animation: pet-float 3.4s ease-in-out infinite;
}

.fallback-dialog h2 {
  margin: 0.8rem 0;
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.fallback-dialog > p:last-child {
  color: var(--muted);
  line-height: 1.5;
}

.dialog-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 1.7rem;
}

.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 100;
  max-width: min(410px, calc(100% - 40px));
  padding: 1rem 1.1rem;
  transform: translateY(140%);
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  line-height: 1.45;
  text-transform: uppercase;
  transition: transform 240ms ease;
}

.toast.is-visible {
  transform: translateY(0);
}

.home-manifesto,
.project-model,
.route-overview,
.install-paths {
  padding: 9rem 0;
  border-bottom: 1px solid var(--line);
}

.home-manifesto h2 {
  max-width: 1000px;
  margin: 2.2rem 0 0;
  font-size: clamp(3rem, 7vw, 7.2rem);
  font-weight: 560;
  letter-spacing: -0.035em;
  line-height: 0.94;
}

.manifesto-copy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem;
  max-width: 820px;
  margin: 4rem 0 0 auto;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.manifesto-copy p {
  margin: 0;
}

.compact-heading {
  margin-bottom: 3.5rem;
}

.compact-heading h2 {
  font-size: clamp(2.8rem, 5vw, 5.2rem);
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.model-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.model-grid article {
  min-height: 340px;
  padding: clamp(1.6rem, 3vw, 2.5rem);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.model-grid article > span,
.route-number {
  display: block;
  margin-bottom: 5rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
}

.model-grid h3,
.route-card h3 {
  margin: 0.7rem 0 1rem;
  font-size: clamp(1.75rem, 3vw, 2.8rem);
  font-weight: 560;
  letter-spacing: -0.02em;
}

.model-grid article > p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.route-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 380px;
  padding: clamp(1.6rem, 3.5vw, 3rem);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

.route-card:hover {
  background: var(--text);
  color: var(--bg);
}

.route-card:hover .eyebrow,
.route-card:hover .route-number,
.route-card:hover > p:not(.eyebrow) {
  color: var(--bg);
  opacity: 0.72;
}

.route-card-accent {
  box-shadow: inset 0 7px 0 var(--accent);
}

.route-card > p:not(.eyebrow) {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.route-card strong {
  margin-top: auto;
  padding-top: 2rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-closing {
  border-bottom: 0;
}

.page-main {
  min-height: 70vh;
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 5rem;
  align-items: end;
  min-height: 470px;
  padding: 7rem 0 5rem;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  margin: 0.6rem 0 0;
  font-size: clamp(5rem, 11vw, 10rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.85;
}

.try-page-hero h1,
.webpet-page-hero h1 {
  font-size: clamp(4.3rem, 9vw, 8.6rem);
}

.page-hero > p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.page-section.app-shell,
.page-section.desktop-lab {
  padding: 9rem 0;
}

.next-route {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3rem;
  padding: 7rem 0;
  border-bottom: 1px solid var(--line);
}

.next-route h2 {
  max-width: 770px;
  margin: 0.8rem 0 0;
  font-size: clamp(2.5rem, 5vw, 5.2rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 0.98;
}

.try-lab {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 1rem;
  padding: 6rem 0 9rem;
  border-bottom: 1px solid var(--line);
}

.try-stage {
  --pet-width: 220px;
  position: relative;
  min-height: 720px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--panel);
  background-size: 34px 34px;
}

.try-stage[data-pet-size="small"] {
  --pet-width: 128px;
}

.try-stage[data-pet-size="medium"] {
  --pet-width: 220px;
}

.try-stage[data-pet-size="large"] {
  --pet-width: 320px;
}

.try-pet-field {
  position: absolute;
  inset: 4rem 2rem;
}

.webpet-pet {
  --pet-x: 0px;
  --pet-y: 0px;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: min(var(--pet-width), calc(100% - 36px));
  max-height: calc(100% - 36px);
  transform: translate(calc(-50% + var(--pet-x)), calc(-50% + var(--pet-y)));
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.webpet-pet.is-dragging {
  cursor: grabbing;
}

.webpet-pet img {
  position: relative;
  z-index: 1;
  width: 100%;
  filter: var(--mark-filter);
  animation: pet-float 3.4s ease-in-out infinite;
  pointer-events: none;
}

.webpet-pet .pet-shadow {
  right: 20%;
  bottom: 0;
  left: 20%;
  width: auto;
  height: 7%;
}

.try-signal-left {
  top: 22%;
  left: 12%;
}

.try-signal-right {
  top: 13%;
  right: 12%;
  animation-delay: -1s;
}

.try-stage[data-pet-state="thinking"] .webpet-pet img {
  animation-duration: 1.8s;
}

.try-stage[data-pet-state="thinking"] .signal {
  background: #63d7ff;
}

.try-stage[data-pet-state="working"] .webpet-pet img {
  animation: pet-working 0.55s ease-in-out infinite;
}

.try-stage[data-pet-state="working"] .signal {
  background: #ffb62e;
}

.try-stage[data-pet-state="waiting"] .webpet-pet img {
  animation: pet-waiting 1.4s steps(2) infinite;
}

.try-stage[data-pet-state="waiting"] .signal {
  background: var(--accent);
}

.try-stage[data-pet-state="success"] .webpet-pet img {
  animation: pet-success 1.1s ease-in-out infinite;
}

.try-stage[data-pet-state="success"] .signal {
  background: var(--signal);
}

.try-stage[data-pet-state="failed"] .webpet-pet img {
  animation: pet-failed 1.1s ease-in-out infinite;
}

.try-stage[data-pet-state="failed"] .signal {
  background: #ff5f57;
}

.try-stage[data-motion="off"] *,
.try-stage[data-motion="off"] *::before,
.try-stage[data-motion="off"] *::after {
  animation: none !important;
}

.try-controls {
  display: flex;
  flex-direction: column;
  min-height: 720px;
  padding: clamp(1.7rem, 3.5vw, 3rem);
  border: 1px solid var(--line);
  background: var(--panel);
}

.try-controls h2 {
  margin: 1.8rem 0 1rem;
  font-size: clamp(2.4rem, 3.5vw, 4rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 0.96;
}

.try-controls > p:not(.panel-index):not(.secure-note) {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.selected-pet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.selected-pet-row > div {
  min-width: 0;
}

.selected-pet-row span:not(.status-chip),
.selected-pet-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-pet-row span:not(.status-chip) {
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
}

.selected-pet-row strong {
  font-size: 0.92rem;
}

.control-group {
  margin: 1.6rem 0 0;
  padding: 0;
  border: 0;
}

.control-group legend {
  padding: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.state-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.state-button,
.size-button {
  min-height: 43px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.state-button:hover,
.state-button.is-active,
.size-button:hover,
.size-button.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.size-control-group {
  margin-top: 1rem;
}

.size-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.try-readout {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
  margin: 1.4rem 0 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.try-readout span {
  color: var(--muted);
}

.try-readout strong {
  max-width: 100%;
  line-height: 1.45;
}

.try-controls .button-block {
  margin-top: 1.8rem;
}

.webpet-utility-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.webpet-utility-row .text-link {
  font-size: 0.56rem;
}

.secure-note {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.54rem;
  letter-spacing: 0.05em;
  line-height: 1.45;
  text-transform: uppercase;
}

.webpet-boundary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 5rem;
  align-items: start;
  padding: 8rem 0;
  border-bottom: 1px solid var(--line);
}

.webpet-boundary h2 {
  max-width: 720px;
  margin: 0.8rem 0 0;
  font-size: clamp(2.8rem, 5vw, 5rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 0.98;
}

.boundary-list {
  border-top: 1px solid var(--line);
}

.boundary-list p {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 1rem;
  margin: 0;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.5;
}

.boundary-list span {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

@keyframes pet-working {
  0%,
  100% { transform: translateX(-3px) rotate(-1deg); }
  50% { transform: translateX(3px) rotate(1deg); }
}

@keyframes pet-success {
  0%,
  100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-24px) scale(1.04); }
}

@keyframes pet-waiting {
  0%,
  45%,
  100% { opacity: 1; }
  50%,
  80% { opacity: 0.48; }
}

@keyframes pet-failed {
  0%,
  100% { transform: rotate(0); }
  25% { transform: rotate(-2deg); }
  75% { transform: rotate(2deg); }
}

@keyframes pet-float {
  0%,
  100% {
    transform: translateY(0) rotate(-0.6deg);
  }
  50% {
    transform: translateY(-13px) rotate(0.7deg);
  }
}

@keyframes shadow-breathe {
  0%,
  100% {
    transform: scaleX(1);
    opacity: 0.55;
  }
  50% {
    transform: scaleX(0.78);
    opacity: 0.32;
  }
}

@keyframes signal-pop {
  0%,
  35%,
  100% {
    transform: translateY(0) scale(1);
  }
  40%,
  65% {
    transform: translateY(-4px) scale(1.06);
  }
}

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
  }

  .main-nav {
    display: flex;
    justify-self: center;
    gap: 1.1rem;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 6rem;
  }

  .hero-object {
    width: min(500px, 100%);
    min-height: 420px;
    margin: 1rem auto 0;
  }

  .chapter {
    grid-template-columns: 55px minmax(0, 1fr);
  }

  .chapter-action {
    grid-column: 2;
    align-items: flex-start;
    padding-top: 0;
  }

  .section-heading,
  .app-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    gap: 1.5rem;
  }

  .page-hero,
  .try-lab,
  .webpet-boundary {
    grid-template-columns: 1fr;
  }

  .page-hero {
    gap: 2rem;
  }

  .try-stage,
  .try-controls {
    min-height: 570px;
  }

  .webpet-boundary {
    gap: 3rem;
  }
}

@media (max-width: 680px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    grid-template-columns: 1fr auto;
    gap: 0.8rem;
    min-height: 0;
    padding: 0.8rem 0 0.7rem;
  }

  .brand span {
    display: initial;
  }

  .main-nav {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: space-between;
    justify-self: stretch;
    width: 100%;
    padding-top: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .hero {
    gap: 3rem;
    padding: 4.5rem 0 5rem;
  }

  .hero h1 {
    font-size: clamp(4.7rem, 21.5vw, 6.2rem);
  }

  .hero-actions,
  .hero-actions .button {
    width: 100%;
  }

  .hero-object {
    min-height: 350px;
  }

  .thesis,
  .app-shell,
  .desktop-lab,
  .home-manifesto,
  .project-model,
  .route-overview,
  .install-paths {
    padding: 6rem 0;
  }

  .manifesto-copy,
  .model-grid,
  .model-grid-two,
  .route-grid {
    grid-template-columns: 1fr;
  }

  .manifesto-copy {
    gap: 1.5rem;
    margin-top: 2.5rem;
  }

  .model-grid article,
  .route-card {
    min-height: 320px;
  }

  .page-hero {
    min-height: 390px;
    padding: 5rem 0 3.5rem;
  }

  .page-hero h1,
  .try-page-hero h1,
  .webpet-page-hero h1 {
    font-size: clamp(4rem, 19vw, 6rem);
  }

  .page-section.app-shell,
  .page-section.desktop-lab {
    padding: 6rem 0;
  }

  .next-route {
    align-items: flex-start;
    flex-direction: column;
    padding: 5rem 0;
  }

  .try-lab {
    padding: 4rem 0 6rem;
  }

  .try-stage,
  .try-controls {
    min-height: 500px;
  }

  .try-controls {
    min-height: auto;
  }

  .try-pet-field {
    inset-inline: 0.75rem;
  }

  .webpet-boundary {
    gap: 2.5rem;
    padding: 6rem 0;
  }

  .webpet-utility-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .chapter {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 2.7rem 0;
  }

  .chapter-action {
    grid-column: 1;
  }

  .wallet-panel,
  .pet-panel {
    min-height: 470px;
  }

  .pet-stats {
    grid-template-columns: 1fr;
  }

  .desktop-options {
    grid-template-columns: 1fr;
  }

  .desktop-option {
    min-height: 430px;
  }

  .download-row {
    grid-template-columns: 1fr;
  }

  .closing {
    padding: 8rem 0;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
  }

  .footer-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
