:root {
  color-scheme: light;
  font-family: "Inter", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: #f2f2ec;
  color: #151815;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg,
      rgba(248, 244, 232, 0.9) 0%,
      rgba(248, 244, 232, 0.7) 30%,
      rgba(248, 244, 232, 0.22) 56%,
      rgba(248, 244, 232, 0.04) 100%),
    linear-gradient(180deg,
      rgba(255, 250, 239, 0.14) 0%,
      rgba(255, 250, 239, 0.02) 54%,
      rgba(118, 74, 32, 0.14) 100%),
    url("/images/desktop2.png");
  background-size: cover;
  background-position: center center;
  -webkit-font-smoothing: antialiased;
}

.experience-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  padding:
    max(18px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  display: grid;
}

.site-footer {
  position: absolute;
  left: max(20px, env(safe-area-inset-left));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: rgba(32, 29, 24, 0.62);
  font-size: 12px;
  letter-spacing: 0;
}

.device-stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(500px, 1.18fr);
  gap: clamp(18px, 4vw, 58px);
  align-items: center;
}

.device-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: clamp(12px, 2vh, 24px);
  text-shadow: 0 1px 16px rgba(255, 250, 239, 0.62);
}

.eyebrow {
  margin: 0;
  color: #4d4f46;
  font-size: clamp(13px, 1.3vw, 15px);
  letter-spacing: 0;
}

h1 {
  max-width: 9.8em;
  margin: 0;
  font-size: clamp(38px, 5.4vw, 76px);
  line-height: 1.02;
  letter-spacing: 0;
}

.lead {
  max-width: 28em;
  margin: 0;
  color: #282c26;
  font-size: clamp(16px, 1.45vw, 22px);
  line-height: 1.72;
}

.flow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 34em;
}

.flow-row span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(31, 42, 31, 0.2);
  background: rgba(255, 250, 239, 0.54);
  color: #212720;
  font-size: clamp(12px, 1vw, 14px);
  font-weight: 700;
  backdrop-filter: blur(3px);
}

.mode-switch {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  width: min(100%, 460px);
  padding: 4px;
  border: 1px solid rgba(31, 42, 31, 0.22);
  background: rgba(255, 250, 239, 0.58);
  backdrop-filter: blur(3px);
}

.mode-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #273027;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
}

.mode-button small {
  color: rgba(39, 48, 39, 0.7);
  font-size: 11px;
  font-weight: 700;
}

.mode-button.is-selected {
  background: #1f2a1f;
  color: #f9f4e8;
}

.mode-button.is-selected small {
  color: rgba(249, 244, 232, 0.78);
}

.assistant-tip {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  border-bottom: 1px dotted currentColor;
  cursor: help;
}

.assistant-tip-card {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  z-index: 20;
  width: min(300px, calc(100vw - 48px));
  padding: 10px 12px;
  border: 1px solid rgba(31, 42, 31, 0.22);
  background: rgba(255, 250, 239, 0.96);
  box-shadow: 0 14px 30px rgba(25, 23, 18, 0.18);
  color: #1f2a1f;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
  text-align: left;
  text-shadow: none;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.assistant-tip:hover .assistant-tip-card,
.assistant-tip:focus-visible .assistant-tip-card,
.mode-button:focus-visible .assistant-tip-card {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mode-button:focus-visible {
  outline: 2px solid #ff6b2c;
  outline-offset: 2px;
}

.mode-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.mode-note {
  max-width: 36em;
  min-height: 3.3em;
  margin: -8px 0 0;
  color: #2e342d;
  font-size: clamp(13px, 1.05vw, 15px);
  line-height: 1.45;
}

.copy-agent-prompt {
  width: fit-content;
  min-height: 30px;
  margin-top: -14px;
  padding: 0 11px;
  border: 1px solid rgba(31, 42, 31, 0.24);
  background: rgba(255, 250, 239, 0.76);
  color: #1f2a1f;
  font: inherit;
  font-size: clamp(12px, 0.95vw, 13px);
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(3px);
}

.copy-agent-prompt[data-copied="true"] {
  border-color: rgba(31, 86, 42, 0.34);
  background: rgba(232, 247, 224, 0.84);
}

.copy-agent-prompt:focus-visible {
  outline: 2px solid #ff6b2c;
  outline-offset: 2px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  max-width: 36em;
  margin-top: -4px;
}

.setup-link {
  width: fit-content;
  color: #1f2a1f;
  font-size: clamp(13px, 1vw, 14px);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.setup-link:focus-visible {
  outline: 2px solid #ff6b2c;
  outline-offset: 3px;
}

.device-wrap {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: min(36vw, 560px);
  aspect-ratio: 4 / 3;
  justify-self: start;
  transform: translate(-2vw, 13vh);
  transition: max-width 180ms ease, transform 180ms ease;
}

.device-wrap[data-screen-mode]:not([data-screen-mode="power_off"]) {
  max-width: min(36vw, 560px);
  transform: translate(0, 11vh);
}

.device-wrap::before,
.device-wrap::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.device-wrap::before {
  left: 17%;
  bottom: 19%;
  width: 62%;
  height: 15%;
  background: radial-gradient(ellipse at center,
    rgba(59, 39, 17, 0.16) 0%,
    rgba(59, 39, 17, 0.09) 43%,
    rgba(59, 39, 17, 0) 76%);
  filter: blur(9px);
  transform: translate(-19%, 22%) skewX(-18deg) rotate(-3deg);
}

.device-wrap::after {
  left: 27%;
  bottom: 18%;
  width: 50%;
  height: 8%;
  background: radial-gradient(ellipse at center,
    rgba(36, 25, 13, 0.18) 0%,
    rgba(36, 25, 13, 0.1) 46%,
    rgba(36, 25, 13, 0) 78%);
  filter: blur(5px);
  transform: translate(-8%, 18%) skewX(-12deg) rotate(-2deg);
}

.device-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.device-canvas:active {
  cursor: grabbing;
}

.button-tooltip {
  position: absolute;
  z-index: 3;
  max-width: 260px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 42, 31, 0.18);
  background: rgba(251, 248, 241, 0.92);
  box-shadow: 0 14px 34px rgba(31, 42, 31, 0.13);
  color: #1f2a1f;
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 12px));
  transition: opacity 120ms ease;
}

.button-tooltip[data-visible="true"] {
  opacity: 1;
}

.button-tooltip strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.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: 980px) {
  .experience-shell {
    padding: 18px;
  }

  .device-stage {
    grid-template-columns: 1fr;
    gap: 12px;
    align-content: start;
  }

  .device-copy {
    gap: 10px;
  }

  h1 {
    max-width: none;
    font-size: clamp(32px, 8vw, 52px);
  }

  .lead {
    max-width: 48em;
    font-size: clamp(14px, 3vw, 17px);
    line-height: 1.5;
  }

  .flow-row {
    gap: 6px;
  }

  .flow-row span {
    min-height: 28px;
    padding: 0 8px;
  }

  .mode-switch {
    width: min(100%, 430px);
  }

  .mode-note {
    margin-top: -4px;
    max-width: 44em;
    font-size: 13px;
  }

  .setup-link {
    font-size: 13px;
  }

  .device-wrap {
    max-width: min(52vw, 500px);
    justify-self: center;
    transform: translateY(2vh);
  }

  .device-wrap[data-screen-mode]:not([data-screen-mode="power_off"]) {
    max-width: min(52vw, 500px);
    transform: translateY(0);
  }
}

@media (max-height: 680px) and (min-width: 981px) {
  .experience-shell {
    padding: 18px 30px;
  }

  .device-stage {
    gap: 28px;
  }

  h1 {
    font-size: clamp(36px, 5.4vw, 68px);
  }

  .lead {
    font-size: 16px;
    line-height: 1.48;
  }

  .device-wrap {
    max-width: min(34vw, 520px);
    transform: translate(5vw, 10vh);
  }

  .device-wrap[data-screen-mode]:not([data-screen-mode="power_off"]) {
    max-width: min(34vw, 520px);
    transform: translate(5vw, 10vh);
  }
}

@media (max-width: 560px) {
  body {
    overflow: hidden;
    background-position: 58% center;
  }

  .experience-shell {
    height: 100vh;
    padding: 12px;
  }

  .device-stage {
    align-content: center;
    gap: 10px;
  }

  .device-copy {
    gap: 8px;
  }

  .eyebrow {
    font-size: 12px;
  }

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

  .lead {
    font-size: 13px;
    line-height: 1.42;
  }

  .flow-row {
    gap: 5px;
  }

  .flow-row span {
    min-height: 24px;
    padding: 0 7px;
    font-size: 11px;
  }

  .mode-switch {
    width: min(100%, 342px);
  }

  .mode-button {
    min-height: 38px;
    font-size: 12px;
  }

  .mode-button small {
    font-size: 10px;
  }

  .mode-note {
    display: none;
  }

  .copy-agent-prompt {
    min-height: 28px;
    margin-top: -4px;
    font-size: 12px;
  }

  .cta-row {
    gap: 5px 10px;
  }

  .setup-link {
    font-size: 12px;
  }

  .device-wrap {
    max-width: min(96vw, 390px);
    transform: translateY(1vh);
  }

  .device-wrap[data-screen-mode]:not([data-screen-mode="power_off"]) {
    max-width: min(98vw, 430px);
    transform: translateY(0);
  }

  .site-footer {
    left: 12px;
    bottom: 8px;
    font-size: 11px;
  }
}
