@layer reset, base, components, showcase, utilities;

@layer reset {
  html {
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
  }

  body,
  header,
  nav,
  main,
  section,
  article,
  aside,
  footer,
  div,
  ul,
  ol,
  li,
  h1,
  h2,
  h3,
  p,
  a,
  button,
  input,
  label,
  details,
  summary,
  span,
  svg {
    box-sizing: inherit;
  }

  body,
  h1,
  h2,
  h3,
  p,
  ul,
  ol {
    margin: 0;
    padding: 0;
  }

  ul,
  ol {
    list-style: none;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  button,
  input {
    font: inherit;
    color: inherit;
  }

  svg {
    display: block;
    max-inline-size: 100%;
  }
}

@layer base {
  :root {
    color-scheme: dark;

    --bg-canvas: #090d16;
    --bg-canvas-alt: #0c121e;
    --bg-surface: #111724;
    --bg-surface-elevated: #161f30;
    --bg-glass: rgba(17, 23, 36, 0.78);

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.2);
    --border-interactive: rgba(203, 213, 225, 0.34);

    --text-primary: #eef2f9;
    --text-secondary: #94a3b8;
    --text-muted: #a3b3c9;

    --cyan: #38bdf8;
    --cyan-bright: #7dd3fc;
    --cyan-surface: rgba(56, 189, 248, 0.12);
    --cyan-border: rgba(56, 189, 248, 0.38);

    --coral: #ef4444;
    --coral-text: #fca5a5;
    --coral-surface: rgba(239, 68, 68, 0.14);
    --coral-border: rgba(239, 68, 68, 0.4);

    --green: #22c55e;
    --green-text: #86efac;
    --green-surface: rgba(34, 197, 94, 0.14);
    --green-border: rgba(34, 197, 94, 0.42);

    --radius-sm: 0.5rem;
    --radius-md: 0.875rem;
    --radius-lg: 1.25rem;
    --radius-pill: 9999px;

    --shadow-panel: 0 24px 64px -20px rgba(0, 0, 0, 0.75);
    --shadow-cta: 0 0 32px -6px rgba(56, 189, 248, 0.45);
  }

  @media (prefers-reduced-motion: no-preference) {
    html {
      scroll-behavior: smooth;
    }
  }

  body {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    text-align: start;
    overflow-x: clip;
  }

  :where(a, button, summary, input):focus-visible {
    outline: 3px solid var(--cyan);
    outline-offset: 3px;
    border-radius: 0.375rem;
  }

  main:focus {
    outline: none;
  }
}

@layer components {
  .container {
    inline-size: min(100% - 2rem, 72rem);
    margin-inline: auto;
  }

  .skip-link {
    position: absolute;
    inset-block-start: -100%;
    inset-inline-start: 1rem;
    z-index: 100;
    padding: 0.75rem 1.25rem;
    background-color: var(--cyan);
    color: var(--bg-canvas);
    font-weight: 700;
    font-size: 0.9375rem;
    border-radius: var(--radius-sm);
  }

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

  /* Sticky Translucent Header */
  .site-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 40;
    background-color: rgba(9, 13, 22, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-block-end: 1px solid var(--border-subtle);
  }

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

  .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-block-size: 2.5rem;
    flex-shrink: 0;
  }

  .brand-logo {
    inline-size: 3.1rem;
    block-size: auto;
  }

  .brand-wordmark {
    inline-size: 6.2rem;
    block-size: auto;
  }

  .main-nav {
    order: 3;
    flex-basis: 100%;
    border-block-start: 1px solid var(--border-subtle);
    padding-block-start: 0.5rem;
  }

  .nav-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem 0.5rem;
  }

  .nav-link {
    display: inline-flex;
    align-items: center;
    min-block-size: 2.25rem;
    padding-inline: 0.65rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: color 0.18s ease, background-color 0.18s ease;
  }

  .nav-link:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
  }

  .btn-nav-cta {
    order: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-block-size: 2.35rem;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-pill);
    background-color: var(--cyan);
    color: var(--bg-canvas);
    font-size: 0.875rem;
    font-weight: 700;
    border: 1px solid transparent;
    transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  }

  .btn-nav-cta:hover {
    background-color: var(--cyan-bright);
    box-shadow: 0 0 20px -4px rgba(56, 189, 248, 0.55);
  }

  @media (min-width: 50rem) {
    .header-inner {
      flex-wrap: nowrap;
    }

    .main-nav {
      order: 2;
      flex-basis: auto;
      border-block-start: none;
      padding-block-start: 0;
    }

    .nav-list {
      gap: 0.35rem 0.75rem;
    }

    .nav-link {
      font-size: 0.9375rem;
      padding-inline: 0.75rem;
    }

    .btn-nav-cta {
      order: 3;
    }
  }

  /* Icons */
  .ico-xs {
    inline-size: 0.875rem;
    block-size: 0.875rem;
    flex-shrink: 0;
  }

  .ico-sm {
    inline-size: 1rem;
    block-size: 1rem;
    flex-shrink: 0;
  }

  .ico-md {
    inline-size: 1.15rem;
    block-size: 1.15rem;
    flex-shrink: 0;
  }

  .live-dot {
    inline-size: 0.5rem;
    block-size: 0.5rem;
    border-radius: 50%;
    background-color: var(--green);
    box-shadow: 0 0 8px var(--green);
    flex-shrink: 0;
  }

  /* Hero Section */
  .hero-section {
    position: relative;
    padding-block: clamp(2.75rem, 2rem + 3vw, 4.75rem) clamp(3.5rem, 2.5rem + 3vw, 5.5rem);
    overflow: hidden;
  }

  .hero-ambient {
    position: absolute;
    inset-block-start: -8rem;
    inset-inline: 0;
    block-size: 32rem;
    background:
      radial-gradient(ellipse 46% 55% at 32% 35%, rgba(56, 189, 248, 0.14), transparent 72%),
      radial-gradient(ellipse 42% 50% at 70% 38%, rgba(239, 68, 68, 0.12), transparent 72%);
    pointer-events: none;
  }

  .hero-layout {
    position: relative;
    display: grid;
    gap: clamp(2.5rem, 2rem + 2vw, 3.75rem);
  }

  .hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    max-inline-size: 52rem;
    margin-inline: auto;
  }

  .release-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.375rem 0.9rem;
    border-radius: var(--radius-pill);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-interactive);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
  }

  .hero-title {
    font-size: clamp(2rem, 1.35rem + 2.8vw, 3.5rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.025em;
    text-wrap: balance;
    background: linear-gradient(180deg, #ffffff 35%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .hero-subtitle {
    max-inline-size: 60ch;
    font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
    line-height: 1.62;
    color: var(--text-secondary);
    text-wrap: pretty;
  }

  .hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.15rem;
    margin-block-start: 0.35rem;
    inline-size: 100%;
  }

  .primary-cta-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
  }

  .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-block-size: 3.125rem;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    color: var(--bg-canvas);
    font-size: 1rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: var(--shadow-cta);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  }

  .btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 0 42px -4px rgba(56, 189, 248, 0.62);
  }

  @media (prefers-reduced-motion: no-preference) {
    .btn-primary:hover {
      transform: translateY(-1px);
    }

    .btn-nav-cta:hover {
      transform: translateY(-1px);
    }
  }

  .release-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
  }

  .secondary-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem 0.75rem;
  }

  .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-block-size: 2.5rem;
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-pill);
    background-color: rgba(17, 23, 36, 0.85);
    border: 1px solid var(--border-interactive);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease;
  }

  .btn-ghost:hover {
    background-color: var(--bg-surface-elevated);
    border-color: var(--cyan);
  }

  .btn-ghost-subtle {
    color: var(--text-secondary);
  }

  .btn-ghost-subtle:hover {
    color: var(--text-primary);
  }

  .btn-copy-link.is-copied {
    border-color: var(--green);
    color: var(--green-text);
    background-color: var(--green-surface);
  }

  .copy-status {
    flex-basis: 100%;
    min-block-size: 1.25rem;
    font-size: 0.875rem;
    color: var(--green-text);
    font-weight: 500;
  }

  .copy-status:empty {
    display: none;
  }

  /* Shared Section Structure */
  .section-block {
    padding-block: clamp(3.25rem, 2.5rem + 3vw, 5.25rem);
  }

  .section-alt {
    background-color: var(--bg-canvas-alt);
    border-block: 1px solid var(--border-subtle);
  }

  .section-header {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-block-end: clamp(2rem, 1.5rem + 1.5vw, 3rem);
    max-inline-size: 46rem;
  }

  .section-title {
    font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.02em;
    text-wrap: balance;
  }

  .section-subtitle {
    max-inline-size: 60ch;
    font-size: 1.0625rem;
    color: var(--text-secondary);
    text-wrap: pretty;
  }

  /* Bento Features Grid */
  .bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
    gap: 1.15rem;
  }

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

  .bento-card {
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 0.85rem;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
    min-inline-size: 0;
  }

  .bento-card:hover {
    border-color: var(--border-hover);
    background-color: var(--bg-surface-elevated);
  }

  .bento-card-cyan:hover {
    border-color: var(--cyan-border);
  }

  .bento-card-coral:hover {
    border-color: var(--coral-border);
  }

  .bento-card-green:hover {
    border-color: var(--green-border);
  }

  @media (prefers-reduced-motion: no-preference) {
    .bento-card:hover {
      transform: translateY(-2px);
    }
  }

  .bento-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 2.4rem;
    block-size: 2.4rem;
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.45rem;
  }

  .card-icon-cyan {
    background-color: var(--cyan-surface);
    border-color: var(--cyan-border);
    color: var(--cyan-bright);
  }

  .card-icon-coral {
    background-color: var(--coral-surface);
    border-color: var(--coral-border);
    color: var(--coral-text);
  }

  .card-icon-green {
    background-color: var(--green-surface);
    border-color: var(--green-border);
    color: var(--green-text);
  }

  .card-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  .card-badge-cyan {
    background-color: var(--cyan-surface);
    color: var(--cyan-bright);
  }

  .card-badge-coral {
    background-color: var(--coral-surface);
    color: var(--coral-text);
  }

  .card-badge-green {
    background-color: var(--green-surface);
    color: var(--green-text);
  }

  .card-title {
    font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
    font-weight: 650;
    line-height: 1.3;
    text-wrap: balance;
  }

  .card-desc {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    text-wrap: pretty;
  }

  /* Install Steps */
  .steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr));
    gap: 1.25rem;
  }

  .step-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    min-inline-size: 0;
  }

  .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-pill);
    background-color: var(--cyan-surface);
    border: 1px solid var(--cyan-border);
    color: var(--cyan-bright);
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }

  .step-title {
    font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
    font-weight: 650;
    line-height: 1.3;
  }

  .step-desc {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    text-wrap: pretty;
    overflow-wrap: break-word;
  }

  /* WhatsNew Timeline */
  .version-pill {
    display: inline-flex;
    align-items: center;
    margin-block-end: 0.65rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    background-color: var(--cyan-surface);
    border: 1px solid var(--cyan-border);
    color: var(--cyan-bright);
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }

  .whatsnew-panel {
    padding: clamp(1.25rem, 1rem + 1.2vw, 2rem);
    border-radius: var(--radius-lg);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
  }

  .whatsnew-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .whatsnew-item {
    position: relative;
    display: grid;
    grid-template-columns: 1rem 1fr;
    gap: 1rem;
    align-items: start;
  }

  .whatsnew-item:not(:last-child)::before {
    content: "";
    position: absolute;
    inset-block-start: 1.1rem;
    inset-block-end: -1.6rem;
    inset-inline-start: 0.45rem;
    inline-size: 1px;
    background-color: var(--border-subtle);
  }

  .whatsnew-marker {
    inline-size: 0.625rem;
    block-size: 0.625rem;
    margin-block-start: 0.45rem;
    margin-inline: auto;
    border-radius: 50%;
    background-color: var(--cyan);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.55);
  }

  .whatsnew-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-inline-size: 0;
  }

  .whatsnew-title {
    font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.15rem);
    font-weight: 650;
    line-height: 1.35;
  }

  .whatsnew-desc {
    max-inline-size: 68ch;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    text-wrap: pretty;
  }

  /* FAQ Accordion */
  .faq-container {
    max-inline-size: 54rem;
  }

  .faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .faq-item {
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-interactive);
    transition: border-color 0.2s ease, background-color 0.2s ease;
  }

  .faq-item[open] {
    border-color: var(--cyan-border);
    background-color: var(--bg-surface-elevated);
  }

  .faq-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    user-select: none;
  }

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

  .faq-summary::after {
    content: "";
    inline-size: 0.55rem;
    block-size: 0.55rem;
    flex-shrink: 0;
    border-inline-end: 2px solid currentColor;
    border-block-end: 2px solid currentColor;
    transform: translateY(-0.1rem) rotate(45deg);
  }

  .faq-item[open] > .faq-summary::after {
    transform: translateY(0.15rem) rotate(-135deg);
  }

  @media (prefers-reduced-motion: no-preference) {
    .faq-summary::after {
      transition: transform 0.2s ease;
    }
  }

  .faq-item::details-content {
    interpolate-size: allow-keywords;
    overflow: clip;
    contain: layout;
  }

  .faq-item:not([open])::details-content {
    block-size: 0;
  }

  @media (prefers-reduced-motion: no-preference) {
    .faq-item::details-content {
      transition: block-size 0.26s ease, content-visibility 0.26s ease;
      transition-behavior: allow-discrete;
    }
  }

  .faq-answer {
    padding: 0 1.25rem 1.2rem;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.65;
    text-wrap: pretty;
  }

  /* Footer */
  .site-footer {
    border-block-start: 1px solid var(--border-subtle);
    padding-block: 2.5rem;
    background-color: var(--bg-canvas);
  }

  .footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.75rem 2.5rem;
  }

  .footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-inline-size: 36rem;
  }

  .footer-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-block-end: 0.15rem;
  }

  .footer-logo {
    inline-size: 2.25rem;
    block-size: auto;
  }

  .footer-name {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.01em;
  }

  .footer-note {
    font-size: 0.875rem;
    color: var(--text-secondary);
  }

  .footer-version {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
  }

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

  .footer-link {
    display: inline-flex;
    align-items: center;
    min-block-size: 2.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.18s ease;
  }

  .footer-link:hover {
    color: var(--cyan-bright);
  }
}

@layer showcase {
  /* Interactive Mini-Showcase of DeckFlow Desktop Window */
  .showcase-wrap {
    position: relative;
    inline-size: 100%;
    max-inline-size: 62rem;
    margin-inline: auto;
  }

  .showcase-backlight {
    position: absolute;
    inset: -1.25rem 6%;
    background:
      radial-gradient(circle at 22% 50%, rgba(56, 189, 248, 0.22), transparent 55%),
      radial-gradient(circle at 78% 50%, rgba(239, 68, 68, 0.2), transparent 55%);
    filter: blur(36px);
    pointer-events: none;
  }

  .showcase-window {
    position: relative;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(19, 26, 41, 0.94) 0%, rgba(12, 17, 29, 0.96) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-panel);
    overflow: hidden;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .app-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    background-color: rgba(9, 13, 22, 0.7);
    border-block-end: 1px solid var(--border-subtle);
  }

  .app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
  }

  .app-mini-logo {
    inline-size: 2rem;
    block-size: auto;
  }

  .app-title {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  .app-status-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }

  .app-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.22rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
  }

  .app-pill-live {
    background-color: var(--green-surface);
    border: 1px solid var(--green-border);
    color: var(--green-text);
  }

  .app-pill-monitor {
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
  }

  .app-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 1.75rem;
    block-size: 1.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), #2563eb);
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 700;
  }

  .app-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    padding: 1rem;
  }

  @media (min-width: 52rem) {
    .app-body {
      grid-template-columns: minmax(14rem, 16.5rem) minmax(0, 1fr);
    }
  }

  .app-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    background-color: rgba(9, 13, 22, 0.55);
    border: 1px solid var(--border-subtle);
    min-inline-size: 0;
  }

  .sidebar-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.3rem;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.04);
  }

  .sidebar-tab {
    padding: 0.3rem 0.35rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 0.35rem;
  }

  .sidebar-tab.is-active {
    background-color: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
  }

  .queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }

  .queue-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.03);
    font-size: 0.75rem;
  }

  .queue-idx {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
  }

  .queue-track {
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .queue-dur {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
  }

  .app-stage {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-inline-size: 0;
  }

  .decks-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

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

  .deck-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.9rem;
    border-radius: var(--radius-md);
    background-color: rgba(9, 13, 22, 0.72);
    border: 1px solid var(--border-subtle);
    min-inline-size: 0;
    transition: opacity 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  }

  .deck-1 {
    opacity: calc(0.45 + 0.55 * var(--d1-level, 0.9));
    border-color: rgba(56, 189, 248, calc(0.18 + 0.45 * var(--d1-level, 0.9)));
    box-shadow: inset 0 1px 0 rgba(56, 189, 248, calc(0.15 + 0.35 * var(--d1-level, 0.9)));
  }

  .deck-2 {
    opacity: calc(0.45 + 0.55 * var(--d2-level, 0.4));
    border-color: rgba(239, 68, 68, calc(0.18 + 0.45 * var(--d2-level, 0.4)));
    box-shadow: inset 0 1px 0 rgba(239, 68, 68, calc(0.15 + 0.35 * var(--d2-level, 0.4)));
  }

  .deck-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .deck-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
  }

  .deck-badge-1 {
    background-color: var(--cyan-surface);
    color: var(--cyan-bright);
  }

  .deck-badge-2 {
    background-color: var(--coral-surface);
    color: var(--coral-text);
  }

  .deck-state {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.04em;
  }

  .deck-track-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .deck-waveform {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: end;
    gap: 0.22rem;
    block-size: 2.1rem;
    padding-block: 0.2rem;
  }

  .wave-bar {
    display: block;
    inline-size: 100%;
    block-size: 100%;
    border-radius: 0.15rem;
    transform-origin: bottom;
    transform: scaleY(0.45);
  }

  .deck-1 .wave-bar {
    background: linear-gradient(180deg, var(--cyan-bright), var(--cyan));
  }

  .deck-2 .wave-bar {
    background: linear-gradient(180deg, var(--coral-text), var(--coral));
  }

  .wave-bar:nth-child(1) { transform: scaleY(0.35); }
  .wave-bar:nth-child(2) { transform: scaleY(0.75); }
  .wave-bar:nth-child(3) { transform: scaleY(0.55); }
  .wave-bar:nth-child(4) { transform: scaleY(0.95); }
  .wave-bar:nth-child(5) { transform: scaleY(0.65); }
  .wave-bar:nth-child(6) { transform: scaleY(0.85); }
  .wave-bar:nth-child(7) { transform: scaleY(0.45); }
  .wave-bar:nth-child(8) { transform: scaleY(0.9); }
  .wave-bar:nth-child(9) { transform: scaleY(0.6); }
  .wave-bar:nth-child(10) { transform: scaleY(0.78); }
  .wave-bar:nth-child(11) { transform: scaleY(0.48); }
  .wave-bar:nth-child(12) { transform: scaleY(0.32); }

  @keyframes wavePulse {
    0%, 100% { transform: scaleY(0.32); }
    50% { transform: scaleY(0.96); }
  }

  @media (prefers-reduced-motion: no-preference) {
    .deck-1 .wave-bar {
      animation: wavePulse 1.8s ease-in-out infinite;
    }

    .deck-1 .wave-bar:nth-child(2n) { animation-duration: 1.45s; animation-delay: 0.2s; }
    .deck-1 .wave-bar:nth-child(3n) { animation-duration: 2.1s; animation-delay: 0.45s; }
    .deck-1 .wave-bar:nth-child(4n) { animation-duration: 1.65s; animation-delay: 0.7s; }
  }

  .deck-progress-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  .deck-progress-track {
    flex: 1;
    block-size: 0.3rem;
    border-radius: var(--radius-pill);
    background-color: rgba(255, 255, 255, 0.1);
    overflow: hidden;
  }

  .deck-progress-fill {
    display: block;
    block-size: 100%;
    border-radius: var(--radius-pill);
  }

  .deck-progress-1 {
    inline-size: 46%;
    background-color: var(--cyan);
  }

  .deck-progress-2 {
    inline-size: 8%;
    background-color: var(--coral);
  }

  .deck-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
  }

  /* Vinhetas Strip */
  .vinhetas-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-md);
    background-color: rgba(9, 13, 22, 0.5);
    border: 1px solid var(--border-subtle);
  }

  .vinhetas-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .vinhetas-pads {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .vinheta-pad {
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
  }

  /* Interactive Bottom Crossfader Bar */
  .mixer-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-md);
    background-color: rgba(9, 13, 22, 0.75);
    border: 1px solid var(--border-subtle);
  }

  .crossfader-controls {
    display: flex;
    flex: 1 1 18rem;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    min-inline-size: 0;
  }

  .fade-btn {
    min-block-size: 2.25rem;
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-interactive);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease;
  }

  .fade-btn-1 {
    color: var(--cyan-bright);
  }

  .fade-btn-1:hover {
    border-color: var(--cyan);
    background-color: var(--cyan-surface);
  }

  .fade-btn-2 {
    color: var(--coral-text);
  }

  .fade-btn-2:hover {
    border-color: var(--coral);
    background-color: var(--coral-surface);
  }

  .xfader-slider-wrap {
    flex: 1 1 8rem;
    display: flex;
    align-items: center;
    min-inline-size: 6rem;
  }

  .xfader-range {
    -webkit-appearance: none;
    appearance: none;
    inline-size: 100%;
    min-block-size: 2.25rem;
    background: transparent;
    cursor: pointer;
  }

  .xfader-range::-webkit-slider-runnable-track {
    block-size: 0.45rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--cyan) 0%, #64748b 50%, var(--coral) 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
  }

  .xfader-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    inline-size: 1.25rem;
    block-size: 1.5rem;
    margin-block-start: -0.58rem;
    border-radius: 0.35rem;
    background-color: #f8fafc;
    border: 2px solid #090d16;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
  }

  .xfader-range::-moz-range-track {
    block-size: 0.45rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--cyan) 0%, #64748b 50%, var(--coral) 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
  }

  .xfader-range::-moz-range-thumb {
    inline-size: 1.25rem;
    block-size: 1.5rem;
    border-radius: 0.35rem;
    background-color: #f8fafc;
    border: 2px solid #090d16;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
  }

  .mixer-pills {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .automix-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
    background-color: var(--cyan-surface);
    border: 1px solid var(--cyan-border);
    color: var(--cyan-bright);
    font-size: 0.75rem;
    font-weight: 700;
  }

  .automix-pill::before {
    content: "";
    inline-size: 0.4rem;
    block-size: 0.4rem;
    border-radius: 50%;
    background-color: var(--cyan);
  }

  .mic-meter {
    display: flex;
    align-items: center;
    gap: 0.45rem;
  }

  .mic-label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
  }

  .mic-track {
    display: block;
    inline-size: 3.5rem;
    block-size: 0.4rem;
    border-radius: var(--radius-pill);
    background-color: rgba(255, 255, 255, 0.12);
    overflow: hidden;
  }

  .mic-fill {
    display: block;
    inline-size: 62%;
    block-size: 100%;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--green), #eab308);
  }
}

@layer utilities {
  .visually-hidden {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  /* Progressive Scroll Reveal: visible by default; enhanced only with js-ready + motion opt-in */
  @media (prefers-reduced-motion: no-preference) {
    html.js-ready [data-reveal]:not(.is-visible) {
      opacity: 0;
      transform: translateY(1rem);
    }

    html.js-ready [data-reveal] {
      transition: opacity 0.48s cubic-bezier(0.22, 1, 0.36, 1), transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
    }

    html.js-ready [data-reveal].is-visible {
      opacity: 1;
      transform: none;
    }
  }

  /* Windows High Contrast / Forced Colors Mode Support */
  @media (forced-colors: active) {
    .hero-title {
      background: none;
      color: CanvasText;
      -webkit-text-fill-color: CanvasText;
    }

    .site-header,
    .bento-card,
    .step-card,
    .whatsnew-panel,
    .faq-item,
    .showcase-window,
    .deck-card,
    .app-sidebar,
    .vinhetas-strip,
    .mixer-bar,
    .release-badge,
    .btn-ghost,
    .fade-btn {
      border: 1px solid CanvasText;
    }

    .btn-primary,
    .btn-nav-cta {
      background: Highlight;
      color: HighlightText;
      border: 1px solid ButtonText;
    }

    .live-dot,
    .whatsnew-marker,
    .automix-pill::before {
      background-color: Highlight;
    }

    .xfader-range::-webkit-slider-runnable-track,
    .xfader-range::-moz-range-track {
      background: ButtonFace;
      border: 1px solid ButtonText;
    }

    .xfader-range::-webkit-slider-thumb,
    .xfader-range::-moz-range-thumb {
      background: Highlight;
      border: 2px solid ButtonText;
    }

    :where(a, button, summary, input):focus-visible {
      outline: 3px solid Highlight;
    }
  }
}
