/* /app.html — phone stage + download. Hard-edge OLED, transform/opacity only. */

.app-hero-split {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
  margin-top: 36px;
  perspective: 1400px;
}

/* ---------- Device stage ---------- */
.app-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1600px;
  perspective-origin: 50% 42%;
  min-height: 100%;
  padding: 8px 0;
}

.app-device {
  --app-mx: 50%;
  --app-my: 18%;
  position: relative;
  width: 300px;
  padding: 14px 12px 12px;
  background: linear-gradient(168deg, #1a1a1a 0%, #0a0a0a 38%, #000 100%);
  border: 1px solid #2a2a2a;
  transform-style: preserve-3d;
  transform-origin: center center;
  will-change: transform;
  isolation: isolate;
}

.app-device-rail {
  position: absolute;
  width: 3px;
  background: #2c2c2c;
  pointer-events: none;
}

.app-device-rail--vol {
  left: -3px;
  top: 78px;
  height: 28px;
}

.app-device-rail--mute {
  left: -3px;
  top: 114px;
  height: 18px;
}

.app-device-rail--power {
  right: -3px;
  top: 96px;
  height: 44px;
}

.app-device-gloss {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(
    240px circle at var(--app-mx) var(--app-my),
    rgba(255, 255, 255, 0.07),
    transparent 58%
  );
  opacity: 0;
  transition: opacity var(--pc-t-2) var(--ease);
}

.app-device.is-lit .app-device-gloss {
  opacity: 1;
}

.app-device::after {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  pointer-events: none;
  z-index: 6;
  background: radial-gradient(
    180px circle at var(--app-mx) var(--app-my),
    rgba(14, 165, 233, 0.95),
    rgba(14, 165, 233, 0.28) 30%,
    transparent 60%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--pc-t-2) var(--ease);
}

.app-device.is-lit::after {
  opacity: 1;
}

.app-device-island {
  width: 78px;
  height: 8px;
  margin: 0 auto 12px;
  background: #000;
  border: 1px solid #222;
}

.app-device-screen {
  position: relative;
  overflow: visible;
  background: #000;
  border: 1px solid #1a1a1a;
  padding: 8px 8px 10px;
  transform-style: preserve-3d;
}

.app-device-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 8%;
  height: 1px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  animation: app-hud-scan 4.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.app-device-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 8px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.app-device-pips {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 8px;
}

.app-device-pips i {
  display: block;
  width: 2px;
  background: #555;
}

.app-device-pips i:nth-child(1) { height: 3px; }
.app-device-pips i:nth-child(2) { height: 5px; }
.app-device-pips i:nth-child(3) { height: 7px; background: var(--accent); }

.app-device-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-device-hud b {
  color: var(--accent);
  font-weight: 500;
}

.app-device-cores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
  transform-style: preserve-3d;
}

.app-core {
  overflow: hidden;
  background: #050505;
  border: 1px solid var(--border);
  transform: translateZ(16px);
  transition: border-color var(--pc-t-2) var(--ease);
}

.app-core img {
  display: block;
  width: 100%;
  height: 92px;
  object-fit: contain;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-device.is-lit .app-core img {
  transform: scale(1.045);
}

.app-core:hover {
  border-color: var(--accent);
}

.app-device-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  transform-style: preserve-3d;
}

.app-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  cursor: default;
  transform: translateZ(10px);
  transition:
    border-color var(--pc-t-2) var(--ease),
    background var(--pc-t-2) var(--ease),
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-cell:hover,
.app-cell.is-live {
  border-color: var(--accent);
  background: #071018;
}

.app-cell.is-live {
  transform: translateZ(22px) translateY(-3px);
}

.app-cell .app-ico {
  width: 34px;
  height: 34px;
  display: block;
  color: var(--accent);
  overflow: visible;
}

.app-cell span {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-align: center;
}

.app-cell.is-live span,
.app-cell:hover span {
  color: var(--accent);
}

.app-device-home {
  width: 92px;
  height: 4px;
  margin: 12px auto 2px;
  background: #2a2a2a;
}

body.pc-booted .app-cell {
  animation: app-cell-in 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.app-cell:nth-child(1) { animation-delay: 40ms; }
.app-cell:nth-child(2) { animation-delay: 90ms; }
.app-cell:nth-child(3) { animation-delay: 140ms; }
.app-cell:nth-child(4) { animation-delay: 190ms; }
.app-cell:nth-child(5) { animation-delay: 240ms; }
.app-cell:nth-child(6) { animation-delay: 290ms; }

@keyframes app-cell-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes app-hud-scan {
  0% { top: 6%; opacity: 0; }
  8% { opacity: 0.7; }
  88% { opacity: 0.55; }
  100% { top: 94%; opacity: 0; }
}

/* ---------- Icon motion ---------- */
.app-metro-swing,
.app-tuner-needle,
.app-tuner-tines,
.app-page-leaf {
  transform-box: view-box;
}

.app-metro-swing {
  transform-origin: 24px 40px;
  animation: app-metro-swing 1.15s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
}

.app-cell.is-live .app-metro-swing {
  animation-duration: 0.52s;
}

@keyframes app-metro-swing {
  from { transform: rotate(-20deg); }
  to { transform: rotate(20deg); }
}

.app-tuner-tines {
  transform-origin: 24px 30px;
}

.app-cell.is-live .app-tuner-tines,
.app-cell:hover .app-tuner-tines {
  animation: app-tuner-hum 0.11s linear infinite;
}

@keyframes app-tuner-hum {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(0.7px); }
}

.app-tuner-needle {
  transform-origin: 24px 36px;
  transform-box: view-box;
}

.app-cell.is-live .app-tuner-needle {
  animation: app-tuner-needle 1.2s cubic-bezier(0.16, 1, 0.3, 1) infinite alternate;
}

@keyframes app-tuner-needle {
  from { transform: rotate(-14deg); }
  to { transform: rotate(12deg); }
}

.app-pk-live {
  transform-origin: center bottom;
  transition: transform var(--pc-t-2) var(--ease), fill var(--pc-t-2) var(--ease);
}

.app-cell.is-live .app-pk-live,
.app-cell:hover .app-pk-live {
  transform: translateY(2px);
  fill: var(--accent);
}

.app-page-leaf {
  transform-origin: 24px 24px;
  transform-box: view-box;
}

.app-cell.is-live .app-page-leaf {
  animation: app-page-flip 1.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes app-page-flip {
  0%, 100% { transform: rotateY(0deg); }
  42% { transform: rotateY(-58deg); }
  58% { transform: rotateY(-58deg); }
}

.app-drum-hit {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform var(--pc-t-1) var(--ease), fill var(--pc-t-1) var(--ease);
}

.app-cell.is-live .app-drum-hit {
  fill: var(--accent);
  animation: app-drum-hit 0.7s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes app-drum-hit {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(0.86); }
}

.app-ear-ring {
  transform-origin: 16px 24px;
  transform-box: view-box;
}

.app-cell.is-live .app-ear-ring {
  animation: app-ear-ring 1.3s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes app-ear-ring {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* ---------- Download card ---------- */
.app-dl {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 36px 28px;
  overflow: hidden;
}

.app-dl-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  pointer-events: none;
}

body.pc-booted .app-dl-bar {
  width: 100%;
  transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-dl-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-live-pip {
  width: 6px;
  height: 6px;
  background: var(--accent);
  animation: app-live-pip 1.8s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes app-live-pip {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.app-dl h2 {
  margin: 0 0 8px;
  color: var(--text-1);
  font-size: 22px;
  font-weight: 600;
}

.app-dl p {
  margin: 0 0 22px;
  color: var(--text-3);
  font-size: 14px;
  line-height: 22px;
}

.app-dl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}

.app-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 148px;
}

.app-qr-frame {
  position: relative;
  width: 148px;
  height: 148px;
  padding: 10px;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
}

.app-qr-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-qr-c {
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--accent);
  border-style: solid;
  pointer-events: none;
  z-index: 2;
}

.app-qr-c--tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.app-qr-c--tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.app-qr-c--bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.app-qr-c--br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.app-qr-scan {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  height: 2px;
  background: var(--accent);
  opacity: 0.85;
  pointer-events: none;
  z-index: 3;
  animation: app-qr-scan 2.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes app-qr-scan {
  0% { top: 10px; opacity: 0; }
  12% { opacity: 0.9; }
  88% { opacity: 0.7; }
  100% { top: calc(100% - 12px); opacity: 0; }
}

.app-stores {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 168px;
}

.app-store-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  transition: border-color var(--pc-t-2) var(--ease), color var(--pc-t-2) var(--ease);
}

.app-store-btn small {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.app-store-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 36%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.14), transparent);
  transform: translateX(-120%);
  pointer-events: none;
}

.app-store-btn:hover {
  border-color: var(--accent);
  color: var(--text-1);
}

.app-store-btn:hover::after {
  animation: app-sheen 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes app-sheen {
  from { transform: translateX(-120%); }
  to { transform: translateX(380%); }
}

.app-same {
  margin: 18px 0 0;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
}

/* ---------- Feature / chips ---------- */
.app-feat {
  padding: 0;
  overflow: hidden;
}

.app-feat-art {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 148px;
  background: #000;
  border-bottom: 1px solid var(--border);
}

.app-feat-art img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-feat:hover .app-feat-art img {
  transform: scale(1.07);
}

.app-feat-copy {
  padding: 20px 24px 24px;
}

.app-feat h3 {
  margin: 0 0 8px;
  color: var(--text-1);
  font-size: 20px;
  font-weight: 600;
}

.app-feat p {
  margin: 0;
  color: var(--text-3);
  font-size: 14px;
  line-height: 22px;
}

.app-sec-head {
  max-width: 640px;
  margin: 0 0 32px;
}

.app-sec-head h2 {
  margin: 8px 0 8px;
  color: var(--text-1);
  font-size: 28px;
  font-weight: 600;
  line-height: 36px;
}

.app-sec-head p {
  margin: 0;
  color: var(--text-3);
}

.app-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.app-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  transition: border-color var(--pc-t-2) var(--ease), color var(--pc-t-2) var(--ease);
}

.app-chip img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-chip:hover {
  border-color: var(--accent);
  color: var(--text-1);
}

.app-chip:hover img {
  transform: scale(1.1);
}

.app-bottom {
  text-align: center;
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.app-bottom h2 {
  margin: 0 0 24px;
  color: var(--text-1);
  font-size: 24px;
  font-weight: 600;
}

@media (max-width: 960px) {
  .app-hero-split {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 24px;
  }

  .app-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (hover: none), (pointer: coarse) {
  .app-device {
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-device-scan,
  .app-qr-scan,
  .app-live-pip,
  .app-metro-swing,
  .app-tuner-tines,
  .app-tuner-needle,
  .app-page-leaf,
  .app-drum-hit,
  .app-ear-ring,
  .app-cell,
  .app-store-btn::after,
  .app-dl-bar {
    animation: none !important;
  }

  .app-cell {
    opacity: 1;
    transform: none;
  }

  .app-device.is-lit .app-core img,
  .app-feat:hover .app-feat-art img,
  .app-chip:hover img {
    transform: none;
  }
}
