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

:root {
  --red: #e30613;
  --ink: #171717;
  --muted: #5c5c5c;
  --paper: #f4f2f1;
  --gap: 2.2vh;
  --frame-h: 80.5vh; /* the 16:9 slide card; everything else fits around it */
  --ease: cubic-bezier(.7, 0, .2, 1);
}

html, body { width: 100%; height: 100%; overflow: hidden; cursor: none; }

body {
  display: grid;
  grid-template-columns: calc(var(--frame-h) * 16 / 9) minmax(0, 1fr);
  grid-template-rows: var(--frame-h);
  align-content: start;
  padding-top: 15vh;
  column-gap: var(--gap);
  padding-inline: var(--gap);
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

/* Solid red rule at the very top: colour only, so the Teams banner can cover it. */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: .7vh; background: var(--red); }

/* ---- Side panel ---- */
.side {
  grid-area: 1 / 2;
  display: flex;
  flex-direction: column;
  gap: 2.4vh;
  min-width: 0;
  min-height: 0;
  padding: 2.4vh 1.1vw;
  background: #fff;
  border-radius: 1.8vh;
  border-right: .9vh solid var(--red);
  box-shadow: 0 1.2vh 3.5vh rgba(60, 10, 10, .09);
}

.logo { width: 100%; height: auto; }

.boxes { flex: 1; display: grid; grid-template-rows: 1fr 1fr; gap: 2vh; min-height: 0; }
.box { min-height: 0; overflow: hidden; border-top: .15vh solid #ead9d9; padding-top: 1.8vh; }
.box[hidden] { display: none; }
#information { grid-row: 1; }
#announcements { grid-row: 2; }

.box h2 {
  display: flex;
  align-items: center;
  gap: .6vw;
  margin-bottom: 1.2vh;
  color: var(--red);
  font-size: 1.7vh;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.box h2::before { content: ""; flex: none; width: 1.3vw; height: .4vh; background: var(--red); transform: skewX(-35deg); }

.box p {
  font-size: 2.5vh;
  font-weight: 600;
  line-height: 1.32;
  overflow-wrap: break-word;
  hyphens: auto;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}
.box p.in { animation: rise .7s var(--ease) both; }

.clock { display: block; font-variant-numeric: tabular-nums; }
.clock strong { display: block; color: var(--red); font-size: 8.2vh; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.clock span { display: block; margin-top: 1vh; color: var(--muted); font-size: 1.9vh; }

/* ---- Slide card ---- */
.stage { grid-area: 1 / 1; min-width: 0; }

.frame {
  position: relative;
  height: var(--frame-h);
  overflow: hidden;
  border-radius: 1.8vh;
  /* Seen only while there are no slides: quiet slanted bands. */
  background: repeating-linear-gradient(-22deg, #fff 0 7vh, #fbeaea 7vh 9vh);
  box-shadow: 0 1.2vh 3.5vh rgba(60, 10, 10, .14);
}

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* never crop */
  background: #101010;
  opacity: 0;
}
.slide:not([src]) { visibility: hidden; }
.slide.prev { opacity: 1; z-index: 1; }
.slide.on { opacity: 1; z-index: 2; animation: wipe 1.1s var(--ease) both; }

/* The red slanted blade that leads each new slide in. */
.sweep {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: 0;
  /* Slant = 14% of the card, same as the wipe edge: 8% thick + 14% lean = 22% wide. */
  width: 22%;
  background: var(--red);
  clip-path: polygon(63.64% 0, 100% 0, 36.36% 100%, 0 100%);
  transform: translateX(-120%); /* parked off the card when not running */
}
.sweep.run { animation: sweep 1.1s var(--ease); }

/* ---- Countdown to the next slide ---- */
.countdown { display: flex; align-items: center; gap: .7vw; color: var(--muted); font-size: 1.7vh; font-variant-numeric: tabular-nums; }
.countdown[hidden] { display: none; }
.tag { display: grid; place-items: center; width: 6.4vh; height: 4.2vh; overflow: hidden; background: var(--red); color: #fff; transform: skewX(-14deg); }
.tag b { font-size: 2.5vh; font-weight: 700; transform: skewX(14deg); }
.tag b.roll { animation: roll .35s var(--ease); }
@keyframes wipe {
  from { clip-path: polygon(0 0, 0 0, -14% 100%, -14% 100%); }
  to   { clip-path: polygon(0 0, 114% 0, 100% 100%, -14% 100%); }
}
@keyframes sweep {
  /* Keeps the blade centred on the wipe edge from start to finish. */
  from { transform: translateX(-81.82%); }
  to   { transform: translateX(436.36%); }
}
@keyframes roll { from { opacity: 0; transform: skewX(14deg) translateY(-100%); } to { opacity: 1; transform: skewX(14deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(1.5vh); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .slide.on, .sweep.run, .box p.in, .tag b.roll { animation: none; }
}
