@layer reset, tokens, base, layout, components, utilities;

/* ==================== 1. RESET ==================== */
@layer reset {
  :where(
    html, body, div, span, header, nav, main, section, article, aside, footer,
    figure, figcaption, picture, img, blockquote, h1, h2, h3, h4, p, ul, ol, li,
    details, summary, dialog, form, label, input, button, a, svg
  ) {
    box-sizing: border-box;
  }

  :where(body, h1, h2, h3, h4, p, figure, blockquote, ul, ol) {
    margin: 0;
  }

  :where(ul, ol) {
    padding: 0;
    list-style: none;
  }

  :where(img, svg) {
    display: block;
    max-inline-size: 100%;
  }

  :where(img) {
    block-size: auto;
  }

  :where(button, input) {
    font: inherit;
    color: inherit;
  }
}

/* ==================== 2. DESIGN TOKENS ==================== */
@layer tokens {
  :root {
    color-scheme: dark;

    /* Surfaces */
    --bg-void: #080b12;
    --bg-deep: #0d121d;
    --bg-card: #121827;
    --bg-card-elevated: #182034;
    --bg-stage: #0b0f19;

    /* Accents */
    --gold-bright: #f7dfa0;
    --gold-main: #deb868;
    --gold-deep: #9e742b;
    --etsy-ember: #f1641e;
    --etsy-ember-hover: #ff7633;
    --emerald-main: #38d9a9;
    --emerald-deep: #134e3e;
    --cyan-main: #38bdf8;
    --cyan-deep: #0b2944;
    --violet-main: #9775fa;
    --violet-deep: #2e2159;
    --crimson-alert: #ff6b6b;

    /* Text */
    --text-primary: #f5f2eb;
    --text-secondary: #c4cad9;
    --text-muted: #939db5;
    --text-dark: #0a0d14;

    /* Borders & Glows */
    --border-subtle: rgb(255 255 255 / 0.09);
    --border-gold: rgb(222 184 104 / 0.3);
    --border-gold-strong: rgb(247 223 160 / 0.58);
    --shadow-card: 0 20px 50px rgb(0 0 0 / 0.48);
    --focus-ring: #f7dfa0;

    /* Typography */
    --font-display: "Palatino Linotype", "Book Antiqua", Georgia, serif;
    --font-sans: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;

    /* Radii & Spacing */
    --radius-sm: 0.5rem;
    --radius-md: 0.875rem;
    --radius-lg: 1.25rem;
    --radius-pill: 999rem;
    --container-max: 78rem;
  }
}

/* ==================== 3. BASE ==================== */
@layer base {
  html {
    scroll-behavior: smooth;
    scroll-padding-block-start: 5.5rem;
    background-color: var(--bg-void);
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
  }

  body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background:
      radial-gradient(circle at 18% 8%, rgb(151 117 250 / 0.11), transparent 42%),
      radial-gradient(circle at 84% 14%, rgb(222 184 104 / 0.1), transparent 38%),
      linear-gradient(180deg, var(--bg-void) 0%, var(--bg-deep) 55%, var(--bg-void) 100%);
    overflow-wrap: anywhere;
    text-align: start;
  }

  h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--text-primary);
    line-height: 1.18;
    letter-spacing: -0.01em;
    text-wrap: balance;
  }

  h1 {
    font-size: clamp(2rem, 1.35rem + 2.8vw, 3.85rem);
  }

  h2 {
    font-size: clamp(1.65rem, 1.2rem + 1.8vw, 2.75rem);
  }

  h3 {
    font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.75rem);
  }

  p, li, blockquote {
    text-wrap: pretty;
  }

  code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    padding-inline: 0.35em;
    padding-block: 0.1em;
    border-radius: 0.3rem;
    background: rgb(255 255 255 / 0.08);
    color: var(--gold-bright);
  }

  a {
    color: var(--gold-bright);
    text-underline-offset: 0.22em;
    transition: color 0.18s ease;
  }

  a:hover {
    color: #ffffff;
  }

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

/* ==================== 4. LAYOUT ==================== */
@layer layout {
  .container {
    inline-size: min(100% - 2rem, var(--container-max));
    margin-inline: auto;
  }

  .section {
    padding-block: clamp(3.75rem, 2.5rem + 4vw, 6.25rem);
    position: relative;
  }

  .section-header {
    max-inline-size: 52rem;
    margin-inline: auto;
    margin-block-end: clamp(2.25rem, 1.5rem + 2vw, 3.5rem);
    text-align: center;
  }

  .section-kicker {
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold-main);
    margin-block-end: 0.65rem;
  }

  .section-sub {
    margin-block-start: 1rem;
    font-size: 1.0625rem;
    color: var(--text-secondary);
    max-inline-size: 62ch;
    margin-inline: auto;
  }

  /* Sticky Header */
  .site-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 50;
    background: rgb(8 11 18 / 0.84);
    backdrop-filter: blur(14px);
    border-block-end: 1px solid var(--border-subtle);
  }

  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.75rem;
    flex-wrap: wrap;
  }

  .brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
  }

  .brand-coin {
    inline-size: 3rem;
    block-size: 3rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    padding: 0.28rem;
    background: radial-gradient(circle at 32% 24%, #222b44 0%, #0b0f1b 76%);
    border: 2px solid var(--border-gold-strong);
    box-shadow: 0 0 18px rgb(222 184 104 / 0.24), inset 0 1px 0 rgb(255 255 255 / 0.14);
    flex-shrink: 0;
  }

  .brand-coin-sm {
    inline-size: 2.25rem;
    block-size: 2.25rem;
    padding: 0.2rem;
    border-width: 1.5px;
  }

  .brand-dc-mark {
    inline-size: 100%;
    block-size: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.55));
  }

  .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
  }

  .brand-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.01em;
  }

  .brand-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
  }

  .nav-list {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 1.8vw, 1.75rem);
    flex-wrap: wrap;
  }

  .nav-list a {
    display: inline-flex;
    align-items: center;
    min-block-size: 1.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding-block: 0.35rem;
  }

  @media (pointer: coarse) {
    .nav-list a {
      min-block-size: 2.75rem;
    }
  }

  .nav-list a:hover {
    color: var(--gold-bright);
  }

  @media (max-width: 52rem) {
    .primary-nav {
      order: 3;
      inline-size: 100%;
      border-block-start: 1px solid var(--border-subtle);
      padding-block-start: 0.5rem;
    }

    .nav-list {
      justify-content: space-between;
    }
  }

  /* Opening Storefront Section Spacing */
  .shop-section {
    padding-block-start: clamp(2rem, 1.25rem + 2.5vw, 3.5rem);
  }

  .apps-grid > *,
  .updates-grid > * {
    min-inline-size: 0;
  }

  /* Apps Grid: Featured Top-Row Full Span + 2-Column Companion Row */
  .apps-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1.5rem, 2.5vw, 2.25rem);
    align-items: stretch;
  }

  @media (min-width: 62rem) {
    .apps-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-card-featured {
      grid-column: 1 / -1;
    }
  }

  /* Updates & Footer */
  .updates-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: stretch;
  }

  @media (max-width: 56rem) {
    .updates-grid {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  .site-footer {
    border-block-start: 1px solid var(--border-subtle);
    background: #06080e;
    padding-block: 2rem;
  }

  .footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-muted);
  }

  .footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .footer-crest {
    inline-size: 2.25rem;
    block-size: 2.25rem;
    border-radius: 50%;
    border: 1px solid var(--border-gold);
  }

  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
  }
}

/* ==================== 5. COMPONENTS ==================== */
@layer components {
  /* Skip Link */
  .skip-link {
    position: absolute;
    inset-block-start: -10rem;
    inset-inline-start: 1rem;
    z-index: 200;
    padding: 0.75rem 1.25rem;
    background: var(--gold-bright);
    color: var(--text-dark);
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-decoration: none;
  }

  .skip-link:focus {
    inset-block-start: 0.75rem;
  }

  /* Buttons (min-block-size instead of fixed height for WCAG 1.4.12) */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-block-size: 3rem;
    padding-block: 0.65rem;
    padding-inline: 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  }

  @media (prefers-reduced-motion: no-preference) {
    .btn {
      transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.16s ease;
    }

    .btn:hover:not(:disabled) {
      transform: translateY(-1px);
    }
  }

  .btn-compact {
    min-block-size: 2.625rem;
    padding-block: 0.45rem;
    padding-inline: 1rem;
    font-size: 0.875rem;
  }

  .btn-lg {
    min-block-size: 3.25rem;
    padding-block: 0.8rem;
    padding-inline: 1.5rem;
    font-size: 1rem;
  }

  .btn-full {
    inline-size: 100%;
  }

  .btn-etsy {
    background: var(--etsy-ember);
    color: #ffffff;
    box-shadow: 0 8px 24px rgb(241 100 30 / 0.32);
  }

  .btn-etsy:hover:not(:disabled) {
    background: var(--etsy-ember-hover);
    color: #ffffff;
  }

  .btn-gold {
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-main));
    color: var(--text-dark);
  }

  .btn-gold:hover:not(:disabled) {
    background: var(--gold-bright);
    color: var(--text-dark);
  }

  .btn-gold-outline {
    background: rgb(222 184 104 / 0.1);
    border-color: var(--border-gold-strong);
    color: var(--gold-bright);
  }

  .btn-gold-outline:hover:not(:disabled) {
    background: rgb(222 184 104 / 0.2);
    color: #ffffff;
  }

  .btn-secondary {
    background: rgb(255 255 255 / 0.06);
    border-color: rgb(255 255 255 / 0.18);
    color: var(--text-primary);
  }

  .btn-secondary:hover:not(:disabled) {
    background: rgb(255 255 255 / 0.12);
    border-color: var(--border-gold);
  }

  .btn-emerald {
    background: var(--emerald-main);
    color: #052018;
    box-shadow: 0 8px 24px rgb(56 217 169 / 0.22);
  }

  .btn-emerald:hover:not(:disabled) {
    background: #63e6be;
    color: #052018;
  }

  .btn-cyan {
    background: var(--cyan-main);
    color: #051324;
    box-shadow: 0 8px 24px rgb(56 189 248 / 0.25);
  }

  .btn-cyan:hover:not(:disabled) {
    background: #7dd3fc;
    color: #051324;
  }

  .btn-violet {
    background: var(--violet-main);
    color: #100926;
    box-shadow: 0 8px 24px rgb(151 117 250 / 0.25);
  }

  .btn-violet:hover:not(:disabled) {
    background: #b197fc;
    color: #100926;
  }

  .btn-ghost {
    background: rgb(255 255 255 / 0.04);
    border-color: var(--border-subtle);
    color: var(--text-secondary);
  }

  .btn-ghost:hover:not(:disabled) {
    background: rgb(255 255 255 / 0.1);
    border-color: rgb(255 255 255 / 0.24);
    color: #ffffff;
  }

  /* Hand-Inked Character Vellum Medallion */
  .vellum-medallion {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #fdf9f0 0%, #f1e3c6 68%, #dfc99f 100%);
    border: 2px solid var(--gold-main);
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.38), inset 0 1px 2px rgb(255 255 255 / 0.82);
    overflow: hidden;
    flex-shrink: 0;
  }

  .vellum-medallion img {
    inline-size: 88%;
    block-size: 88%;
    object-fit: contain;
  }

  .shop-story h1 {
    font-size: clamp(1.95rem, 1.35rem + 2.2vw, 3.15rem);
  }

  .shop-feeder-note {
    margin-block-start: 1.15rem;
    font-size: 0.875rem;
    color: var(--text-muted);
  }

  .shop-feeder-note a {
    font-weight: 600;
    color: var(--emerald-main);
  }

  .shop-feeder-note a:hover {
    color: #63e6be;
  }

  /* App Showcase Cards */
  .app-card {
    container-type: inline-size;
    container-name: app-card;
    background: linear-gradient(180deg, var(--bg-card-elevated) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    display: flex;
  }

  .app-card-masters {
    border-block-start: 3px solid var(--cyan-main);
    background:
      radial-gradient(circle at 14% 12%, rgb(56 189 248 / 0.09), transparent 44%),
      linear-gradient(180deg, var(--bg-card-elevated) 0%, var(--bg-card) 100%);
  }

  .app-card-connections {
    border-block-start: 3px solid var(--emerald-main);
  }

  .app-card-display {
    border-block-start: 3px solid var(--violet-main);
  }

  .app-card-inner {
    padding: clamp(1.35rem, 2.5vw, 2rem);
    display: flex;
    flex-direction: column;
    inline-size: 100%;
  }

  .app-top-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-block-end: 0.85rem;
  }

  .app-badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .app-pill {
    display: inline-flex;
    align-items: center;
    min-block-size: 1.65rem;
    padding-block: 0.15rem;
    padding-inline: 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
  }

  .pill-cyan {
    background: rgb(56 189 248 / 0.16);
    border: 1px solid rgb(56 189 248 / 0.48);
    color: #7dd3fc;
  }

  .pill-emerald {
    background: rgb(56 217 169 / 0.16);
    border: 1px solid rgb(56 217 169 / 0.45);
    color: #63e6be;
  }

  .pill-violet {
    background: rgb(151 117 250 / 0.18);
    border: 1px solid rgb(151 117 250 / 0.48);
    color: #d0bfff;
  }

  .pill-status {
    background: rgb(222 184 104 / 0.13);
    border: 1px solid var(--border-gold);
    color: var(--gold-bright);
  }

  .app-platform-tag {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
  }

  .app-header-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-block-end: 0.85rem;
  }

  .app-header-titles {
    min-inline-size: 0;
    flex: 1;
  }

  .app-icon-squircle {
    display: block;
    inline-size: 4rem;
    block-size: 4rem;
    border-radius: 0.95rem;
    overflow: hidden;
    flex-shrink: 0;
    background: #0d1220;
    border: 1px solid rgb(255 255 255 / 0.16);
    box-shadow: 0 8px 20px rgb(0 0 0 / 0.42);
  }

  .app-icon-squircle img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
  }

  .app-icon-squircle-sm {
    inline-size: 2.75rem;
    block-size: 2.75rem;
    border-radius: 0.65rem;
  }

  .icon-squircle-cyan {
    border-color: rgb(56 189 248 / 0.55);
    box-shadow: 0 8px 22px rgb(56 189 248 / 0.22);
  }

  .icon-squircle-emerald {
    border-color: rgb(56 217 169 / 0.48);
    box-shadow: 0 8px 22px rgb(56 217 169 / 0.18);
  }

  .icon-squircle-violet {
    border-color: rgb(50 156 207 / 0.52);
    box-shadow: 0 8px 22px rgb(50 156 207 / 0.2);
  }

  @container app-card (max-width: 24rem) {
    .app-header-row {
      flex-direction: column;
      gap: 0.75rem;
    }
  }

  .app-title {
    margin-block-end: 0.35rem;
  }

  .app-tagline {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gold-bright);
    margin-block-end: 0.75rem;
  }

  .app-header-titles .app-tagline {
    margin-block-end: 0;
  }

  .app-summary {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-block-end: 1.25rem;
  }

  /* Featured Full-Span Masters Card Interior Grid (Container Query) */
  .masters-showcase-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.35rem;
    flex-grow: 1;
  }

  .masters-preview-col,
  .masters-details-col {
    min-inline-size: 0;
    display: flex;
    flex-direction: column;
  }

  @container app-card (inline-size > 52rem) {
    .masters-showcase-grid {
      grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
      gap: clamp(1.35rem, 2.5cqi, 2.25rem);
      align-items: stretch;
    }

    .masters-preview-col .interactive-preview {
      margin-block-end: 0;
      margin-block-start: auto;
    }
  }

  /* Interactive Mini-Demos Inside App Cards */
  .interactive-preview {
    contain: layout style paint;
    background: var(--bg-stage);
    border: 1px solid rgb(255 255 255 / 0.12);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-block-end: 1.35rem;
  }

  .preview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    background: rgb(255 255 255 / 0.04);
    border-block-end: 1px solid var(--border-subtle);
  }

  .preview-window-title {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    min-inline-size: 0;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
  }

  .dcd-studio-badge,
  .dcm-studio-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.48rem;
    border-radius: 0.3rem;
    background: #131d30;
    border: 1px solid #284369;
    color: #329ccf;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
  }

  .dcm-studio-badge {
    background: #0e223d;
    border-color: rgb(56 189 248 / 0.5);
    color: #7dd3fc;
  }

  .preview-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .demo-chip {
    min-block-size: 2rem;
    min-inline-size: 1.75rem;
    padding-block: 0.25rem;
    padding-inline: 0.65rem;
    border-radius: 0.4rem;
    border: 1px solid rgb(255 255 255 / 0.18);
    background: rgb(255 255 255 / 0.06);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
  }

  @media (pointer: coarse) {
    .demo-chip {
      min-block-size: 2.75rem;
      min-inline-size: 2.75rem;
      padding-inline: 0.75rem;
    }
  }

  .demo-chip:hover {
    background: rgb(255 255 255 / 0.14);
  }

  .demo-chip.is-cyan {
    background: rgb(56 189 248 / 0.18);
    border-color: rgb(56 189 248 / 0.55);
    color: #bae6fd;
  }

  .demo-chip.is-emerald {
    background: rgb(56 217 169 / 0.16);
    border-color: rgb(56 217 169 / 0.5);
    color: #96f2d7;
  }

  .demo-chip.is-gold {
    background: rgb(222 184 104 / 0.16);
    border-color: rgb(222 184 104 / 0.55);
    color: var(--gold-bright);
  }

  .demo-chip.is-violet {
    background: rgb(151 117 250 / 0.18);
    border-color: rgb(151 117 250 / 0.55);
    color: #e5dbff;
  }

  .preview-status-bar {
    padding: 0.55rem 0.85rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    background: rgb(0 0 0 / 0.35);
    border-block-start: 1px solid var(--border-subtle);
  }

  /* Dice Chaos Masters 3D Parametric CAD & MSLA Stage */
  .dcm-cad-stage {
    position: relative;
    aspect-ratio: 560 / 252;
    background: #080d1c;
    overflow: clip;
  }

  .dcm-cad-svg {
    inline-size: 100%;
    block-size: 100%;
  }

  /* 4 Studio Resin Material Presets (Arcane Sapphire, Master Grey, Cure Clear, Obsidian) */
  .dcm-cad-stage {
    --f-crown: #1d3f7a;
    --f-top-l: #1a3568;
    --f-top-r: #152b56;
    --f-mid-l: #162e5c;
    --f-mid-r: #112347;
    --f-side-l: #12254b;
    --f-side-r: #0d1c3b;
    --f-bot-l: #0e1d3d;
    --f-bot-r: #0b1631;
    --f-bot-c: #102044;
    --f-num: #fde68a;
  }

  .dcm-cad-stage[data-resin-shader="grey"] {
    --f-crown: #576375;
    --f-top-l: #4d596b;
    --f-top-r: #434e5e;
    --f-mid-l: #465263;
    --f-mid-r: #3b4554;
    --f-side-l: #3d4857;
    --f-side-r: #313a47;
    --f-bot-l: #333c4a;
    --f-bot-r: #29313d;
    --f-bot-c: #36404f;
    --f-num: #f8fafc;
  }

  .dcm-cad-stage[data-resin-shader="clear"] {
    --f-crown: rgba(125, 211, 252, 0.34);
    --f-top-l: rgba(125, 211, 252, 0.28);
    --f-top-r: rgba(96, 165, 250, 0.24);
    --f-mid-l: rgba(103, 232, 249, 0.26);
    --f-mid-r: rgba(96, 165, 250, 0.2);
    --f-side-l: rgba(56, 189, 248, 0.22);
    --f-side-r: rgba(59, 130, 246, 0.18);
    --f-bot-l: rgba(56, 189, 248, 0.18);
    --f-bot-r: rgba(37, 99, 235, 0.16);
    --f-bot-c: rgba(56, 189, 248, 0.21);
    --f-num: #e0f2fe;
  }

  .dcm-cad-stage[data-resin-shader="obsidian"] {
    --f-crown: #1d1a2f;
    --f-top-l: #181529;
    --f-top-r: #131121;
    --f-mid-l: #161326;
    --f-mid-r: #100e1c;
    --f-side-l: #12101f;
    --f-side-r: #0d0b17;
    --f-bot-l: #0e0c19;
    --f-bot-r: #0a0812;
    --f-bot-c: #100d1c;
    --f-num: #f59e0b;
  }

  .dcm-f-crown  { fill: var(--f-crown); }
  .dcm-f-top-l  { fill: var(--f-top-l); }
  .dcm-f-top-r  { fill: var(--f-top-r); }
  .dcm-f-mid-l  { fill: var(--f-mid-l); }
  .dcm-f-mid-r  { fill: var(--f-mid-r); }
  .dcm-f-side-l { fill: var(--f-side-l); }
  .dcm-f-side-r { fill: var(--f-side-r); }
  .dcm-f-bot-l  { fill: var(--f-bot-l); }
  .dcm-f-bot-r  { fill: var(--f-bot-r); }
  .dcm-f-bot-c  { fill: var(--f-bot-c); }

  .dcm-crown-numeral {
    fill: var(--f-num);
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  .dcm-layer-xray,
  .dcm-layer-supports,
  .dcm-layer-wiretop {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .dcm-d20-solid {
    transition: opacity 0.2s ease;
  }

  .dcm-cad-stage[data-cad-mode="xray"] .dcm-d20-solid {
    opacity: 0.36;
  }

  .dcm-cad-stage[data-cad-mode="xray"] .dcm-layer-xray {
    opacity: 1;
  }

  .dcm-cad-stage[data-cad-mode="supports"] .dcm-d20-solid {
    clip-path: url(#dcmPrintedClip);
  }

  .dcm-cad-stage[data-cad-mode="supports"] .dcm-layer-supports,
  .dcm-cad-stage[data-cad-mode="supports"] .dcm-layer-wiretop {
    opacity: 1;
  }

  .dcm-hud-pill {
    position: absolute;
    inset-block-start: 0.55rem;
    inset-inline-end: 0.65rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    background: rgb(8 13 28 / 0.88);
    border: 1px solid rgb(56 189 248 / 0.45);
    color: #7dd3fc;
    font-size: 0.68rem;
    font-weight: 700;
  }

  /* Connections Canvas Stage */
  .dcc-canvas-stage {
    position: relative;
    aspect-ratio: 520 / 235;
    min-block-size: 13.5rem;
    background:
      radial-gradient(circle at 30% 35%, rgb(56 217 169 / 0.08), transparent 55%),
      #090d18;
    overflow: hidden;
  }

  .dcc-edges-svg {
    position: absolute;
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
  }

  .dcc-faction-box {
    fill: rgb(222 184 104 / 0.06);
    stroke: rgb(222 184 104 / 0.35);
    stroke-width: 1.4;
    stroke-dasharray: 5 4;
  }

  .dcc-faction-label {
    fill: #deb868;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
  }

  .dcc-edge {
    fill: none;
    stroke-width: 2.2;
  }

  .dcc-edge-allied {
    stroke: #38d9a9;
  }

  .dcc-edge-quest {
    stroke: #deb868;
    stroke-dasharray: 4 3;
  }

  .dcc-edge-secret {
    stroke: #ff6b6b;
    stroke-dasharray: 6 4;
  }

  .dcc-edge-meta {
    stroke: #f783ac;
    stroke-width: 1.8;
    stroke-dasharray: 2 3;
  }

  .dcc-meta-anchor {
    fill: #f783ac;
  }

  .dcc-node {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.42rem;
    padding: 0.35rem 0.5rem;
    border-radius: 0.45rem;
    background: rgb(20 27 45 / 0.95);
    border: 1px solid rgb(255 255 255 / 0.18);
    font-size: 0.7rem;
    line-height: 1.22;
    max-inline-size: 38%;
    box-shadow: 0 6px 16px rgb(0 0 0 / 0.45);
  }

  .dcc-node-thumb {
    inline-size: 1.75rem;
    block-size: 1.75rem;
    border-radius: 0.3rem;
    flex-shrink: 0;
    border: 1px solid rgb(222 184 104 / 0.38);
  }

  .dcc-node-text {
    display: flex;
    flex-direction: column;
    min-inline-size: 0;
  }

  .dcc-node-ally {
    inset-block-start: 21%;
    inset-inline-start: 4.5%;
    border-color: rgb(56 217 169 / 0.55);
  }

  .dcc-node-patron {
    inset-block-start: 54%;
    inset-inline-start: 29%;
    border-color: rgb(222 184 104 / 0.5);
  }

  .dcc-node-loc {
    inset-block-start: 22%;
    inset-inline-end: 3%;
    border-color: rgb(116 192 252 / 0.5);
  }

  .dcc-node-secret {
    inset-block-start: 60%;
    inset-inline-end: 3%;
    background: rgb(48 16 26 / 0.95);
    border-color: rgb(255 107 107 / 0.7);
  }

  .dcc-legend-pill {
    position: absolute;
    inset-block-start: 0.45rem;
    inset-inline-end: 0.55rem;
    padding: 0.16rem 0.5rem;
    border-radius: var(--radius-pill);
    background: rgb(8 11 18 / 0.88);
    border: 1px solid rgb(56 217 169 / 0.45);
    color: #63e6be;
    font-size: 0.64rem;
    font-family: var(--font-mono);
    font-weight: 700;
  }

  .dcc-node-cat {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
  }

  .dcc-node-sub {
    color: var(--text-secondary);
    font-size: 0.66rem;
  }

  .dcc-node-dm-cue {
    color: #ffa8a8;
    font-size: 0.62rem;
    font-weight: 600;
    margin-block-start: 0.12rem;
  }

  .dcc-dm-secret-layer {
    transition: opacity 0.22s ease, transform 0.22s ease;
  }

  .dcc-canvas-stage.is-player-safe .dcc-dm-secret-layer {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.94);
  }

  @container app-card (max-width: 27rem) {
    .dcc-canvas-stage {
      min-block-size: 16rem;
    }

    .dcc-node {
      padding: 0.25rem 0.4rem;
      font-size: 0.64rem;
      max-inline-size: 44%;
    }

    .dcc-node-thumb {
      display: none;
    }
  }

  /* Mystery Portrait Overlay */
  .dcc-mystery-overlay {
    position: absolute;
    inset: 0;
    background: rgb(6 9 16 / 0.88);
    backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
    padding: 0.85rem;
  }

  .dcc-mystery-overlay[hidden] {
    display: none;
  }

  .mystery-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card-elevated);
    border: 1px solid var(--border-gold-strong);
    max-inline-size: 28rem;
  }

  .mystery-portrait-slot {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .mystery-reveal-art {
    inline-size: 6rem;
    block-size: auto;
    border-radius: 0.4rem;
    border: 1.5px solid var(--gold-main);
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.5);
  }

  .mystery-silhouette {
    inline-size: 2.75rem;
    block-size: 2.75rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #221a3a;
    border: 2px solid var(--gold-main);
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gold-bright);
    flex-shrink: 0;
  }

  .mystery-meta {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    flex: 1 1 10rem;
  }

  .mystery-kicker {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--emerald-main);
  }

  /* DiceChaosDisplay TV Stage */
  .dcd-tv-stage {
    position: relative;
    aspect-ratio: 520 / 230;
    background: #07090f;
    overflow: hidden;
  }

  .dcd-map-svg {
    inline-size: 100%;
    block-size: 100%;
  }

  .dcd-fog-shroud {
    transition: opacity 0.35s ease;
  }

  .dcd-tv-stage.is-vault-open .dcd-fog-shroud {
    opacity: 0;
    pointer-events: none;
  }

  /* Under-Mini Overlay Modes */
  .dcd-aura-inner {
    fill: rgb(56 217 169 / 0.2);
    stroke: #38d9a9;
    stroke-width: 2.5;
  }

  .dcd-aura-outer {
    fill: none;
    stroke: #38d9a9;
    stroke-width: 1.2;
    stroke-dasharray: 4 3;
    opacity: 0.7;
  }

  .dcd-layer-aoe,
  .dcd-layer-ruler {
    opacity: 0;
    transition: opacity 0.22s ease;
  }

  .dcd-tv-stage[data-overlay-mode="aoe"] .dcd-aura-inner {
    fill: rgb(255 107 107 / 0.25);
    stroke: #ff6b6b;
  }

  .dcd-tv-stage[data-overlay-mode="aoe"] .dcd-aura-outer {
    stroke: #ff922b;
  }

  .dcd-tv-stage[data-overlay-mode="aoe"] .dcd-layer-aoe {
    opacity: 1;
  }

  .dcd-tv-stage[data-overlay-mode="ruler"] .dcd-layer-ruler {
    opacity: 1;
  }

  .dcd-sonar-ping {
    opacity: 0;
    pointer-events: none;
  }

  .dcd-sonar-ping.is-pinging {
    opacity: 1;
  }

  @media (prefers-reduced-motion: no-preference) {
    .dcd-sonar-ping.is-pinging .sonar-wave {
      transform-origin: 264px 115px;
      animation: sonarPulse 0.9s ease-out forwards;
    }
  }

  @keyframes sonarPulse {
    0% { transform: scale(0.3); opacity: 1; }
    100% { transform: scale(2.1); opacity: 0; }
  }

  .dcd-tv-hud-pill {
    position: absolute;
    inset-block-start: 0.55rem;
    inset-inline-start: 0.65rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    background: rgb(8 11 18 / 0.85);
    border: 1px solid rgb(56 217 169 / 0.45);
    color: #63e6be;
    font-size: 0.68rem;
    font-weight: 700;
  }

  .dcd-secret-pin {
    position: absolute;
    inset-block-end: 0.55rem;
    inset-inline-start: 0.65rem;
    padding: 0.2rem 0.55rem;
    border-radius: 0.35rem;
    background: rgb(42 22 58 / 0.9);
    border: 1px solid rgb(151 117 250 / 0.5);
    color: #e5dbff;
    font-size: 0.68rem;
    font-weight: 600;
  }

  /* Feature Checklists inside App Cards */
  .feature-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-block-end: 1.65rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-grow: 1;
  }

  .feature-checklist li {
    position: relative;
    padding-inline-start: 1.35rem;
  }

  .feature-checklist li::before {
    content: "◆";
    position: absolute;
    inset-inline-start: 0;
    color: var(--gold-main);
    font-size: 0.75rem;
    inset-block-start: 0.2rem;
  }

  .feature-checklist strong {
    color: var(--text-primary);
  }

  .app-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.7rem;
    margin-block-start: auto;
  }

  .app-actions .btn {
    inline-size: 100%;
  }

  @container app-card (min-width: 26rem) {
    .app-actions {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-actions .btn-app-primary {
      grid-column: 1 / -1;
    }
  }

  /* Feeder-to-Etsy Conversion Bridge (Container Query Component) */
  .feeder-etsy-bridge {
    container: feeder-bridge / inline-size;
    margin-block-start: clamp(1.75rem, 3vw, 2.5rem);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-gold-strong);
    background:
      radial-gradient(circle at 88% 50%, rgb(241 100 30 / 0.18), transparent 48%),
      radial-gradient(circle at 12% 20%, rgb(222 184 104 / 0.12), transparent 45%),
      linear-gradient(155deg, #191f33 0%, #101524 100%);
    box-shadow: var(--shadow-card);
  }

  .feeder-bridge-inner {
    padding: clamp(1.35rem, 2.8vw, 2.15rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.35rem;
    align-items: center;
  }

  @container feeder-bridge (inline-size > 48rem) {
    .feeder-bridge-inner {
      grid-template-columns: minmax(0, 1.35fr) auto;
      gap: 2rem;
    }
  }

  .feeder-bridge-kicker {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--gold-main);
    margin-block-end: 0.35rem;
  }

  .feeder-bridge-copy h3 {
    margin-block-end: 0.5rem;
  }

  .feeder-bridge-copy p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-inline-size: 66ch;
  }

  .feeder-bridge-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
  }

  /* Etsy Storefront Section */
  .shop-banner-card {
    background:
      radial-gradient(circle at 92% 8%, rgb(241 100 30 / 0.14), transparent 42%),
      linear-gradient(160deg, #161c2e 0%, #0e1320 100%);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 3.5vw, 3rem);
    box-shadow: var(--shadow-card);
  }

  .shop-header-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.98fr);
    gap: clamp(1.75rem, 3.5vw, 3rem);
    align-items: center;
  }

  .shop-header-grid > * {
    min-inline-size: 0;
  }

  @media (max-width: 60rem) {
    .shop-header-grid {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  .shop-lead {
    margin-block-start: 1rem;
    font-size: 1.08rem;
    color: var(--text-primary);
  }

  .shop-body {
    margin-block-start: 0.85rem;
    color: var(--text-secondary);
  }

  .shopkeeper-roster {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
    gap: 0.75rem;
    margin-block-start: 1.5rem;
  }

  .keeper-chip {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-md);
    background: rgb(255 255 255 / 0.04);
    border: 1px solid var(--border-subtle);
  }

  .keeper-medallion {
    inline-size: 3rem;
    block-size: 3rem;
  }

  .keeper-meta {
    min-inline-size: 0;
    line-height: 1.25;
  }

  .keeper-role {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gold-main);
  }

  .shop-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-block-start: 1.75rem;
  }

  .shop-art-stage {
    margin: 0;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-gold);
    background:
      radial-gradient(circle at 28% 68%, rgb(56 217 169 / 0.16), transparent 46%),
      radial-gradient(circle at 56% 42%, rgb(190 110 245 / 0.16), transparent 48%),
      radial-gradient(circle at 78% 66%, rgb(247 223 160 / 0.15), transparent 44%),
      linear-gradient(180deg, #1a2238 0%, #0c111e 100%);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08), 0 18px 42px rgb(0 0 0 / 0.42);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-block-start: 1rem;
    padding-inline: clamp(0.75rem, 2vw, 1.5rem);
    padding-block-end: 0;
  }

  .shop-stage-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-block-end: 0.75rem;
  }

  .shop-stage-badge {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-bright);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
    background: rgb(222 184 104 / 0.12);
    border: 1px solid var(--border-gold);
  }

  .shop-stage-sub {
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--text-secondary);
  }

  .shop-trio-picture {
    display: block;
    margin-block-start: auto;
    margin-inline: auto;
    max-inline-size: 32rem;
    inline-size: 100%;
    line-height: 0;
  }

  .shop-trio-img {
    display: block;
    inline-size: 100%;
    block-size: auto;
    margin-inline: auto;
    filter: drop-shadow(0 10px 24px rgb(0 0 0 / 0.48));
  }

  .vault-pillars {
    margin-block-start: 2rem;
    padding-block-start: 1.75rem;
    border-block-start: 1px solid var(--border-subtle);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr));
    gap: 1rem;
  }

  .pillar-card {
    padding: 1.15rem;
    border-radius: var(--radius-md);
    background: rgb(8 11 18 / 0.62);
    border: 1px solid var(--border-subtle);
  }

  .pillar-card h3 {
    font-size: 1.125rem;
    margin-block: 0.35rem 0.45rem;
  }

  .pillar-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
  }

  .pillar-highlight {
    border-color: var(--border-gold);
    background: rgb(222 184 104 / 0.07);
  }

  .pillar-tag {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--gold-main);
  }

  .reviews-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 1rem;
    margin-block-start: 2rem;
    padding-block-start: 1.75rem;
    border-block-start: 1px solid var(--border-subtle);
  }

  .review-quote {
    padding: 1rem 1.2rem;
    border-radius: var(--radius-sm);
    background: rgb(255 255 255 / 0.03);
    border-inline-start: 3px solid var(--etsy-ember);
  }

  .review-quote blockquote {
    font-size: 0.925rem;
    color: var(--text-primary);
    font-style: italic;
  }

  .review-quote figcaption {
    margin-block-start: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
  }

  /* Bernie's 4-Stage Dice-Making Guide & Workbench */
  .maker-tip-banner {
    container: maker-tip / inline-size;
    margin-block-end: clamp(1.5rem, 2.5vw, 2.25rem);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-gold);
    background:
      radial-gradient(circle at 12% 50%, rgb(222 184 104 / 0.14), transparent 46%),
      linear-gradient(160deg, #171e31 0%, #0f1422 100%);
    box-shadow: var(--shadow-card);
  }

  .maker-tip-inner {
    padding: clamp(1.1rem, 2.2vw, 1.5rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
  }

  @container maker-tip (inline-size > 46rem) {
    .maker-tip-inner {
      grid-template-columns: auto minmax(0, 1fr) auto;
      gap: 1.25rem;
    }
  }

  .maker-tip-medallion {
    inline-size: 3.5rem;
    block-size: 3.5rem;
  }

  .maker-tip-copy {
    min-inline-size: 0;
  }

  .maker-tip-kicker {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-bright);
    margin-block-end: 0.25rem;
  }

  .maker-tip-copy p {
    font-size: 0.925rem;
    color: var(--text-secondary);
  }

  .maker-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 29rem), 1fr));
    gap: clamp(1.25rem, 2.2vw, 1.75rem);
    align-items: stretch;
  }

  .maker-step-card {
    container: maker-step / inline-size;
    min-inline-size: 0;
    background: linear-gradient(180deg, var(--bg-card-elevated) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-subtle);
    border-block-start: 3px solid var(--gold-main);
    border-radius: var(--radius-lg);
    padding: clamp(1.25rem, 2.4vw, 1.75rem);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
  }

  .step-card-header {
    margin-block-end: 1.15rem;
    padding-block-end: 1rem;
    border-block-end: 1px solid var(--border-subtle);
  }

  .step-card-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-block-end: 0.65rem;
  }

  .step-num-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.6rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-main));
    color: var(--text-dark);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .step-phase-pill {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--gold-bright);
    padding: 0.16rem 0.6rem;
    border-radius: var(--radius-pill);
    background: rgb(222 184 104 / 0.12);
    border: 1px solid var(--border-gold);
  }

  .step-card-header h3 {
    font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.45rem);
    margin-block-end: 0.45rem;
  }

  .step-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
  }

  .maker-gear-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }

  .gear-item-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.85rem;
    min-block-size: 3.25rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    background: rgb(8 11 18 / 0.56);
    border: 1px solid rgb(255 255 255 / 0.07);
    text-decoration: none;
    transition: background-color 0.16s ease, border-color 0.16s ease;
  }

  .gear-item-link:hover {
    background: rgb(255 255 255 / 0.07);
    border-color: var(--border-gold);
  }

  @container maker-step (max-width: 24rem) {
    .gear-item-link {
      flex-direction: column;
      align-items: flex-start;
      gap: 0.45rem;
    }
  }

  .gear-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-inline-size: 0;
  }

  .gear-item-name {
    font-size: 0.925rem;
    color: var(--text-primary);
    line-height: 1.3;
  }

  .gear-item-link:hover .gear-item-name {
    color: var(--gold-bright);
  }

  .gear-item-why {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
  }

  .gear-item-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    padding: 0.22rem 0.55rem;
    border-radius: var(--radius-pill);
    background: rgb(255 255 255 / 0.06);
    border: 1px solid rgb(255 255 255 / 0.14);
    color: var(--gold-bright);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
  }

  .gear-item-cta.is-free-stl {
    background: rgb(56 217 169 / 0.15);
    border-color: rgb(56 217 169 / 0.48);
    color: #63e6be;
  }

  .affiliate-disclosure {
    margin-block-start: 1.5rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
  }

  /* Exclusive FAQ Accordions + Illustrated Guide Card */
  .faq-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: start;
  }

  .faq-layout > * {
    min-inline-size: 0;
  }

  @media (max-width: 58rem) {
    .faq-layout {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  .faq-guide-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-gold);
    background:
      radial-gradient(circle at 50% 72%, rgb(222 184 104 / 0.15), transparent 56%),
      linear-gradient(170deg, #182034 0%, #0e1320 100%);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-block-start: 1.5rem;
    padding-inline: 1.5rem;
    padding-block-end: 0;
  }

  .faq-guide-copy h3 {
    font-size: 1.35rem;
    margin-block-end: 0.55rem;
  }

  .faq-guide-copy p {
    font-size: 0.925rem;
    color: var(--text-secondary);
    margin-block-end: 1rem;
  }

  .faq-guide-picture {
    display: block;
    margin-block-start: auto;
    margin-inline: auto;
    max-inline-size: 21rem;
    inline-size: 100%;
    line-height: 0;
  }

  .faq-guide-img {
    display: block;
    inline-size: 100%;
    block-size: auto;
    filter: drop-shadow(0 8px 20px rgb(0 0 0 / 0.45));
  }

  .faq-stack {
    inline-size: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }

  .faq-accordion {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .faq-accordion[open] {
    border-color: var(--border-gold);
  }

  .faq-accordion summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-block-size: 3.35rem;
    padding: 0.95rem 1.25rem;
    cursor: pointer;
    font-weight: 700;
    color: var(--text-primary);
    user-select: none;
  }

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

  .faq-accordion summary::after {
    content: "+";
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--gold-main);
    flex-shrink: 0;
  }

  .faq-accordion[open] summary {
    border-block-end: 1px solid var(--border-subtle);
    background: rgb(222 184 104 / 0.06);
    color: var(--gold-bright);
  }

  .faq-accordion[open] summary::after {
    content: "−";
  }

  .faq-answer {
    padding: 1rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-inline-size: 68ch;
  }

  /* Dispatch Form & Social Channels */
  .dispatch-card,
  .channels-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
  }

  .channels-card {
    padding: clamp(1.5rem, 3vw, 2.25rem);
  }

  .dispatch-card {
    border-color: var(--border-gold);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .dispatch-parchment-banner {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 50% 18%, #fdf9f0 0%, #f2e5cb 66%, #e2cea6 100%);
    border-block-end: 2px solid var(--gold-main);
    padding-block-start: 0.85rem;
    padding-inline: 1rem;
    padding-block-end: 0;
  }

  .dispatch-postmark {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #4f3815;
    background: rgb(79 56 21 / 0.08);
    border: 1px dashed rgb(79 56 21 / 0.38);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.55rem;
    margin-block-end: 0.3rem;
  }

  .dispatch-sticker-seal {
    position: absolute;
    inset-block-start: 0.6rem;
    inset-inline-end: 0.8rem;
    inline-size: 2.85rem;
    block-size: 2.85rem;
    transform: rotate(8deg);
    pointer-events: none;
    filter: drop-shadow(0 3px 6px rgb(40 28 10 / 0.25));
  }

  .dispatch-sticker-seal img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: contain;
  }

  .dispatch-waving-picture {
    display: block;
    max-inline-size: 26rem;
    inline-size: 100%;
    margin-inline: auto;
    margin-block-end: -1px;
    line-height: 0;
  }

  .dispatch-waving-img {
    display: block;
    inline-size: 100%;
    block-size: auto;
  }

  .dispatch-body {
    padding: clamp(1.4rem, 2.8vw, 2.1rem);
    flex: 1;
  }

  .dispatch-copy,
  .channels-copy {
    margin-block: 0.75rem 1.35rem;
    color: var(--text-secondary);
  }

  .form-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }

  .form-field label {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
  }

  .input-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
  }

  .input-action-row input[type="email"] {
    flex: 1 1 14rem;
    min-block-size: 3rem;
    padding-block: 0.65rem;
    padding-inline: 0.95rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgb(255 255 255 / 0.24);
    background: #090d16;
    color: var(--text-primary);
    font-size: max(1rem, 1em);
  }

  @media (pointer: coarse) {
    .input-action-row input[type="email"] {
      min-block-size: 3.25rem;
    }
  }

  .input-action-row input[type="email"]:user-invalid {
    border-color: var(--crimson-alert);
    box-shadow: 0 0 0 2px rgb(255 107 107 / 0.25);
  }

  .field-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
  }

  .social-links-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }

  .channel-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    min-block-size: 3rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    background: rgb(255 255 255 / 0.04);
    border: 1px solid var(--border-subtle);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
  }

  .channel-link:hover {
    border-color: var(--border-gold);
    background: rgb(255 255 255 / 0.08);
  }

  .channel-etsy {
    border-inline-start: 3px solid var(--etsy-ember);
  }

  .channel-github {
    border-inline-start: 3px solid var(--emerald-main);
  }

  .channel-youtube {
    border-inline-start: 3px solid #ff4d4d;
  }

  .channel-instagram {
    border-inline-start: 3px solid #e1306c;
  }

  .channel-x {
    border-inline-start: 3px solid #ced4da;
  }

  .channel-handle {
    font-size: 0.8125rem;
    color: var(--text-muted);
  }

  .direct-contact {
    margin-block-start: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
  }

  /* Native <dialog> Deep-Dive Spec Modals */
  .spec-modal {
    inline-size: min(94vw, 68rem);
    max-block-size: 88dvh;
    margin: auto;
    padding: 0;
    border: 1px solid var(--border-gold-strong);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 28px 80px rgb(0 0 0 / 0.78);
  }

  .spec-modal::backdrop {
    background: rgb(4 6 12 / 0.78);
    backdrop-filter: blur(6px);
  }

  .modal-shell {
    display: flex;
    flex-direction: column;
    max-block-size: 88dvh;
  }

  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card-elevated);
    border-block-end: 1px solid var(--border-subtle);
  }

  .modal-header-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-inline-size: 0;
  }

  .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
  }

  .modal-intro {
    color: var(--text-secondary);
    margin-block-end: 1.35rem;
    max-inline-size: 68ch;
  }

  .spec-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
    gap: 1rem;
  }

  @media (min-width: 56rem) {
    .spec-module-wide {
      grid-column: 1 / -1;
    }
  }

  .spec-module {
    padding: 1.15rem;
    border-radius: var(--radius-md);
    background: rgb(8 11 18 / 0.6);
    border: 1px solid var(--border-subtle);
  }

  .spec-module h3 {
    font-size: 1.0625rem;
    color: var(--gold-bright);
    margin-block-end: 0.65rem;
  }

  .spec-module ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
  }

  .spec-module li {
    position: relative;
    padding-inline-start: 1rem;
  }

  .spec-module li::before {
    content: "•";
    position: absolute;
    inset-inline-start: 0;
    color: var(--gold-main);
  }

  .modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card-elevated);
    border-block-start: 1px solid var(--border-subtle);
    font-size: 0.875rem;
    color: var(--text-muted);
  }

  .modal-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
  }
}

/* ==================== 6. UTILITIES ==================== */
@layer utilities {
  [hidden] {
    display: none !important;
  }
  .visually-hidden {
    position: absolute;
    clip-path: inset(50%);
    overflow: hidden;
    inline-size: 1px;
    block-size: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    white-space: nowrap;
  }
}
