/* Paper detail slides 05 / 06 */
body { overflow: hidden; }

.stage {
  height: 100dvh;
  overflow: hidden;
}

.stage__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 75% 55% at 88% 12%, rgba(212, 137, 74, 0.15), transparent 55%),
    radial-gradient(ellipse 50% 45% at 8% 78%, rgba(90, 110, 130, 0.12), transparent 50%),
    linear-gradient(155deg, #121417 0%, #0a0b0d 48%, #0d0f12 100%);
}

.frame {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  padding: clamp(1.15rem, 2.8vw, 2rem) clamp(1.25rem, 4vw, 3.25rem);
}

.board {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  gap: clamp(0.85rem, 2vh, 1.35rem);
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.85s var(--ease) 0.2s forwards;
}

.identity { flex-shrink: 0; max-width: min(72rem, 100%); }

.identity .name {
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  font-size: clamp(1.45rem, 3.2vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.identity__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
  pointer-events: auto;
}

.identity__row .name {
  margin: 0;
}

.out-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  pointer-events: auto;
}

.out-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.7rem;
  border: 1px solid rgba(236, 233, 227, 0.14);
  border-radius: 999px;
  background: rgba(236, 233, 227, 0.04);
  color: var(--muted);
  text-decoration: none;
  font-family: "Outfit", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.out-link:hover {
  color: var(--ink);
  border-color: rgba(212, 137, 74, 0.55);
  background: rgba(212, 137, 74, 0.1);
}

.out-link__ico {
  width: 0.85rem;
  height: 0.85rem;
  display: block;
  flex-shrink: 0;
}

.accent {
  width: 0;
  height: 2px;
  margin: 0.7rem 0 0.55rem;
  background: linear-gradient(90deg, var(--copper), transparent);
  animation: draw 1s var(--ease) 0.55s forwards;
}

.lede {
  color: var(--muted);
  font-size: clamp(0.92rem, 1.45vw, 1.05rem);
  max-width: none;
  white-space: nowrap;
}

/* horizontal flow: 4 or 6 cells */
.flow {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(0.4rem, 1.1vh, 0.7rem);
}

.flow__row {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: stretch;
  gap: clamp(0.3rem, 0.9vw, 0.55rem);
}

.flow--4 .flow__row { flex: 1; }
.flow--6 .flow__row { flex: 1 1 0; }

.cell {
  flex: 1 1 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.35rem;
  min-width: 0;
  min-height: 0;
  padding: clamp(0.65rem, 1.25vw, 0.95rem);
  background: linear-gradient(165deg, rgba(236, 233, 227, 0.05), rgba(236, 233, 227, 0.012));
  border-left: 2px solid rgba(212, 137, 74, 0.35);
  opacity: 0;
  transform: translateY(8px);
  animation: rise 0.65s var(--ease) forwards;
}

.cell:nth-child(1) { animation-delay: 0.28s; }
.cell:nth-child(3) { animation-delay: 0.36s; }
.cell:nth-child(5) { animation-delay: 0.44s; }
.cell:nth-child(7) { animation-delay: 0.52s; }
.flow__row:last-child .cell:nth-child(1) { animation-delay: 0.52s; }
.flow__row:last-child .cell:nth-child(3) { animation-delay: 0.6s; }
.flow__row:last-child .cell:nth-child(5) { animation-delay: 0.68s; }

.cell--focus {
  border-left-color: var(--copper);
  background: linear-gradient(165deg, rgba(212, 137, 74, 0.11), rgba(236, 233, 227, 0.02));
}

.cell__n {
  font-family: "Outfit", sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(212, 137, 74, 0.88);
}

.cell__t {
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  font-size: clamp(0.9rem, 1.3vw, 1.1rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.cell__viz {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  min-height: 0;
}

.cell__note {
  font-size: clamp(0.84rem, 1.15vw, 0.96rem);
  line-height: 1.42;
  color: var(--muted);
}

.flow__arrow {
  flex: 0 0 auto;
  align-self: center;
  width: 0.9rem;
  height: 1px;
  background: rgba(212, 137, 74, 0.5);
  position: relative;
  opacity: 0;
  animation: rise 0.5s var(--ease) 0.42s forwards;
}

.flow__arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid rgba(212, 137, 74, 0.75);
  border-top: 1.5px solid rgba(212, 137, 74, 0.75);
  transform: translateY(-50%) rotate(45deg);
}

.tag {
  font-family: "Outfit", sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a1410;
  background: var(--copper-soft);
  padding: 0.12rem 0.35rem;
  width: fit-content;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.stack__label {
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.byte-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.14rem;
}

.byte-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.byte-row--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.byte-row--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.byte-row span,
.score-row span {
  font-family: "Outfit", sans-serif;
  font-size: clamp(0.56rem, 0.9vw, 0.68rem);
  font-weight: 600;
  text-align: center;
  padding: 0.2rem 0.04rem;
  color: var(--ink);
  background: rgba(236, 233, 227, 0.06);
  border: 1px solid rgba(236, 233, 227, 0.12);
}

.log-line {
  font-size: clamp(0.62rem, 0.95vw, 0.72rem);
  line-height: 1.35;
  color: rgba(236, 233, 227, 0.72);
  padding: 0.25rem 0.35rem;
  border: 1px solid rgba(236, 233, 227, 0.1);
  background: rgba(236, 233, 227, 0.03);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mlm-mini {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.4rem;
  border: 1px solid rgba(212, 137, 74, 0.35);
  background: rgba(212, 137, 74, 0.07);
}

.cell__viz > .mlm-mini + .mlm-mini {
  margin-top: 0.2rem;
}

.mlm-mini__mid {
  text-align: center;
  font-family: "Outfit", sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper);
}

.score-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.14rem;
}

.score-row--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.score-row--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.unit-score {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.unit-score .stack__label {
  margin-top: 0.1rem;
}

.unit-score .stack__label:first-child {
  margin-top: 0;
}

.pair {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.35rem 0.4rem 0.4rem;
  border: 1px solid rgba(236, 233, 227, 0.12);
  background: rgba(236, 233, 227, 0.03);
}

.pair--hot {
  border-color: rgba(196, 120, 106, 0.45);
  background: rgba(196, 120, 106, 0.08);
}

.pair__tag {
  align-self: flex-start;
  font-family: "Outfit", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--copper);
  line-height: 1;
}

.pair--hot .pair__tag {
  color: #e8a090;
}

.unit-score__row {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr) auto auto;
  gap: 0.3rem;
  align-items: center;
  padding: 0;
  border: none;
  background: transparent;
}

.unit-score__row .byte-row {
  min-width: 0;
}

.unit-score__row--hot {
  border: none;
  background: transparent;
}

.unit-score__kind {
  font-family: "Outfit", sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.unit-score__arrow {
  font-family: "Outfit", sans-serif;
  font-size: 0.8rem;
  color: var(--copper);
}

.unit-score__num {
  font-family: "Outfit", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  min-width: 2.2rem;
  text-align: right;
}

.unit-score__num--hot {
  color: #e8a090;
}

.score-row span {
  font-size: clamp(0.52rem, 0.85vw, 0.62rem);
  padding: 0.15rem 0.02rem;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.score-row .hi {
  color: #1a1410;
  background: #c4786a;
  border-color: #c4786a;
}

.score-row .mid {
  color: #1a1410;
  background: rgba(212, 137, 74, 0.55);
  border-color: rgba(212, 137, 74, 0.55);
}

.score-row .lo {
  color: var(--muted);
  background: rgba(236, 233, 227, 0.05);
  border: 1px solid rgba(236, 233, 227, 0.1);
}

.cell__viz--scatter {
  justify-content: stretch;
}

.qmap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.35rem;
  width: 100%;
  height: 100%;
  min-height: 7rem;
}

.qmap__cell {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(236, 233, 227, 0.14);
  background: rgba(236, 233, 227, 0.03);
  min-height: 0;
  overflow: hidden;
}

.qmap__cell--hot {
  border-color: rgba(196, 120, 106, 0.4);
  background: rgba(196, 120, 106, 0.07);
}

.qmap__h {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.45rem;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.qmap__h strong {
  font-family: "Outfit", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--copper);
}

.qmap__dots {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.dot {
  position: absolute;
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.9;
}

.dot--lo {
  background: rgba(236, 233, 227, 0.7);
}

.dot--mid {
  background: rgba(212, 137, 74, 0.55);
  width: 0.4rem;
  height: 0.4rem;
  opacity: 0.65;
}

.dot--hi {
  background: #c4786a;
}

.temp {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.temp__rail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
}

.temp__box {
  padding: 0.3rem 0.35rem;
  border: 1px solid rgba(236, 233, 227, 0.12);
  background: rgba(236, 233, 227, 0.03);
}

.temp__box strong {
  display: block;
  font-family: "Outfit", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--copper);
  margin-bottom: 0.28rem;
}

.temp__box p {
  font-size: 0.86rem;
  line-height: 1.4;
  color: rgba(236, 233, 227, 0.82);
  white-space: nowrap;
}

.temp__cands {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  margin: 0.4rem 0 0;
  padding: 0.4rem 0 0;
  border-top: 1px solid rgba(236, 233, 227, 0.1);
}

.temp__cand {
  display: grid;
  grid-template-columns: 1.7rem 1fr 2.4rem;
  align-items: center;
  gap: 0.35rem;
  font-family: "Outfit", sans-serif;
  font-size: 0.78rem;
}

.temp__cand span {
  font-weight: 600;
  color: rgba(236, 233, 227, 0.78);
}

.temp__cand i {
  display: block;
  height: 0.32rem;
  width: var(--w, 40%);
  border-radius: 999px;
  background: rgba(236, 233, 227, 0.2);
}

.temp__cand em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--muted);
}

.temp__cand--pick span,
.temp__cand--pick em {
  color: var(--copper);
}

.temp__cand--pick i {
  background: rgba(212, 137, 74, 0.85);
}

.pill {
  width: fit-content;
  font-family: "Outfit", sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a1410;
  background: var(--copper-soft);
  padding: 0.18rem 0.42rem;
}

.mask {
  color: #1a1410 !important;
  background: var(--copper) !important;
  border-color: var(--copper) !important;
}

.ok {
  color: #1a1410 !important;
  background: rgba(212, 137, 74, 0.85) !important;
  border-color: rgba(212, 137, 74, 0.85) !important;
}

.bad {
  color: #1a1410 !important;
  background: #c4786a !important;
  border-color: #c4786a !important;
}

.mut {
  color: #1a1410 !important;
  background: #c4925a !important;
  border-color: #c4925a !important;
}

@keyframes draw { to { width: 6.5rem; } }

/* Unlock fixed viewport when width or height is tight */
@media (max-width: 1200px), (max-height: 860px) {
  body { overflow: auto; }
  .stage {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  .frame {
    height: auto;
    min-height: 100dvh;
  }
  .board {
    height: auto;
  }
  .flow,
  .flow__row,
  .cell {
    flex: none;
    min-height: auto;
  }
  .lede { white-space: normal; }
  .log-line { white-space: normal; }
}

/* Tablet / phone: stack the flow */
@media (max-width: 1200px) {
  .frame {
    padding: 1.1rem 1.15rem 1.4rem;
  }

  .board {
    gap: 1.1rem;
  }

  .flow {
    gap: 0.85rem;
  }

  .flow__row {
    flex-direction: column;
    gap: 0.55rem;
  }

  .flow__arrow {
    width: 1px;
    height: 0.85rem;
    align-self: flex-start;
    margin-left: 0.85rem;
  }

  .flow__arrow::after {
    right: auto;
    left: 50%;
    top: auto;
    bottom: -1px;
    border: none;
    border-right: 1.5px solid rgba(212, 137, 74, 0.75);
    border-bottom: 1.5px solid rgba(212, 137, 74, 0.75);
    transform: translateX(-50%) rotate(45deg);
  }

  .cell {
    gap: 0.45rem;
    padding: 0.9rem 0.95rem;
  }

  .cell__t {
    font-size: clamp(1rem, 3.2vw, 1.2rem);
  }

  .cell__viz {
    min-height: 8.5rem;
    justify-content: flex-start;
  }

  .cell__viz--scatter {
    min-height: 14rem;
  }

  .cell__note {
    font-size: 0.95rem;
  }

  .qmap {
    min-height: 13rem;
  }

  .qmap__cell {
    padding: 0.65rem 0.7rem;
    overflow: visible;
  }

  .qmap__dots {
    inset: 1.8rem 0.4rem 0.4rem;
  }

  .byte-row span,
  .score-row span {
    font-size: 0.68rem;
    padding: 0.28rem 0.08rem;
  }

  .pair__tag {
    font-size: 0.78rem;
  }

  .unit-score__num {
    font-size: 1rem;
  }
}

/* Short landscape desktops / tablets that stay wide */
@media (max-height: 860px) and (min-width: 1201px) {
  .flow {
    gap: 0.75rem;
  }

  .flow__row {
    min-height: 17rem;
  }

  .cell {
    min-height: 16rem;
  }

  .cell__viz {
    min-height: 8rem;
  }

  .qmap {
    min-height: 11rem;
  }
}

/* Phones */
@media (max-width: 640px) {
  .frame {
    padding: 0.9rem 0.85rem 1.2rem;
  }

  site-nav {
    margin-bottom: 0.85rem;
  }

  .identity .name {
    font-size: clamp(1.25rem, 6.5vw, 1.55rem);
  }

  .lede {
    font-size: 0.92rem;
  }

  .cell__viz {
    min-height: 7.5rem;
  }

  .cell__viz--scatter {
    min-height: 16rem;
  }

  .qmap {
    min-height: 15rem;
    gap: 0.3rem;
  }

  .qmap__h {
    font-size: 0.78rem;
    gap: 0.2rem 0.35rem;
  }

  .qmap__h strong {
    font-size: 0.86rem;
  }

  .unit-score__row {
    grid-template-columns: 1rem minmax(0, 1fr) auto;
  }

  .unit-score__arrow {
    display: none;
  }

  .unit-score__num {
    font-size: 0.95rem;
  }

  .temp__rail {
    grid-template-columns: 1fr;
  }

  .temp__box p {
    white-space: normal;
  }

  .footer {
    flex-wrap: wrap;
    gap: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .board, .cell, .flow__arrow, .accent {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .accent { width: 6.5rem; }
}

.fill-steps {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.4rem;
  border: 1px solid rgba(212, 137, 74, 0.35);
  background: rgba(212, 137, 74, 0.07);
}
.fill-steps__mid {
  text-align: center;
  font-family: Outfit, sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper);
}
