/* Shared type system for the storefront, customer account, Editor and 404.
   Source Sans 3 is self-hosted; Chinese glyphs use a matching native sans.
   Legacy --sans/--serif names remain aliases so existing components inherit it. */
@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url('../fonts/source-sans-3-roman-variable.woff2') format('woff2');
}
@font-face {
    font-family: 'Source Sans 3';
    font-style: italic;
    font-weight: 200 900;
    font-display: swap;
    src: url('../fonts/source-sans-3-italic-variable.woff2') format('woff2');
}
:root {
    --font-family: 'Source Sans 3', 'Source Han Sans SC', 'Noto Sans CJK SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
    --sans: var(--font-family);
    --serif: var(--font-family);
    --driver-popover-font-family: var(--font-family);
    font-family: var(--font-family);
}
html[lang='zh-CN'] {
    --sans: var(--font-family);
    --serif: var(--font-family);
}
body,
html[lang='zh-CN'] body {
    font-family: var(--font-family);
}
body.storefront :is(h1, h2),
body.editor-app :is(h1, h2),
body:not(.storefront):not(.editor-app) :is(h1, h2) {
    font-weight: 600;
    letter-spacing: -.025em;
    text-wrap: balance;
}
body.storefront :is(h3, h4),
body.editor-app :is(h3, h4),
body:not(.storefront):not(.editor-app) :is(h3, h4) {
    font-weight: 600;
    letter-spacing: -.01em;
}
/* Product names stay quieter than section headings and retain their wrapping. */
.storefront .product-grid .product-card h3 {
    font-weight: 500;
}
html[lang='zh-CN'] :is(h1, h2, h3, h4) {
    letter-spacing: 0;
}

/* One role scale: large editorial titles, compact application titles, readable
   prose and consistent controls. Spacing follows a four-pixel base. */
:root {
    --type-display-size: clamp(3rem, 5.56vw, 5rem);
    --type-display-line: 1.1;
    --type-page-title-size: clamp(2.25rem, 4.45vw, 4rem);
    --type-page-title-line: 1.15;
    --type-section-title-size: clamp(2rem, 3.34vw, 3rem);
    --type-section-title-line: 1.2;
    --type-app-title-size: 2.5rem;
    --type-app-title-line: 1.2;
    --type-auth-title-size: 2rem;
    --type-auth-title-line: 1.25;
    --type-panel-title-size: 1.5rem;
    --type-panel-title-line: 1.35;
    --type-card-title-size: 1.25rem;
    --type-card-title-line: 1.4;
    --type-lead-size: 1.125rem;
    --type-lead-line: 1.65;
    --type-body-size: 1rem;
    --type-body-line: 1.75;
    --type-ui-size: .875rem;
    --type-ui-line: 1.5;
    --type-meta-size: .8125rem;
    --type-meta-line: 1.5;
    --type-label-size: .875rem;
    --type-label-line: 1.5;
    --type-control-size: 1rem;
    --type-control-line: 1.5;
    --type-button-size: .875rem;
    --type-button-line: 1.5;
    --type-eyebrow-size: .75rem;
    --type-heading-cjk-line: 1.25;
    --type-card-cjk-line: 1.45;
    --space-1: .25rem;
    --space-2: .5rem;
    --space-3: .75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-panel: var(--space-6);
    --space-grid: var(--space-6);
    --space-block: var(--space-8);
    --space-section: var(--space-20);
    --space-field: var(--space-4);
    --space-label: var(--space-2);
    --control-height: 3rem;
    --control-compact-height: 2.75rem;
}
body.storefront {
    --refine-space: var(--space-section); --editorial-section: var(--space-section);
    --editorial-type-body: var(--type-body-size); --editorial-leading-body: var(--type-body-line);
    --editorial-type-support: var(--type-ui-size); --editorial-type-control: var(--type-button-size);
    --editorial-type-meta: var(--type-meta-size); --editorial-measure-body: 68ch;
    --fc-control-type: var(--type-button-size);
    font-size: var(--type-body-size); line-height: var(--type-body-line);
}
body.storefront.page-home { --home-section-space: var(--space-section); }
body.storefront.page-about .about-page { --about-space: var(--space-section); }
body.storefront.page-contact .contact-page { --contact-space: var(--space-section); }
body.storefront.page-oem .oem-page { --oem-space: var(--space-section); }
body.customer-app, body.editor-app { font-size: var(--type-body-size); line-height: var(--type-ui-line); }

/* Public page and section titles share roles rather than one universal size. */
body.storefront.page-home main #spotlight-heading { font-size: var(--type-display-size); line-height: var(--type-display-line); }
body.storefront.page-home main #spotlight-heading em { font-size: .7em; line-height: 1.2; }
body.storefront.page-collection .collection-masthead h1.page-purpose-heading,
body.storefront.page-about .about-page h1.page-purpose-heading,
body.storefront.page-contact .contact-page h1.page-purpose-heading,
body.storefront.page-oem .oem-page h1,
body.storefront.page-brand .brand-page-hero h1,
body.storefront.page-certificates .certificates-page .cert-hero h1 {
    font-size: var(--type-page-title-size); line-height: var(--type-page-title-line);
}
body.storefront.page-about .about-page h2,
body.storefront.page-contact .contact-page h2,
body.storefront.page-oem .oem-page h2,
body.storefront.page-brand :is(.brand-page-introduction,.brand-page-section-heading,.brand-page-enquiry,.brand-page-other) h2,
body.storefront.page-certificates .certificates-page h2,
body.storefront.page-home main .section-heading h2,
body.storefront.page-home main :is(#spotlight-edit-heading,#home-story-title,#home-cocoa-heading,#home-partner-heading,#home-certificates-title,#home-closing-title,#recently-viewed-title),
body.storefront #footer-invitation-heading,
body.storefront .related-section .section-heading h2 {
    font-size: var(--type-section-title-size); line-height: var(--type-section-title-line);
}
body.storefront.page-product .gallery-product-page .detail-copy h1,
body.storefront.page-product main #product-title { font-size: var(--type-app-title-size); line-height: var(--type-app-title-line); }
body.storefront.page-about .about-page h3,
body.storefront.page-contact .contact-page h3,
body.storefront.page-oem .oem-page h3,
body.storefront.page-certificates .certificates-page h3,
body.storefront .home-discovery h3 { font-size: var(--type-panel-title-size); line-height: var(--type-panel-title-line); }
body.storefront .product-grid .product-card h3,
body.storefront .brand-page-product-grid .product-card h3,
body.storefront .recently-viewed-name,
body.storefront .spotlight-product-copy h2 { font-size: var(--type-card-title-size); line-height: var(--type-card-title-line); }
body.storefront:not(.page-home) .product-grid .product-card h3 { font-size: var(--type-card-title-size); line-height: var(--type-card-title-line); }
body.storefront .home-story-year { font-size: var(--type-panel-title-size); line-height: var(--type-panel-title-line); }
body.storefront .qv-copy #qv-name { font-size: var(--type-panel-title-size); line-height: var(--type-panel-title-line); }

/* Longer prose keeps a comfortable line; short labels keep a tighter rhythm. */
body.storefront.page-about .about-page :is(p,dd,li):where(:not(.eyebrow,.about-section-caption,.page-purpose-tagline,.about-lead)),
body.storefront.page-oem .oem-page :is(p,dd,li):where(:not(.eyebrow,.oem-tagline,.oem-breadcrumbs)),
body.storefront.page-home .home-story-copy > p:not(.eyebrow),
body.storefront.page-home .home-cocoa-copy > p:not(.eyebrow),
body.storefront.page-home .home-campaign .spotlight-description,
body.storefront .contact-intro-copy,
body.storefront .product-rich-description,
body.storefront .product-note-content {
    font-size: var(--type-body-size); line-height: var(--type-body-line); max-inline-size: 68ch;
}
body.storefront.page-about .about-page :is(.about-lead,.page-purpose-tagline),
body.storefront.page-collection .collection-masthead .page-purpose-tagline,
body.storefront.page-contact .contact-hero .page-purpose-tagline,
body.storefront.page-oem .oem-page .oem-tagline {
    font-size: var(--type-lead-size); line-height: var(--type-lead-line);
}
body.storefront.page-home .spotlight-business-intro { font-size: var(--type-body-size); line-height: var(--type-ui-line); }
body.storefront :is(.eyebrow,.kicker,.about-section-caption,.product-brand) { font-size: var(--type-eyebrow-size); line-height: var(--type-ui-line); }
body.storefront.page-about .about-page .eyebrow,
body.storefront.page-contact .contact-page .eyebrow,
body.storefront.page-oem .oem-page .eyebrow,
body.storefront.page-certificates .certificates-page .eyebrow { font-size: var(--type-eyebrow-size); line-height: var(--type-ui-line); }
body.storefront :is(.breadcrumbs,.product-code,.product-photo-status,.footer-bottom) { font-size: var(--type-meta-size); line-height: var(--type-meta-line); }
body.storefront .site-header .site-nav a { font-size: var(--type-ui-size); line-height: var(--type-ui-line); }
body.storefront .site-language, body.customer-app .site-language, body.editor-app .site-language { --language-font-size: var(--type-ui-size); }

/* Components retain their existing action, imagery and focus treatment. */
body.storefront :is(.button,.search-submit,.apply-filters,.detail-save,.product-compare-detail) {
    min-height: var(--control-height); padding: var(--space-3) var(--space-5);
    font-size: var(--type-button-size); line-height: var(--type-button-line); gap: var(--space-3);
}
body.storefront a.button.fc-atelier-cta:any-link {
    min-height: 3.25rem; padding: .875rem 4.5rem .875rem var(--space-6);
    font-size: var(--type-button-size); line-height: var(--type-button-line);
}
body.storefront.page-about .about-page :is(.button,.text-link),
body.storefront.page-oem .oem-page :is(.button,.text-link) { font-size: var(--type-button-size); line-height: var(--type-button-line); }
body.storefront .text-link { min-height: var(--control-compact-height); font-size: var(--type-button-size); line-height: var(--type-button-line); gap: var(--space-4); }
body.storefront :is(.enquiry-field,.contact-field,.field) { gap: var(--space-label); font-size: var(--type-label-size); line-height: var(--type-label-line); }
body.storefront :is(.catalog-search input,.enquiry-field input,.enquiry-field select,.enquiry-field textarea,.contact-field input,.contact-field textarea) {
    min-height: var(--control-height); font-size: var(--type-control-size); line-height: var(--type-control-line); padding: var(--space-3) var(--space-4);
}
body.storefront :is(.enquiry-contact-grid,.contact-form-grid) { gap: var(--space-field) var(--space-grid); }
body.storefront :is(.oem-enquiry,.enquiry-basket-dialog) .enquiry-field { font-size: var(--type-label-size); line-height: var(--type-label-line); gap: var(--space-label); }
body.storefront :is(.oem-enquiry,.enquiry-basket-dialog) .enquiry-field :is(input,textarea) {
    min-height: var(--control-height); font-size: var(--type-control-size); line-height: var(--type-control-line); padding: var(--space-3) var(--space-4);
}
body.storefront :is(.oem-enquiry,.enquiry-basket-dialog) .enquiry-field textarea {
    min-height: calc(var(--control-height) * 3); line-height: var(--type-body-line);
}
body.storefront :is(.oem-enquiry,.enquiry-basket-dialog) .enquiry-contact-grid { gap: var(--space-field) var(--space-grid); }
body.storefront.page-product .gallery-product-page .detail-save {
    min-height: var(--control-height); font-size: var(--type-button-size); line-height: var(--type-button-line); padding: var(--space-3) var(--space-5);
}
body.storefront.page-product .gallery-product-page .detail-code { font-size: var(--type-meta-size); line-height: var(--type-meta-line); }
body.storefront.page-home .spotlight-rail-filters button {
    min-inline-size: var(--control-compact-height); min-block-size: var(--control-compact-height);
    padding-inline: var(--space-3); font-size: var(--type-button-size); line-height: var(--type-button-line);
}
body.storefront :is(.section-heading,.about-section-heading,.contact-section-heading,.cert-section-heading,.brand-page-section-heading) { gap: var(--space-grid); margin-bottom: var(--space-block); }
body.storefront :is(.product-grid,.brand-page-product-grid) { gap: var(--space-grid); }
body.storefront .home-story-inner { column-gap: var(--space-section); row-gap: var(--space-block); }
body.storefront .home-story-copy > .text-link { margin-top: var(--space-6); }
body.storefront.page-about .about-page .about-hero-spread,
body.storefront.page-oem .oem-page .oem-hero-spread { gap: var(--space-block) var(--space-section); }
body.storefront .footer-main :is(p,a), body.storefront .footer-links { font-size: var(--type-ui-size); line-height: var(--type-ui-line); }
body.storefront .footer-main { gap: var(--space-block); padding-block: var(--space-12); }
body.storefront .footer-links { gap: var(--space-2); }
body.storefront .footer-links a { min-height: var(--control-compact-height); }
body.storefront .footer-bottom { gap: var(--space-4); padding-block: var(--space-6); }
body.storefront .footer-note > p { font-size: var(--type-ui-size); line-height: var(--type-body-line); }
body.storefront :is(.dialog-panel,.image-zoom-dialog) h2,
body.storefront .enquiry-basket-dialog h2 { font-size: var(--type-panel-title-size); line-height: var(--type-panel-title-line); }
body.storefront .fc-assistant-header h2 { font-size: var(--type-card-title-size); line-height: var(--type-card-title-line); }
body.storefront .fc-assistant-message > p { font-size: var(--type-body-size); line-height: var(--type-ui-line); }
body.storefront .fc-assistant-message > p.fc-assistant-message-label { font-size: var(--type-meta-size); line-height: var(--type-meta-line); }

/* Standalone not-found pages use the same public title, prose and control roles. */
body[data-public-not-found] #error-heading { font-size: var(--type-page-title-size); line-height: var(--type-page-title-line); margin-bottom: var(--space-6); }
body[data-public-not-found] .error-card { padding: var(--space-block); }
body[data-public-not-found] .error-description { font-size: var(--type-body-size); line-height: var(--type-body-line); }
body[data-public-not-found] .error-actions { margin-top: var(--space-block); gap: var(--space-3); }
body[data-public-not-found] :is(.error-action,.error-language-trigger,.error-language select) { font-size: var(--type-button-size); line-height: var(--type-button-line); }
body[data-public-not-found] .error-eyebrow { font-size: var(--type-eyebrow-size); line-height: var(--type-ui-line); margin-bottom: var(--space-6); }

@media (max-width: 780px) {
    :root {
        --type-app-title-size: 2rem;
        --type-auth-title-size: 1.75rem;
        --type-panel-title-size: 1.25rem;
        --type-card-title-size: 1.125rem;
        --space-panel: var(--space-5);
        --space-grid: var(--space-4);
        --space-block: var(--space-6);
        --space-section: var(--space-12);
    }
}
