/* NSF Global — v11 Polished
   RM20k agency-tier corporate website */

/* === Design tokens === */
:root {
    --nsf-text: #1d1d1f;
    --nsf-text-soft: #515154;
    --nsf-text-muted: #86868b;
    --nsf-bg: #ffffff;
    --nsf-bg-soft: #fafafa;
    --nsf-bg-dark: #0a0a0b;
    --nsf-line: rgba(0,0,0,0.08);
    --nsf-line-strong: rgba(0,0,0,0.16);
    --nsf-gold: #c9a96e;
    --nsf-gold-dark: #8b6f3f;
    --nsf-radius: 4px;
    --nsf-radius-lg: 8px;
    --nsf-section-py: clamp(64px, 9vw, 112px);
    --nsf-section-px: clamp(20px, 4vw, 40px);
    --nsf-container: 1100px;
    --nsf-container-narrow: 720px;
    --nsf-container-wide: 1280px;
    --nsf-easing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset Astra defaults that clash === */
body.fi-body, body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', system-ui, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'ss01', 'cv01';
    color: var(--nsf-text);
    line-height: 1.55;
}

/* === Skip-to-content (accessibility) === */
.skip-link {
    position: absolute; top: -100px; left: 0;
    background: var(--nsf-text); color: white;
    padding: 12px 16px; z-index: 9999;
    text-decoration: none; font-weight: 600;
    transition: top 0.2s var(--nsf-easing);
}
.skip-link:focus { top: 0; }

/* === Header — sticky glass, refined === */
.site-header, .ast-primary-header-bar, header.site-header {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--nsf-line) !important;
    box-shadow: none !important;
    position: sticky !important;
    top: 0;
    z-index: 100;
    transition: padding 0.25s var(--nsf-easing), background 0.25s var(--nsf-easing) !important;
    padding: 12px 0 !important;
}
body.is-scrolled .ast-primary-header-bar,
body.is-scrolled .site-header {
    padding: 6px 0 !important;
    background: rgba(255, 255, 255, 0.92) !important;
}
.site-logo-img img, img.custom-logo {
    max-height: 36px !important;
    width: auto !important;
    transition: max-height 0.25s var(--nsf-easing);
}
body.is-scrolled .site-logo-img img,
body.is-scrolled img.custom-logo {
    max-height: 32px !important;
}
.site-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
    color: var(--nsf-text) !important;
}
.site-title a { color: inherit !important; text-decoration: none !important; }

/* Nav typography */
.main-header-menu .menu-link,
.ast-builder-menu-1 .menu-link,
.ast-primary-header-bar nav a {
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: -0.005em !important;
    color: var(--nsf-text) !important;
    padding: 8px 14px !important;
    transition: color 0.18s var(--nsf-easing) !important;
}
.main-header-menu .menu-link:hover,
.ast-builder-menu-1 .menu-link:hover {
    color: var(--nsf-gold-dark) !important;
}
.current-menu-item > .menu-link,
.current_page_item > a {
    color: var(--nsf-gold-dark) !important;
}

/* Mobile hamburger refinement */
.ast-mobile-menu-buttons-minimal {
    color: var(--nsf-text) !important;
}

/* === Typography === */
.nsf-cp-eyebrow {
    font-size: 11px;
    font-weight: 600;
    color: var(--nsf-text-muted);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-feature-settings: 'tnum';
}
.nsf-cp-h1 {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 700;
    color: var(--nsf-text);
    letter-spacing: -0.028em;
    line-height: 1.04;
    margin: 0;
    font-feature-settings: 'ss01', 'cv01';
}
.nsf-cp-h2 {
    font-size: clamp(24px, 3.5vw, 36px);
    font-weight: 600;
    color: var(--nsf-text);
    letter-spacing: -0.022em;
    line-height: 1.15;
    margin: 0 0 16px;
}
.nsf-cp-h3 {
    font-size: 19px;
    font-weight: 600;
    color: var(--nsf-text);
    letter-spacing: -0.014em;
    margin: 0 0 10px;
}
.nsf-cp-body {
    font-size: clamp(15.5px, 1.5vw, 17px);
    line-height: 1.65;
    color: var(--nsf-text);
    letter-spacing: -0.004em;
}
.nsf-cp-quiet {
    color: var(--nsf-text-soft);
    font-size: 14.5px;
}
.nsf-cp-fact-label {
    font-size: 11px;
    color: var(--nsf-text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 500;
    margin: 0 0 8px;
}
.nsf-cp-fact-value {
    font-size: 18px;
    color: var(--nsf-text);
    font-weight: 500;
    letter-spacing: -0.008em;
    margin: 0;
    line-height: 1.45;
}
.nsf-cp-fact-big {
    font-size: clamp(40px, 6vw, 64px);
    font-weight: 700;
    color: var(--nsf-text);
    letter-spacing: -0.032em;
    line-height: 0.95;
    font-feature-settings: 'tnum', 'ss01';
}

.nsf-cp-hr {
    border: none;
    border-top: 1px solid var(--nsf-line);
    margin: clamp(40px, 6vw, 64px) 0;
}

.nsf-cp-link {
    color: var(--nsf-text);
    text-decoration: none;
    border-bottom: 1px solid var(--nsf-gold);
    padding-bottom: 1px;
    font-weight: 500;
    transition: color 0.18s var(--nsf-easing), border-color 0.18s var(--nsf-easing);
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}
.nsf-cp-link:hover {
    color: var(--nsf-gold-dark);
    border-bottom-color: var(--nsf-gold-dark);
}
.nsf-cp-link::after {
    content: '→';
    display: inline-block;
    transition: transform 0.25s var(--nsf-easing), opacity 0.25s var(--nsf-easing);
    opacity: 0.7;
    margin-left: 2px;
}
.nsf-cp-link:hover::after {
    transform: translateX(3px);
    opacity: 1;
}

/* === Photo treatment === */
.nsf-photo-banner,
picture .nsf-photo-banner,
img.nsf-photo-banner {
    width: 100% !important;
    height: clamp(280px, 45vw, 520px) !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block;
    border-radius: var(--nsf-radius);
    filter: contrast(102%) saturate(90%);
}

/* All content images get subtle refinement */
section img:not(.custom-logo):not(.site-logo-img img) {
    filter: contrast(102%) saturate(92%);
    transition: filter 0.4s var(--nsf-easing);
}

/* === At a Glance grid === */
.nsf-glance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0;
    border-top: 1px solid var(--nsf-line);
    border-bottom: 1px solid var(--nsf-line);
}
.nsf-glance-item {
    padding: 40px 24px;
    border-right: 1px solid var(--nsf-line);
    text-align: left;
}
.nsf-glance-item:last-child { border-right: none; }
@media (max-width: 768px) {
    .nsf-glance-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .nsf-glance-item {
        padding: 28px 20px;
        border-bottom: 1px solid var(--nsf-line);
    }
    .nsf-glance-item:nth-child(2n) { border-right: none; }
    .nsf-glance-item:nth-last-child(-n+2) { border-bottom: none; }
}

/* === Sales channels tiles === */
.nsf-channels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid var(--nsf-line);
    border-bottom: 1px solid var(--nsf-line);
}
.nsf-channel {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 28px;
    text-decoration: none;
    color: var(--nsf-text);
    border-right: 1px solid var(--nsf-line);
    transition: background 0.2s var(--nsf-easing), padding 0.2s var(--nsf-easing);
    cursor: pointer;
}
.nsf-channel:last-child { border-right: none; }
.nsf-channel:hover {
    background: rgba(0, 0, 0, 0.02);
    padding-left: 32px;
}
.nsf-channel-logo {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border-radius: var(--nsf-radius);
}
.nsf-channel-name {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--nsf-text);
    letter-spacing: -0.008em;
    flex: 1;
}
.nsf-channel-arrow {
    color: var(--nsf-text-muted);
    font-size: 14px;
    transition: transform 0.2s var(--nsf-easing), color 0.2s var(--nsf-easing);
}
.nsf-channel:hover .nsf-channel-arrow {
    transform: translateX(4px);
    color: var(--nsf-gold-dark);
}
@media (max-width: 768px) {
    .nsf-channels { grid-template-columns: 1fr; }
    .nsf-channel {
        border-right: none;
        border-bottom: 1px solid var(--nsf-line);
    }
    .nsf-channel:last-child { border-bottom: none; }
}

.logo-shopee { background: linear-gradient(135deg, #ee4d2d 0%, #f47521 100%); color: #fff; }
.logo-tiktok { background: #000; color: #fff; }
.logo-nsf { background: linear-gradient(135deg, var(--nsf-gold) 0%, var(--nsf-gold-dark) 100%); color: #fff; font-size: 11px; letter-spacing: 0.04em; }

/* === Reveal-on-scroll === */
.nsf-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--nsf-easing), transform 0.8s var(--nsf-easing);
}
.nsf-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Back-to-top === */
.nsf-totop {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 44px;
    height: 44px;
    background: var(--nsf-text);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--nsf-easing), transform 0.3s var(--nsf-easing), background 0.18s;
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
    z-index: 999;
    border: none;
}
.nsf-totop.is-visible {
    opacity: 0.9;
    pointer-events: auto;
}
.nsf-totop:hover {
    transform: translateY(-3px);
    opacity: 1;
    background: var(--nsf-gold-dark);
}

/* === Focus rings (accessibility) === */
*:focus-visible {
    outline: 2px solid var(--nsf-gold);
    outline-offset: 2px;
    border-radius: var(--nsf-radius);
}
a:focus-visible, button:focus-visible {
    outline-offset: 4px;
}

/* === Selection === */
::selection { background: rgba(201, 169, 110, 0.25); color: var(--nsf-text); }

/* === Smooth scroll === */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* === WPForms styling (Contact page) === */
.wpforms-form input[type="text"],
.wpforms-form input[type="email"],
.wpforms-form input[type="tel"],
.wpforms-form input[type="url"],
.wpforms-form input[type="number"],
.wpforms-form select,
.wpforms-form textarea {
    background: var(--nsf-bg) !important;
    border: 1px solid var(--nsf-line-strong) !important;
    border-radius: var(--nsf-radius) !important;
    padding: 12px 14px !important;
    font-size: 15px !important;
    font-family: inherit !important;
    color: var(--nsf-text) !important;
    transition: border-color 0.18s var(--nsf-easing), box-shadow 0.18s var(--nsf-easing) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.wpforms-form input:focus,
.wpforms-form select:focus,
.wpforms-form textarea:focus {
    border-color: var(--nsf-gold) !important;
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.18) !important;
    outline: none !important;
}
.wpforms-form .wpforms-field-label {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--nsf-text) !important;
    margin-bottom: 6px !important;
    letter-spacing: -0.005em !important;
}
.wpforms-form button[type="submit"],
.wpforms-form .wpforms-submit {
    background: var(--nsf-text) !important;
    color: #fff !important;
    border: none !important;
    padding: 14px 28px !important;
    border-radius: var(--nsf-radius) !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
    cursor: pointer !important;
    transition: background 0.18s var(--nsf-easing), transform 0.1s var(--nsf-easing) !important;
}
.wpforms-form button[type="submit"]:hover,
.wpforms-form .wpforms-submit:hover {
    background: var(--nsf-gold-dark) !important;
}
.wpforms-form button[type="submit"]:active {
    transform: scale(0.98);
}

/* === Mobile === */
@media (max-width: 768px) {
    .nsf-cp-h1 { font-size: 32px; letter-spacing: -0.022em; }
    .nsf-cp-h2 { font-size: 22px; }
    .nsf-cp-fact-big { font-size: 40px; }
    .nsf-photo-banner { height: clamp(220px, 60vw, 360px) !important; }
    .nsf-totop { bottom: 20px; right: 20px; }
}

/* === Print stylesheet === */
@media print {
    .site-header, .nsf-totop, footer, .nsf-channels { display: none !important; }
    .nsf-photo-banner { max-height: 200px !important; }
    body { font-size: 11pt; color: #000; background: #fff; }
    .nsf-cp-h1 { font-size: 22pt; }
    .nsf-cp-h2 { font-size: 16pt; }
    section { break-inside: avoid; page-break-inside: avoid; }
}
