/* Shared across every page: tokens, base, buttons/links, nav, layout container, footer. */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---- TOKENS ---- */
:root {
    --black: #0A0A0A;
    --white: #FFFFFF;
    --burgundy: #7A2238;
    --burgundy-hover: #651C2E;
    --muted-on-black: rgba(255,255,255,0.45);
    --muted-on-white: rgba(10,10,10,0.5);
    --border-on-black: rgba(255,255,255,0.08);
    --border-on-white: rgba(10,10,10,0.08);

    /* Layout */
    --container-max: 1440px;
    --gutter: clamp(20px, 5vw, 80px);
    --section-pad-y: clamp(72px, 10vw, 160px);
    --nav-h: 68px;
    --measure: 60ch;

    /* Motion */
    --reveal-distance: 24px;
    --reveal-duration: 0.6s;
    --reveal-stagger: 80ms;
    --ease: ease-out;

    --font-headline: 'Playfair Display', Georgia, serif;
    --font-display: 'Bebas Neue', 'Inter', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Contextual tokens, defaulting to the black scheme */
    --bg: var(--black);
    --fg: var(--white);
    --muted: var(--muted-on-black);
    --line: var(--border-on-black);
    --eyebrow: var(--muted-on-black);
}

/* Section schemes: strict black / white alternation */
#hero,
#testimonials,
#mobile-app,
#referral,
#other-products {
    --bg: var(--white);
    --fg: var(--black);
    --muted: var(--muted-on-white);
    --line: var(--border-on-white);
    --eyebrow: var(--burgundy);
}
#problem,
#features,
#pricing,
#final-cta,
footer,
.mobile-menu,
.phone-frame {
    --bg: var(--black);
    --fg: var(--white);
    --muted: var(--muted-on-black);
    --line: var(--border-on-black);
    --eyebrow: var(--muted-on-black);
}
section, footer {
    background: var(--bg);
    color: var(--fg);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 8px);
}
/* Reduced motion: everything visible and static, no smooth scrolling */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .js [data-reveal]:not(.is-revealed) { opacity: 1; transform: none; }
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
    .btn-primary:hover,
    .nav-cta:hover { transform: none; }
}

h1, h2, h3 {
    font-family: var(--font-headline);
    font-weight: 400;
}

.phone-frame * {
    font-family: var(--font-body);
}

body {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    background-color: var(--black);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- SCROLL REVEAL ----
   Only under .js (set in <head>), so content stays visible without JavaScript.
   assets/motion.js adds .is-revealed when an element enters view, then .reveal-done
   once it has settled, handing transitions back to the element's own rules. */
.js [data-reveal]:not(.is-revealed) {
    opacity: 0;
    transform: translateY(var(--reveal-distance));
}
.js [data-reveal]:not(.reveal-done) {
    transition: opacity var(--reveal-duration) var(--ease), transform var(--reveal-duration) var(--ease);
    transition-delay: calc(var(--i, 0) * var(--reveal-stagger));
}

/* ---- BUTTONS & LINKS ---- */
.btn-primary,
.nav-cta {
    background: var(--burgundy);
    color: var(--white);
    border: 1px solid var(--burgundy);
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn-primary {
    padding: 0.75rem 1.75rem;
    font-size: 0.9375rem;
}
.btn-primary:hover,
.nav-cta:hover {
    background: #5E1A2B;
    border-color: #5E1A2B;
    transform: translateY(-1px);
}
.btn-primary:active,
.nav-cta:active,
.btn-primary:disabled { transform: none; }
.btn-secondary {
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--fg);
    border-radius: 4px;
    padding: 0.75rem 1.75rem;
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.btn-secondary:hover {
    background: var(--fg);
    color: var(--bg);
}
.footer-links a,
.text-link {
    color: var(--fg);
    text-decoration: none;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.footer-links a:hover,
.text-link:hover { text-decoration: underline; }
.text-link {
    font-size: 0.875rem;
    font-weight: 500;
}

/* ---- NAV ---- */
nav {
    /* Transparent over the white hero, solid black once scrolled */
    --fg: var(--black);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding-inline: max(var(--gutter), calc((100% - var(--container-max)) / 2 + var(--gutter)));
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.4s ease, border-bottom-color 0.4s ease;
    border-bottom: 0.5px solid transparent;
}
nav.scrolled {
    --fg: var(--white);
    background: var(--black);
    border-bottom-color: var(--border-on-black);
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--fg);
    text-decoration: none;
    transition: color 0.4s ease;
}
.nav-logo-word {
    font-family: var(--font-headline);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(16px, 1.8vw, 32px);
    list-style: none;
    margin: 0 clamp(16px, 2vw, 40px);
    flex: 1;
}
.nav-links a {
    position: relative;
    display: block;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--fg);
    opacity: 0.7;
    text-decoration: none;
    transition: color 0.4s ease, opacity 0.2s ease;
}
.nav-links a:hover,
.nav-links a[aria-current="true"] { opacity: 1; }
/* Active-section underline: absolutely positioned so it never shifts layout */
.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease);
}
.nav-links a:hover::after,
.nav-links a[aria-current="true"]::after { transform: scaleX(1); }
.nav-actions {
    display: flex;
    align-items: center;
    gap: clamp(16px, 1.8vw, 32px);
    flex-shrink: 0;
}
.nav-login { transition: color 0.4s ease; }
.nav-cta {
    padding: 0.5rem 1.125rem;
    font-size: 0.875rem;
    white-space: nowrap;
}
button.nav-cta,
button.btn-primary,
button.btn-secondary {
    font-family: var(--font-body);
    line-height: inherit;
    cursor: pointer;
}
.nav-toggle {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    background: none;
    border: none;
    cursor: pointer;
}
.nav-toggle span {
    position: absolute;
    left: 11px;
    width: 22px;
    height: 1.5px;
    background: var(--fg);
    transition: transform 0.3s var(--ease), background 0.4s ease;
}
.nav-toggle span:first-child { top: 18px; }
.nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
/* While the menu panel is open the bar is always solid black */
nav.menu-open {
    --fg: var(--white);
    background: var(--black);
    border-bottom-color: transparent;
}
/* Switch to solid instantly on open (the scroll fade still applies otherwise) */
nav.menu-open,
nav.menu-open .nav-logo { transition: none; }
nav.menu-open .nav-toggle span { transition: transform 0.3s var(--ease); }
.mobile-menu {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    z-index: 999;
    height: calc(100vh - var(--nav-h));
    height: calc(100svh - var(--nav-h));
    overflow-y: auto;
    background: var(--black);
    border-top: 1px solid var(--border-on-black);
    padding: 32px var(--gutter);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
}
.mobile-menu[hidden] { display: none; }
/* Opening: panel drops in, then its links stagger in 50ms apart */
@keyframes menu-in {
    from { opacity: 0; transform: translateY(-8px); }
}
.mobile-menu:not([hidden]) { animation: menu-in 0.3s var(--ease); }
.mobile-menu:not([hidden]) .mobile-links li,
.mobile-menu:not([hidden]) .mobile-login {
    animation: menu-in 0.3s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 50ms);
}
.mobile-links li:nth-child(2) { --i: 1; }
.mobile-links li:nth-child(3) { --i: 2; }
.mobile-links li:nth-child(4) { --i: 3; }
.mobile-links li:nth-child(5) { --i: 4; }
.mobile-links li:nth-child(6) { --i: 5; }
.mobile-login { --i: 6; }
.mobile-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.mobile-links a {
    font-family: var(--font-headline);
    font-size: 28px;
    line-height: 1.2;
    color: var(--white);
    text-decoration: none;
}
.mobile-login {
    align-self: flex-start;
    font-size: 15px;
    font-weight: 500;
    color: var(--white);
    text-decoration: none;
    text-underline-offset: 3px;
}
.mobile-login:hover { text-decoration: underline; }
@media (max-width: 1099px) {
    .nav-links, .nav-login { display: none; }
    .nav-toggle { display: block; }
    .nav-actions { gap: 8px; }
    .nav-cta { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
}
@media (max-width: 359px) {
    .nav-cta { display: none; }
}

/* ---- LAYOUT ---- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* ---- FOOTER (black, continues final CTA) ---- */
footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding: 2.5rem 0;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.footer-logo {
    font-size: 1rem;
    font-weight: 600;
    color: var(--fg);
}
.footer-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}
.footer-links a { font-size: 13px; }
.footer-legal {
    margin-top: 1.5rem;
    font-size: 12px;
    color: var(--muted);
}
@media (max-width: 960px) {
    .footer-inner { flex-direction: column; gap: 1.5rem; text-align: center; }
    .footer-links { flex-wrap: wrap; justify-content: center; }
    .footer-legal { text-align: center; }
}
