/* Dracontis showcase. Tokens follow the family apps (weekly-planner/src/styles/tokens.css). */
:root {
  --bg: #f5f4f9;
  --surface: #ffffff;
  --surface-2: #eceaf3;
  --text: #1f1d2b;
  --muted: #67647a;
  --line: #dfdce9;
  --accent: #6f5cd6;
  --accent-ink: #ffffff;
  --focus: #6f5cd6;
  --shadow: 0 1px 2px rgb(31 29 43 / 6%), 0 8px 24px rgb(31 29 43 / 6%);
  --logo-1: #b9a9ff;
  --logo-2: #8fe0bc;
  --logo-3: #ffb894;
  --logo-4: #9ccbff;
  --live: #1d7a52;
  --live-bg: #d9f5e8;
  --beta: #2f62a8;
  --beta-bg: #dcebff;
  --progress: #9a4a1c;
  --progress-bg: #ffe6d8;
  --planned: #5a4fa8;
  --planned-bg: #e8e3ff;
  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
  --radius: 22px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #14131b;
    --surface: #1e1c29;
    --surface-2: #2a2838;
    --text: #f1effa;
    --muted: #a29eb6;
    --line: #34313f;
    --accent: #b9a9ff;
    --accent-ink: #14131b;
    --focus: #b9a9ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    --live: #8fe0bc;
    --live-bg: #183a2c;
    --beta: #9ccbff;
    --beta-bg: #1b2d45;
    --progress: #ffb894;
    --progress-bg: #42291c;
    --planned: #c8bcff;
    --planned-bg: #2c2550;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #14131b;
  --surface: #1e1c29;
  --surface-2: #2a2838;
  --text: #f1effa;
  --muted: #a29eb6;
  --line: #34313f;
  --accent: #b9a9ff;
  --accent-ink: #14131b;
  --focus: #b9a9ff;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  --live: #8fe0bc;
  --live-bg: #183a2c;
  --beta: #9ccbff;
  --beta-bg: #1b2d45;
  --progress: #ffb894;
  --progress-bg: #42291c;
  --planned: #c8bcff;
  --planned-bg: #2c2550;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 10px;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.top,
main,
.foot {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 32px;
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-name {
  font: 600 20px/1 var(--font-display);
  letter-spacing: -0.02em;
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seg {
  display: flex;
  padding: 4px;
  gap: 2px;
  background: var(--surface-2);
  border-radius: 14px;
}

.seg button {
  min-width: 44px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.seg button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-2);
}

/* Hero */
.hero {
  padding-block: 40px 28px;
  max-width: 720px;
}

.hero h1 {
  margin: 0 0 12px;
  font: 600 clamp(30px, 5vw, 48px) / 1.1 var(--font-display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  text-wrap: pretty;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.chip {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
}

.chip[aria-pressed='true'] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding: 0;
  margin: 0 0 64px;
  list-style: none;
}

.card {
  height: 100%;
}

.card button {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: start;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.card button:hover {
  transform: translateY(-2px);
}

.cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: color-mix(in srgb, var(--tint) 35%, var(--surface));
  overflow: hidden;
}

.cover img,
.cover video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

.cover.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.cover.empty img {
  width: 88px;
  height: 88px;
  border-radius: 20px;
}

.card-body {
  display: grid;
  gap: 8px;
  padding: 18px 20px 20px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-head img {
  border-radius: 10px;
}

.card-name {
  margin: 0;
  font: 600 18px/1.2 var(--font-display);
  letter-spacing: -0.02em;
}

.card-tagline {
  margin: 0;
  color: var(--muted);
}

.badge {
  margin-inline-start: auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.live {
  color: var(--live);
  background: var(--live-bg);
}
.badge.beta {
  color: var(--beta);
  background: var(--beta-bg);
}
.badge.in-progress {
  color: var(--progress);
  background: var(--progress-bg);
}
.badge.planned {
  color: var(--planned);
  background: var(--planned-bg);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 4px 0 0;
  list-style: none;
}

.tags li {
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.empty-state {
  color: var(--muted);
}

/* Detail dialog */
.detail {
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 80px rgb(0 0 0 / 30%);
}

.detail::backdrop {
  background: rgb(20 19 27 / 55%);
  backdrop-filter: blur(4px);
}

.detail-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}

.viewer {
  display: grid;
  grid-template-rows: auto auto;
  gap: 12px;
  padding: 20px;
  background: color-mix(in srgb, var(--tint) 22%, var(--surface-2));
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  border-radius: 16px;
  overflow: hidden;
}

.stage img,
.stage video {
  display: block;
  max-width: 100%;
  max-height: 64dvh;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.stage .nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
}

.stage .nav.prev {
  inset-inline-start: 8px;
}
.stage .nav.next {
  inset-inline-end: 8px;
}

.stage-caption {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: thin;
}

.thumbs button {
  flex: none;
  position: relative;
  width: 96px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.thumbs button[aria-current='true'] {
  border-color: var(--accent);
}

.thumbs img,
.thumbs video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

.thumbs .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgb(0 0 0 / 35%);
}

.info {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  overflow-y: auto;
  max-height: calc(100dvh - 32px);
}

.info-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.info-head img {
  border-radius: 14px;
}

.info h2 {
  margin: 0;
  font: 600 24px/1.15 var(--font-display);
  letter-spacing: -0.02em;
}

.info .close {
  margin-inline-start: auto;
  align-self: flex-start;
}

.info p {
  margin: 0;
}

.info h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.highlights {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.highlights li {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.highlights li::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--tint);
  translate: 0 -1px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.foot {
  padding-block: 24px 40px;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--line);
}

@media (max-width: 860px) {
  .detail-inner {
    grid-template-columns: 1fr;
  }
  .info {
    max-height: none;
  }
  .detail {
    overflow-y: auto;
  }
}

@media (max-width: 600px) {
  .top,
  main,
  .foot {
    padding-inline: 16px;
  }
  .top {
    flex-wrap: wrap;
  }
  .brand-name {
    font-size: 18px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding-block: 16px 20px;
  }
  .hero p {
    font-size: 16px;
  }
  .viewer {
    padding: 12px;
  }
  .info {
    padding: 20px;
  }
  .detail {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card button {
    transition: none;
  }
  .card button:hover {
    transform: none;
  }
}
