/**
 * Global visual polish — overseas premium SaaS look
 * Loaded last after Vite + site-theme. Clay + ink brand; no purple AI wash.
 */

:root {
    --ink: #12100e;
    --ink-mute: #5a544c;
    --ink-faint: #8a837a;
    --paper: #f6f3ef;
    --paper-card: #fffcf8;
    --paper-deep: #ece7e0;
    --clay: #c45c26;
    --clay-dark: #9a4318;
    --clay-soft: #f3e6dc;
    --moss: #2a5642;
    --moss-soft: #e7efe9;

    /* Remap former "dream" purple → refined ink accent (global) */
    --dream: #1c1917;
    --dream-dark: #0c0a09;
    --dream-soft: #f0ebe4;
    --dream-teal: #6b635a;

    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 0.9rem;
    --shadow-lift: 0 1px 2px rgba(18, 16, 14, 0.04), 0 12px 28px -14px rgba(18, 16, 14, 0.16);
    --shadow-lift-lg: 0 2px 4px rgba(18, 16, 14, 0.05), 0 22px 48px -18px rgba(18, 16, 14, 0.2);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--paper);
    color: var(--ink);
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Atmosphere — warm paper depth, no purple/teal glow */
.site-body-pattern {
    background-color: var(--paper) !important;
    background-image:
        linear-gradient(rgba(246, 243, 239, 0.72), rgba(246, 243, 239, 0.72)),
        url('/brand/pattern-tile.png'),
        radial-gradient(ellipse 80% 55% at 50% -25%, rgba(196, 92, 38, 0.05), transparent 58%),
        radial-gradient(ellipse 50% 40% at 100% 0%, rgba(18, 16, 14, 0.03), transparent 52%) !important;
}

.hero-section-atmosphere,
.page-atmosphere,
.page-atmosphere--pricing,
.page-atmosphere--tools,
.page-atmosphere--member {
    background-image:
        radial-gradient(ellipse 70% 50% at 80% 0%, rgba(196, 92, 38, 0.06), transparent 55%),
        radial-gradient(ellipse 55% 45% at 10% 20%, rgba(18, 16, 14, 0.035), transparent 50%) !important;
}

.cta-band::before {
    background:
        radial-gradient(ellipse 70% 60% at 90% 15%, rgba(196, 92, 38, 0.22), transparent 55%),
        radial-gradient(ellipse 50% 45% at 10% 85%, rgba(18, 16, 14, 0.12), transparent 50%) !important;
}

/* Typography hierarchy */
.page-title,
.section-title,
.hero-title,
.tool-chrome-title,
.home-value-title {
    letter-spacing: -0.03em;
}

.page-lead,
.section-lead,
.tool-chrome-lead {
    color: var(--ink-mute);
    line-height: 1.65;
}

.page-eyebrow {
    border-radius: 0.4rem !important;
    border-color: rgba(18, 16, 14, 0.1) !important;
    background: rgba(255, 252, 248, 0.9) !important;
    color: var(--ink-mute) !important;
    letter-spacing: 0.1em !important;
    font-weight: 600 !important;
}

.chip-accent {
    border-color: rgba(18, 16, 14, 0.1) !important;
    background: var(--paper-deep) !important;
    color: var(--ink) !important;
}

.chip-live {
    border-color: rgba(42, 86, 66, 0.18) !important;
    background: var(--moss-soft) !important;
    color: var(--moss) !important;
}

/* Cards / surfaces — tighter radius, quieter shadow */
.card,
.tool-workspace-surface,
.tool-chrome,
.pricing-card,
.faq-item,
.group-panel,
.nav-flyout {
    border-radius: var(--radius-lg) !important;
    border-color: rgba(18, 16, 14, 0.08) !important;
    box-shadow: var(--shadow-lift) !important;
}

.card:hover,
.tool-featured:hover,
.tool-card:hover {
    box-shadow: var(--shadow-lift-lg);
}

/* Kill purple→teal accent bars / icons */
.value-card::before,
.member-stat-card::before,
.tools-group::before,
.tool-card-ai::before,
.ai-spotlight-card::before {
    background: linear-gradient(90deg, rgba(196, 92, 38, 0.75), rgba(18, 16, 14, 0.2)) !important;
}

.value-card-icon {
    background: var(--clay-soft) !important;
    color: var(--clay-dark) !important;
    border-radius: var(--radius-md) !important;
}

.step-number {
    background: var(--ink) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.site-nav .nav-link-active::after {
    background: var(--clay) !important;
    width: 1.15rem !important;
}

/* Pricing featured — clay, not purple glow */
.pricing-card-featured {
    outline: 1.5px solid rgba(196, 92, 38, 0.35) !important;
    box-shadow: var(--shadow-lift-lg) !important;
    transform: translateY(-0.2rem);
}

.pricing-ribbon {
    background: var(--ink) !important;
    color: #fff !important;
}

.faq-item[open] {
    border-color: rgba(196, 92, 38, 0.2) !important;
}

.faq-item[open] .faq-question {
    border-left-color: var(--clay) !important;
}

/* Focus / forms */
a:focus-visible,
button:focus-visible,
.nav-link:focus-visible,
.field:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
}

.field:focus,
input:focus,
textarea:focus,
select:focus,
.qr-studio-input:focus,
.form-input:focus,
.form-select:focus {
    border-color: rgba(196, 92, 38, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.12) !important;
}

/* Buttons */
.btn-primary {
    border-radius: 999px;
    letter-spacing: -0.01em;
    box-shadow: 0 1px 2px rgba(154, 67, 24, 0.2);
}

.btn-ghost {
    border-radius: 999px;
    border-color: rgba(18, 16, 14, 0.12);
}

/* Page rhythm */
.page-wrap {
    max-width: 72rem;
}

.page-section {
    padding-block: clamp(2rem, 4vw, 3.25rem);
}

.page-hero {
    margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
}

/* Header polish */
.site-header {
    backdrop-filter: blur(12px) saturate(1.1);
    background: rgba(246, 243, 239, 0.82) !important;
    border-bottom: 1px solid rgba(18, 16, 14, 0.06) !important;
}

.nav-flyout-link:hover,
.mega-menu-link:hover,
.mobile-nav-link:hover {
    background: rgba(196, 92, 38, 0.06) !important;
    color: var(--clay-dark) !important;
}

.nav-flyout-link.is-active,
.mega-menu-link.is-active {
    background: rgba(196, 92, 38, 0.08) !important;
    color: var(--clay-dark) !important;
}

/* Footer */
.site-footer {
    background: rgba(236, 231, 224, 0.72) !important;
}

.site-footer-cta {
    background: linear-gradient(135deg, rgba(196, 92, 38, 0.07) 0%, rgba(255, 252, 248, 0.92) 48%, rgba(236, 231, 224, 0.8) 100%) !important;
}

.site-footer::before {
    background: linear-gradient(90deg, transparent, rgba(196, 92, 38, 0.28), transparent) !important;
}

.locale-menu-option:hover {
    background: rgba(196, 92, 38, 0.07) !important;
}

.locale-menu-option.is-active {
    background: rgba(196, 92, 38, 0.1) !important;
    color: var(--clay-dark) !important;
}

.locale-menu-option.is-active .locale-menu-option-code {
    color: var(--clay) !important;
}

.locale-menu-trigger:hover,
.locale-menu.is-open .locale-menu-trigger {
    border-color: rgba(196, 92, 38, 0.35) !important;
    box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.08) !important;
}

/* Tool chrome */
.tool-page .tool-chrome-group,
.tool-page .tool-chrome-aside-link,
.tool-page .tool-chrome-tip-link {
    color: var(--clay-dark) !important;
}

.tool-page .tool-chrome-tip--promo {
    background: linear-gradient(90deg, rgba(196, 92, 38, 0.06), rgba(18, 16, 14, 0.03)) !important;
    color: var(--ink-mute) !important;
}

.tool-page .tool-chrome-back:hover {
    color: var(--clay-dark) !important;
}

/* QR studio accents */
.qr-studio-type-tab.is-active,
.qr-studio-mode.is-active,
.qr-studio-preset-card.is-active,
.qr-studio-scene-chip.is-active,
.qr-studio-scene-chip:hover {
    border-color: rgba(196, 92, 38, 0.35) !important;
    background: rgba(196, 92, 38, 0.07) !important;
    color: var(--clay-dark) !important;
}

.qr-studio-link,
.qr-studio-link-btn,
.qr-studio-spotlight-cta,
.qr-studio-pro-panel-badge,
.qr-studio-pro-tag,
.qr-studio-inline-pro,
.qr-studio-chip-pro {
    color: var(--clay-dark) !important;
    background: rgba(196, 92, 38, 0.1);
}

.qr-studio-pro-panel {
    border-color: rgba(196, 92, 38, 0.2) !important;
    background: linear-gradient(135deg, rgba(255, 252, 248, 0.98) 0%, rgba(243, 230, 220, 0.55) 100%) !important;
}

/* Home chips */
.home-spotlight-chip:hover {
    border-color: rgba(196, 92, 38, 0.3) !important;
    color: var(--clay-dark) !important;
}

.home-value-index {
    color: var(--clay) !important;
}

/* Soften leftover lavender utility classes from Vite build */
.text-dream,
.text-dream-dark {
    color: var(--clay-dark) !important;
}

.bg-dream-soft {
    background-color: var(--dream-soft) !important;
}

.bg-dream {
    background-color: var(--ink) !important;
}

.border-dream\/20,
.border-dream\/15,
.border-dream\/30 {
    border-color: rgba(196, 92, 38, 0.2) !important;
}

.ring-dream\/15,
.ring-dream\/20,
.ring-dream\/30 {
    --tw-ring-color: rgba(196, 92, 38, 0.15) !important;
}

/* Empty / notice polish */
.notice-bar {
    border-radius: var(--radius-md) !important;
}

/* Tools index — editorial jump chips */
.tools-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(18, 16, 14, 0.07);
}

.tools-jump-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    border: 1px solid rgba(18, 16, 14, 0.1);
    background: var(--paper-card);
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-mute);
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}

.tools-jump-chip:hover {
    border-color: rgba(196, 92, 38, 0.3);
    color: var(--clay-dark);
    background: rgba(255, 252, 248, 0.98);
    box-shadow: var(--shadow-lift);
}

.tools-jump-count {
    font-variant-numeric: tabular-nums;
    font-size: 0.7rem;
    color: var(--ink-faint);
    background: var(--paper-deep);
    border-radius: 999px;
    padding: 0.1rem 0.4rem;
}

.tools-group-icon {
    border-radius: var(--radius-md) !important;
    background: var(--clay-soft) !important;
    color: var(--clay-dark) !important;
    box-shadow: none !important;
}

.tool-card {
    border-radius: var(--radius-lg) !important;
    background: var(--paper-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tool-card:hover {
    transform: translateY(-2px);
    border-color: rgba(196, 92, 38, 0.16) !important;
}

/* Pricing typography */
.pricing-price {
    letter-spacing: -0.04em;
    font-feature-settings: "tnum";
}

.pricing-card-pack {
    background: linear-gradient(180deg, var(--paper-card) 0%, rgba(243, 230, 220, 0.35) 100%);
}

.pricing-feature-item::before {
    color: var(--clay) !important;
}

/* Articles / legal / contact */
.article-card {
    border-radius: var(--radius-lg) !important;
    background: var(--paper-card);
    box-shadow: var(--shadow-lift);
}

.article-prose,
.legal-prose {
    max-width: 42rem;
    line-height: 1.75;
    color: var(--ink);
}

.article-prose h2,
.legal-prose h2 {
    letter-spacing: -0.025em;
    margin-top: 2rem;
}

.contact-card {
    border-radius: var(--radius-lg) !important;
    background: var(--paper-card);
    box-shadow: var(--shadow-lift);
}

.contact-card-icon {
    background: var(--clay-soft) !important;
    color: var(--clay-dark) !important;
}

.contact-email-link {
    color: var(--clay-dark) !important;
}

.contact-topic {
    border-radius: var(--radius-md) !important;
    border-color: rgba(18, 16, 14, 0.08) !important;
    background: rgba(255, 252, 248, 0.7);
}

/* Member */
.member-support-card {
    border-radius: var(--radius-lg) !important;
    border-color: rgba(196, 92, 38, 0.16) !important;
    background: linear-gradient(135deg, rgba(196, 92, 38, 0.06), rgba(255, 252, 248, 0.95)) !important;
}

.member-qr-nav-link:hover {
    background: rgba(196, 92, 38, 0.06) !important;
    color: var(--clay-dark) !important;
}

/* Auth */
.auth-aside--aurora {
    background-image: linear-gradient(135deg, rgba(20, 18, 16, 0.92) 0%, rgba(20, 18, 16, 0.78) 45%, rgba(196, 92, 38, 0.28) 100%), var(--auth-aurora) !important;
}

/* Showcase / styles gallery */
.tool-showcase-card,
.styles-card,
.scene-card {
    border-radius: var(--radius-lg) !important;
    border-color: rgba(18, 16, 14, 0.08) !important;
    box-shadow: var(--shadow-lift);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-showcase-card:hover,
.styles-card:hover,
.scene-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift-lg);
}

/* Quiet motion for premium feel */
@media (prefers-reduced-motion: no-preference) {
    .btn-primary,
    .tool-card,
    .pricing-card,
    .article-card,
    .home-spotlight-chip {
        transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    }

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

/* Skip link & selection */
::selection {
    background: rgba(196, 92, 38, 0.18);
    color: var(--ink);
}

/* ── Mobile layout (all public pages) ── */
@media (max-width: 639px) {
    .page-wrap {
        padding-inline: 1rem;
    }

    .page-section {
        padding-block: clamp(1.5rem, 5vw, 2.5rem);
    }

    .site-footer-cta-inner {
        padding-block: 1.25rem;
    }

    .site-footer-cta-actions {
        width: 100%;
    }

    .site-footer-cta-actions .btn-primary,
    .site-footer-cta-actions .btn-ghost {
        flex: 1 1 calc(50% - 0.35rem);
        justify-content: center;
        min-height: 2.75rem;
    }

    .site-footer-grid {
        gap: 1.5rem;
        padding-block: 1.75rem 1.5rem;
    }

    .site-footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .pricing-grid,
    .home-value-grid,
    .tools-grid {
        gap: 1rem;
    }

    .hero-section-inner {
        padding-inline: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn-primary,
    .hero-actions .btn-ghost {
        width: 100%;
        justify-content: center;
        min-height: 2.75rem;
    }

    .cta-band-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-band-actions .btn-primary,
    .cta-band-actions .btn-ghost {
        width: 100%;
        justify-content: center;
    }

    .auth-card {
        margin-inline: 0;
    }

    .tool-page.page-wrap {
        padding-inline: 1rem;
    }

    .member-qr-page-shell .page-wrap {
        padding-inline: 1rem;
    }

    .back-to-top {
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        right: calc(1rem + env(safe-area-inset-right, 0px));
    }

    body.nav-open .back-to-top,
    body.nav-open .qr-studio-mobile-bar {
        visibility: hidden;
        pointer-events: none;
    }
}

@media (max-width: 1023px) {
    .qr-studio-mobile-bar {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }

    .tool-chrome-head {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .blog-layout {
        gap: 1.25rem;
    }

    .blog-hero-title {
        font-size: clamp(1.75rem, 7vw, 2.25rem);
    }

    .pricing-card-featured {
        transform: none;
    }
}

@media (max-width: 1023px) and (pointer: coarse) {
    .btn,
    .nav-mobile-toggle,
    .locale-menu-trigger,
    .locale-menu-option,
    .footer-link,
    .tool-card {
        touch-action: manipulation;
    }
}
