/* U-05 MOBILE — Phone-Frame Preview, cleanes Chrome, CRT nur als Ereignis */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #050505;
  --chrome: #c8c4bc;
  --muted: rgba(200, 196, 188, 0.38);
  --bezel: #121212;
  --bezel-hi: #1c1c1c;
  --screen: #080808;
  --accent: #c8c4bc;
  --ease-move: cubic-bezier(0.25, 0.85, 0.3, 1);
  --phone-w: 390px;
  --phone-h: 844px;
  --radius: 44px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--chrome);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body {
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, #0c0c0c 0%, var(--bg) 72%),
    var(--bg);
}

.lab-chrome {
  position: fixed;
  top: 18px;
  left: 22px;
  right: 22px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  z-index: 10;
  pointer-events: none;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.lab-mark {
  color: var(--chrome);
  letter-spacing: 0.18em;
  font-weight: 500;
}

.stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 16px 48px;
}

/* —— Physical phone on the dark stage —— */
.phone {
  width: var(--phone-w);
  height: var(--phone-h);
  max-height: calc(100dvh - 110px);
  aspect-ratio: 390 / 844;
  flex-shrink: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.phone-bezel {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 12px;
  background:
    linear-gradient(160deg, var(--bezel-hi) 0%, var(--bezel) 40%, #0a0a0a 100%);
  border-radius: var(--radius);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 -1px 0 rgba(0, 0, 0, 0.55) inset,
    0 28px 80px rgba(0, 0, 0, 0.72),
    0 8px 24px rgba(0, 0, 0, 0.45);
}

.phone-notch {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 26px;
  background: #050505;
  border-radius: 20px;
  z-index: 6;
  pointer-events: none;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius) - 8px);
  overflow: hidden;
  background: var(--screen);
  isolation: isolate;
}

.phone-home {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 108px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.22);
  z-index: 6;
  pointer-events: none;
}

/* —— Channel switch (clean chrome) —— */
.channel-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 48px 16px 0;
  background: linear-gradient(180deg, rgba(8, 8, 8, 0.92) 0%, rgba(8, 8, 8, 0.55) 70%, transparent 100%);
  pointer-events: none;
}

.channel-btn {
  pointer-events: auto;
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(200, 196, 188, 0.32);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 10px 0 14px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color 70ms steps(2, end), border-color 70ms steps(2, end);
}

.channel-btn:active {
  transform: scale(0.98);
}

.channel-btn.is-active {
  color: var(--chrome);
  border-bottom-color: rgba(200, 196, 188, 0.55);
}

.channel-btn:focus-visible {
  outline: 1px solid rgba(200, 196, 188, 0.55);
  outline-offset: 2px;
}

/* —— Zap viewport —— */
.viewport {
  position: absolute;
  inset: 0;
  cursor: grab;
}

.viewport.is-dragging {
  cursor: grabbing;
}

.cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
  transform-origin: center center;
  will-change: transform, opacity;
}

.glitch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  mix-blend-mode: screen;
}

.glitch.is-active {
  opacity: 1;
}

.osd {
  position: absolute;
  top: 96px;
  right: 18px;
  z-index: 4;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: rgba(230, 230, 230, 0.9);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 70ms steps(2, end);
}

.osd.is-visible {
  opacity: 1;
}

.work-chrome {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 48px 20px 36px;
  background: linear-gradient(0deg, rgba(8, 8, 8, 0.88) 0%, rgba(8, 8, 8, 0.35) 55%, transparent 100%);
  pointer-events: none;
}

.work-ch {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(200, 196, 188, 0.45);
}

.work-title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--chrome);
  line-height: 1.2;
}

.gesture-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 78px;
  z-index: 3;
  text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(200, 196, 188, 0.28);
  pointer-events: none;
  transition: opacity 180ms steps(2, end);
}

.gesture-hint.is-gone {
  opacity: 0;
}

/* —— Open state: clean medium (§4b) —— */
.open-layer {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  background: #060606;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 650ms var(--ease-move),
    transform 650ms var(--ease-move),
    visibility 0s linear 650ms;
}

.open-layer.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    opacity 650ms var(--ease-move),
    transform 650ms var(--ease-move),
    visibility 0s linear 0s;
}

.open-layer.is-closing {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 500ms var(--ease-move),
    transform 500ms var(--ease-move),
    visibility 0s linear 500ms;
}

.open-media {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 14px 8px;
}

.open-cover {
  width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: 2px;
  background: #111;
}

.open-meta {
  flex: 0 0 auto;
  padding: 16px 20px 40px;
}

.open-title {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: var(--chrome);
  margin-bottom: 8px;
}

.open-strip {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.open-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--chrome);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 0;
  cursor: pointer;
  border-bottom: 1px solid rgba(200, 196, 188, 0.35);
}

.open-close:active {
  transform: scale(0.98);
}

.open-close:focus-visible {
  outline: 1px solid rgba(200, 196, 188, 0.55);
  outline-offset: 3px;
}

.stage-hint {
  position: fixed;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  pointer-events: none;
  z-index: 10;
}

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

/* Scale phone down on short viewports */
@media (max-height: 900px) {
  .phone {
    height: calc(100dvh - 110px);
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .channel-btn,
  .osd,
  .gesture-hint,
  .open-layer,
  .open-layer.is-open,
  .open-layer.is-closing,
  .cover {
    transition: none !important;
    animation: none !important;
  }

  .open-layer {
    transform: none;
  }

  .open-layer.is-open,
  .open-layer.is-closing {
    transform: none;
  }
}
