/* ==========================================================================
   Invensa Discord bot — presentation styles
   Layered on top of the Design Lab system:
     css/tokens.css          Tokyo Night theme tokens
     css/library/_base.css   structural shell for every c-* component
     css/library/glass.css   the glass style pack
     css/library/scenes.css  the reader scene layout (.s-reader)
     css/presentation.css    THIS FILE — deck chrome + Discord mockups
   Nothing in the library files is edited here; this file only adds.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1 · Ground
   The articlenator recipe: a 1-bit library burst crushed into Tokyo Night.
   Panels float over it with the glass pack's blur.
   -------------------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-base);
}

/* The baked articlenator look: the library burst recoloured into Tokyo Night.
   Layer 1 casts the image; layer 2 is the vignette that keeps text readable. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: url("../assets/library-burst.webp");
  background-size: cover;
  background-position: center;
  filter: brightness(0.25) sepia(1) saturate(2) hue-rotate(190deg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(26, 27, 38, 0.5), rgba(26, 27, 38, 0.9) 70%),
    linear-gradient(to bottom, rgba(22, 22, 30, 0.35), rgba(22, 22, 30, 0.85));
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: reveal-rise var(--dur-slow) var(--ease-out) both;
  }
}

@keyframes reveal-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* --------------------------------------------------------------------------
   2 · Deck chrome
   -------------------------------------------------------------------------- */

.s-reader__body--wide {
  max-inline-size: none;
}

/* The deck has no table-of-contents sidebar (it never fit and could not
   scroll), so the article takes the full grid width. */
.s-reader__main {
  grid-template-columns: minmax(0, 1fr);
}

.s-reader__brand-logo {
  display: block;
  height: 1.75rem;
  width: auto;
}

/* The section wrapper. One per chapter of the deck. The number is the
   "slide" count shown to the presenter, not a page number. */
.slide {
  scroll-margin-block-start: calc(var(--space-8) + var(--space-6));
}

.slide__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 1.6rem;
  padding: 0 var(--space-2);
  border-radius: var(--radius-full);
  background-color: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  margin-inline-end: var(--space-3);
  vertical-align: middle;
}

.slide--break {
  margin-block-start: var(--space-8);
  padding-block-start: var(--space-7);
  border-block-start: 1px solid var(--border);
}

/* A lead-in paragraph that sets up a slide. */
.lead {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-inline-size: 68ch;
}

/* --------------------------------------------------------------------------
   3 · Screenshot slots
   Drop a real file at the printed path and it replaces the placeholder with
   no HTML change. The onerror handler in the markup adds .is-missing.
   -------------------------------------------------------------------------- */

.shot {
  margin: var(--space-5) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.shot__frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(var(--panel-blur)) saturate(140%);
  backdrop-filter: blur(var(--panel-blur)) saturate(140%);
}

.shot__img {
  display: block;
  width: 100%;
  height: auto;
}

.shot__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 16rem;
  padding: var(--space-7) var(--space-5);
  text-align: center;
  color: var(--text-muted);
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent 0 14px,
      rgba(122, 162, 247, 0.05) 14px 28px
    );
}

.shot__placeholder svg {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--accent);
  opacity: 0.8;
}

.shot__label {
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  color: var(--text);
  max-inline-size: 46ch;
}

.shot__path {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
}

/* The placeholder is the default. When the real image loads, JS adds
   .is-loaded and the slot is swapped for the screenshot. */
.shot__img {
  display: none;
}

.shot.is-loaded .shot__img {
  display: block;
}

.shot.is-loaded .shot__placeholder {
  display: none;
}

/* --------------------------------------------------------------------------
   3b · Vertical screenshot beside a wide table
   The channel list screenshot is a tall narrow strip, so it takes its own
   narrow column and stays in view while the table scrolls past.
   -------------------------------------------------------------------------- */

.channel-split {
  display: grid;
  grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
  margin-block: var(--space-5);
}

.channel-split__shot {
  margin: 0;
  position: sticky;
  top: calc(var(--space-8) + var(--space-5));
}

.channel-split__shot .shot__img {
  width: 100%;
  height: auto;
}

.channel-split__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.channel-split__info .c-table {
  margin: 0;
}

@media (max-width: 52rem) {
  .channel-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .channel-split__shot {
    position: static;
    max-width: 15rem;
  }
}

/* --------------------------------------------------------------------------
   4 · Discord window mockup
   A CSS recreation of the client, so the deck reads without screenshots.
   -------------------------------------------------------------------------- */

.dc {
  display: flex;
  flex-direction: column;
  min-height: 22rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.dc__titlebar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
  color: var(--text-faint);
  font-size: var(--text-xs);
}

.dc__dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: var(--radius-full);
  background: var(--surface-3);
}

.dc__dot--red { background: #f7768e; }
.dc__dot--yellow { background: #e0b670; }
.dc__dot--green { background: #a3d172; }

.dc__body {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
}

.dc__channels {
  padding: var(--space-3) var(--space-2);
  background: var(--bg-sunken);
  border-inline-end: 1px solid var(--border);
  overflow-y: auto;
}

.dc__server {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  margin-block-end: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}

.dc__cat {
  margin: var(--space-3) 0 var(--space-1);
  padding-inline: var(--space-3);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-faint);
}

.dc__chan {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.dc__chan::before {
  content: "#";
  color: var(--text-faint);
  font-weight: var(--weight-bold);
}

.dc__chan--voice::before {
  content: "\1F50A";
  font-size: 0.85em;
}

.dc__chan--active {
  background: var(--accent-soft);
  color: var(--text);
}

.dc__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.dc__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: var(--weight-bold);
}

.dc__header .dc__topic {
  color: var(--text-faint);
  font-weight: var(--weight-normal);
  font-size: var(--text-xs);
}

.dc__messages {
  flex: 1 1 auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  overflow-y: auto;
}

.dc__msg {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.dc__avatar {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--text-on-accent);
}

.dc__msg-body {
  min-width: 0;
}

.dc__msg-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-block-end: 2px;
}

.dc__msg-author {
  font-weight: var(--weight-medium);
  color: var(--text);
}

.dc__msg-time {
  font-size: var(--text-xs);
  color: var(--text-faint);
}

.dc__msg-text {
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.dc__msg-text--mono {
  font-family: var(--font-mono);
}

.dc__msgnote {
  margin-block-start: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-inline-start: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.dc__mention {
  color: var(--info);
  background: var(--info-soft);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-1);
}

.dc__input {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 var(--space-4) var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-faint);
}

/* Slash-command slash chip used inline in prose and mockups. */
.slash {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-1);
}

/* --------------------------------------------------------------------------
   5 · Role ladder
   Colours are the real guild role colours read from the Discord API.
   -------------------------------------------------------------------------- */

.tier-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-4) 0;
  padding: 0;
  list-style: none;
}

.tier {
  display: grid;
  grid-template-columns: 0.75rem minmax(0, 14rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  border: 1px solid var(--border);
}

.tier__swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px color-mix(in srgb, currentColor 60%, transparent);
}

.tier__name {
  font-weight: var(--weight-medium);
  color: var(--text);
}

.tier__desc {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.tier__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  justify-content: flex-end;
}

.tier--group {
  background: none;
  border: 0;
  padding: var(--space-2) 0 0;
  color: var(--text-faint);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  grid-template-columns: 1fr;
}

/* Role colour dot used inside tables. */
.roledot {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: var(--radius-full);
  margin-inline-end: var(--space-2);
  vertical-align: middle;
  box-shadow: 0 0 8px color-mix(in srgb, currentColor 55%, transparent);
}

/* --------------------------------------------------------------------------
   6 · Command reference
   -------------------------------------------------------------------------- */

.cmd-group {
  margin: var(--space-6) 0 var(--space-3);
}

.cmd-group__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text);
}

.cmd-list {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.cmd {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(var(--panel-blur)) saturate(140%);
  backdrop-filter: blur(var(--panel-blur)) saturate(140%);
}

.cmd__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
}

.cmd__name {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--accent);
}

.cmd__args {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-faint);
}

.cmd__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.cmd__example {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
}

/* --------------------------------------------------------------------------
   7 · Small helpers
   -------------------------------------------------------------------------- */

.kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: var(--space-4);
  margin-block: var(--space-4);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--space-3);
  margin-block: var(--space-5);
}

.callout {
  margin-block: var(--space-5);
}

.toc__num {
  font-family: var(--font-mono);
  color: var(--text-faint);
  margin-inline-end: var(--space-2);
}

/* --------------------------------------------------------------------------
   8 · Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 64rem) {
  .s-reader__main {
    grid-template-columns: minmax(0, 1fr);
  }

  .s-reader__aside {
    position: static;
    order: -1;
  }
}

@media (max-width: 42rem) {
  .dc__body {
    grid-template-columns: 10rem minmax(0, 1fr);
  }

  .tier {
    grid-template-columns: 0.75rem minmax(0, 1fr);
  }

  .tier__desc,
  .tier__badges {
    grid-column: 2;
    justify-content: flex-start;
  }
}

/* --------------------------------------------------------------------------
   9 · Print
   -------------------------------------------------------------------------- */

@media print {
  body {
    background: var(--bg-base);
  }

  body::before,
  body::after,
  .s-reader__top,
  .s-reader__aside,
  .s-reader__tools {
    display: none;
  }

  .slide--break {
    break-before: page;
  }

  .shot__frame,
  .dc,
  .cmd {
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--surface);
  }
}
