/* ═══════════════════════════════════════════════════════
   style.css — Keyboardly Terms & Conditions
   Aesthetic: Editorial dark hero · warm paper content
   Fonts: Playfair Display (headings) · DM Sans (body)
═══════════════════════════════════════════════════════ */

/* ─── Reset & Root ─────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --ink:        #1a1612;
    --ink-light:  #5a5249;
    --paper:      #f6f4f0;
    --paper-dark: #edeae4;
    --hero-bg:    #131921;
    --accent:     #c8965a;
    --accent-dim: #c8965a22;
    --accent-alt: #4a7c6f;
    --border:     #ddd9d2;
    --white:      #ffffff;
    --radius:     12px;
    --font-head:  'Playfair Display', Georgia, serif;
    --font-body:  'DM Sans', system-ui, sans-serif;
    --max-w:      1200px;
    --trans:      0.28s cubic-bezier(.4,0,.2,1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

/* ─── Container ─────────────────────────────────────── */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 28px;
}

.container.wide {
    max-width: 1280px;
    display: flex;
    gap: 64px;
    align-items: flex-start;
    padding: 72px 40px 96px;
}

/* ═══════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════ */
.hero {
    position: relative;
    background: var(--hero-bg);
    min-height: 300px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Grid background pattern */
.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(200,150,90,.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(200,150,90,.08) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, black 40%, transparent 100%);
}

/* Glowing orb */
.hero-glow {
    position: absolute;
    top: -80px;
    right: -60px;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(200,150,90,.18) 0%, transparent 70%);
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 2;
    padding-top: 64px;
    padding-bottom: 96px;
}

.hero-inner {
    max-width: 640px;
}

.hero-tag {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid rgba(200,150,90,.35);
    padding: 5px 14px;
    border-radius: 999px;
    margin-bottom: 20px;
    background: rgba(200,150,90,.07);
    animation: fadeSlideDown 0.7s ease both;
}

.hero-title {
    font-family: var(--font-head);
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    font-weight: 900;
    color: var(--white);
    line-height: 1.1;
    letter-spacing: -0.02em;
    animation: fadeSlideDown 0.7s 0.1s ease both;
}

.hero-title em {
    font-style: italic;
    color: var(--accent);
}

.hero-sub {
    margin-top: 16px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.06em;
    animation: fadeSlideDown 0.7s 0.2s ease both;
}

/* Wave divider */
.hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    line-height: 0;
    z-index: 3;
}

.hero-wave svg {
    width: 100%;
    height: 80px;
    display: block;
}

/* ═══════════════════════════════════════════════════
   TABLE OF CONTENTS SIDEBAR
═══════════════════════════════════════════════════ */
.toc {
    flex: 0 0 220px;
    position: sticky;
    top: 40px;
    align-self: flex-start;
}

.toc-label {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-light);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.toc nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-link {
    display: block;
    font-size: 0.875rem;
    color: var(--ink-light);
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 6px;
    border-left: 2px solid transparent;
    transition: all var(--trans);
    font-weight: 400;
}

.toc-link:hover,
.toc-link.active {
    color: var(--ink);
    background: var(--accent-dim);
    border-left-color: var(--accent);
}

.toc-footer {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.effective-badge {
    font-size: 0.65rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-light);
}

.effective-date {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink);
    font-family: 'Courier New', monospace;
}

/* ═══════════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════════ */
.content {
    flex: 1;
    min-width: 0;
}

/* ─── Section Blocks ────────────────────────────── */
.section-block {
    position: relative;
    margin-bottom: 72px;
    padding-bottom: 72px;
    border-bottom: 1px solid var(--border);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-marker {
    font-family: var(--font-head);
    font-size: 5rem;
    font-weight: 900;
    color: var(--paper-dark);
    line-height: 1;
    position: absolute;
    top: -18px;
    right: 0;
    user-select: none;
    pointer-events: none;
    letter-spacing: -0.05em;
}

.section-block h2 {
    font-family: var(--font-head);
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.section-block h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    margin-top: 12px;
}

.section-block p {
    font-size: 0.975rem;
    color: #3a342e;
    line-height: 1.85;
    margin-bottom: 18px;
}

.section-block p:last-child {
    margin-bottom: 0;
}

.section-block a {
    color: var(--accent-alt);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--trans);
}

.section-block a:hover {
    color: var(--accent);
}

strong {
    font-weight: 600;
    color: var(--ink);
}

/* ─── Callout Box ─────────────────────────────── */
.callout {
    background: linear-gradient(135deg, #fff 0%, var(--paper-dark) 100%);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin: 28px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.callout-title {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

.callout p {
    margin-bottom: 12px !important;
}

/* ─── Lists ───────────────────────────────────── */
.third-party-list,
.bullet-list {
    list-style: none;
    margin: 12px 0 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.third-party-list li,
.bullet-list li {
    font-size: 0.95rem;
    color: #3a342e;
    padding-left: 20px;
    position: relative;
    line-height: 1.7;
}

.third-party-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 600;
}

.bullet-list li::before {
    content: '·';
    position: absolute;
    left: 4px;
    color: var(--accent);
    font-size: 1.3em;
    line-height: 1.4;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════ */
.site-footer {
    background: var(--hero-bg);
    text-align: center;
    padding: 28px;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.04em;
}

.site-footer strong {
    color: rgba(255,255,255,0.65);
}

/* ═══════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════ */
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════
   SCROLLBAR (WebKit)
═══════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .container.wide {
        flex-direction: column;
        gap: 32px;
        padding: 48px 24px 64px;
    }

    .toc {
        position: static;
        flex: unset;
        width: 100%;
        background: var(--white);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 20px 24px;
    }

    .toc nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }

    .toc-link {
        border-left: none;
        border-bottom: 2px solid transparent;
        font-size: 0.82rem;
        padding: 5px 10px;
    }

    .toc-link:hover,
    .toc-link.active {
        border-left-color: transparent;
        border-bottom-color: var(--accent);
    }

    .section-marker {
        font-size: 3.5rem;
    }
}

@media (max-width: 580px) {
    .hero .container {
        padding-top: 48px;
        padding-bottom: 80px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .section-block {
        margin-bottom: 48px;
        padding-bottom: 48px;
    }

    .section-block h2 {
        font-size: 1.5rem;
    }
}
