/* melodias-studio site
   Mercury theme: onyx canvas, graphite cards, one cobalt action. No shadows. */

:root {
  --onyx: #171721;
  --graphite: #1e1e2a;
  --obsidian: #272735;
  --slate: #70707d;
  --mist: #e2e3ed;
  --ash: #c3c3cc;
  --ivory: #ededf3;
  --cobalt: #5266eb;
  --white: #ffffff;
  --hairline: rgba(226, 227, 237, 0.12);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1200px;
  --gutter: 24px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--onyx);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; }
img { height: auto; }

::selection {
  background: var(--cobalt);
  color: var(--white);
}

a { color: var(--ivory); }

code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.9em;
  color: var(--ivory);
  background: var(--obsidian);
  padding: 1px 6px;
  border-radius: 4px;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ivory);
  color: var(--onyx);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 32px;
  text-decoration: none;
}

.skip:focus { left: 16px; top: 16px; }

/* ---------- background ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, #20202e 0%, transparent 60%),
    linear-gradient(180deg, #191922 0%, var(--onyx) 55%, #14141c 100%);
}

.bg-video {
  position: absolute;
  top: -6vh;
  left: 0;
  width: 100%;
  height: 64vh;
  object-fit: cover;
  opacity: 0.12;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.4) 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.4) 55%, transparent 100%);
}

.bg-grid,
.bg-glow,
.scanlines { display: none; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 clamp(16px, 4vw, 42px);
  min-height: 72px;
  background: rgba(23, 23, 33, 0.72);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ivory);
  text-decoration: none;
  white-space: nowrap;
}

.brand-note {
  color: var(--ivory);
  font-size: 17px;
}

.brand-dim { color: var(--ash); font-weight: 400; }

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.topnav::-webkit-scrollbar { display: none; }

.topnav a {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: var(--ivory);
  text-decoration: none;
  white-space: nowrap;
  padding: 10px 20px;
  border-radius: 40px;
}

.topnav a:hover,
.topnav a:focus-visible {
  background: var(--obsidian);
}

.topnav-source {
  background: var(--cobalt) !important;
  color: var(--white) !important;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  z-index: 1;
  padding: clamp(56px, 8vw, 104px) 0 clamp(48px, 6vw, 72px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 48px);
  max-width: 1200px;
  margin: 0 auto;
}

.hero-grid > *,
.split > *,
.install-grid > * { min-width: 0; }

.hero-copy {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(32px, 5.4vw, 65px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--ivory);
  text-wrap: balance;
}

.lede {
  margin: 0 auto;
  max-width: 640px;
  font-size: 18px;
  line-height: 1.35;
  color: var(--ash);
}

.lede strong { color: var(--ivory); font-weight: 500; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 32px 0 28px;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  color: var(--white);
  background: var(--cobalt);
  border: 0;
  border-radius: 32px;
}

.btn:hover { filter: brightness(1.1); }

.btn-ghost {
  color: var(--ivory);
  background: transparent;
  border: 1px solid var(--mist);
}

.btn-ghost:hover {
  background: var(--obsidian);
  filter: none;
}

/* ---------- terminal rune ---------- */

.rune {
  margin: 0;
  background: var(--graphite);
  border: 0;
  border-radius: 12px;
}

.rune + .rune { margin-top: 16px; }

.rune figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 0;
  font-size: 14px;
  color: var(--ash);
}

.copy {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1;
  padding: 8px 20px;
  color: var(--ivory);
  background: transparent;
  border: 1px solid var(--mist);
  border-radius: 32px;
  cursor: pointer;
}

.copy:hover,
.copy:focus-visible { background: var(--obsidian); }

.copy.done { border-color: var(--cobalt); }

.rune pre {
  margin: 0;
  padding: 12px 20px 20px;
  overflow-x: auto;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ivory);
  tab-size: 2;
}

.hero-art {
  margin: 0;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.hero-figure { margin: 0; }

.hero-frame {
  padding: 0;
  overflow: hidden;
  background: var(--graphite);
  border: 0;
  border-radius: 12px;
}

.hero-frame::after { display: none; }

.hero-frame img {
  display: block;
  width: 100%;
}

.hero-art figcaption {
  margin-top: 16px;
  font-size: 14px;
  text-align: center;
  color: var(--ash);
}

/* ---------- sections ---------- */

.section {
  position: relative;
  z-index: 1;
  padding: 72px 0;
  border-top: 1px solid var(--hairline);
}

.section.alt { background: none; }

.sec-head {
  max-width: 640px;
  margin: 0 0 40px;
}

.sec-index {
  display: inline-block;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ash);
  background: none;
  border: 0;
}

.sec-head h2 {
  margin: 12px 0 14px;
  font-size: 32px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.015em;
  color: var(--ivory);
  text-wrap: balance;
}

.sec-head p {
  margin: 0;
  max-width: 640px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ash);
}

.aside {
  margin: 32px 0 0;
  padding: 0 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ash);
  border-left: 1px solid var(--slate);
  background: none;
}

.aside-tag {
  display: inline-block;
  margin-right: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ivory);
}

/* ---------- outputs ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 24px;
  align-items: start;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.card {
  padding: 32px;
  background: var(--graphite);
  border: 0;
  border-radius: 12px;
}

.card::before { display: none; }

.card:hover { transform: none; }

.card h3,
.panel h3 {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ivory);
}

.card p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ash);
}

/* ---------- pipeline ---------- */

.stages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: 12px;
  counter-reset: stage;
}

.stage {
  padding: 32px;
  background: var(--graphite);
  border: 0;
  border-radius: 12px;
}

.stage:hover { background: var(--graphite); }

.stage-num {
  position: static;
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ash);
}

.stage-name {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ivory);
}

.stage-desc {
  display: block;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ash);
}

/* ---------- score ---------- */

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 12px;
}

.panel {
  padding: 32px;
  background: var(--graphite);
  border: 0;
  border-radius: 12px;
}

.panel h3 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash);
}

.panel p {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ash);
}

.panel p:last-child { margin-bottom: 0; }

.ticks {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.ticks li {
  padding: 10px 0 10px 20px;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ash);
}

.ticks li:last-child { border-bottom: 0; }

.ticks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 18px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ash);
}

.ticks li { position: relative; }

.ticks li span {
  color: var(--ivory);
  font-weight: 500;
  margin-right: 6px;
}

.ticks.compact li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 2px 0 15px;
  font-size: 16px;
  color: var(--ivory);
}

.formula span { color: var(--ivory); }
.formula .plus { color: var(--ash); }

/* ---------- gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.shot {
  grid-column: span 5;
  margin: 0;
  padding: 12px;
  background: var(--graphite);
  border: 0;
  border-radius: 12px;
}

.shot.wide { grid-column: span 7; }

.shot.cell { grid-column: span 4; }

.shot-frame {
  overflow: hidden;
  background: var(--onyx);
  border: 0;
  border-radius: 8px;
}

.shot-frame img {
  display: block;
  width: 100%;
}

.shot.tall .shot-frame {
  position: relative;
  max-height: 520px;
}

.shot.tall .shot-frame img {
  height: 520px;
  object-fit: cover;
  object-position: top center;
}

.shot.tall .shot-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 110px;
  background: linear-gradient(180deg, rgba(30, 30, 42, 0) 0%, var(--graphite) 88%);
  pointer-events: none;
}

.shot-open {
  display: inline-block;
  margin-left: 4px;
  font-size: 14px;
  color: var(--ivory);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.shot figcaption {
  padding: 16px 8px 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ash);
}

.shot-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 6px 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ivory);
  border: 1px solid var(--mist);
  border-radius: 40px;
}

.gallery-run { margin: 28px 0 12px; }
.gallery-run:first-of-type { margin-top: 32px; }

/* ---------- creations (filterable gallery) ---------- */

.creations-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.creations-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--graphite);
  border: 0;
  border-radius: 40px;
}

.creation-filter {
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ash);
  background: transparent;
  border: 0;
  border-radius: 32px;
  cursor: pointer;
}

.creation-filter span {
  margin-left: 6px;
  font-size: 12px;
  color: inherit;
  opacity: 0.75;
}

.creation-filter.is-active {
  color: var(--white);
  background: var(--cobalt);
}

.creations-winners {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--ash);
  background: var(--graphite);
  border: 0;
  border-radius: 40px;
  cursor: pointer;
}

.creations-winners input { accent-color: var(--cobalt); }

.creations-count {
  margin: 0 0 0 auto;
  font-size: 14px;
  color: var(--ash);
}

.creations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.creation {
  margin: 0;
  padding: 8px;
  background: var(--graphite);
  border: 0;
  border-radius: 12px;
}

.creation-open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: var(--onyx);
  border: 0;
  border-radius: 8px;
  cursor: zoom-in;
}

.creation-open img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.creation-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--cobalt);
  border-radius: 40px;
}

.creation figcaption {
  padding: 10px 4px 2px;
  font-size: 14px;
  color: var(--ash);
}

.creation[hidden] { display: none; }

.creation-lightbox {
  max-width: min(1024px, calc(100vw - 48px));
  padding: 12px;
  color: var(--ivory);
  background: var(--graphite);
  border: 0;
  border-radius: 12px;
}

.creation-lightbox::backdrop { background: rgba(10, 10, 15, 0.8); }

.creation-lightbox-inner img {
  display: block;
  width: 100%;
  border-radius: 8px;
}

.creation-lightbox-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px 0;
}

.creation-lightbox-bar p {
  margin: 0;
  font-size: 14px;
  color: var(--ash);
}

.creation-lightbox-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.creation-lightbox-nav button {
  padding: 8px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ivory);
  background: transparent;
  border: 1px solid var(--mist);
  border-radius: 32px;
  cursor: pointer;
}

.creation-lightbox-nav button:hover { background: var(--obsidian); }

#creation-position { font-size: 14px; color: var(--ash); }

/* ---------- run section groups ---------- */

h3.run-sub { margin: 72px 0 20px; }

h3.run-sub:first-of-type { margin-top: 8px; }

.tab-panel .shot,
.tab-panel .rune {
  margin-left: auto;
  margin-right: auto;
}

/* ---------- pipeline diagram ---------- */

.diagram { margin: 0 0 20px; }

.diagram-frame {
  overflow: hidden;
  background: var(--graphite);
  border: 0;
  border-radius: 12px;
}

.diagram-frame iframe,
.diagram-frame svg {
  display: block;
  width: 100%;
}

.diagram-frame iframe {
  height: 560px;
  background: var(--graphite);
  border: 0;
}

.diagram-svg {
  --bg: #020617;
  --grid: #1e293b;
  --canvas-dot: rgba(148, 163, 184, 0.16);
  --text: #ffffff;
  --text-muted: #94a3b8;
  --text-dim: #475569;
  --text-faint: #7d8da1;
  --panel: rgba(15, 23, 42, 0.5);
  --panel-border: #1e293b;
  --lane-fill: rgba(15, 23, 42, 0.22);
  --lane-stroke: #334155;
  --arrow: #94a3b8;
  --arrow-emphasis: #34d399;
  --mask: #0f172a;
  --frontend-fill: rgba(8, 51, 68, 0.4);
  --frontend-stroke: #22d3ee;
  --backend-fill: rgba(6, 78, 59, 0.4);
  --backend-stroke: #34d399;
  --database-fill: rgba(76, 29, 149, 0.4);
  --database-stroke: #a78bfa;
  --cloud-fill: rgba(120, 53, 15, 0.3);
  --cloud-stroke: #fbbf24;
  --security-fill: rgba(136, 19, 55, 0.4);
  --security-stroke: #fb7185;
  --messagebus-fill: rgba(251, 146, 60, 0.3);
  --messagebus-stroke: #fb923c;
  --external-fill: rgba(30, 41, 59, 0.5);
  --external-stroke: #94a3b8;
}

.diagram-svg-art { height: auto; }

/* HTML legend replacing the cropped SVG one: same hues, readable size. */

.diagram-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  font-size: 14px;
  color: var(--ash);
}

.diagram-legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.diagram-legend .sw {
  width: 14px;
  height: 9px;
  border-radius: 2px;
  border: 1px solid;
}

.diagram-legend .sw-frontend { border-color: #22d3ee; background: rgba(8, 51, 68, 0.4); }
.diagram-legend .sw-backend { border-color: #34d399; background: rgba(6, 78, 59, 0.4); }
.diagram-legend .sw-database { border-color: #a78bfa; background: rgba(76, 29, 149, 0.4); }
.diagram-legend .sw-cloud { border-color: #fbbf24; background: rgba(120, 53, 15, 0.3); }
.diagram-legend .sw-external { border-color: #94a3b8; background: rgba(30, 41, 59, 0.5); }

/* Widen the frame on large screens so the diagram text reads bigger. */
@media (min-width: 1400px) {
  .diagram-frame { margin-left: -80px; margin-right: -80px; }
}

@media (min-width: 1680px) {
  .diagram-frame { margin-left: -160px; margin-right: -160px; }
}

/* archify diagram classes, scoped from the pipeline.html viewer */
.diagram-svg .c-grid { stroke: var(--grid); fill: none; }
.diagram-svg .c-mask { fill: var(--mask); stroke: none; }
.diagram-svg .c-lane-rule { stroke: var(--lane-stroke); fill: none; opacity: 0.7; }
.diagram-svg .c-lane-wash { fill: var(--lane-fill); stroke: none; }
.diagram-svg .c-frontend { fill: var(--frontend-fill);   stroke: var(--frontend-stroke); }
.diagram-svg .c-backend { fill: var(--backend-fill);    stroke: var(--backend-stroke); }
.diagram-svg .c-database { fill: var(--database-fill);   stroke: var(--database-stroke); }
.diagram-svg .c-cloud { fill: var(--cloud-fill);      stroke: var(--cloud-stroke); }
.diagram-svg .c-security { fill: var(--security-fill);   stroke: var(--security-stroke); }
.diagram-svg .c-messagebus { fill: var(--messagebus-fill); stroke: var(--messagebus-stroke); }
.diagram-svg .c-external { fill: var(--external-fill);   stroke: var(--external-stroke); }
.diagram-svg .t-primary { fill: var(--text); }
.diagram-svg .t-muted { fill: var(--text-muted); }
.diagram-svg .t-backend { fill: var(--backend-stroke); }
.diagram-svg svg .semantic-sigil {
      fill: none;
      stroke: currentColor;
      stroke-width: 1.35;
      stroke-linecap: round;
      stroke-linejoin: round;
      opacity: 0.76;
      pointer-events: none;
    }
.diagram-svg svg .semantic-sigil > * { vector-effect: non-scaling-stroke; }
.diagram-svg svg .semantic-sigil .sigil-fill { fill: currentColor; stroke: none; }
.diagram-svg svg .s-frontend { color: var(--frontend-stroke); }
.diagram-svg svg .s-backend { color: var(--backend-stroke); }
.diagram-svg svg .s-database { color: var(--database-stroke); }
.diagram-svg svg .s-cloud { color: var(--cloud-stroke); }
.diagram-svg svg .s-external { color: var(--external-stroke); }
.diagram-svg .a-default { stroke: var(--arrow); fill: none; }
.diagram-svg .a-emphasis { stroke: var(--arrow-emphasis); fill: none; }
.diagram-svg .m-default { fill: var(--arrow); }
.diagram-svg .m-emphasis { fill: var(--arrow-emphasis); }
.diagram-svg .m-security { fill: var(--security-stroke); }
.diagram-svg .m-dashed { fill: var(--database-stroke); }
.diagram-svg svg [data-node-id] > .c-mask { fill-opacity: 1; }
.diagram-svg svg[data-preset="editorial"] .c-grid {
      stroke-dasharray: 1 4;
      opacity: 0.48;
    }
.diagram-svg svg[data-preset="editorial"] .c-region {
      fill: color-mix(in srgb, var(--cloud-fill) 48%, transparent);
      stroke-dasharray: 9 4;
    }
.diagram-svg svg[data-preset="blueprint"] .c-grid {
      stroke-dasharray: 1 3;
      opacity: 0.78;
    }
.diagram-svg svg[data-preset="blueprint"] .c-region {
      fill: color-mix(in srgb, var(--cloud-fill) 58%, transparent);
      stroke-dasharray: 12 4 2 4;
    }
.diagram-svg svg[data-preset="blueprint"] .c-security-group, .diagram-svg svg[data-preset="blueprint"] .c-lane { stroke-dasharray: 7 3; }
.diagram-svg .c-security-group { fill: transparent; stroke: var(--security-stroke); stroke-dasharray: 4,4; }
.diagram-svg .c-region { fill: rgba(251, 191, 36, 0.05); stroke: var(--cloud-stroke); stroke-dasharray: 8,4; }
.diagram-svg .c-lane { fill: var(--lane-fill); stroke: var(--lane-stroke); stroke-dasharray: 6,6; }

/* ---------- demo ---------- */

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.demo-grid > * { min-width: 0; }

/* The players wrapper is flattened so the four media cards form a 2x2
   grid: still | video on the first row, track | vertical on the second. */
.demo-players { display: contents; }

.demo-still { order: 1; }
.demo-players > article:nth-child(1) { order: 3; }
.demo-players > article:nth-child(2) { order: 2; }
.demo-player.vertical { order: 4; }

.demo-still {
  margin: 0;
  padding: 12px;
  background: var(--graphite);
  border: 0;
  border-radius: 12px;
}

.demo-frame {
  overflow: hidden;
  background: var(--onyx);
  border: 0;
  border-radius: 8px;
}

.demo-frame img {
  display: block;
  width: 100%;
}

.demo-still figcaption,
.demo-player p {
  padding: 16px 8px 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ash);
}

.demo-still figcaption { margin: 0; }

.demo-players {
  display: contents;
}

.demo-player {
  margin: 0;
  padding: 32px;
  background: var(--graphite);
  border: 0;
  border-radius: 12px;
}

.demo-player h3 {
  margin: 0 0 12px;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ivory);
}

.demo-player p { margin: 12px 0 0; padding: 0; }

.demo-player p a {
  color: var(--ivory);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.tracklist {
  margin-top: 12px;
  padding: 32px;
  background: var(--graphite);
  border: 0;
  border-radius: 12px;
}

.tracklist ul {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.tracklist li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
}

.tracklist li:last-child { border-bottom: 0; }

.tracklist li a {
  color: var(--ivory);
  text-decoration: none;
}

.tracklist li a:hover { text-decoration: underline; text-underline-offset: 3px; }

.tracklist li span {
  flex-shrink: 0;
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--ash);
}

.tracklist p { margin: 12px 0 0; font-size: 14px; }

.tracklist p a {
  color: var(--ivory);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.demo-player audio,
.demo-player video {
  display: block;
  width: 100%;
  max-width: 100%;
  background: var(--onyx);
  border: 0;
  border-radius: 8px;
}

.demo-player video { aspect-ratio: 16 / 9; }

.demo-player.vertical {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.demo-player.vertical h3 {
  flex: 1 1 100%;
  margin: 0;
}

.demo-player.vertical video {
  aspect-ratio: 9 / 16;
  flex: 0 1 200px;
  min-width: 0;
  margin: 0;
}

.demo-player.vertical p {
  flex: 1 1 220px;
  margin: 0;
}

/* ---------- install ---------- */

.install-grid { align-items: start; }

.mini-head {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.chips li {
  padding: 8px 20px;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.007em;
  color: var(--ivory);
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 40px;
}

.chips em {
  font-style: normal;
  font-size: 12px;
  color: var(--ash);
}

.small {
  margin: 0 0 14px;
  max-width: 640px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ash);
}

.small:last-child { margin-bottom: 0; }

/* ---------- command table ---------- */

.table-wrap {
  overflow-x: auto;
  background: var(--graphite);
  border: 0;
  border-radius: 12px;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

th {
  padding: 16px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash);
  background: none;
  border-bottom: 1px solid var(--hairline);
}

td {
  padding: 14px 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ash);
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: 0; }

tbody tr:hover td { background: none; }

td code {
  white-space: nowrap;
  color: var(--ivory);
}

/* ---------- docs ---------- */

/* ---------- footer ---------- */

.footer {
  position: relative;
  z-index: 1;
  margin-top: 0;
  padding: 72px 0;
  background: var(--onyx);
  border-top: 1px solid var(--hairline);
}

.footer-inner p {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.5;
  color: var(--ash);
}

.footer-inner strong { color: var(--ivory); font-weight: 500; }

.social {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--ivory);
  border: 1px solid var(--mist);
  border-radius: 50%;
  text-decoration: none;
}

.social a:hover { background: var(--obsidian); }

/* ---------- to top ---------- */

#to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  font-size: 20px;
  color: var(--ivory);
  background: var(--obsidian);
  border: 1px solid var(--mist);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

#to-top.show { opacity: 1; visibility: visible; }
#to-top:hover { background: var(--cobalt); border-color: var(--cobalt); color: var(--white); }

/* ---------- reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.5s ease var(--d, 0ms),
    transform 0.5s ease var(--d, 0ms);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- focus ---------- */

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

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .shot,
  .shot.wide { grid-column: span 6; }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 64px;
    gap: 12px;
    padding: 0 16px;
  }

  .topnav { gap: 4px; }
  .topnav a { padding: 8px 12px; }
  .topnav a:not(.topnav-source):not([href="#demo"]) { display: none; }

  h1 { font-size: clamp(32px, 9vw, 42px); }
  .lede { font-size: 18px; }

  .card-grid { grid-template-columns: 1fr; }
  .demo-grid { grid-template-columns: 1fr; }
  .shot,
  .shot.wide,
  .shot.cell { grid-column: span 12; }
}

@media (max-width: 460px) {
  :root { --gutter: 18px; }
  .rune pre {
    font-size: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .card, .panel, .demo-player, .tracklist { padding: 24px; }
}

@media (max-width: 600px) {
  table { min-width: 0; }
  thead { display: none; }
  tbody tr {
    display: block;
    padding: 12px 20px;
    border-bottom: 1px solid var(--hairline);
  }
  tbody tr:last-child { border-bottom: 0; }
  td {
    display: block;
    padding: 2px 0;
    border: 0;
  }
  td:first-child { margin-bottom: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg-video { display: none; }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- novu-style components ---------- */

.badge {
  display: inline-block;
  margin: 0 0 20px;
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ivory);
  border: 1px solid var(--mist);
  border-radius: 40px;
}

.hero { overflow: hidden; }

.hero-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.9;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.6) 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.6) 70%, transparent 100%);
}

.hero-grid,
.hero-rune,
.hero .strip { position: relative; }

.hero-rune-full {
  max-width: 640px;
  margin: 32px auto 28px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.stats div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 20px;
  background: var(--graphite);
  border: 0;
  border-radius: 12px;
}

.stats dt {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash);
}

.stats dd {
  margin: 0;
  font-size: 21px;
  font-weight: 500;
  color: var(--ivory);
}

/* ---------- engine strip ---------- */

.strip { border-top: 1px solid var(--hairline); }

.strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 24px;
  padding-top: 28px;
  padding-bottom: 28px;
}

.strip-inner p {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash);
}

.strip-inner ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.strip-inner li {
  padding: 8px 20px;
  font-size: 14px;
  color: var(--ivory);
  border: 1px solid var(--hairline);
  border-radius: 40px;
}

/* ---------- tabs ---------- */

.tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--graphite);
  border: 0;
  border-radius: 40px;
}

.tab {
  padding: 10px 28px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ash);
  background: transparent;
  border: 0;
  border-radius: 32px;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  color: var(--white);
  background: var(--cobalt);
}

.tab-panel .shot { max-width: 900px; }
.tab-panel .rune { max-width: 900px; }
.tab-panel .small { margin-top: 16px; }

/* ---------- four cards ---------- */

.card-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- faq ---------- */

.faq { max-width: 800px; }

.faq details {
  padding: 20px 0;
  border-bottom: 1px solid var(--hairline);
}

.faq details:first-child { border-top: 1px solid var(--hairline); }

.faq summary {
  font-size: 18px;
  font-weight: 500;
  color: var(--ivory);
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  float: right;
  color: var(--ash);
}

.faq details[open] summary::after { content: "–"; }

.faq details p {
  margin: 12px 0 4px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ash);
}

/* ---------- footer columns ---------- */

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.footer-col h3 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash);
}

.footer-col a {
  display: block;
  width: fit-content;
  padding: 5px 0;
  font-size: 14px;
  color: var(--ivory);
  text-decoration: none;
}

.footer-col a:hover { text-decoration: underline; text-underline-offset: 3px; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
}

.footer-bottom p { margin: 0; }

/* ---------- novu components responsive ---------- */

@media (max-width: 980px) {
  .card-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shot.cell { grid-column: span 6; }
}

@media (max-width: 760px) {
  .footer-cols { grid-template-columns: 1fr; }
  .card-grid.four { grid-template-columns: 1fr; }
  .strip-inner { flex-direction: column; }
  .stats div { padding: 10px 16px; }
  .stats dd { font-size: 18px; }
}
