/* ═══════════════════════════════════════════════════════════════
   rankless.ai — shared site shell
   Tokens, base, nav, footer, buttons, cards, forms, sections.
   Linked from every public page. Page-specific CSS stays inline.
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* Brand (unchanged) */
    --charcoal: #1F1F1F;
    --teal: #2EE2C7;
    --teal-dim: #25B8A3;
    --teal-dark: #1A8A79;
    --teal-ink: #0B1F1C;              /* text on teal */
    --teal-glow: rgba(46, 226, 199, 0.12);
    --teal-glow-strong: rgba(46, 226, 199, 0.25);
    --teal-line: rgba(46, 226, 199, 0.35);

    /* Surfaces: elevation by lightness, not shadow */
    --surface: #262626;
    --surface-hover: #2E2E2E;
    --surface-raised: #2E2E2E;
    --surface-sunken: #1A1A1A;

    /* Text (AA on charcoal and surface) */
    --text: #F2F2F2;
    --soft-white: #E6E6E6;
    --body-gray: #B3B3B3;
    --muted: #949494;

    /* Status */
    --error-red: #EF5B67;
    --alert-amber: #F5A623;

    /* Lines */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    /* Type */
    --font-display: 'Outfit', system-ui, sans-serif;
    --font-body: 'Outfit', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --fs-xs: 13px;
    --fs-sm: 15px;
    --fs-base: 17px;
    --fs-md: 20px;
    --fs-lg: 24px;
    --fs-xl: 30px;
    --fs-2xl: clamp(30px, 2.4vw + 16px, 40px);
    --fs-3xl: clamp(38px, 4vw + 18px, 64px);

    /* Space (4px base) */
    --section-y: 96px;
    --gutter: 32px;
    --container: 1200px;

    /* Radii */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-pill: 999px;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur: 180ms;

    --nav-h: 64px;
}

@media (max-width: 768px) {
    :root { --section-y: 64px; --gutter: 16px; }
}

/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 16px);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    color-scheme: dark;
    scrollbar-color: #3A3A3A var(--charcoal);
}
body {
    background: var(--charcoal);
    color: var(--body-gray);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.6;
    overflow-x: clip;
    min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    color: var(--text);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    text-wrap: balance;
}
p { text-wrap: pretty; }
strong { color: var(--soft-white); font-weight: 600; }

::selection { background: var(--teal); color: var(--teal-ink); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--charcoal); }
::-webkit-scrollbar-thumb { background: #3A3A3A; border-radius: 999px; border: 3px solid var(--charcoal); }
::-webkit-scrollbar-thumb:hover { background: #4A4A4A; }
input { caret-color: var(--teal); }

:focus { outline: none; }
:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 3px;
    border-radius: 6px;
}

.skip-link {
    position: absolute; left: 16px; top: -48px; z-index: 2000;
    background: var(--teal); color: var(--teal-ink);
    padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600;
}
.skip-link:focus { top: 12px; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}
.mono, .num {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}
.teal { color: var(--teal); }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── Buttons (one system) ─────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 24px;
    border-radius: var(--r-pill);
    border: 1px solid transparent;
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out),
                border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; transition: transform var(--dur) var(--ease-out); }
.btn:hover svg { transform: translateX(2px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--teal); color: var(--teal-ink); }
.btn-primary:hover { background: #5BEAD5; color: var(--teal-ink); }
.btn-secondary { background: var(--surface-raised); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: #363636; color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--teal-line); color: var(--teal); }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 16px; }

.text-link {
    color: var(--teal);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-underline-offset: 4px;
}
.text-link:hover { text-decoration: underline; }
.text-link svg { width: 14px; height: 14px; }

/* ── Nav ──────────────────────────────────────────────────────── */
.nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    height: var(--nav-h);
    background: rgba(31, 31, 31, 0.6);
    border-bottom: 1px solid transparent;
    transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.nav.scrolled, .nav.open {
    background: rgba(31, 31, 31, 0.86);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom-color: var(--border-subtle);
}
.nav-inner {
    max-width: var(--container);
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    gap: 32px;
}
.nav-logo { display: flex; align-items: center; flex-shrink: 0; }
.nav-logo-img { height: 24px; width: auto; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin-right: auto;
}
.nav-links a {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--r-sm);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--body-gray);
    transition: color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links .nav-menu-only { display: none; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-login {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--body-gray);
    padding: 0 12px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--r-sm);
}
.nav-login:hover { color: var(--text); }
.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-strong);
    background: transparent;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.nav-toggle span {
    display: block;
    width: 16px;
    height: 1.5px;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}
.nav.open .nav-toggle span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.open .nav-toggle span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 900px) {
    .nav-inner { gap: 12px; }
    .nav-logo { margin-right: auto; }
    .nav-logo-img { height: 20px; }
    .nav-login { display: none; }
    .nav-toggle { display: flex; }
    .nav-links {
        position: fixed;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 0;
        padding: 8px var(--gutter) 20px;
        background: var(--charcoal);
        border-bottom: 1px solid var(--border-subtle);
        box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.6);
        max-height: calc(100vh - var(--nav-h));
        overflow-y: auto;
        display: none;
    }
    .nav.open .nav-links { display: flex; }
    .nav-links li { width: 100%; }
    .nav-links a { display: flex; width: 100%; height: 48px; font-size: 17px; padding: 0 4px; border-radius: 0; border-bottom: 1px solid var(--border-subtle); }
    .nav-links li:last-child a { border-bottom: none; }
    .nav-links .nav-menu-only { display: block; }
}

/* ── Sections & headings ──────────────────────────────────────── */
.section { padding: var(--section-y) 0; position: relative; }
.section + .section { border-top: 1px solid var(--border-subtle); }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-headline { font-size: var(--fs-2xl); font-weight: 600; margin-bottom: 16px; }
.section-sub { font-size: 18px; color: var(--body-gray); max-width: 62ch; }
.section-head.center .section-sub { margin: 0 auto; }

/* ── Cards (one system) ───────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    padding: 24px;
    transition: border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
a.card:hover, .card.is-link:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.card h3 { font-size: var(--fs-md); margin-bottom: 8px; }
.card p { font-size: var(--fs-sm); color: var(--body-gray); }

/* ── Form fields ──────────────────────────────────────────────── */
.field {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    background: var(--surface-sunken);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 16px;
    transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.field::placeholder { color: #949494; }
.field:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-line); outline: none; }

/* Inline domain form (hero, closing CTA, tools) */
.domain-form {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-pill);
    transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.domain-form:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-line); }
.domain-form input {
    flex: 1;
    min-width: 0;
    height: 48px;
    padding: 0 18px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 17px;
}
.domain-form input::placeholder { color: #949494; }
.domain-form input:focus-visible { outline: none; }
.domain-form .btn { min-height: 48px; }
.form-note {
    margin-top: 12px;
    font-size: var(--fs-xs);
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}
.form-note span { display: inline-flex; align-items: center; gap: 6px; }
.form-note svg { width: 14px; height: 14px; color: var(--teal); }

@media (max-width: 560px) {
    .domain-form { flex-direction: column; align-items: stretch; border-radius: var(--r-md); padding: 6px; }
    .domain-form input { flex: 0 0 auto; height: 48px; text-align: left; }
    .domain-form .btn { width: 100%; border-radius: var(--r-sm); }
}

/* ── FAQ (details/summary) ────────────────────────────────────── */
.faq-list { border-top: 1px solid var(--border-subtle); }
.faq-list details { border-bottom: 1px solid var(--border-subtle); }
.faq-list summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 0;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    color: var(--text);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
    content: '';
    width: 10px; height: 10px;
    flex-shrink: 0;
    border-right: 1.5px solid var(--muted);
    border-bottom: 1.5px solid var(--muted);
    transform: rotate(45deg) translateY(-3px);
    transition: transform var(--dur) var(--ease-out);
}
.faq-list details[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.faq-list summary:hover { color: var(--teal); }
.faq-list .faq-answer { padding: 0 0 20px; font-size: 16px; color: var(--body-gray); max-width: 68ch; }
.faq-list .faq-answer p + p { margin-top: 10px; }
.faq-list .faq-answer a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }

/* ── Newsletter band ──────────────────────────────────────────── */
.newsletter {
    display: grid;
    grid-template-columns: 1fr minmax(0, 440px);
    gap: 32px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    padding: 32px;
}
.newsletter h2, .newsletter h3 { font-size: var(--fs-lg); margin-bottom: 6px; }
.newsletter p { font-size: var(--fs-sm); color: var(--body-gray); }
.newsletter-form { display: flex; gap: 8px; }
.newsletter-form .field { flex: 1; min-width: 0; }
.newsletter-msg { margin-top: 10px; font-size: 14px; min-height: 1em; }
.newsletter-msg.ok { color: var(--teal); }
.newsletter-msg.err { color: var(--error-red); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 760px) {
    .newsletter { grid-template-columns: 1fr; padding: 24px; }
    .newsletter-form { flex-direction: column; }
}

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 64px 0 32px;
    background: var(--surface-sunken);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 48px;
}
.footer-logo-img { height: 24px; width: auto; margin-bottom: 16px; }
.footer-desc { font-size: var(--fs-sm); color: var(--body-gray); max-width: 34ch; margin-bottom: 12px; }
.footer-eb { font-size: var(--fs-xs); color: var(--muted); }
.footer-col h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0;
    margin-bottom: 14px;
}
.footer-col a {
    display: block;
    width: fit-content;
    font-size: var(--fs-sm);
    color: var(--body-gray);
    padding: 5px 0;
    transition: color var(--dur) var(--ease-out);
}
.footer-col a:hover { color: var(--teal); }
.footer-bottom {
    border-top: 1px solid var(--border-subtle);
    padding-top: 24px;
    font-size: var(--fs-xs);
    color: var(--muted);
}
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ── Mobile sticky CTA ────────────────────────────────────────── */
.sticky-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(26, 26, 26, 0.94);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-subtle);
    display: none;
    align-items: center;
    gap: 12px;
    transform: translateY(110%);
    visibility: hidden;
    transition: transform 240ms var(--ease-out), visibility 0s linear 240ms;
}
.sticky-cta p { font-size: 13px; color: var(--body-gray); line-height: 1.3; flex: 1; }
.sticky-cta .btn { min-height: 44px; }
.sticky-cta.show { transform: none; visibility: visible; transition: transform 240ms var(--ease-out), visibility 0s; }
@media (max-width: 768px) {
    .sticky-cta { display: flex; }
}

/* ── Reveal (visible without JS; one gentle entrance) ─────────── */
.js .reveal { opacity: 0; transform: translateY(8px); transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); }
.js .reveal.visible { opacity: 1; transform: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .js .reveal { opacity: 1; transform: none; }
}
