/* ==========================================================================
   BJJ Tools — site styles
   Lightweight, framework-free, responsive.
   ========================================================================== */

/* --- Design tokens -------------------------------------------------------- */
:root {
    /* Brand palette */
    --color-darkblue: #1c2126;
    --color-red:      #c8102e;
    --color-black:    #000000;
    --color-white:    #ffffff;

    /* Derived shades */
    --color-darkblue-700: #161a1e;
    --color-darkblue-900: #0e1114;
    --color-red-600:      #a50d26;
    --color-muted:        #6b7480;
    --color-muted-light:  #aab2bd;
    --color-surface:      #f5f6f8;
    --color-border:       #e2e5ea;

    /* Typography */
    --font-sans: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;

    /* Layout */
    --container: 1120px;
    --radius:    10px;
    --radius-lg: 16px;
    --shadow:    0 10px 30px rgba(14, 17, 20, 0.08);
    --shadow-lg: 0 24px 60px rgba(14, 17, 20, 0.16);
    --transition: 160ms ease;
}

/* --- Reset / base --------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.65;
    color: var(--color-darkblue);
    background: var(--color-white);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    line-height: 1.2;
    margin: 0 0 0.5em;
    font-weight: 700;
    letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; }

a {
    color: var(--color-red);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--color-red-600); }

img { max-width: 100%; display: block; }

ul { margin: 0; padding: 0; }

/* --- Accessibility helpers ------------------------------------------------ */
.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--color-red);
    color: var(--color-white);
    padding: 0.6rem 1rem;
    z-index: 100;
    border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; color: var(--color-white); }

:focus-visible {
    outline: 3px solid var(--color-red);
    outline-offset: 2px;
}

/* --- Layout --------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.section {
    padding: clamp(3rem, 7vw, 6rem) 0;
}
.section--tight { padding: clamp(2rem, 4vw, 3.5rem) 0; }
.section--surface { background: var(--color-surface); }
.section--dark {
    background: var(--color-darkblue);
    color: var(--color-white);
}
.section--dark h1,
.section--dark h2,
.section--dark h3 { color: var(--color-white); }

.section__head {
    max-width: 720px;
    margin: 0 auto 2.75rem;
    text-align: center;
}
.section__head p {
    color: var(--color-muted);
    font-size: 1.1rem;
}
.section--dark .section__head p { color: var(--color-muted-light); }

.eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-red);
    margin-bottom: 0.75rem;
}

.lead { font-size: 1.2rem; color: var(--color-muted); }
.section--dark .lead { color: var(--color-muted-light); }

/* --- Buttons -------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.6rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition),
                color var(--transition), border-color var(--transition);
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn--primary {
    background: var(--color-red);
    color: var(--color-white);
    border-color: var(--color-red);
}
.btn--primary:hover { background: var(--color-red-600); border-color: var(--color-red-600); color: var(--color-white); }

.btn--ghost {
    background: transparent;
    color: var(--color-white);
    border-color: rgba(255, 255, 255, 0.45);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.1); color: var(--color-white); }

.btn--outline {
    background: transparent;
    color: var(--color-darkblue);
    border-color: var(--color-border);
}
.btn--outline:hover { border-color: var(--color-darkblue); color: var(--color-darkblue); }

.btn--sm { padding: 0.55rem 1.1rem; font-size: 0.92rem; }
.btn--lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn--block { width: 100%; }

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* --- Header / nav --------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-darkblue);
    color: var(--color-white);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
    color: var(--color-white);
    line-height: 0;
}
.brand:hover { color: var(--color-white); }

/* Logo image: scale by height, never distort (width stays auto). */
.brand__logo {
    height: 56px;
    width: auto;
    display: block;
}
.brand--footer { font-size: 1.25rem; }
.brand--footer .brand__logo { height: 52px; }

/* Text fallback (used only if the logo image is ever swapped back to text). */
.brand__mark {
    background: var(--color-red);
    color: var(--color-white);
    padding: 0.05em 0.35em;
    border-radius: 6px;
    margin-right: 0.25em;
}

.primary-nav__list {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
}
.primary-nav__link {
    display: inline-block;
    padding: 0.5rem 0.85rem;
    color: var(--color-muted-light);
    font-weight: 500;
    border-radius: var(--radius);
}
.primary-nav__link:hover { color: var(--color-white); }
.primary-nav__link.is-active { color: var(--color-white); }
.primary-nav__link.is-active::after {
    content: "";
    display: block;
    height: 2px;
    background: var(--color-red);
    margin-top: 2px;
    border-radius: 2px;
}
.primary-nav__cta { margin-left: 0.75rem; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.nav-toggle__bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-white);
    transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Hero ----------------------------------------------------------------- */
.hero {
    position: relative;
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(200, 16, 46, 0.35), transparent 60%),
        linear-gradient(160deg, var(--color-darkblue) 0%, var(--color-darkblue-900) 100%);
    color: var(--color-white);
    padding: clamp(3.5rem, 9vw, 7rem) 0;
    overflow: hidden;
}
.hero__inner {
    max-width: 760px;
}
.hero h1 { color: var(--color-white); margin-bottom: 0.5rem; }
.hero__sub {
    font-size: 1.2rem;
    color: var(--color-muted-light);
    margin-bottom: 2rem;
    max-width: 600px;
}
.hero .btn-group { margin-bottom: 1.5rem; }
.hero__note {
    font-size: 0.92rem;
    color: var(--color-muted-light);
    margin: 0;
}

/* --- Cards / grids -------------------------------------------------------- */
.grid {
    display: grid;
    gap: 1.5rem;
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    height: 100%;
}
.card h3 { margin-bottom: 0.4rem; }
.card p { color: var(--color-muted); margin-bottom: 0; }
.card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(200, 16, 46, 0.1);
    color: var(--color-red);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

/* --- Stats ---------------------------------------------------------------- */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    text-align: center;
}
.stat__value {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--color-red);
    line-height: 1;
}
.stat__label { color: var(--color-muted-light); font-size: 0.95rem; }

/* --- Pricing -------------------------------------------------------------- */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem;
    max-width: 820px;
    margin: 0 auto;
}
.plan {
    position: relative;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.plan--featured {
    border-color: var(--color-red);
    box-shadow: var(--shadow-lg);
}
.plan__badge {
    position: absolute;
    top: -0.85rem;
    right: 1.5rem;
    background: var(--color-red);
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
}
.plan__name { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); }
.plan__price {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--color-darkblue);
    line-height: 1.1;
    margin: 0.25rem 0 0;
}
.plan__period { color: var(--color-muted); font-size: 1rem; font-weight: 500; }
.plan__save { color: var(--color-red); font-weight: 600; margin: 0.4rem 0 1rem; }
.plan__list {
    list-style: none;
    margin: 1.25rem 0;
    display: grid;
    gap: 0.6rem;
}
.plan__list li {
    padding-left: 1.6rem;
    position: relative;
    color: var(--color-darkblue);
}
.plan__list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-red);
    font-weight: 700;
}
.plan .btn { margin-top: auto; }

/* --- CTA banner ----------------------------------------------------------- */
.cta-banner {
    background:
        radial-gradient(800px 400px at 100% 0%, rgba(200, 16, 46, 0.4), transparent 55%),
        var(--color-darkblue);
    color: var(--color-white);
    border-radius: var(--radius-lg);
    padding: clamp(2.5rem, 5vw, 4rem);
    text-align: center;
}
.cta-banner h2 { color: var(--color-white); }
.cta-banner p { color: var(--color-muted-light); max-width: 540px; margin: 0 auto 1.75rem; }
.cta-banner .btn-group { justify-content: center; }

/* --- Article / prose (legal & about) ------------------------------------- */
.prose {
    max-width: 760px;
    margin: 0 auto;
}
.prose h2 { margin-top: 2.25rem; }
.prose h3 { margin-top: 1.5rem; }
.prose ul { padding-left: 1.25rem; margin: 0 0 1rem; list-style: disc; }
.prose li { margin-bottom: 0.4rem; }
.prose .meta { color: var(--color-muted); font-size: 0.95rem; }

/* --- Page header band ----------------------------------------------------- */
.page-head {
    background: var(--color-darkblue);
    color: var(--color-white);
    padding: clamp(2.5rem, 6vw, 4.5rem) 0;
    text-align: center;
}
.page-head h1 { color: var(--color-white); margin-bottom: 0.4rem; }
.page-head p { color: var(--color-muted-light); max-width: 620px; margin: 0 auto; font-size: 1.15rem; }

/* --- Forms ---------------------------------------------------------------- */
.form {
    max-width: 620px;
    margin: 0 auto;
    display: grid;
    gap: 1.1rem;
}
.form__row { display: grid; gap: 0.4rem; }
.form label { font-weight: 600; font-size: 0.95rem; }
.form input,
.form textarea {
    width: 100%;
    font: inherit;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-white);
    color: var(--color-darkblue);
}
.form input:focus,
.form textarea:focus {
    outline: none;
    border-color: var(--color-red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.15);
}
.form textarea { resize: vertical; min-height: 140px; }

/* Honeypot field — visually hidden and removed from the a11y tree. */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Form status messages. */
.alert {
    max-width: 620px;
    margin: 0 auto 1.5rem;
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-weight: 500;
}
.alert--success {
    background: #e9f7ef;
    border-color: #b7e4c7;
    color: #1b5e34;
}
.alert--error {
    background: #fdecee;
    border-color: #f5c2c7;
    color: #842029;
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 2.5rem;
}

/* --- FAQ ------------------------------------------------------------------ */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--color-white);
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--color-red); font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 0.75rem 0 0; color: var(--color-muted); }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
    background: var(--color-darkblue-900);
    color: var(--color-muted-light);
    padding-top: 3rem;
}
.site-footer__inner {
    display: grid;
    grid-template-columns: 1.4fr 2fr;
    gap: 2.5rem;
    padding-bottom: 2.5rem;
}
.site-footer__tagline { max-width: 320px; margin-top: 0.75rem; }
.site-footer__nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.site-footer__heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-white);
    margin-bottom: 0.85rem;
}
.site-footer__nav ul { list-style: none; display: grid; gap: 0.5rem; }
.site-footer__nav a { color: var(--color-muted-light); }
.site-footer__nav a:hover { color: var(--color-white); }
.site-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.25rem 0;
    font-size: 0.9rem;
}
.site-footer__bottom p { margin: 0; }

/* --- Utilities ------------------------------------------------------------ */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 1rem; }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .site-footer__inner { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 760px) {
    .nav-toggle { display: flex; }
    .brand__logo { height: 44px; }
    .primary-nav {
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--color-darkblue);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition);
    }
    .primary-nav.is-open { max-height: 420px; }
    .primary-nav__list {
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem 1.25rem 1.25rem;
        gap: 0.25rem;
    }
    .primary-nav__link { padding: 0.75rem 0.5rem; }
    .primary-nav__link.is-active::after { display: none; }
    .primary-nav__cta { margin: 0.5rem 0 0; }
    .primary-nav__cta .btn { width: 100%; }
}

@media (max-width: 640px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr; gap: 2rem; }
    .contact-cards { grid-template-columns: 1fr; }
    .btn-group .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
    .btn:hover { transform: none; }
}
