/* Storefront: cut paper, circuit symbols, and a plain catalog grid. */
:root,
:root.light,
:root.dark {
    --color-bg: #ffffff;
    --color-surface: #ffffff;
    --color-text: #101010;
    --color-muted: #555550;
    --color-line: #101010;
    --color-line-soft: #eeeee8;
    --color-error: #a62e21;
    --color-success: #28503a;
    --studio-blue: #2449db;
    --studio-red: #ed4c32;
    --studio-yellow: #f4ce37;
    --studio-green: #356b4e;
    --font-display: "Helvetica Neue", "OpenAI Sans", Arial, sans-serif;
    --font-body: "OpenAI Sans", Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --page-x: clamp(16px, 2vw, 32px);
    --page-y: 0px;
    --text-xs: 0.8125rem;
    --text-sm: 0.875rem;
    --tracking-sm: 0;
    --tracking-md: 0;
    --tracking-lg: 0;
    --desktop-header-height: 68px;
    --type-page-title: clamp(3.25rem, 7.5vw, 7.5rem);
    --type-section-title: clamp(2rem, 1.4rem + 2.4vw, 3.75rem);
    --type-subheading: clamp(1.5rem, 1.15rem + 1.2vw, 2.25rem);
    --type-card-title: clamp(2rem, 3.4vw, 3.75rem);
    --type-body: clamp(1.125rem, 1rem + 0.4vw, 1.375rem);
    --type-lead: clamp(1.375rem, 1.15rem + 0.8vw, 1.875rem);
    --type-meta: clamp(0.875rem, 0.8rem + 0.2vw, 1rem);
    --type-code: clamp(1rem, 0.95rem + 0.15vw, 1.125rem);
}

html { scroll-padding-top: 90px; }
body { font-family: var(--font-body); font-weight: 400; }
h1, h2, h3, h4, h5, h6, .hero-title { font-family: var(--font-display); }
.container { max-width: 1680px; }

/* Interface copy is lowercase; technical prose, code, and entered values keep their case. */
.site-shell :is(h1, h2, h3, h4, h5, h6, button, .badge, .kicker, .subtitle,
    .control-label, .tiny-copy, .continue-link, .price, .stock-label, .module-description,
    .in-cart-label, .quantity-static, .stock-overlay, .promo-tier-row,
    .catalog-mobile-filter, .catalog-mobile-sort, .variant-option-copy,
    .purchase-assurance, .product-purchase-summary, .cart-head, .cart-copy,
    .cart-price, .summary, .remove-link, .summary-note, .checkout-error,
    .mobile-menu-links, .trial-download-action, .firmware-download-action,
    .pikocore-loader-action, .sample-manager-action, .blog-kicker,
    .blog-post-meta, .blog-breadcrumbs, .blog-article-byline, .blog-read-link,
    .blog-back-shop, .blog-preview-banner, .blog-post-navigation small,
    .site-footer-line),
.site-shell .desktop-nav-item,
.site-shell .mobile-nav > a,
.site-shell .mobile-nav > button,
.site-shell .catalog-mobile-sort select,
.site-shell select.form-input,
.site-shell .variant-option-copy :is(strong, small) {
    text-transform: lowercase;
}

.kicker, .control-label, .badge, .stock-label, .in-cart-label,
.price, .tiny-copy, .continue-link, .blog-kicker, .blog-post-meta {
    font-family: var(--font-mono);
}

.body-copy, .module-description, .details-markdown, .markdown-content,
.summary p, .checkout-email-field p, .coupon-form p {
    font-size: 1rem;
    letter-spacing: 0;
    line-height: 1.6;
}

a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--studio-blue);
    outline-offset: 3px;
}

.site-header {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-text);
    background: var(--color-bg);
    box-shadow: none;
}
.site-header-inner { min-height: 68px; }
.site-header-row { gap: 16px; }
.brand-link { gap: 10px; }
.brand-logo { width: 32px; height: 32px; }
.brand-copy strong {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.055em;
    text-transform: lowercase;
}
.desktop-nav { gap: 0; align-self: stretch; }
.desktop-nav-item {
    align-self: stretch;
    min-height: 44px;
    padding: 12px 16px;
    border-left: 1px solid var(--color-text);
    border-radius: 0;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: -0.04em;
}
.desktop-nav-item > i { display: none; }
.desktop-nav-item:hover,
.desktop-nav-item:focus-visible,
.desktop-nav-item[aria-current="page"] {
    background: var(--studio-yellow);
    color: var(--color-text);
}
.desktop-nav-item[aria-current="page"]::after { content: none; }
.desktop-cart-link {
    margin-left: 0;
    padding-right: 40px;
    border: 0;
    border-left: 1px solid var(--color-text);
}

.page-title, .section-title {
    font-weight: 700;
    letter-spacing: -0.06em;
    line-height: 1;
}
.storefront-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    gap: 0;
    margin-bottom: 0;
    padding: 0;
    border: 2px solid var(--color-text);
}
.storefront-intro-title {
    display: flex;
    min-width: 0;
    align-items: center;
    padding: clamp(24px, 4vw, 64px);
    overflow: hidden;
    background: var(--studio-yellow);
}
.storefront-intro .page-title {
    max-width: none;
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(4.25rem, 10.8vw, 11rem);
    font-weight: 900;
    line-height: 0.78;
    letter-spacing: -0.085em;
    text-transform: lowercase;
}
.storefront-intro .page-title span {
    display: inline-block;
    margin-top: 0.1em;
    color: var(--color-text);
}
.studio-cutout {
    display: flex;
    min-width: 0;
    align-items: center;
    overflow: hidden;
    border-left: 2px solid var(--color-text);
    background: var(--studio-blue);
}
.studio-cutout svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 440px;
}

.discount-section { margin: 0; padding: 0; }
.promo-tier-row {
    padding: 12px 20px;
    border: 2px solid var(--color-text);
    border-top: 0;
    background: var(--studio-red);
}
.promo-tier-row-sale {
    border-color: var(--color-text);
    background: var(--color-text);
    color: #fff;
}
.promo-tier-row-items { color: var(--color-text); }

.catalog-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    margin: 0;
    padding: 0;
    border: 2px solid var(--color-text);
    border-top: 0;
    border-bottom: 0;
    background: var(--color-text);
}
.catalog-control-group {
    gap: 10px;
    align-content: start;
    padding: 18px 20px;
    background: var(--color-bg);
}
.catalog-desktop-filters { grid-column: span 2; }
.catalog-desktop-sort { border-left: 0; }
.control-label { font-size: 0.875rem; letter-spacing: 0; }
.catalog-button-row { gap: 4px 12px; }
.catalog-pill {
    min-height: 36px;
    padding: 4px 2px;
    border: 0;
    border-bottom: 2px solid transparent;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    letter-spacing: -0.025em;
}
.catalog-pill[aria-pressed="true"],
[data-category-toggle][aria-pressed="true"],
[data-sort-control][aria-pressed="true"] {
    border-bottom-color: var(--color-text);
    background: var(--studio-yellow) !important;
    color: var(--color-text) !important;
}
.catalog-pill:hover {
    background: var(--color-text) !important;
    color: #fff !important;
}
/* Match categories rather than grid position, including longer collection names. */
:is([data-category-slug^="desktop" i], [data-category-name^="desktop" i]) {
    --category-color: #f4ce37;
}
:is([data-category-slug^="diy" i], [data-category-name^="diy" i]) {
    --category-color: #d9cdef;
}
:is([data-category-slug^="eurorack" i], [data-category-name^="eurorack" i]) {
    --category-color: #ed765d;
}
:is([data-category-slug^="plugin" i], [data-category-name^="plugin" i]) {
    --category-color: #b9cdb2;
}
.catalog-pill[data-category-toggle] {
    padding-inline: 8px;
    background: var(--category-color, var(--color-line-soft));
}
.catalog-pill[data-category-toggle][aria-pressed="true"] {
    background: var(--category-color, var(--color-line-soft)) !important;
    color: var(--color-text) !important;
    box-shadow: inset 0 0 0 2px var(--color-text);
}
.modules-page { scroll-margin-top: 88px; }
#storefront-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 2px;
    padding: 0;
    border: 2px solid var(--color-text);
    background: var(--color-bg);
}
.storefront-product-card.module-row,
.storefront-product-card.module-row:nth-child(even) {
    --card-paper: var(--category-color, var(--color-line-soft));
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    grid-column: auto;
    gap: 0;
    padding: 0;
    border: 0;
    background: var(--color-surface);
    box-shadow: 0 0 0 1px var(--color-text);
}
.storefront-product-card.module-row:hover,
.storefront-product-card.module-row:focus-within { background: var(--color-surface); }
.storefront-product-card.module-row::before { content: none; }
.storefront-product-card .storefront-media-frame {
    display: flex;
    width: 100%;
    aspect-ratio: 1;
    flex: 0 0 auto;
    overflow: hidden;
    border: 0;
    border-bottom: 2px solid var(--color-text);
    background: var(--card-paper);
}
.storefront-product-card .storefront-media-frame::before,
.storefront-product-card .storefront-media-frame::after {
    content: none;
}
.storefront-product-card .storefront-media-image {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 28px;
    object-fit: contain;
}
.storefront-product-card.is-out-of-stock .storefront-media-image {
    filter: grayscale(1);
    opacity: 0.55;
}
.product-card-description {
    position: absolute;
    z-index: 3;
    inset: 0;
    display: flex;
    align-items: center;
    padding: clamp(20px, 2.5vw, 36px);
    overflow: hidden;
    background: var(--card-paper);
    color: var(--color-text);
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
}
.product-card-description [data-fit-description] {
    display: block;
    flex: 0 0 100%;
    min-width: 0;
    width: 100%;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.055em;
    overflow-wrap: anywhere;
    text-transform: lowercase;
}
.storefront-product-card .stock-overlay { z-index: 4; }
.storefront-media-frame:has(.stock-overlay) .product-card-description {
    padding-bottom: 64px;
}
.storefront-product-card:has(:focus-visible) .product-card-description,
.storefront-product-card.is-description-open .product-card-description {
    opacity: 1;
}
@media (hover: hover) and (pointer: fine) {
    .storefront-product-card:hover .product-card-description { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .product-card-description { transition: none; }
}
.storefront-product-card .storefront-product-body {
    display: grid;
    min-width: 0;
    flex: 1;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    gap: 12px;
    padding: clamp(14px, 1.5vw, 20px);
}
.storefront-product-card .module-heading-row {
    min-width: 0;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}
.storefront-product-card [data-product-name-box] {
    width: 100%;
    min-width: 0;
}
.storefront-product-card [data-fit-product-name] {
    display: inline-block;
    white-space: nowrap;
}
.storefront-product-card .module-name {
    overflow-wrap: anywhere;
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.4vw, 3.75rem);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.065em;
    text-transform: lowercase;
}
.storefront-product-card .module-actions:empty { display: none; }
.storefront-product-card .storefront-purchase-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
    border: 0;
}
.storefront-product-card .storefront-card-actions {
    width: auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-left: 0;
}
.storefront-product-card .storefront-card-actions > * {
    min-width: 0;
    grid-column: 1;
    grid-row: auto;
}
.storefront-product-card .storefront-card-actions > .product-state-slot { order: -1; }
.storefront-product-card .storefront-card-actions .btn-primary {
    width: auto;
    min-height: 44px;
    padding-inline: 12px;
    font-size: 0.875rem;
    white-space: nowrap;
}
.storefront-product-card.hidden,
.storefront-product-card .storefront-media-frame.hidden { display: none; }

.btn-primary, .btn-secondary, .btn-github, .button {
    min-height: 48px;
    border-width: 2px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    letter-spacing: 0;
    text-transform: lowercase;
}
.btn-primary { border-color: var(--color-text); background: var(--color-text); color: #fff; }
.btn-primary::after, .button::after, .product-state-slot .btn-primary::before { content: none; }
.product-state-slot .btn-primary,
.product-state-slot .btn-primary:not(:disabled) {
    min-width: 0;
    background: var(--color-text) !important;
    color: #fff !important;
}
.product-state-slot .btn-primary .add-to-cart-label,
.product-state-slot .btn-primary:not(:disabled) .add-to-cart-label { color: inherit; }
.product-state-slot .btn-primary:not(:disabled):hover,
.product-state-slot .btn-primary:not(:disabled):focus-visible {
    background: var(--studio-yellow) !important;
    color: var(--color-text) !important;
}
.trial-download-action, .firmware-download-action,
.pikocore-loader-action, .sample-manager-action { font-family: var(--font-mono); letter-spacing: 0; }
.btn-primary:focus-visible, .btn-secondary:focus-visible, .button:focus-visible,
.catalog-pill:focus-visible, .category-badge-button:focus-visible {
    outline: 3px solid var(--studio-blue);
    outline-offset: 3px;
}
.form-input { font-family: var(--font-body); font-size: 1rem; letter-spacing: 0; }
select.form-input { padding-right: 36px; }
.product-info > .section-title {
    font-size: var(--type-page-title);
    font-weight: 700;
    letter-spacing: -0.07em;
}
.product-info > .subtitle {
    font-family: var(--font-body);
    font-size: var(--type-lead);
    letter-spacing: 0;
    line-height: 1.55;
}
.purchase-panel {
    padding: 24px;
    border: 2px solid var(--color-text);
    background: var(--studio-yellow);
}
.variant-option:has(input:checked) {
    border-color: var(--color-text);
    background: var(--color-text);
    color: #fff;
}
.product-stage { border-color: var(--color-text); background: var(--color-line-soft); }
.product-guide-callout { padding: 20px; border: 2px solid var(--color-text); background: var(--color-surface); }
.product-guide-callout > i, .product-guide-primary > i { color: var(--color-text); }
.blog-index-hero, .guide-directory > .blog-article-header {
    padding: 24px 0;
    border: 0;
    border-bottom: 2px solid var(--color-text);
    background: transparent;
}
.blog-index-hero h1, .blog-article-header h1, .guide-page .blog-article-header h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--type-page-title);
    letter-spacing: -0.065em;
    overflow-wrap: anywhere;
}
.guide-directory-grid { gap: 2px; padding: 2px; background: var(--color-text); }
.guide-directory-card { padding: 24px; border: 0; background: var(--color-surface); }
.guide-directory-card h2 { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; letter-spacing: -0.06em; }
.home-blog-section { padding-top: 28px; border-top: 2px solid var(--color-text); }
.blog-section-heading h2, .home-blog-card h3, .blog-story-card h3 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.05em;
}
.blog-story-card, .home-blog-card { background: var(--color-surface); }
.blog-card-grid, .home-blog-grid { gap: 2px; border-width: 2px; }
.blog-shop-cta { border-width: 2px; background: var(--studio-yellow); }
.summary { padding: 24px; border: 2px solid var(--color-text); background: var(--studio-yellow); letter-spacing: 0; }
.site-footer { margin-top: 64px; padding: 24px 0 32px; border-top: 2px solid var(--color-text); }
.site-footer-inner { justify-content: space-between; }
.site-footer-line { font-size: 0.8125rem; letter-spacing: 0; line-height: 1.8; }

/* Keep the reading pages on the same type scale as the storefront. */
.product-info,
.blog-page-shell,
.blog-prose,
.guide-main {
    font-family: var(--font-body);
    font-size: var(--type-body);
    line-height: 1.6;
    letter-spacing: 0;
}
.product-info > .section-title { overflow-wrap: anywhere; }
.product-detail :is(.body-copy, .markdown-content, .details-markdown),
.product-reviews :is(p, blockquote, textarea),
.product-guide-callout p,
.blog-featured-copy > p:not(.blog-post-meta),
.blog-story-copy > p:not(.blog-post-meta),
.home-blog-card > div > p:not(.blog-post-meta),
.blog-product-card > div > p:not(.blog-kicker),
.guide-directory-card p,
.guide-page .guide-main :is(p, li, dd, dt) {
    font-family: var(--font-body);
    font-size: var(--type-body);
    line-height: 1.6;
    letter-spacing: 0;
}
.blog-index-hero > p,
.blog-article-dek {
    font-size: var(--type-lead);
    line-height: 1.45;
}
.product-detail h2.section-title,
.product-reviews .section-title,
.product-stories h2,
.blog-section-heading h2,
.blog-featured-copy h2,
.blog-related h2,
.blog-prose h1,
.blog-prose h2,
.guide-page .guide-main h1,
.guide-page .guide-main h2,
.product-detail .markdown-content h1,
.product-detail .markdown-content h2 {
    font-family: var(--font-display);
    font-size: var(--type-section-title);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.055em;
    overflow-wrap: anywhere;
}
.blog-prose h3,
.guide-page .guide-main h3,
.product-detail .markdown-content h3,
.review-form-intro h3,
.review-sign-in h3 {
    font-family: var(--font-display);
    font-size: var(--type-subheading);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.04em;
}
.blog-prose h4,
.guide-page .guide-main h4,
.product-detail .markdown-content h4 {
    font-family: var(--font-display);
    font-size: var(--type-body);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
}
.blog-story-copy h3,
.home-blog-card h3,
.blog-product-card h3,
.guide-directory-card h2 {
    font-family: var(--font-display);
    font-size: var(--type-card-title);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.055em;
    overflow-wrap: anywhere;
}
.blog-prose :is(h1, h2, h3, h4),
.guide-page .guide-main :is(h1, h2, h3, h4) {
    margin-block: 1.5em 0.55em;
    scroll-margin-top: calc(var(--desktop-header-height) + 24px);
}
.blog-prose > p:first-child::first-letter {
    float: none;
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}
.blog-breadcrumbs,
.blog-post-meta,
.blog-article-byline,
.blog-kicker,
.blog-article-hero figcaption,
.blog-prose figcaption,
.guide-main figcaption,
.blog-toc > p,
.blog-toc li,
.guide-toc li,
.guide-main .kicker {
    font-size: var(--type-meta);
    line-height: 1.5;
}
.blog-read-link,
.blog-back-shop,
.blog-post-navigation small,
.guide-directory-cta,
.guide-product-links,
.guide-footer,
.guide-toc summary,
.product-detail .control-label,
.product-detail .continue-link,
.detail-topline .continue-link {
    font-size: 1rem;
    line-height: 1.5;
}
.blog-related a strong,
.product-story-list a strong,
.blog-post-navigation strong {
    font-family: var(--font-display);
    font-size: var(--type-subheading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.035em;
}
.blog-related a small,
.product-story-list a small {
    font-size: var(--type-body);
    line-height: 1.5;
}
.blog-related a span,
.product-story-list a span {
    font-size: var(--type-meta);
}
.product-info .price span:first-child { font-size: var(--type-subheading); }
.product-info .price span:last-child,
.product-info .variant-option-copy strong,
.product-guide-primary,
.product-detail :is(.btn-primary, .btn-secondary, .trial-download-action,
    .firmware-download-action, .sample-manager-action, .pikocore-loader-action),
.blog-product-action,
.blog-product-action a,
.guide-main .oooo-grid-tutorials button {
    font-size: 1rem;
    line-height: 1.35;
}
.product-info .variant-option-copy small,
.product-info .purchase-assurance,
.product-info .purchase-rating,
.product-guide-secondary,
.product-purchase-summary strong,
.product-purchase-summary > span,
.product-purchase-action {
    font-size: var(--type-meta);
    line-height: 1.45;
}
.blog-prose :is(pre, table),
.guide-main :is(pre, table, code),
.product-detail .markdown-content :is(pre, code) {
    font-size: var(--type-code);
    line-height: 1.6;
}
.guide-main :is(th, td) { font-size: inherit; }

@media (max-width: 1100px) {
    #storefront-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .catalog-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .catalog-desktop-filters { grid-column: auto; }
    .desktop-nav-item { padding-inline: 10px; font-size: 1rem; }
    .desktop-cart-link { padding-right: 34px; }
}

@media (max-width: 780px) {
    .site-header-inner, .site-header-row { min-height: 68px; }
    .site-header-row { padding-bottom: 0; border-bottom: 0; }
    .site-header { margin-bottom: 16px; }
    .storefront-intro-title { padding: 24px; }
    .storefront-intro .page-title { font-size: 11vw; }
    .mobile-nav { border-top-width: 2px; background: var(--color-bg); box-shadow: none; backdrop-filter: none; }
    .mobile-nav > a, .mobile-nav > button {
        font-family: var(--font-body);
        font-size: 0.875rem;
        letter-spacing: -0.035em;
    }
    .mobile-nav > a[aria-current="page"], .mobile-nav > button[aria-current="page"] { background: var(--studio-yellow); }
    .mobile-nav > a[aria-current="page"]::before, .mobile-nav > button[aria-current="page"]::before { content: none; }
    .catalog-mobile-controls { grid-column: 1 / -1; gap: 12px; padding: 16px; background: var(--color-bg); }
    .catalog-mobile-filter summary, .catalog-mobile-filter-option, .catalog-mobile-sort select {
        font-size: 0.875rem;
        letter-spacing: 0;
    }
    .catalog-mobile-filter-menu { z-index: 5; background: var(--color-surface); }
    .storefront-product-card .product-state-slot .btn-primary { font-size: 0.875rem; }
}

@media (max-width: 640px) {
    .storefront-intro { grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr); }
    .storefront-intro-title { padding: 20px 14px; }
    .storefront-intro .page-title { font-size: clamp(2.9rem, 12vw, 4.75rem); }
    .studio-cutout svg { min-height: 180px; }
    #storefront-grid { grid-template-columns: minmax(0, 1fr); }
    .storefront-product-card .module-name { font-size: 2.75rem; }
    .storefront-product-card .add-to-cart-default { display: inline; }
    .storefront-product-card .add-to-cart-mobile { display: none; }
    .purchase-panel { padding: 20px; }
    .site-footer { margin-top: 48px; }
    .site-footer-inner { flex-direction: column; gap: 14px; }
}
