/* ============================================
   Pepper Auditors — Shared Design System
   Single source of truth for tokens, layout
   primitives, and accessibility foundations.
   ============================================ */

/* --- Design Tokens --- */
:root {
    color-scheme: light only;
    --color-bg: #F5F0E6;
    --color-bg-alt: #F0EFEC;
    --color-text: #1A1F16;
    --color-text-muted: #5C6356;
    --color-terracotta: #ac5e41;
    --color-terracotta-dark: #8f4e36;
    --color-error: #B53A30;
    --color-error-light: rgba(181, 58, 48, 0.1);
    --color-warning-bg: #FFF8E1;
    --color-warning-text: #7A6520;
    --color-warning-icon: #B8941A;
    --color-pine: #2D4A3E;
    --color-pine-dark: #1E3830;
    --color-pine-darker: #162A22;
    --color-pine-light: #E5EDE8;
    --color-cream: #F2F1ED;
    --color-border: #E0DED9;
    --color-glow: rgba(45, 74, 62, 0.08);
    --color-surface: #FFFFFF;
    --color-placeholder: #B0A99E;
    --color-explainer-text: #E8E4DD;
    --font-serif: 'DM Serif Display', Georgia, serif;
    --font-sans: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 0 1px rgba(45, 74, 62, 0.08), 0 4px 16px rgba(45, 74, 62, 0.1);
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* --- Skip Link (WCAG 2.4.1) --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-pine);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    z-index: 200;
    transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* --- Focus Indicators (WCAG 2.4.7) --- */
*:focus-visible {
    outline: 2px solid var(--color-pine);
    outline-offset: 2px;
}
a:focus-visible { outline-offset: 3px; }
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    border-color: var(--color-pine);
    box-shadow: 0 0 0 3px rgba(45, 74, 62, 0.2);
}

/* --- Promo Bar --- */
.promo-bar {
    background: var(--color-pine);
    color: #fff;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.55rem 1rem;
    letter-spacing: 0.01em;
}
.promo-bar a {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-left: 0.5rem;
}
.promo-bar a:hover {
    opacity: 0.85;
}

/* --- Logo --- */
.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
    color: var(--color-terracotta);
    text-decoration: none;
    display: flex;
    align-items: center;
}

/* --- Site Header (promo + nav wrapper) --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transform: translateY(0);
    transition: transform 0.45s cubic-bezier(0.38, 0.005, 0.215, 1);
    will-change: transform;
}
.site-header.header-hidden {
    transform: translateY(-100%);
}
@media (prefers-reduced-motion: reduce) {
    .site-header { transition: none; }
}
.header-spacer {
    height: calc(5.5rem + 2rem);
}

/* --- Navigation Primitives --- */
nav {
    height: 5.5rem;
    display: flex;
    align-items: center;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-terracotta);
}
.nav-inner {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 4rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}
.nav-cta-group {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.nav-phone-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-pine) !important;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none !important;
    padding: 0.75rem 1.2rem;
    border-radius: 999px;
    border: 2px solid var(--color-pine);
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease, transform 0.12s ease;
}
.nav-phone-btn:hover { background: var(--color-pine); color: #fff !important; transform: translateY(-1px); }
.nav-phone-btn:active { background: var(--color-terracotta-dark); border-color: var(--color-terracotta-dark); color: #fff !important; transform: translateY(0); }
.nav-phone-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--color-text);
}
.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: center;
}
.nav-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--color-text); text-decoration: none; }
.nav-links a.active { color: var(--color-text); font-weight: 600; }
.nav-cta-btn {
    background: var(--color-pine);
    color: white !important;
    padding: 0.75rem 1.6rem;
    border-radius: 999px;
    font-weight: 600 !important;
    font-size: 0.95rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.01em;
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.12s ease;
}
.nav-cta-btn,
.nav-cta-btn:link,
.nav-cta-btn:visited,
.nav-cta-btn:hover,
.nav-cta-btn:active,
.nav-links a.nav-cta-btn,
.nav-links a.nav-cta-btn:hover {
    text-decoration: none !important;
}
.nav-cta-btn:hover { background: var(--color-terracotta); transform: translateY(-1px); }
.nav-cta-btn:active { background: var(--color-terracotta-dark); transform: translateY(0); }

/* --- Buttons --- */
.cta-btn {
    display: inline-block;
    background: var(--color-pine);
    color: #fff;
    padding: 0.9rem 2.25rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
}
.cta-btn:hover { background: var(--color-terracotta); transform: translateY(-1px); color: #fff; }
.cta-btn:active { background: var(--color-terracotta-dark); transform: translateY(0); }

.hero-cta-outline {
    display: inline-block;
    background: transparent;
    color: var(--color-pine);
    border: 2px solid var(--color-pine);
    padding: calc(0.9rem - 2px) 2.25rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.hero-cta-outline:hover { background: var(--color-pine); color: #fff; transform: translateY(-1px); text-decoration: none; }

/* --- Section Utilities --- */
.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-terracotta);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    text-align: center;
}
.section-heading {
    font-family: var(--font-sans);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 3rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Hero --- */
.hero {
    padding: 6rem 4rem 5rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}
.hero-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-terracotta);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}
.hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.25rem, 4.5vw, 3.25rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}
.hero h1 em { font-style: italic; color: var(--color-pine); }
.hero-text {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}
.hero-cta-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-secondary { margin-top: 1rem; font-size: 0.95rem; color: var(--color-text-muted); }
.hero-secondary a { color: var(--color-pine); text-decoration: none; font-weight: 500; }
.hero-secondary a:hover { text-decoration: underline; }

/* --- Dark Hero Variant (interior pages) --- */
.hero.hero-dark {
    background: var(--color-pine-darker);
    padding: 8rem 4rem 6rem;
    max-width: none;
}
.hero-dark .hero-inner {
    max-width: 800px;
    margin: 0 auto;
}
.hero-dark .hero-label { color: var(--color-terracotta); }
.hero-dark h1 {
    font-size: clamp(2.5rem, 5.5vw, 4rem);
    color: var(--color-cream);
}
.hero-dark h1 em { color: var(--color-terracotta); }
.hero-dark .hero-text { color: rgba(245, 241, 232, 0.7); }
.hero-dark .hero-secondary { color: rgba(245, 241, 232, 0.5); }
.hero-dark .hero-secondary a { color: var(--color-cream); }
.hero-dark .cta-btn { background: var(--color-terracotta); }
.hero-dark .cta-btn:hover { background: var(--color-terracotta-dark); }
.hero-dark .hero-cta-outline {
    color: var(--color-cream);
    border-color: rgba(245, 241, 232, 0.3);
}
.hero-dark .hero-cta-outline:hover {
    background: rgba(245, 241, 232, 0.1);
    border-color: var(--color-cream);
    color: var(--color-cream);
}
/* Dark hero entrance stagger */
@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.hero-dark .hero-label,
.hero-dark h1,
.hero-dark .hero-text,
.hero-dark .hero-cta-group,
.hero-dark .hero-secondary {
    animation: heroFadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-dark h1 { animation-delay: 0.1s; }
.hero-dark .hero-text { animation-delay: 0.2s; }
.hero-dark .hero-cta-group { animation-delay: 0.3s; }
.hero-dark .hero-secondary { animation-delay: 0.35s; }

/* --- Explainer (pine background) --- */
.explainer-section { background: var(--color-pine); padding: 5rem 4rem; }
.explainer-inner { max-width: 800px; margin: 0 auto; }
.explainer-section h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 400;
    color: var(--color-cream);
    margin-bottom: 2rem;
    text-align: center;
}
.explainer-section p {
    font-size: 1.05rem;
    color: var(--color-explainer-text);
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

/* --- Cards --- */
.cards-section { padding: 5rem 4rem; max-width: 1200px; margin: 0 auto; }
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.card {
    background: var(--color-surface);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    transition: border-color 0.2s ease;
}
.card:hover { border-color: var(--color-pine); }
.card h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.75rem; }
.card p { font-size: 0.95rem; color: var(--color-text-muted); line-height: 1.65; }

/* --- Value List --- */
.value-section { padding: 5rem 4rem; max-width: 900px; margin: 0 auto; }
.value-list { display: flex; flex-direction: column; }
.value-item {
    display: flex;
    gap: 1.5rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--color-border);
    align-items: flex-start;
}
.value-item:last-child { border-bottom: none; }
.value-icon {
    width: 48px;
    height: 48px;
    background: var(--color-pine-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.value-icon svg { width: 24px; height: 24px; color: var(--color-pine); }
.value-content h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.4rem; }
.value-content p { font-size: 0.95rem; color: var(--color-text-muted); line-height: 1.6; }

/* --- FAQ --- */
.faq-section { padding: 5rem 4rem; max-width: 800px; margin: 0 auto; }
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item {
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid var(--color-border);
    overflow: hidden;
}
.faq-question {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: transparent;
    border: none;
    text-align: left;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}
.faq-question:hover { background: var(--color-cream); }
.faq-question svg {
    width: 20px;
    height: 20px;
    color: var(--color-text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}
.faq-item.active .faq-question svg { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-item.active .faq-answer { max-height: 2000px; }
.faq-answer-inner {
    padding: 0 1.5rem 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}
.faq-answer-inner a { color: var(--color-pine); text-decoration: none; font-weight: 500; }
.faq-answer-inner a:hover { text-decoration: underline; }

/* --- CTA Section --- */
.cta-section {
    padding: 5rem 4rem;
    text-align: center;
    background: var(--color-pine);
}
.cta-section-inner {
    max-width: 700px;
    margin: 0 auto;
}
.cta-section h2 {
    font-family: var(--font-sans);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: var(--color-cream);
}
.cta-section .cta-text {
    color: rgba(245, 241, 232, 0.8);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.7;
}
.cta-section .cta-btn {
    background: var(--color-terracotta);
}
.cta-section .cta-btn:hover {
    background: var(--color-terracotta-dark);
}
.cta-secondary { margin-top: 1rem; font-size: 0.9rem; color: rgba(245, 241, 232, 0.65); }
.cta-secondary a { color: var(--color-cream); text-decoration: none; }
.cta-secondary a:hover { text-decoration: underline; }

/* --- Blog Article --- */
.article { max-width: 720px; margin: 0 auto; padding: 4rem 2rem; }
.article-meta { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 1rem; }
.article-meta span { margin-right: 1rem; }
.article-back {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--color-pine);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color 0.2s ease;
}
.article-back:hover { color: var(--color-terracotta); }
.article h1 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}
.prose p { margin-bottom: 1.5rem; line-height: 1.8; color: var(--color-text-muted); }
.prose h2 { font-family: var(--font-sans); font-size: 1.4rem; font-weight: 600; color: var(--color-text); margin: 2.5rem 0 1rem; }
.prose ul, .prose ol { margin-left: 1.5rem; margin-bottom: 1.5rem; }
.prose li { line-height: 1.8; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.prose li strong { color: var(--color-text); }
.prose a { color: var(--color-pine); text-decoration: underline; text-underline-offset: 2px; transition: color 0.2s ease; }
.prose a:hover { color: var(--color-terracotta); }
.cta-callout {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-pine);
    border-radius: 12px;
    padding: 2rem;
    margin: 2.5rem 0;
}
.cta-callout p { margin-bottom: 1rem; font-weight: 500; color: var(--color-text); line-height: 1.6; }

/* --- Footer --- */
footer {
    border-top: 1px solid var(--color-border);
    padding: 4rem 4rem 2.5rem;
}
.footer-inner { max-width: 1400px; margin: 0 auto; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}
.footer-brand { max-width: 280px; }
.footer-logo {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
    display: block;
    margin-bottom: 0.75rem;
}
.footer-tagline { font-size: 0.9rem; color: var(--color-text-muted); line-height: 1.6; }
.footer-col h4 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text);
    margin-bottom: 1rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--color-text); }
.footer-bottom {
    border-top: 1px solid var(--color-border);
    padding-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 0.32s; }

/* --- Responsive Foundation --- */
@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    .nav-inner { padding: 0 1.5rem; display: flex; justify-content: space-between; }
    .nav-cta-group { display: none; }
    .nav-cta-mobile { display: block !important; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }
    .nav-links.open { display: flex; }
    /* Touch targets (WCAG 2.5.8) */
    .nav-links a { min-height: 44px; display: flex; align-items: center; justify-content: center; }
    .nav-cta-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .footer-col a { display: inline-flex; align-items: center; min-height: 44px; }
    footer { padding: 3rem 1.5rem 2rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .footer-brand { max-width: 100%; }
    .hero { padding: 4rem 1.5rem 3rem; }
    .hero h1 { font-size: clamp(2rem, 8vw, 2.75rem); }
    .hero.hero-dark { padding: 6rem 1.5rem 4rem; }
    .hero-dark h1 { font-size: clamp(2rem, 8vw, 3rem); }
    .hero-cta-group { flex-direction: column; align-items: stretch; text-align: center; }
    .explainer-section, .cards-section, .value-section, .faq-section, .cta-section { padding-left: 1.5rem; padding-right: 1.5rem; }
    .cards-grid { grid-template-columns: 1fr; }
    .value-item { flex-direction: column; gap: 1rem; }
    .article { padding: 2.5rem 1.5rem; }
    .article h1 { font-size: 1.75rem; }
}

/* --- Reduced Motion (WCAG 2.3.3) --- */
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .skip-link { transition: none; }
    html { scroll-behavior: auto; }
    .hero-dark .hero-label,
    .hero-dark h1,
    .hero-dark .hero-text,
    .hero-dark .hero-cta-group,
    .hero-dark .hero-secondary { animation: none; opacity: 1; }
}
