/* /demos/ gallery. Loaded only on that page. */

/* ── hero: always dark, in both themes ── */
.dg-hero {
  --h-bg: #0E2B35; --h-ink: #EAF3F3; --h-ink-2: #A9C2C7; --h-line: rgb(255 255 255 / 14%); --h-accent: #6CD9C8;
  position: relative; overflow: hidden; margin-top: var(--s4);
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem);
  background:
    radial-gradient(900px 480px at 85% 30%, rgb(108 196 214 / 22%), transparent 65%),
    radial-gradient(600px 400px at 0% 100%, rgb(95 227 208 / 10%), transparent 70%),
    var(--h-bg);
  color: var(--h-ink);
}
:root[data-theme="dark"] .dg-hero { --h-bg: #10262D; border-block: 1px solid var(--line); }
.dg-hero__inner { display: grid; gap: var(--s7); align-items: center; }
@media (min-width: 1000px) { .dg-hero__inner { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.dg-hero h1 { color: var(--h-ink); font-size: var(--h1); max-width: 16ch; }
.dg-hero__kicker { display: inline-flex; align-items: center; gap: var(--s2); margin-bottom: var(--s4); padding: 4px 12px 4px 10px; border: 1px solid var(--h-line); border-radius: 999px; font-size: var(--text-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--h-accent); }
.dg-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--h-accent); box-shadow: 0 0 0 0 rgb(108 217 200 / 60%); animation: dg-pulse 2s infinite; }
@keyframes dg-pulse { 70% { box-shadow: 0 0 0 8px rgb(108 217 200 / 0%); } 100% { box-shadow: 0 0 0 0 rgb(108 217 200 / 0%); } }
.dg-hero__lede { margin-top: var(--s4); max-width: 34rem; font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); color: var(--h-ink-2); }
.dg-hero__stats { display: flex; flex-wrap: wrap; gap: var(--s5) var(--s6); margin: var(--s6) 0 0; }
.dg-hero__stats div { display: flex; flex-direction: column-reverse; gap: 2px; padding-left: var(--s3); border-left: 2px solid var(--h-accent); }
.dg-hero__stats dt { font-size: var(--text-xs); color: var(--h-ink-2); }
.dg-hero__stats dd { margin: 0; font-size: 2rem; line-height: 1; font-weight: 620; font-stretch: var(--display-stretch); font-variant-numeric: tabular-nums; }
.dg-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); margin-top: var(--s6); }
.dg-hero .button--primary { background: var(--h-accent); color: #06181E; }
.dg-hero .button--primary:hover { background: #9BE8DC; color: #06181E; }
.dg-hero__all { color: var(--h-ink); font-weight: 600; text-decoration: none; padding-block: var(--s2); }
.dg-hero__all:hover { text-decoration: underline; }
.dg-hero :focus-visible { outline-color: var(--h-accent); }

/* mosaic of the demo images */
.dg-mosaic { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); gap: 10px; }
.dg-mosaic__tile { position: relative; display: block; overflow: hidden; border-radius: var(--r-lg); border: 1px solid var(--h-line); background: #0b1a20; aspect-ratio: 16 / 10; box-shadow: 0 18px 40px -20px rgb(0 0 0 / 70%); }
.dg-mosaic__tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease); }
.dg-mosaic__tile span { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #EAF3F3; background: rgb(6 24 30 / 72%); }
.dg-mosaic__tile:hover img { transform: scale(1.06); }
.dg-mosaic__tile--1 { grid-column: 1 / 3; grid-row: 1 / 3; aspect-ratio: auto; }
.dg-mosaic__tile--2 { grid-column: 3; grid-row: 1; }
.dg-mosaic__tile--3 { grid-column: 3; grid-row: 2; }
.dg-mosaic__tile--4 { grid-column: 1; grid-row: 3; }
.dg-mosaic__tile--5 { grid-column: 2 / 4; grid-row: 3; aspect-ratio: auto; }
@media (min-width: 1000px) {
  .dg-mosaic { transform: perspective(1600px) rotateY(-9deg) rotateX(3deg); transform-origin: left center; }
  .dg-mosaic__tile { animation: dg-rise .7s var(--ease) both; }
  .dg-mosaic__tile--2 { animation-delay: .08s; } .dg-mosaic__tile--3 { animation-delay: .16s; }
  .dg-mosaic__tile--4 { animation-delay: .24s; } .dg-mosaic__tile--5 { animation-delay: .32s; }
}
@keyframes dg-rise { from { opacity: 0; transform: translateY(14px); } }
@media (max-width: 599px) { .dg-mosaic__tile span { display: none; } }

/* ── filter chips ── */
.dg-gallery { padding-top: clamp(2rem, 1.5rem + 2vw, 3.5rem); scroll-margin-top: 4rem; }
.dg-filter { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); }
.dg-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; font: inherit; font-size: var(--text-sm); font-weight: 500; color: var(--ink); background: var(--surface); border: 1px solid var(--control); border-radius: 999px; cursor: pointer; transition: background-color var(--fast), border-color var(--fast), color var(--fast); }
.dg-chip span { font-size: var(--text-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dg-chip:hover { border-color: var(--ink); }
.dg-chip[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: var(--on-teal); }
.dg-chip[aria-pressed="true"] span { color: inherit; opacity: .8; }

/* ── cards ── */
.dg-card { position: relative; display: flex; flex-direction: column; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: border-color var(--fast), box-shadow var(--med), transform var(--med) var(--ease); }
.dg-card:hover, .dg-card:focus-within { border-color: var(--teal); box-shadow: var(--shadow); transform: translateY(-3px); }
.dg-card[hidden] { display: none; }
.dg-card__media { position: relative; overflow: hidden; background: #0b1a20; aspect-ratio: 16 / 10; }
.dg-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.dg-card:hover .dg-card__media img { transform: scale(1.04); }
.dg-card__badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.dg-badge { font-size: var(--text-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #EAF3F3; background: rgb(6 24 30 / 82%); padding: 3px 10px; border-radius: 999px; }
.dg-badge--live { color: #6CD9C8; }
.dg-badge--live::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 2px; }
.dg-card__body { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); flex: 1; }
.dg-card__q { margin: 0; color: var(--link); font-weight: 600; font-size: var(--text-sm); }
.dg-card__name { margin: 0; font-size: 1.75rem; line-height: 1.05; }
.dg-card__name a { color: inherit; text-decoration: none; }
.dg-card__name a::after { content: ''; position: absolute; inset: 0; z-index: 1; } /* whole card is the link */
.dg-card__name a:focus-visible { outline: none; }
.dg-card:has(.dg-card__name a:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.dg-card__place { display: flex; align-items: center; gap: 6px; margin: 0; font-size: var(--text-sm); color: var(--ink-2); }
.dg-card__place svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--teal); stroke-width: 2; }
.dg-card__text { margin: 0; color: var(--ink-2); }
.dg-card__label { display: block; margin: 0 0 var(--s1); font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.dg-card__uses .dg-card__label { display: inline; margin-right: 4px; }
.dg-card__try ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: try; }
.dg-card__try li { counter-increment: try; position: relative; padding-left: 30px; font-size: var(--text-sm); }
.dg-card__try li::before { content: counter(try); position: absolute; left: 0; top: 0; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-wash); color: var(--link); font-size: 12px; font-weight: 700; }
.dg-card__uses { margin: 0; font-size: var(--text-sm); color: var(--ink-2); }
.dg-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.dg-card__tags span { font-size: var(--text-xs); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--ink-2); }
.dg-card__go { margin-top: auto; padding-top: var(--s2); font-weight: 600; color: var(--link); }
.dg-card:hover .dg-card__go { text-decoration: underline; text-underline-offset: .2em; }

/* featured card: image beside the text on wide screens */
.dg-card--featured { margin-bottom: var(--s5); }
.dg-card--featured .dg-card__name { font-size: var(--h2); }
@media (min-width: 900px) {
  .dg-card--featured { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .dg-card--featured .dg-card__media { aspect-ratio: auto; min-height: 100%; }
  .dg-card--featured .dg-card__body { padding: var(--s6); }
}

.dg-grid { display: grid; gap: var(--s5); }
@media (min-width: 760px) { .dg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── how it works with your data ── */
.dg-yours h2 { max-width: 20ch; }
.dg-yours__lede { margin-top: var(--s3); max-width: 40rem; color: var(--ink-2); }
.dg-steps { list-style: none; margin: var(--s6) 0 0; padding: 0; display: grid; gap: var(--s4); counter-reset: step; }
@media (min-width: 760px) { .dg-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dg-steps li { counter-increment: step; display: grid; gap: var(--s2); padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--teal); border-radius: var(--r); }
.dg-steps li::before { content: '0' counter(step); font-size: var(--text-xs); font-weight: 700; letter-spacing: .08em; color: var(--link); }
.dg-steps strong { font-size: 1.125rem; }
.dg-steps span { font-size: var(--text-sm); color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  .dg-pulse, .dg-mosaic__tile { animation: none; }
  .dg-card, .dg-card__media img, .dg-mosaic__tile img { transition: none; }
  .dg-card:hover, .dg-card:focus-within { transform: none; }
}
