/* ============================================================
   CSS SUBGRID DEMO  ·  prefix: dm-sg-
   ============================================================ */

.dm-sg-stage {
  position: relative;
  min-height: 100%;
  width: 100%;
  padding: 80px 6vw 120px;
  background:
    radial-gradient(circle at 12% 0%, #1a1530 0%, transparent 55%),
    radial-gradient(circle at 88% 100%, #0c1a2c 0%, transparent 55%),
    #07060d;
  color: #e8e6f0;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── INTRO ── */
.dm-sg-intro {
  max-width: 880px;
  margin: 0 auto 60px;
  text-align: center;
}

.dm-sg-eyebrow {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #a78bfa;
  padding: 6px 14px;
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.06);
  margin-bottom: 24px;
}

.dm-sg-headline {
  font-size: clamp(1.9rem, 3.6vw, 2.85rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0 0 22px;
  color: #fff;
  background: linear-gradient(135deg, #fff 0%, #c5b8ff 65%, #7dd3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dm-sg-lead {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #b4b0c8;
  margin: 0;
}

.dm-sg-lead strong {
  color: #fff;
  font-weight: 600;
  background: linear-gradient(120deg, rgba(167,139,250,0.25) 0%, rgba(167,139,250,0.25) 100%);
  background-size: 100% 0.4em;
  background-repeat: no-repeat;
  background-position: 0 88%;
  padding: 0 2px;
}

/* ── COMPARE GRID ── */
.dm-sg-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  max-width: 1280px;
  margin: 0 auto 60px;
}

@media (max-width: 900px) {
  .dm-sg-compare { grid-template-columns: 1fr; }
}

.dm-sg-compare-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dm-sg-compare-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
}

.dm-sg-compare-tag--bad {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.dm-sg-compare-tag--good {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.dm-sg-tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.dm-sg-compare-frame {
  position: relative;
  padding: 24px 18px 20px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
}

/* dashed alignment lines */
.dm-sg-rule {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1px;
  background-image: linear-gradient(to right, rgba(252, 165, 165, 0.55) 50%, transparent 50%);
  background-size: 8px 1px;
  background-repeat: repeat-x;
  pointer-events: none;
  z-index: 2;
  opacity: 0.6;
}

.dm-sg-rule--good {
  background-image: linear-gradient(to right, rgba(134, 239, 172, 0.7) 50%, transparent 50%);
  opacity: 0.85;
}

.dm-sg-compare-note {
  font-size: 0.875rem;
  line-height: 1.55;
  color: #8e8aa6;
  margin: 0;
  padding: 0 4px;
}

/* ── CARDS WRAPPERS ── */

/* BAD: each card is its own grid, so rows do not align across siblings */
.dm-sg-cards--bad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

.dm-sg-card--bad {
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 10px;
  background: #15121f;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
}

/* GOOD: parent owns rows, children inherit them via subgrid */
.dm-sg-cards--good {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
}

.dm-sg-card--good {
  grid-row: span 4;
  display: grid;
  grid-template-rows: subgrid;
  gap: 10px;
  background: #131a1f;
  border: 1px solid rgba(134, 239, 172, 0.18);
  border-radius: 12px;
  padding: 12px;
}

/* ── CARD INTERNALS ── */
.dm-sg-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
}

.dm-sg-card-brand {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a78bfa;
  font-weight: 600;
}

.dm-sg-card--good .dm-sg-card-brand { color: #86efac; }

.dm-sg-card-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dm-sg-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.dm-sg-card-desc {
  font-size: 0.78rem;
  line-height: 1.5;
  color: #8e8aa6;
  margin: 0;
}

.dm-sg-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.dm-sg-card-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.dm-sg-card-btn {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 7px 10px;
  background: #fff;
  color: #0a0716;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease;
}

.dm-sg-card-btn:hover { transform: translateY(-1px); }

/* ── CODE BLOCK ── */
.dm-sg-codeblock {
  max-width: 920px;
  margin: 0 auto 80px;
  background: #0a0814;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
}

.dm-sg-codeblock--mini {
  max-width: 720px;
  margin-bottom: 80px;
}

.dm-sg-code-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dm-sg-code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.dm-sg-code-dot:nth-child(1) { background: #ff5f57; }
.dm-sg-code-dot:nth-child(2) { background: #febc2e; }
.dm-sg-code-dot:nth-child(3) { background: #28c840; }

.dm-sg-code-file {
  margin-left: 10px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  color: #8e8aa6;
}

.dm-sg-code {
  margin: 0;
  padding: 22px 26px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.75;
  color: #d6d4e4;
  white-space: pre;
  overflow-x: auto;
}

.dm-sg-code-explain {
  display: grid;
  gap: 14px;
  padding: 22px 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.dm-sg-code-explain > div {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #b4b0c8;
}

.dm-sg-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #7dd3fc);
  color: #0a0716;
  font-weight: 700;
  font-size: 12px;
}

.dm-sg-code-explain code {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.82rem;
  padding: 1px 6px;
  background: rgba(167, 139, 250, 0.15);
  color: #c5b8ff;
  border-radius: 4px;
}

/* ── SECTION HEADS ── */
.dm-sg-section-head {
  max-width: 760px;
  margin: 0 auto 36px;
  text-align: center;
}

.dm-sg-h3 {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 16px 0 10px;
}

.dm-sg-section-sub {
  color: #8e8aa6;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.55;
}

/* ── MAGAZINE SUBGRID ── */
.dm-sg-mag {
  display: grid;
  grid-template-columns: 1fr 2fr 2fr 1fr;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto 28px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

@media (max-width: 900px) {
  .dm-sg-mag { grid-template-columns: 1fr 1fr; }
}

.dm-sg-mag-col--side {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dm-sg-mag-side-tag {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7dd3fc;
  font-weight: 700;
  grid-column: 1;
  align-self: center;
}

.dm-sg-mag-col--side h5 {
  grid-column: 2 / 4;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  letter-spacing: -0.01em;
}

.dm-sg-mag-col--side p {
  grid-column: 4;
  font-size: 0.82rem;
  color: #8e8aa6;
  margin: 0;
  line-height: 1.45;
}

.dm-sg-mag-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dm-sg-mag-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  border-radius: 10px;
  margin-bottom: 4px;
}

.dm-sg-mag-kicker {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #a78bfa;
  font-weight: 700;
}

.dm-sg-mag-headline {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
  margin: 0;
}

.dm-sg-mag-lead {
  font-size: 0.85rem;
  line-height: 1.55;
  color: #b4b0c8;
  margin: 0;
}

.dm-sg-mag-side {
  background: rgba(125, 211, 252, 0.06);
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dm-sg-mag-side-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: #7dd3fc;
  letter-spacing: -0.04em;
  line-height: 1;
}

.dm-sg-mag-side h6 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.dm-sg-mag-side p {
  font-size: 0.8rem;
  color: #8e8aa6;
  margin: 0;
  line-height: 1.45;
}

/* ── USE CASES ── */
.dm-sg-uses {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 1080px;
  margin: 0 auto 60px;
}

@media (max-width: 800px) {
  .dm-sg-uses { grid-template-columns: 1fr; }
}

.dm-sg-use {
  padding: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.dm-sg-use:hover {
  border-color: rgba(167, 139, 250, 0.4);
  transform: translateY(-2px);
}

.dm-sg-use-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(167,139,250,0.2), rgba(125,211,252,0.15));
  color: #c5b8ff;
  border-radius: 10px;
  margin-bottom: 4px;
}

.dm-sg-use h5 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  letter-spacing: -0.01em;
}

.dm-sg-use p {
  font-size: 0.85rem;
  line-height: 1.55;
  color: #8e8aa6;
  margin: 0;
}

/* ── BROWSER SUPPORT ── */
.dm-sg-support {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto 48px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(34,197,94,0.08), rgba(125,211,252,0.05));
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 12px;
}

.dm-sg-support-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.dm-sg-support-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.88rem;
}

.dm-sg-support-text strong {
  color: #fff;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.dm-sg-support-text span {
  color: #b4b0c8;
  line-height: 1.5;
}

.dm-sg-support-text em {
  font-style: normal;
  color: #86efac;
  font-weight: 600;
}

/* ── OUTRO ── */
.dm-sg-outro {
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6b6783;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 720px;
  margin: 0 auto;
}
