/* ============================================================
   CREATOR KIT — downloads for streamers and video creators
   Hero with the key art, a sticky section switcher (same liquid
   glass pill as the nav), then one section per kit folder:
   preview cards with direct downloads (files live on
   downloads.divinestudios.io, an R2 bucket).
   ============================================================ */

.ck {
  padding-bottom: var(--space-xl);
  color: var(--color-text);
}

.ck-h2,
.ck-h3,
.ck-title,
.ck-name,
.ck-howto h3,
.ck-beat h3 {
  color: #fff;
}

.ck-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding-top: var(--space-xl);
  scroll-margin-top: 130px;
}

/* Section header: title left, file facts right, hairline under */
.ck-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.ck-h2 {
  font-family: var(--font-heading);
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: var(--lh-heading);
  margin: 0;
  text-wrap: balance;
}

.ck-meta {
  margin: 0;
  color: var(--color-text-dim);
  font-size: 1.05rem;
}

.ck .ck-intro {
  margin: 0;
  font-size: 1.15rem;
}

.ck-h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  font-weight: 500;
  margin: var(--space-md) 0 0;
}

.ck-dim {
  color: var(--color-text-dim);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  margin-left: 10px;
}

.ck p {
  max-width: 68ch;
}

.ck code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--color-cyan-light);
  overflow-wrap: anywhere;
}

/* ---------- Hero ---------- */

.ck-hero {
  position: relative;
  min-height: min(80vh, 760px);
  display: flex;
  align-items: flex-end;
  padding-top: var(--nav-height);
  overflow: hidden;
}

.ck-hero-media {
  position: absolute;
  inset: 0;
}

.ck-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
}

.ck-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 8, 14, 0.35) 0%, rgba(6, 8, 14, 0.15) 35%, var(--color-bg) 100%),
    linear-gradient(90deg, rgba(6, 8, 14, 0.92) 0%, rgba(6, 8, 14, 0.7) 40%, rgba(6, 8, 14, 0.1) 75%);
}

.ck-hero-body {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
}

.ck-title {
  font-family: var(--font-heading);
  font-size: var(--fs-hero);
  font-weight: 800;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
}

.ck-lede {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--color-text);
}

.ck-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* ---------- Buttons: glass pills. The main download is the game's living
   glass pill (js/modules/glass-pill.js); the rest light up the same blue on hover ---------- */

.ck-btn,
.ck-download,
.ck-chip {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
  border-radius: 100px;
  font-family: var(--font-ui);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 255, 255, 0.06) 0%, transparent 100%),
    linear-gradient(180deg, rgba(20, 24, 33, 0.85), rgba(7, 9, 15, 0.9));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -3px 5px -3px rgba(0, 0, 0, 0.5),
    0 4px 10px rgba(0, 0, 0, 0.35);
  transition: color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.ck-btn svg,
.ck-download svg {
  align-self: center;
  flex: none;
}

.ck-btn {
  padding: 16px 26px;
  font-size: 0.95rem;
}

.ck-btn-size,
.ck-download span,
.ck-chip span {
  font-weight: 400;
  font-size: 0.85em;
  letter-spacing: 0;
  opacity: 0.75;
}

.ck-btn:hover,
.ck-download:hover,
.ck-chip:hover {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  background:
    radial-gradient(ellipse 55% 55% at 40% 30%, rgba(140, 240, 255, 0.3) 0%, transparent 100%),
    radial-gradient(ellipse 90% 80% at 50% 50%, transparent 50%, rgba(0, 5, 20, 0.25) 100%),
    linear-gradient(90deg, #0a1a60 0%, #002d99 26%, #0050cc 53%, #0078ee 79%, #0d9cf5 100%);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 3px 6px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(150, 220, 255, 0.28),
    inset 0 2px 1px rgba(180, 240, 255, 0.6),
    inset 0 6px 14px rgba(60, 200, 255, 0.2),
    inset 6px 0 10px rgba(80, 200, 255, 0.3),
    inset -6px 0 10px rgba(80, 200, 255, 0.3),
    inset 0 -6px 14px rgba(0, 5, 25, 0.9);
}

/* Main download: the pause pill, always lit */
.ck-btn--primary {
  position: relative;
  isolation: isolate;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  background:
    radial-gradient(ellipse 55% 55% at 40% 30%, rgba(140, 240, 255, 0.3) 0%, transparent 100%),
    radial-gradient(ellipse 90% 80% at 50% 50%, transparent 50%, rgba(0, 5, 20, 0.25) 100%),
    linear-gradient(90deg, #0a1a60 0%, #002d99 26%, #0050cc 53%, #0078ee 79%, #0d9cf5 100%);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 3px 6px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(150, 220, 255, 0.28),
    inset 0 2px 1px rgba(180, 240, 255, 0.6),
    inset 0 6px 14px rgba(60, 200, 255, 0.2),
    inset 6px 0 10px rgba(80, 200, 255, 0.35),
    inset -6px 0 10px rgba(80, 200, 255, 0.35),
    inset 0 -6px 14px rgba(0, 5, 25, 0.9);
}

/* tight self-bloom, as in the game */
.ck-btn--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  filter: blur(6px);
  opacity: 0.55;
  z-index: -1;
  transition: opacity 0.3s ease;
}

/* specular line along the top */
.ck-btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.35) 8%, transparent 16%),
    radial-gradient(ellipse 60% 50% at 40% 25%, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, black 0%, black 30%, transparent 65%);
  mask-image: linear-gradient(180deg, black 0%, black 30%, transparent 65%);
  pointer-events: none;
  z-index: 1;
}

.ck-btn--primary > svg,
.ck-btn--primary > span {
  position: relative;
  z-index: 2;
}

.ck-btn--primary:hover::before {
  opacity: 0.9;
}

.ck-btn:active,
.ck-download:active,
.ck-chip:active {
  transform: scale(0.96);
}

.ck-download,
.ck-chip {
  align-self: flex-start;
  margin-top: var(--space-xs);
  padding: 9px 16px;
  font-size: 0.8rem;
  gap: 8px;
}

.ck-chip {
  padding: 8px 14px;
}

/* ---------- Section switcher: the pause menu's icon track. Icons only;
   the active item opens to icon + label under the living glass pill ---------- */

.ck-tabs {
  position: sticky;
  top: 62px;
  z-index: calc(var(--z-nav) - 1);
  display: flex;
  justify-content: center;
  padding: 0 var(--space-sm);
  pointer-events: none;
}

.ck-tabs-inner {
  pointer-events: auto;
  position: relative;
  display: flex;
  height: 40px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px;
  border-radius: 100px;
  /* clear glass: no tint, just blur so the page behind stays out of the way */
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Liquid glass (Chromium, set up in creator-kit.js): hardly any blur, the page
   refracts at the rim, and a bright edge catches the light like the Apple glass */
.ck-tabs-inner.is-liquid {
  /* a faint milky lift, as Apple's glass brightens what it sits on */
  background:
    radial-gradient(ellipse 70% 120% at 50% -20%, rgba(255, 255, 255, 0.07), transparent 70%),
    rgba(255, 255, 255, 0.05);
  backdrop-filter: url(#ck-liquid) saturate(1.5) brightness(1.1);
  -webkit-backdrop-filter: url(#ck-liquid) saturate(1.5) brightness(1.1);
  box-shadow:
    inset 0 0 8px rgba(255, 255, 255, 0.06),
    inset 0 -6px 10px -8px rgba(255, 255, 255, 0.18),
    0 0 0 0.5px rgba(255, 255, 255, 0.14),
    0 10px 24px rgba(0, 0, 0, 0.32);
}

/* specular rim: the light catches the top-left and bottom-right of the edge */
.ck-tabs-inner.is-liquid::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(125deg,
    rgba(255, 255, 255, 0.75) 0%,
    rgba(255, 255, 255, 0.18) 18%,
    rgba(255, 255, 255, 0.06) 45%,
    rgba(255, 255, 255, 0.06) 60%,
    rgba(255, 255, 255, 0.22) 85%,
    rgba(255, 255, 255, 0.5) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  z-index: 2;
}

.ck-tabs-inner.is-liquid a:not(.active) {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.ck-tabs-inner::-webkit-scrollbar {
  display: none;
}

.ck-tabs a {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 100px;
  font: 300 11px/1 var(--font-ui);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  user-select: none;
  transition: color 0.35s ease;
}

.ck-tabs a svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ck-tab-lbl {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.4s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.25s ease;
}

.ck-tab-lbl::before {
  content: '';
  display: inline-block;
  width: 8px;
}

.ck-tabs a:hover {
  color: #fff;
}

.ck-tabs a.active {
  color: #fff;
  font-weight: 400;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.ck-tabs a.active .ck-tab-lbl {
  max-width: var(--lbl-w, 160px);
  opacity: 1;
}

/* The pause pill — the fluid comes from glass-pill.js, this is its fallback */
.ck-tabs-slider {
  --px: 50%;
  position: absolute;
  border-radius: 100px;
  background:
    radial-gradient(ellipse 55% 55% at var(--px) 30%, rgba(140, 240, 255, 0.3) 0%, transparent 100%),
    radial-gradient(ellipse 90% 80% at 50% 50%, transparent 50%, rgba(0, 5, 20, 0.25) 100%),
    linear-gradient(90deg, #0a1a60 0%, #002d99 26%, #0050cc 53%, #0078ee 79%, #0d9cf5 100%);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 3px 6px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(150, 220, 255, 0.28),
    inset 0 2px 1px rgba(180, 240, 255, 0.6),
    inset 0 6px 14px rgba(60, 200, 255, 0.2),
    inset 6px 0 10px rgba(80, 200, 255, 0.35),
    inset -6px 0 10px rgba(80, 200, 255, 0.35),
    inset 0 -6px 14px rgba(0, 5, 25, 0.9);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: left 0.4s cubic-bezier(0.34, 1.3, 0.64, 1),
              width 0.4s cubic-bezier(0.34, 1.3, 0.64, 1),
              opacity 0.3s ease,
              --px 0.4s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.ck-tabs-slider::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  filter: blur(6px);
  opacity: 0.55;
  z-index: -1;
}

.ck-tabs-slider::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.35) 8%, transparent 16%),
    radial-gradient(ellipse 60% 50% at var(--px, 50%) 25%, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, black 0%, black 30%, transparent 65%);
  mask-image: linear-gradient(180deg, black 0%, black 30%, transparent 65%);
}

/* ---------- The game ---------- */

.ck-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: var(--space-lg);
  align-items: start;
}

.ck-pitch {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.ck-facts {
  margin: 0;
  border-top: 1px solid var(--color-border-hover);
}

.ck-facts div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-sm);
  padding: 9px 0;
  border-bottom: 1px solid var(--color-border);
}

.ck-facts dt {
  color: var(--color-text-dim);
}

.ck-facts dd {
  margin: 0;
  min-width: 0;
  color: #fff;
  overflow-wrap: anywhere;
}

.ck a:not(.ck-btn):not(.ck-download):not(.ck-chip):not(.ck-thumb):not(.ck-shot):not(.ck-tabs a) {
  color: var(--color-cyan-light);
}

/* ---------- Asset cards ---------- */

.ck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: var(--space-md);
}

.ck-asset {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  min-width: 0;
  transition: border-color var(--ease-base);
}

.ck-asset:hover {
  border-color: var(--color-border-hover);
}

.ck-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  /* checkerboard so transparent overlays read as transparent */
  background:
    conic-gradient(#12152e 25%, #0b0d18 0 50%, #12152e 0 75%, #0b0d18 0) 0 0 / 20px 20px;
  overflow: hidden;
}

.ck-thumb img,
.ck-thumb video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform var(--ease-smooth);
}

.ck-thumb--video video {
  object-fit: cover;
  background: #000;
}

.ck-asset:hover .ck-thumb img {
  transform: scale(1.03);
}

.ck-grid--top {
  align-items: start;
}

.ck-asset--tall .ck-thumb {
  aspect-ratio: 3 / 4;
}

.ck-asset--logo .ck-thumb {
  aspect-ratio: 3 / 1;
  background: #0b0d18;
}

.ck-asset--logo .ck-thumb img {
  padding: 8% 10%;
}

.ck-asset--light .ck-thumb {
  background: #e8ecf4;
}

.ck-asset figcaption {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-sm);
  flex: 1;
}

.ck-name {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ck-name .ck-dim {
  font-size: 0.95rem;
}

.ck-asset code {
  color: var(--color-text-dim);
  font-size: var(--fs-tiny);
}

.ck-use {
  color: var(--color-text-dim);
  font-size: var(--fs-small);
  line-height: 1.4;
  flex: 1;
}

.ck-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ck-note {
  color: var(--color-text-dim);
  font-size: var(--fs-small);
}

/* ---------- How-to ---------- */

.ck-howto {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-bg-card);
  padding: var(--space-md);
}

.ck-howto h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  margin: 0 0 var(--space-sm);
}

.ck-howto ol {
  margin: 0;
  padding-left: 1.3em;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 80ch;
}

/* ---------- Footage ---------- */

.ck-trailer {
  margin: 0;
  border: 1px solid var(--color-border-hover);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

.ck-trailer video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.ck-trailer figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-card);
}

.ck-trailer .ck-download {
  margin-top: 0;
}

.ck-shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 10px;
}

.ck-shot {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast);
}

.ck-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ck-shot:hover {
  border-color: var(--color-cyan-light);
  box-shadow: 0 0 18px var(--color-cyan-shadow);
}

/* ---------- Moments ---------- */

.ck-beats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--space-md);
}

.ck-beat {
  padding: var(--space-sm) 0 0;
  border-top: 2px solid var(--color-border-hover);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ck-beat-t {
  color: var(--color-purple-light);
  font-size: 0.95rem;
}

.ck-beat h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0;
}

.ck-beat p {
  color: var(--color-text-dim);
  margin: 0;
}

/* ---------- Permissions ---------- */

.ck-rules {
  margin: 0;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ck-rules b {
  color: #fff;
  font-weight: 600;
}

.ck-copies {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 0;
}

.ck-copy {
  border: 1px solid var(--color-border-hover);
  border-radius: 14px;
  background: var(--color-bg-card);
  overflow: hidden;
}

.ck-copy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 8px 14px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-dim);
}

.ck-copy-btn {
  font-family: var(--font-heading);
  font-size: var(--fs-small);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(18, 24, 40, 0.85);
  border: none;
  border-radius: 100px;
  padding: 5px 14px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: color 0.3s ease, box-shadow 0.3s ease;
}

.ck-copy-btn:hover,
.ck-copy-btn.is-done {
  color: #fff;
  box-shadow: 0 0 0 1px var(--color-cyan-light), 0 0 12px rgba(0, 168, 255, 0.3);
}

.ck-copy pre {
  margin: 0;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- Closing CTA ---------- */

.ck-cta {
  align-items: center;
  text-align: center;
}

.ck-version {
  font-size: var(--fs-small);
  color: var(--color-text-dim);
}

@media (max-width: 600px) {
  .ck-facts div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .ck-hero {
    min-height: 0;
  }
  .ck-hero-body {
    padding-top: 16vh;
  }
  .ck-btn {
    padding: 15px 22px;
  }
  .ck-tabs {
    top: 58px;
    padding: 0 8px;
  }
  .ck-tabs a {
    padding: 0 12px;
  }
  .ck-dim {
    display: block;
    margin: 4px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ck-thumb img,
  .ck-btn,
  .ck-tabs-slider {
    transition: none;
  }
}
