/* ==========================================================================
   Orangebing — legal pages (Privacy Policy, Terms & Conditions)
   Builds on css/modern.css
   ========================================================================== */

/* ----- Reading progress ----- */

.progress {
    position: fixed;
    inset: 0 0 auto;
    z-index: 101;
    height: 2px;
    background: linear-gradient(90deg, var(--orange-soft), var(--orange));
    transform: scaleX(0);
    transform-origin: left;
}

/* ----- Hero ----- */

.legal-hero {
    position: relative;
    padding: 168px 0 96px;
    overflow: hidden;
    isolation: isolate;
    background: var(--brand-gradient);
}
.legal-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 160px;
    background: linear-gradient(to bottom, transparent, var(--ink));
    z-index: -1;
}
.legal-hero .hero__glow--1 { width: 520px; height: 520px; top: -220px; }
.legal-hero .hero__glow--2 { width: 420px; height: 420px; bottom: -220px; }

.legal-hero h1 {
    font-size: clamp(2.6rem, 6vw, 4.5rem);
    letter-spacing: -0.04em;
    line-height: 1.02;
}
.legal-hero .eyebrow { color: rgba(255, 255, 255, 0.85); }

.legal-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    margin-top: 20px;
    font-size: 14.5px;
    color: rgba(255, 255, 255, 0.8);
}
.legal-meta span { display: inline-flex; align-items: center; gap: 8px; }
.legal-meta svg { width: 16px; height: 16px; }

/* Privacy / Terms switch */
.legal-tabs {
    display: inline-flex;
    gap: 4px;
    margin-top: 36px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.legal-tabs a {
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
    transition: background-color 0.2s, color 0.2s;
}
.legal-tabs a:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.legal-tabs a[aria-current="page"] { background: #fff; color: var(--rust); }

/* ----- Layout ----- */

.legal { padding: 24px 0 clamp(80px, 10vw, 120px); }

.legal__grid {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: clamp(40px, 6vw, 88px);
    align-items: start;
}

/* Table of contents */
.toc { position: sticky; top: 110px; }
.toc__label {
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
}
.toc ol { border-left: 1px solid var(--line); }
.toc a {
    position: relative;
    display: block;
    padding: 7px 0 7px 18px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--muted);
    transition: color 0.2s;
}
.toc a::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    border-radius: 2px;
    background: var(--orange);
    transform: scaleY(0);
    transition: transform 0.3s var(--ease-out);
}
.toc a:hover { color: #fff; }
.toc a.is-active { color: #fff; }
.toc a.is-active::before { transform: scaleY(1); }

/* ----- Document ----- */

.doc { max-width: 740px; counter-reset: sec; }

.legal-intro {
    position: relative;
    padding: 28px 32px;
    margin-bottom: 56px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(240, 82, 35, 0.14), rgba(240, 82, 35, 0.03));
    border: 1px solid rgba(240, 82, 35, 0.28);
    font-size: 1.0625rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.86);
}

.doc section {
    padding: 44px 0;
    border-top: 1px solid var(--line);
    counter-increment: sec;
}
.doc section:first-of-type { border-top: 0; padding-top: 0; }

.doc h2 {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 18px;
    font-size: clamp(1.4rem, 2.4vw, 1.75rem);
    letter-spacing: -0.02em;
}
.doc h2::before {
    content: counter(sec, decimal-leading-zero);
    flex: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--orange-soft);
    transform: translateY(-3px);
}

.doc p {
    margin-bottom: 14px;
    font-size: 16px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.7);
}
.doc p:last-child { margin-bottom: 0; }
.doc strong { color: #fff; font-weight: 600; }

.doc ul { margin: 6px 0 18px; }
.doc ul li {
    position: relative;
    padding: 8px 0 8px 26px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
}
.doc ul li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 19px;
    width: 10px;
    height: 2px;
    border-radius: 2px;
    background: var(--orange);
}

.doc a { color: var(--orange-soft); text-decoration: underline; text-decoration-color: rgba(255, 122, 77, 0.4); text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.doc a:hover { text-decoration-color: currentColor; }
.doc a.btn { color: var(--rust); text-decoration: none; }

.warning-box {
    margin-top: 6px;
    padding: 20px 24px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--orange);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.7;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
}

/* Contact card */
.legal-contact {
    position: relative;
    margin-top: 32px;
    padding: clamp(32px, 5vw, 48px);
    border-radius: 24px;
    background: var(--brand-gradient);
    overflow: hidden;
    isolation: isolate;
}
.legal-contact .cta__glow { width: 360px; height: 360px; top: -200px; left: auto; right: -80px; margin: 0; }
.legal-contact h3 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.03em; }
.legal-contact p { margin-top: 10px; color: rgba(255, 255, 255, 0.85); }
.legal-contact .btn { margin-top: 24px; }
.legal-contact .btn:hover svg { transform: none; }

/* Back to top */
.to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 90;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(26, 18, 16, 0.9);
    border: 1px solid var(--line-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s var(--ease-out), visibility 0.3s, background-color 0.2s;
}
.to-top svg { width: 18px; height: 18px; }
.to-top:hover { background: var(--orange); border-color: var(--orange); }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

/* ----- Responsive ----- */

@media (max-width: 960px) {
    .legal__grid { grid-template-columns: 1fr; }
    .toc { display: none; }
    .legal-hero { padding: 140px 0 72px; }
}

@media (max-width: 640px) {
    .legal-intro { padding: 22px; }
    .doc section { padding: 36px 0; }
    .doc h2 { gap: 12px; }
    .legal-contact .btn { width: 100%; justify-content: center; }
    .to-top { right: 12px; bottom: 12px; }
}

@media print {
    .nav, .progress, .legal-tabs, .toc, .to-top, .footer, .hero__glow, .hero__grid { display: none !important; }
    body, .legal-hero, .legal-contact { background: #fff !important; color: #000; }
    .doc p, .doc ul li, .legal-intro, .warning-box { color: #222 !important; }
    .legal__grid { grid-template-columns: 1fr; }
}
