/* U-02 REELS-RAIL — 9:16 EDIT-Kanal, Hochkant-Monitore auf horizontaler Schiene */

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

html, body {
  height: 100%;
  background: #040404;
  color: #b8b8b8;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
}

.stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 4vh, 40px) clamp(16px, 3vw, 32px) clamp(32px, 6vh, 64px);
}

/* —— Chrome —— */
.chrome-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(24px, 4vh, 48px);
  flex-shrink: 0;
}

.chrome-brand {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.42);
  text-transform: uppercase;
}

.chrome-channel {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(180, 255, 160, 0.72);
  text-shadow: 0 0 12px rgba(120, 255, 100, 0.18);
}

.rail-label {
  margin-bottom: clamp(12px, 2vh, 20px);
  flex-shrink: 0;
}

.rail-label h1 {
  font-size: clamp(14px, 1.8vw, 17px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.02em;
}

.rail-label p {
  margin-top: 4px;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.28);
  text-transform: uppercase;
}

/* —— Horizontal rail —— */
.rail-scroll {
  flex: 1;
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: visible;
  gap: clamp(20px, 3vw, 36px);
  padding: 12px 4px 28px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.rail-scroll::-webkit-scrollbar { height: 4px; }
.rail-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

/* —— Portrait monitor device —— */
.device {
  flex: 0 0 auto;
  scroll-snap-align: center;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  outline: none;
}

.device:focus-visible .device-bezel {
  box-shadow:
    0 2px 0 #2a2a2a inset,
    0 -1px 0 #080808 inset,
    0 24px 60px rgba(0, 0, 0, 0.75),
    0 0 0 2px rgba(180, 255, 160, 0.45);
}

.device.is-ghost {
  cursor: default;
  pointer-events: none;
}

.device-bezel {
  position: relative;
  padding: clamp(8px, 1.2vw, 12px) clamp(10px, 1.4vw, 14px) clamp(12px, 1.8vw, 18px);
  background: linear-gradient(165deg, #1e1e1e 0%, #111 45%, #0a0a0a 100%);
  border-radius: 5px 5px 3px 3px;
  box-shadow:
    0 2px 0 #2a2a2a inset,
    0 -1px 0 #080808 inset,
    0 20px 48px rgba(0, 0, 0, 0.7),
    0 6px 16px rgba(0, 0, 0, 0.45);
  transition: transform 600ms cubic-bezier(0.25, 0.85, 0.3, 1),
              box-shadow 600ms cubic-bezier(0.25, 0.85, 0.3, 1);
}

.device:not(.is-ghost):hover .device-bezel,
.device:not(.is-ghost).is-hover .device-bezel {
  transform: translateY(-6px);
  box-shadow:
    0 2px 0 #2a2a2a inset,
    0 -1px 0 #080808 inset,
    0 28px 64px rgba(0, 0, 0, 0.8),
    0 0 24px color-mix(in srgb, var(--accent, #888) 18%, transparent);
}

.device-brand {
  position: absolute;
  bottom: clamp(4px, 0.6vw, 7px);
  left: 50%;
  transform: translateX(-50%);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 7px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.12);
  text-transform: uppercase;
  pointer-events: none;
}

.device-stand {
  width: 38%;
  height: clamp(6px, 0.9vw, 10px);
  margin: 0 auto;
  background: linear-gradient(180deg, #141414, #0c0c0c);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
}

.device-base {
  width: 52%;
  height: 4px;
  margin: 0 auto;
  background: #0e0e0e;
  border-radius: 0 0 2px 2px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
}

.screen-wrap {
  position: relative;
  width: clamp(108px, 14vw, 156px);
  aspect-ratio: 9 / 16;
  background: #000;
  overflow: hidden;
  box-shadow:
    0 0 0 1px #000,
    0 0 32px rgba(0, 0, 0, 0.85) inset;
}

.screen-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 88% 82% at 50% 46%, transparent 52%, rgba(0, 0, 0, 0.32) 100%);
  pointer-events: none;
  z-index: 3;
}

.screen-poster,
.screen-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.screen-poster { z-index: 0; }

.screen-frame {
  z-index: 1;
  opacity: 0;
  transition: opacity 90ms steps(2);
}

.screen-frame.visible { opacity: 1; }

.screen-poster.ken-burns {
  animation: ken-burns 7s ease-in-out infinite alternate;
}

@keyframes ken-burns {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.08) translate(-1.5%, -1%); }
}

/* Ghost slot */
.device.is-ghost .device-bezel {
  opacity: 0.42;
}

.ghost-signal {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 2px,
      rgba(255, 255, 255, 0.03) 2px 3px
    ),
    #080808;
}

.ghost-signal span {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.18);
}

.device-caption {
  margin-top: 10px;
  max-width: clamp(108px, 14vw, 156px);
}

.device-caption .title {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.device-caption .meta {
  margin-top: 3px;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.24);
}

.device.is-ghost .device-caption .title {
  color: rgba(255, 255, 255, 0.28);
}

/* —— Detail overlay (§4b: Werk clean) —— */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 32px);
  background: rgba(2, 2, 2, 0.92);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 600ms cubic-bezier(0.25, 0.85, 0.3, 1),
              visibility 600ms;
}

.detail-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.detail-panel {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(200px, 280px);
  gap: clamp(20px, 4vw, 40px);
  align-items: start;
  max-width: min(920px, 100%);
  width: 100%;
  transform: translateY(12px);
  transition: transform 600ms cubic-bezier(0.25, 0.85, 0.3, 1);
}

.detail-overlay.is-open .detail-panel {
  transform: translateY(0);
}

.detail-medium {
  position: relative;
  width: min(42vw, 280px);
  aspect-ratio: 9 / 16;
  background: #000;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}

.detail-medium img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-meta {
  padding-top: 4px;
}

.detail-meta h2 {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.3;
  margin-bottom: 16px;
}

.meta-strip {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meta-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.28);
  text-transform: uppercase;
}

.meta-value {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.45;
}

.detail-close {
  position: fixed;
  top: clamp(16px, 3vh, 28px);
  right: clamp(16px, 3vw, 28px);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.32);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 101;
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms cubic-bezier(0.25, 0.85, 0.3, 1),
              color 120ms steps(2);
}

.detail-overlay.is-open + .detail-close,
.detail-close.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.detail-close:hover { color: rgba(255, 255, 255, 0.62); }

.hud-hint {
  position: fixed;
  bottom: clamp(16px, 3vh, 28px);
  left: clamp(16px, 3vw, 28px);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.18);
  line-height: 1.7;
  pointer-events: none;
}

@media (max-width: 640px) {
  .detail-panel {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .detail-medium {
    width: min(72vw, 280px);
  }

  .detail-meta {
    width: 100%;
    max-width: 320px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .device-bezel,
  .detail-overlay,
  .detail-panel,
  .detail-close { transition: none; }

  .screen-poster.ken-burns { animation: none; }
}
