/* RBGA kiosk: an unlinked attract screen for stall laptops.
   Full-bleed slides crossfade and their elements stagger in one by
   one; a website QR stays pinned top right. */

:root {
  --felt: #12433d; /* deep teal table, matching the poster ground */
  --felt-deep: #0a2b27;
  --card: #fbf8e6; /* poster cream */
  --paper: #f0efa9;
  --ink: #143b36;
  --ink-muted: #3f6b62;
  --brand: #e8862b; /* poster orange */
  --brand-bright: #b8451f;
  --accent: #1e6f66; /* teal */
  --font-display: "KN Yuanmo", "Arial Black", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Shared with the main site; see styles.css for the subsetting note. */
@font-face {
  font-family: "KN Yuanmo";
  src: url("media/fonts/knyuanmo-latin.woff2") format("woff2"),
    url("media/fonts/knyuanmo-latin.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: "Montserrat", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% 30%, var(--felt) 0%, var(--felt-deep) 100%);
  display: flex;
  flex-direction: column;
  cursor: default;
}

body.hide-cursor {
  cursor: none;
}

/* Subtle felt grain over the whole table */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Slide progress hairline */
.timer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 30;
  background: rgba(255, 255, 255, 0.08);
}

.timer-fill {
  height: 100%;
  width: 0%;
  background: var(--brand-bright);
}

.timer-fill.is-running {
  animation: timer-run linear forwards;
}

@keyframes timer-run {
  from { width: 0%; }
  to { width: 100%; }
}

/* ---------- The table and its cards ---------- */

.table {
  position: relative;
  flex: 1;
  min-height: 0;
}

.card {
  position: absolute;
  inset: 0;
  background: var(--card);
  overflow: hidden;
  visibility: hidden;
}

/* Card states: the new card fades in over the old one, which holds
   still underneath until the crossfade finishes */
.card.is-active {
  visibility: visible;
  z-index: 2;
}

.card.is-entering {
  animation: card-fade 0.75s ease both;
}

.card.is-leaving {
  visibility: visible;
  z-index: 1;
  animation: card-hold 0.75s linear both;
}

@keyframes card-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes card-hold {
  from { opacity: 1; }
  to { opacity: 1; }
}

/* Once the card is up, its elements rise in one after another.
   Longhand properties on purpose: the animation shorthand would reset
   the per-element animation-delay set below. */
.card.is-active .card-inner > :not(.photo-img):not(.session-row):not(.whats-on-list):not(.join-row),
.card.is-active .session-row > .session,
.card.is-active .whats-on-list > .whats-on-card,
.card.is-active .join-row > .join-qr {
  animation-name: rise-in;
  animation-duration: 0.7s;
  animation-timing-function: var(--ease-out);
  animation-fill-mode: both;
}

.card.is-active .card-inner > :nth-child(1) { animation-delay: 0.25s; }
.card.is-active .card-inner > :nth-child(2) { animation-delay: 0.4s; }
.card.is-active .card-inner > :nth-child(3) { animation-delay: 0.55s; }

.card.is-active .session-row > :nth-child(1),
.card.is-active .whats-on-list > :nth-child(1),
.card.is-active .join-row > :nth-child(1) { animation-delay: 0.55s; }
.card.is-active .session-row > :nth-child(2),
.card.is-active .whats-on-list > :nth-child(2),
.card.is-active .join-row > :nth-child(2) { animation-delay: 0.7s; }
.card.is-active .whats-on-list > :nth-child(3) { animation-delay: 0.85s; }
.card.is-active .whats-on-list > :nth-child(4) { animation-delay: 1s; }

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.card-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vh, 72px) clamp(28px, 6vw, 96px);
}

/* ---------- Type ---------- */

.display {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 6.5vw, 110px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-shadow: 5px 5px 0 var(--ink);
}

.display span {
  color: var(--brand);
}

.lede {
  margin: clamp(14px, 2.4vh, 28px) 0 0;
  max-width: 26em;
  font-size: clamp(18px, 2.1vw, 32px);
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink-muted);
}

/* ---------- Attract slide ---------- */

.attract {
  align-items: flex-start;
  text-align: left;
}

.attract-logo {
  width: clamp(220px, 30vw, 460px);
  height: auto;
  margin-bottom: clamp(16px, 3vh, 36px);
}

/* ---------- Photo slides ---------- */

.card-inner.photo {
  padding: 0;
  justify-content: flex-end;
}

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

.card.is-active .photo-img {
  animation: kenburns 14s ease-out forwards;
}

@keyframes kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.07); }
}

.photo-caption {
  position: relative;
  margin: 0;
  padding: clamp(80px, 14vh, 160px) clamp(28px, 6vw, 96px) clamp(28px, 5vh, 64px);
  font-size: clamp(22px, 2.6vw, 42px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--card);
  background: linear-gradient(to top, rgba(10, 43, 39, 0.88), rgba(10, 43, 39, 0));
  text-wrap: balance;
}

/* ---------- Sessions slide ---------- */

.session-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 3vw, 40px);
  margin-top: clamp(24px, 4.5vh, 52px);
}

.session {
  border-left: clamp(4px, 0.5vw, 8px) solid var(--brand);
  padding-left: clamp(16px, 2vw, 32px);
}

.session h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 42px);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.session-when {
  margin: clamp(6px, 1vh, 12px) 0 0;
  font-size: clamp(17px, 1.9vw, 30px);
  font-weight: 600;
  color: var(--brand);
}

.session-where {
  margin: clamp(4px, 0.8vh, 10px) 0 0;
  font-size: clamp(15px, 1.6vw, 24px);
  color: var(--ink-muted);
}

/* ---------- What's on slide ---------- */

.whats-on-list {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 2vw, 28px);
  margin-top: clamp(20px, 4vh, 44px);
}

/* Card width follows screen height so the 8:5 Rubric banners show
   uncropped and four cards still fit on small laptops */
.whats-on-card {
  width: calc(clamp(120px, 20vh, 220px) * 1.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: var(--card);
}

.whats-on-image {
  width: 100%;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  border-bottom: 2px solid rgba(15, 23, 42, 0.08);
}

.whats-on-row {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2vw, 18px);
  padding: clamp(12px, 1.4vw, 20px);
}

.whats-on-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: none;
  width: clamp(52px, 5vw, 76px);
  padding: clamp(6px, 0.9vh, 12px) 0;
  border-radius: 14px;
  background: var(--brand);
  color: var(--card);
}

.whats-on-month {
  font-size: clamp(11px, 1vw, 15px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.whats-on-day {
  font-size: clamp(20px, 2.2vw, 34px);
  font-weight: 800;
  line-height: 1.05;
}

.whats-on-title {
  margin: 0;
  font-size: clamp(15px, 1.5vw, 22px);
  font-weight: 700;
  line-height: 1.2;
}

.whats-on-when {
  margin: clamp(3px, 0.5vh, 8px) 0 0;
  font-size: clamp(12px, 1.2vw, 17px);
  color: var(--ink-muted);
}

/* ---------- Library slide ---------- */

.card-inner.library {
  padding: 0;
  justify-content: space-between;
}

.library-copy {
  padding: clamp(28px, 5vh, 64px) clamp(28px, 6vw, 96px) 0;
}

.library-marquee {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.4vh, 18px);
  padding-bottom: clamp(20px, 3.5vh, 40px);
}

.marquee-row {
  display: flex;
  gap: clamp(10px, 1.2vw, 18px);
  width: max-content;
}

.marquee-row img {
  width: clamp(84px, 9.5vw, 150px);
  height: clamp(84px, 9.5vw, 150px);
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
}

.marquee-row.drift-left {
  animation: drift-left 60s linear infinite;
}

.marquee-row.drift-right {
  animation: drift-right 60s linear infinite;
}

@keyframes drift-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes drift-right {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

/* ---------- Join slide ---------- */

.join {
  align-items: center;
  text-align: center;
}

.join-row {
  display: flex;
  gap: clamp(32px, 6vw, 96px);
  margin-top: clamp(24px, 5vh, 56px);
}

.join-qr img {
  width: clamp(160px, 22vh, 300px);
  height: clamp(160px, 22vh, 300px);
  padding: clamp(10px, 1.4vh, 18px);
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 20px;
}

.join-qr p {
  margin: clamp(10px, 1.6vh, 18px) 0 0;
  font-size: clamp(18px, 2vw, 32px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Persistent website QR, top right ---------- */

.site-qr {
  position: fixed;
  top: clamp(16px, 3vh, 32px);
  right: clamp(16px, 2.5vw, 36px);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(8px, 1.2vh, 14px);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.22);
}

.site-qr img {
  width: clamp(72px, 11vh, 116px);
  height: clamp(72px, 11vh, 116px);
}

.site-qr p {
  margin: clamp(4px, 0.8vh, 8px) 0 0;
  font-size: clamp(10px, 1vw, 14px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
}

/* ---------- Fullscreen hint ---------- */

.fs-hint {
  position: fixed;
  bottom: clamp(12px, 2vh, 24px);
  left: clamp(16px, 2.5vw, 36px);
  z-index: 30;
  margin: 0;
  font-size: clamp(11px, 1vw, 15px);
  color: rgba(15, 23, 42, 0.45);
  transition: opacity 0.6s ease;
}

.fs-hint.is-hidden {
  opacity: 0;
}

/* ---------- Paused badge ---------- */

.paused-badge {
  position: fixed;
  top: clamp(24px, 5vh, 56px);
  left: clamp(24px, 5vw, 64px);
  z-index: 40;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font-size: clamp(14px, 1.4vw, 20px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ---------- Reduced motion: keep the gentle crossfade, drop the rest ---------- */

@media (prefers-reduced-motion: reduce) {
  .card.is-active .card-inner > *,
  .card.is-active .session-row > .session,
  .card.is-active .whats-on-list > .whats-on-card,
  .card.is-active .join-row > .join-qr,
  .card.is-active .photo-img,
  .marquee-row.drift-left,
  .marquee-row.drift-right {
    animation: none;
  }
}

/* Portrait or narrow screens: stack what needs stacking */
@media (max-width: 760px), (orientation: portrait) {
  .session-row {
    grid-template-columns: 1fr;
  }

  .join-row {
    gap: 24px;
  }

  .fs-hint {
    display: none;
  }
}
