/* MJK Electric — legal pages (templates/website/privacy_policy.html, terms.html). Loaded after css/home_v2.css,
   which supplies the tokens, nav, eyebrow, inline links and footer. A plain header (no photo), then the text
   beside a list of its sections. See docs/home_v2.md. */

.legalpage h2, .legalpage h3 { margin: 0; }
.legalpage [id] { scroll-margin-top: 88px; }

/* ----------------------------------------------------------------- header */
.lhead { position: relative; isolation: isolate; overflow: hidden; padding: calc(var(--nav-h) + clamp(40px, 6vw, 88px)) 0 clamp(34px, 4.4vw, 60px); border-bottom: 1px solid var(--line);
    background: radial-gradient(900px 520px at 84% 0%, rgba(194, 124, 46, .14), transparent 62%), var(--bg); }
.lhead__grid { position: absolute; inset: 0; z-index: -1; opacity: .55; pointer-events: none;
    background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 96px 96px; background-position: center;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 96%); mask-image: linear-gradient(180deg, #000 0%, transparent 96%); }
.lhead .eyebrow { margin-bottom: clamp(14px, 2vw, 22px); }
.lhead__title { font-family: var(--display); font-weight: 600; text-transform: uppercase; font-size: clamp(2.9rem, 6.6vw, 6rem); line-height: .92; letter-spacing: -.01em; color: #fff; }
.lhead__title em { font-style: normal; background: linear-gradient(100deg, #f6c58c 0%, #e09544 40%, #b06a1f 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lhead__lede { margin-top: clamp(16px, 2vw, 24px); max-width: 38em; font-size: clamp(1.02rem, 1.2vw, 1.16rem); line-height: 1.6; color: #c9c7c3; font-weight: 350; }
.lhead__meta { display: inline-flex; gap: 10px; margin-top: clamp(18px, 2.2vw, 26px); padding: 7px 12px; border: 1px solid rgba(234, 168, 98, .4); border-radius: 3px; background: rgba(194, 124, 46, .1); color: #fff; font-size: .68rem; letter-spacing: .1em; }
.lhead__meta span { color: var(--copper-hi); }

.js .lhead .wrap > * { opacity: 0; animation: fadeUp .9s var(--ease) forwards; }
.js .lhead .wrap > :nth-child(1) { animation-delay: .05s; }
.js .lhead .wrap > :nth-child(2) { animation-delay: .14s; }
.js .lhead .wrap > :nth-child(3) { animation-delay: .26s; }
.js .lhead .wrap > :nth-child(4) { animation-delay: .38s; }

/* --------------------------------------------------------------- the text */
.legal-body { padding: clamp(44px, 5.5vw, 84px) 0 clamp(72px, 9vw, 136px); background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); }
.legal { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(32px, 6vw, 104px); align-items: start; }

/* the sections, listed like the sheet index of a plan set */
.legal__toc { position: sticky; top: 88px; max-height: calc(100vh - 112px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.legal__toc-title { padding-bottom: 12px; border-bottom: 1px solid var(--line-2); color: var(--copper-hi); font-weight: 600; }
.legal__toc li { border-bottom: 1px solid var(--line); }
.legal__toc li a { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: baseline; padding: 9px 0; font-size: .9rem; line-height: 1.35; color: var(--muted); transition: color .2s, padding .3s var(--ease); }
.legal__toc li a .mono { font-size: .64rem; letter-spacing: .08em; color: var(--copper-hi); }
.legal__toc li a:hover, .legal__toc li a:focus-visible { color: #fff; padding-left: 6px; }
.legal__other { display: inline-flex; gap: 8px; margin-top: 20px; font-family: var(--display); font-weight: 600; font-size: 1rem; letter-spacing: .1em; text-transform: uppercase; color: var(--copper-hi); transition: gap .25s var(--ease); }
.legal__other:hover { gap: 14px; }

.legal__text { max-width: 47em; color: #c5c8cc; font-size: 1rem; line-height: 1.7; }
.legal__text p { margin: 0 0 16px; }
.legal__text strong { font-weight: 600; color: #f1eee9; }
.legal__intro { font-size: 1.1rem; line-height: 1.65; color: #dcd9d4; }
.legal__sec { margin-top: clamp(36px, 4.4vw, 56px); padding-top: clamp(28px, 3.4vw, 44px); border-top: 1px solid var(--line); }
.legal__sec > :last-child, .legal__note > :last-child, .legal__contact > :last-child { margin-bottom: 0; }
.legal__sec h2 { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: baseline; margin-bottom: 18px; font-family: var(--display); font-weight: 600; font-size: clamp(1.8rem, 2.6vw, 2.4rem); line-height: 1.02; letter-spacing: .005em; text-transform: uppercase; color: #fff; text-wrap: balance; }
.legal__no { font-family: var(--mono); font-size: .78rem; font-weight: 600; letter-spacing: .1em; color: var(--copper-hi); }
.legal__sec h3 { margin: 28px 0 10px; font-family: var(--display); font-weight: 600; font-size: 1.32rem; line-height: 1.15; letter-spacing: .03em; text-transform: uppercase; color: #f1eee9; }
.legal__sec h2 + h3 { margin-top: 0; }
.legal__text ul { margin: 0 0 18px; border-top: 1px solid var(--line); }
.legal__text li { position: relative; padding: 10px 0 10px 30px; border-bottom: 1px solid var(--line); line-height: 1.55; }
.legal__text li::before, .legal__text li::after { content: ''; position: absolute; background: var(--copper-hi); }
.legal__text li::before { left: 0; top: calc(10px + .78em); width: 15px; height: 1px; }
.legal__text li::after { left: 15px; top: calc(10px + .78em - 3px); width: 1px; height: 7px; }
.legal__strong { font-weight: 600; color: #f1eee9; }

/* a section the old page set apart (email and text messages): the same text on a panel */
.legal__sec--key, .legal__sec--contact { padding: clamp(22px, 2.8vw, 34px); border: 1px solid var(--line-2); border-radius: 6px; }
.legal__sec--key { border-left: 2px solid var(--copper); background: rgba(194, 124, 46, .07); }
.legal__sec--key + .legal__sec, .legal__sec--contact { border-top-color: var(--line-2); }
.legal__sec--key + .legal__sec:not(.legal__sec--contact) { border-top: 0; padding-top: 0; }
.legal__sec--contact { background: linear-gradient(180deg, var(--panel), #0e1215); box-shadow: 0 40px 80px -50px rgba(0, 0, 0, .9); }
.legal__contact { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.legal__contact p { margin-bottom: 4px; color: #dcd9d4; }
.legal__note { margin: 18px 0; padding: 16px 18px; border-left: 2px solid var(--copper); background: rgba(194, 124, 46, .08); color: #dcd9d4; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1000px) {
    .legal { grid-template-columns: minmax(0, 1fr); }
    /* the list of sections sits above the text, in two columns while there is room */
    .legal__toc { position: static; max-height: none; overflow: visible; }
    .legal__toc ol { columns: 2; column-gap: clamp(20px, 4vw, 48px); }
    .legal__toc li { break-inside: avoid; }
}
@media (max-width: 599px) {
    .legal__toc ol { columns: 1; }
    .legal__sec h2 { grid-template-columns: 40px minmax(0, 1fr); }
    .legalpage .eyebrow { letter-spacing: .14em; }
    .legalpage .eyebrow .tick { width: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    .js .lhead .wrap > * { opacity: 1; animation: none; }
}
