/* ==========================================================================
   Layout: shell + the three columns (left rail, center stage, right plates)
   ========================================================================== */

.shell {
  display: flex;
  width: 100vw;
  height: 100dvh;
  padding: var(--frame);
  gap: var(--frame);
  background-color: var(--backdrop);
  overflow: hidden;
}

/* --- Left rail ----------------------------------------------------------- */

.rail {
  position: relative;
  width: 280px;
  flex-shrink: 0;
  height: 100%;
  background-color: var(--rail);
  color: var(--rail-fg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  overflow: hidden;
}

.rail__art {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("../plates/yones_badge.jpg");
  background-size: cover;
  background-position: center bottom;
  filter: invert(1) hue-rotate(185deg) saturate(1.4) contrast(1.15);
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0.58) 38%, rgba(0, 0, 0, 1) 75%, rgba(0, 0, 0, 0.88) 100%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0.58) 38%, rgba(0, 0, 0, 1) 75%, rgba(0, 0, 0, 0.88) 100%);
}

.rail__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.rail__top {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rail__cta {
  width: 100%;
  height: 32px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--navy);
  border: none;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand__mark img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  color: #ffffff;
}

.rail__handle {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
}

.rail__handle-icon {
  width: 32px;
  height: 32px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rail__handle-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --- Center stage -------------------------------------------------------- */

.stage {
  flex: 1;
  min-width: 0;
  height: 100%;
  background-color: var(--stage);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  padding: 0 38px 28px;
  position: relative;
  overflow: hidden;
  transition: background-color 200ms ease, color 200ms ease;
}

/* Large blurred statue behind the content. */
.stage__angel {
  position: absolute;
  right: -2%;
  top: 2%;
  width: 68%;
  height: 92%;
  pointer-events: none;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.38;
  mix-blend-mode: screen;
  filter: blur(6px) contrast(112%) saturate(130%);
  -webkit-mask-image: radial-gradient(ellipse at 54% 46%, rgba(0, 0, 0, 1) 18%, rgba(0, 0, 0, 0.68) 54%, rgba(0, 0, 0, 0) 82%);
  mask-image: radial-gradient(ellipse at 54% 46%, rgba(0, 0, 0, 1) 18%, rgba(0, 0, 0, 0.68) 54%, rgba(0, 0, 0, 0) 82%);
}

html:not(.dark) .stage__angel {
  mix-blend-mode: multiply;
  opacity: 0.16;
  filter: blur(6px) contrast(115%) saturate(140%);
}

.stage__angel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
}

.strip {
  position: relative;
  z-index: 2;
  height: 50px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.strip__title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.strip__slash {
  opacity: 0.32;
}

.theme-toggle {
  background: transparent;
  border: none;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0.75;
}

/* One .stage-view is visible at a time (toggled by main.js). */
.stage-view {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.stage-view.active {
  display: flex;
  animation: stage-appear 200ms ease-out;
}

@keyframes stage-appear {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Right plate rail ---------------------------------------------------- */

.plate-rail {
  position: relative;
  width: 360px;
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #0c1f66 0%, var(--navy) 85%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.plate-rail::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(2, 6, 33, 0.62) 0%, rgba(2, 6, 33, 0) 24%, rgba(2, 6, 33, 0.14) 60%, rgba(2, 6, 33, 0.94) 100%),
    radial-gradient(circle at 50% 50%, transparent 55%, rgba(2, 6, 33, 0.52) 100%);
}

.plate-rail__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  transition: opacity 320ms ease, filter 360ms ease, transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
  filter: contrast(108%) brightness(0.96) saturate(110%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0.18) 92%, rgba(0, 0, 0, 0.04) 100%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0.18) 92%, rgba(0, 0, 0, 0.04) 100%);
}

/* Applied by main.js for the brief cross-fade when the plate changes. */
.plate-rail__art.is-swapping {
  opacity: 0.4;
}

.plate-rail__head,
.plate-rail__foot {
  position: relative;
  z-index: 20;
  padding: 20px;
}

.plate-rail__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(242, 245, 255, 0.78);
  margin-bottom: 10px;
}

.plate-rail__filter {
  background: rgba(2, 6, 33, 0.65);
  border: 1px solid rgba(242, 245, 255, 0.28);
  color: #f2f5ff;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  cursor: pointer;
  text-transform: uppercase;
}

.plate-rail__title {
  font-family: var(--font-display);
  font-size: 38px;
  line-height: 0.94;
  font-weight: 400;
  color: #ffffff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.75);
}

.plate-rail__medium {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(210, 225, 255, 0.78);
  margin-top: 6px;
}

.plate-rail__desc {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(242, 245, 255, 0.86);
  margin-bottom: 14px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
}

.plate-rail__thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

/* Magnifier that follows the cursor over the plate (positioned by main.js). */
.ink-loupe {
  position: absolute;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  border: 1px solid rgba(224, 236, 255, 0.75);
  box-shadow: 0 14px 36px rgba(0, 4, 18, 0.78), inset 0 0 18px rgba(82, 125, 255, 0.35);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 30;
  background-repeat: no-repeat;
}

.plate-rail:hover .ink-loupe {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.plate-thumb {
  position: relative;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
  cursor: pointer;
  background: var(--navy);
  transition: border-color 150ms ease;
}

.plate-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.52;
  transition: opacity 150ms ease, transform 220ms ease;
}

.plate-thumb:hover img,
.plate-thumb.active img {
  opacity: 1;
  transform: scale(1.06);
}

.plate-thumb.active {
  border-color: #ffffff;
}
