/**
 * Long-form legal agreements.
 *
 * The five older agreement pages each inline their own copy of this same `tc-`
 * vocabulary. This is that vocabulary in one cacheable file — new agreements use
 * it, and the older pages can be moved onto it whenever they are next touched.
 */

.tc-page {
    position: relative;
    overflow: hidden;
    min-height: 80vh;
    padding: 80px 0 100px;
    background: linear-gradient(160deg, #080808 0%, #0f0f14 50%, #0a0012 100%);
}
.tc-page::before,
.tc-page::after { content: ''; position: absolute; pointer-events: none; }
.tc-page::before {
    top: -100px; left: -100px; width: 600px; height: 600px;
    background: radial-gradient(ellipse, rgba(223, 37, 226, .06) 0%, transparent 70%);
}
.tc-page::after {
    bottom: -80px; right: -80px; width: 500px; height: 500px;
    background: radial-gradient(ellipse, rgba(255, 215, 0, .05) 0%, transparent 70%);
}

/* ── Hero ─────────────────────────────────────────────── */

.tc-hero { position: relative; z-index: 1; margin-bottom: 40px; text-align: center; }
.tc-hero__tag {
    display: inline-block; margin-bottom: 24px; padding: 7px 22px;
    border: 1px solid rgba(255, 215, 0, .35); border-radius: 50px;
    background: rgba(255, 215, 0, .08);
    color: #FFD700;
    font-size: 11px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase;
}
.tc-hero__title {
    margin-bottom: 12px;
    font-size: clamp(26px, 4vw, 36px); font-weight: 800; line-height: 1.25; letter-spacing: -.5px;
    color: #FFD700;
    text-shadow: 0 2px 32px rgba(0, 0, 0, .7);
}
.tc-hero__subtitle {
    margin-bottom: 0;
    font-size: 15px; font-weight: 600; letter-spacing: .5px; color: #bdbcbc;
}

.tc-body { position: relative; z-index: 1; width: 100%; margin: 0 auto; }

.tc-effective {
    margin-bottom: 28px; padding: 14px 24px;
    border: 1px solid rgba(255, 215, 0, .25); border-radius: 8px;
    background: rgba(255, 215, 0, .07);
    font-size: 13px; letter-spacing: .5px; color: #aaa; text-align: center;
}
.tc-effective strong { color: #FFD700; }

/* ── Contents ─────────────────────────────────────────── */

/* Thirty articles is a lot to scroll blind, so the page opens with its own map. */
.tc-toc {
    margin-bottom: 28px; padding: 22px 26px;
    border: 1px solid #1e1e1e; border-radius: 12px;
    background: #0d0d0d;
}
.tc-toc__title {
    margin: 0 0 14px;
    font-size: 12px; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase;
    color: #FFD700;
}
.tc-toc__list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
    gap: 2px 20px; margin: 0; padding: 0; list-style: none;
}
.tc-toc__list a {
    display: block; padding: 5px 0;
    font-size: 13.5px; line-height: 1.5; color: #b0b0c0; text-decoration: none;
}
.tc-toc__list a:hover { color: #FFD700; text-decoration: none; }
.tc-toc__list a span { color: #6b6b76; font-weight: 700; margin-right: 7px; }

/* ── Articles ─────────────────────────────────────────── */

.tc-section {
    margin-bottom: 20px; padding: 32px 36px;
    border: 1px solid #1e1e1e; border-radius: 12px;
    background: #0f0f0f;
    transition: border-color .25s;
    /* Anchored from the contents list; clears the sticky site header. */
    scroll-margin-top: 96px;
}
.tc-section:hover { border-color: rgba(255, 215, 0, .2); }
.tc-section__number {
    display: block; margin-bottom: 6px;
    font-size: 11px; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase;
    color: #FFD700;
}
.tc-section__title {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 215, 0, .15);
    font-size: 18px; font-weight: 800; color: #fffbe6;
}
.tc-section__title::before {
    content: ''; display: inline-block; flex-shrink: 0;
    width: 4px; height: 20px; border-radius: 2px; background: #FFD700;
}
.tc-section h4 {
    margin: 22px 0 8px;
    font-size: 14.5px; font-weight: 800; color: #fffbe6;
}
.tc-section h4:first-of-type { margin-top: 0; }
.tc-section p { margin-bottom: 12px; font-size: 15px; line-height: 1.8; color: #b0b0c0; }
.tc-section p:last-child { margin-bottom: 0; }
.tc-section strong { color: #fffbe6; }
.tc-section ul { margin: 12px 0 0; padding: 0; list-style: none; }
.tc-section ul li {
    position: relative; padding: 5px 0 5px 22px;
    font-size: 15px; line-height: 1.75; color: #b0b0c0;
}
.tc-section ul li::before {
    content: '\25B8'; position: absolute; left: 0; top: 5px;
    font-size: 11px; color: #FFD700;
}
.tc-section hr { margin: 20px 0; border: none; border-top: 1px solid #222; }
/* Cross-references to the other agreements. */
.tc-section a { color: #FFD700; text-decoration: none; border-bottom: 1px solid rgba(255, 215, 0, .3); }
.tc-section a:hover { color: #fff3a8; border-bottom-color: rgba(255, 215, 0, .7); }

/* The preamble above the contents map: same voice as an article body. */
.tc-lead { margin-bottom: 14px; font-size: 15px; line-height: 1.8; color: #b0b0c0; }
.tc-lead strong { color: #fffbe6; }

/* Definitions read better as term/description than as bullets. */
.tc-defs { margin: 0; }
.tc-defs dt {
    margin-top: 16px;
    font-size: 14.5px; font-weight: 800; color: #FFD700;
}
.tc-defs dt:first-child { margin-top: 0; }
.tc-defs dd {
    margin: 5px 0 0;
    font-size: 14.5px; line-height: 1.75; color: #b0b0c0;
}

.tc-callout {
    margin: 16px 0; padding: 18px 22px;
    border: 1px solid rgba(255, 215, 0, .28); border-radius: 10px;
    background: rgba(255, 215, 0, .06);
}
.tc-callout p { margin: 0; font-size: 15px; font-weight: 700; color: #fffbe6; text-align: center; }

/* ── Fee table ────────────────────────────────────────── */

.tc-tablewrap { margin: 18px 0; overflow-x: auto; }
.tc-table {
    width: 100%; min-width: 520px; border-collapse: collapse;
    border: 1px solid #262200; border-radius: 10px; overflow: hidden;
    background: #141414;
}
.tc-table th,
.tc-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #222;
    font-size: 14px; line-height: 1.6; text-align: left; vertical-align: top;
}
.tc-table thead th {
    background: rgba(255, 215, 0, .07);
    color: #FFD700;
    font-size: 11.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
}
.tc-table tbody th { color: #fffbe6; font-weight: 700; }
.tc-table tbody td { color: #b0b0c0; }
.tc-table tbody tr:last-child th,
.tc-table tbody tr:last-child td { border-bottom: none; }
.tc-table .tc-table__fee { color: #fffbe6; font-weight: 700; }

/* Left to itself the middle column takes most of the width and squeezes the last
   one into three lines. Fixed proportions read as a table rather than a list.
   Scoped to three-column tables — a two-column table needs its own split, so it
   is opted in with .tc-table--wide-2 instead. */
.tc-table--3col th:first-child,
.tc-table--3col td:first-child { width: 26%; }
.tc-table--3col th:nth-child(2),
.tc-table--3col td:nth-child(2) { width: 37%; }
.tc-table--wide-2 th:first-child,
.tc-table--wide-2 td:first-child { width: 24%; }

/* ── Close ────────────────────────────────────────────── */

.tc-acknowledgment {
    margin-top: 40px; padding: 36px 40px;
    border: 1px solid rgba(255, 215, 0, .4); border-radius: 12px;
    background: linear-gradient(135deg, #0f0f0f, #1a1200);
    text-align: center;
    scroll-margin-top: 96px;            /* it is the anchor for the last article */
}
/* :not() keeps the heading and the acceptance line out — `.tc-acknowledgment > p`
   would otherwise outweigh `.tc-acknowledgment__title` and `.tc-accept` (both a
   single class) and grey the gold out. */
.tc-acknowledgment > p:not(.tc-acknowledgment__title):not(.tc-accept) {
    font-size: 15px; line-height: 1.8; color: #b0b0c0;
}
.tc-acknowledgment__title {
    margin-bottom: 20px;
    font-size: 20px; font-weight: 800; letter-spacing: .5px; color: #FFD700;
}
/* Not a .tc-section, so it needs its own list rules — a green check rather than
   the gold arrow, matching what the AIVA agreement established. */
.tc-acknowledgment ul {
    display: inline-block; max-width: 860px;
    margin: 0 0 28px; padding: 0;
    list-style: none; text-align: left;
}
.tc-acknowledgment ul li {
    position: relative; padding: 5px 0 5px 28px;
    font-size: 15px; line-height: 1.8; color: #fffbe6;
}
.tc-acknowledgment ul li::before {
    content: '\2714'; position: absolute; left: 0; top: 5px;
    font-size: 13px; color: #12FE41;
}
/* The sentence the signer actually confirms — set apart from the surrounding
   acknowledgements so it reads as the operative wording. */
.tc-accept {
    margin: 0 auto 22px; max-width: 780px; padding: 20px 26px;
    border: 1px solid rgba(255, 215, 0, .42); border-radius: 12px;
    background: rgba(255, 215, 0, .08);
    font-size: clamp(15px, 1.9vw, 18px); font-weight: 800; line-height: 1.6;
    color: #FFD700; text-align: center;
}

.tc-back-btn {
    display: inline-block; margin-top: 10px; padding: 14px 40px;
    border-radius: 6px;
    background: linear-gradient(90deg, #FFD700 0%, #B8860B 100%);
    color: #0a0a0a;
    font-size: 15px; font-weight: 800; letter-spacing: .5px; text-decoration: none;
    box-shadow: 0 4px 24px rgba(255, 215, 0, .3);
    transition: transform .2s, box-shadow .2s;
}
.tc-back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(255, 215, 0, .45);
    color: #0a0a0a; text-decoration: none;
}

@media (max-width: 767px) {
    .tc-page { padding: 48px 0 64px; }
    .tc-section { padding: 24px 20px; }
    .tc-toc { padding: 18px 16px; }
    .tc-toc__list { grid-template-columns: 1fr; }
    .tc-acknowledgment { padding: 26px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .tc-section, .tc-back-btn { transition: none; }
    .tc-back-btn:hover { transform: none; }
}

/* ── GEM variant ──────────────────────────────────────────
   The enterprise agreement carries GEM's sky blue rather than the platform
   gold, matching the #gem section and the company dashboard. Scoped to
   .tc-page--gem so the gold agreements are untouched. */

.tc-page--gem::after { background: radial-gradient(ellipse, rgba(56, 189, 248, .06) 0%, transparent 70%); }
.tc-page--gem .tc-hero__tag {
    border-color: rgba(56, 189, 248, .35); background: rgba(56, 189, 248, .08); color: #38bdf8;
}
.tc-page--gem .tc-hero__title { color: #38bdf8; }
.tc-page--gem .tc-effective { border-color: rgba(56, 189, 248, .25); background: rgba(56, 189, 248, .07); }
.tc-page--gem .tc-effective strong { color: #38bdf8; }
.tc-page--gem .tc-toc__title { color: #38bdf8; }
.tc-page--gem .tc-toc__list a:hover { color: #38bdf8; }
.tc-page--gem .tc-section:hover { border-color: rgba(56, 189, 248, .2); }
.tc-page--gem .tc-section__number { color: #38bdf8; }
.tc-page--gem .tc-section__title { color: #eaf6ff; border-bottom-color: rgba(56, 189, 248, .15); }
.tc-page--gem .tc-section__title::before { background: #38bdf8; }
.tc-page--gem .tc-section h4 { color: #eaf6ff; }
.tc-page--gem .tc-section strong { color: #eaf6ff; }
.tc-page--gem .tc-section ul li::before { color: #38bdf8; }
.tc-page--gem .tc-section a { color: #38bdf8; border-bottom-color: rgba(56, 189, 248, .3); }
.tc-page--gem .tc-section a:hover { color: #a5e4ff; border-bottom-color: rgba(56, 189, 248, .7); }
.tc-page--gem .tc-callout {
    border-color: rgba(56, 189, 248, .28); background: rgba(56, 189, 248, .06);
}
.tc-page--gem .tc-callout p { color: #eaf6ff; }
.tc-page--gem .tc-table { border-color: #0b2635; }
.tc-page--gem .tc-table thead th { background: rgba(56, 189, 248, .07); color: #38bdf8; }
.tc-page--gem .tc-table tbody th { color: #eaf6ff; }
.tc-page--gem .tc-table .tc-table__fee { color: #eaf6ff; }
/* The preamble that carries the parties, used by the enterprise agreement. */
.tc-page--gem .tc-preamble {
    margin-bottom: 28px; padding: 26px 30px;
    border: 1px solid #1e1e1e; border-left: 4px solid #38bdf8; border-radius: 12px;
    background: #141414;
    font-size: 15px; line-height: 1.85; color: #b0b0c0;
}
.tc-page--gem .tc-preamble p { margin: 0 0 12px; }
.tc-page--gem .tc-preamble p:last-child { margin-bottom: 0; }
.tc-page--gem .tc-preamble strong { color: #eaf6ff; }
.tc-page--gem .tc-back-btn {
    background: linear-gradient(90deg, #7dd3fc 0%, #0284c7 100%); color: #04202e;
    box-shadow: 0 4px 24px rgba(56, 189, 248, .3);
}
.tc-page--gem .tc-back-btn:hover { color: #04202e; box-shadow: 0 8px 32px rgba(56, 189, 248, .45); }

/* ── Contents sidebar ─────────────────────────────────────
   Two columns on desktop: a sticky contents rail beside the text. Below 1200px
   it becomes a single collapsed toggle above the text, since a fifty-item list
   in front of the reader is worse than no list at all. */

.tc-layout {
    position: relative; z-index: 1;
    display: grid; grid-template-columns: 296px minmax(0, 1fr);
    gap: 28px; align-items: start;
}

.tc-side { position: sticky; top: 96px; }
.tc-toc--side {
    /* Overrides the inline .tc-toc card it replaces. */
    margin-bottom: 0; padding: 18px 8px 14px 18px;
    display: flex; flex-direction: column;
    max-height: calc(100vh - 132px);
}
.tc-side__head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    padding-right: 10px;
}
.tc-toc--side .tc-toc__title { margin: 0; }
.tc-side__count {
    flex-shrink: 0;
    font-size: 10.5px; font-weight: 700; letter-spacing: .6px; color: #6b6b76;
}

.tc-side__bar {
    height: 3px; margin: 12px 10px 12px 0;
    border-radius: 3px; overflow: hidden;
    background: rgba(255, 255, 255, .07);
}
.tc-side__bar-fill {
    display: block; width: 0; height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #FFE55C, #FFD700 60%, #d4a017);
    transition: width .18s linear;
}

/* The list scrolls inside the rail rather than making the rail taller than the
   viewport, which is what would break the sticky. */
.tc-side__scroll {
    overflow-y: auto; overscroll-behavior: contain;
    padding-right: 8px;
    scrollbar-width: thin; scrollbar-color: rgba(255, 215, 0, .3) transparent;
}
.tc-side__scroll::-webkit-scrollbar { width: 6px; }
.tc-side__scroll::-webkit-scrollbar-track { background: transparent; }
.tc-side__scroll::-webkit-scrollbar-thumb {
    border-radius: 6px; background: rgba(255, 215, 0, .26);
}
.tc-side__scroll::-webkit-scrollbar-thumb:hover { background: rgba(255, 215, 0, .45); }

.tc-side__list { margin: 0; padding: 0; list-style: none; counter-reset: none; }
.tc-side__list a {
    position: relative;
    display: flex; align-items: flex-start; gap: 9px;
    padding: 7px 10px 7px 11px;
    border-radius: 8px;
    font-size: 12.5px; line-height: 1.5; color: #9b9baa; text-decoration: none;
    transition: background-color .16s, color .16s;
}
/* The rail that marks the current article. */
.tc-side__list a::before {
    content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
    width: 2px; border-radius: 2px;
    background: transparent;
    transition: background-color .16s;
}
.tc-side__list a:hover {
    background: rgba(255, 255, 255, .04); color: #e8e8f0; text-decoration: none;
}
.tc-side__n {
    flex-shrink: 0; min-width: 20px;
    font-size: 10.5px; font-weight: 800; letter-spacing: .3px; color: #63636f;
    padding-top: 1px;
}
.tc-side__t { min-width: 0; }

.tc-side__list a.is-current {
    background: rgba(255, 215, 0, .1);
    color: #fffbe6; font-weight: 700;
}
.tc-side__list a.is-current::before { background: #FFD700; }
.tc-side__list a.is-current .tc-side__n { color: #FFD700; }

/* ── Collapsed control (narrow screens only) ───────────── */

.tc-side__toggle { display: none; }

@media (max-width: 1199px) {
    .tc-layout { grid-template-columns: 1fr; gap: 0; }
    .tc-side { position: static; margin-bottom: 22px; }
    .tc-toc--side { max-height: none; padding: 0; border: 0; background: none; }

    .tc-side__toggle {
        display: flex; align-items: center; gap: 12px; width: 100%;
        padding: 15px 18px;
        border: 1px solid #1e1e1e; border-radius: 12px;
        background: #0d0d0d;
        font: inherit; font-size: 13.5px; font-weight: 700; color: #e8e8f0;
        text-align: left; cursor: pointer;
    }
    .tc-side__toggle-lbl { flex-shrink: 0; }
    .tc-side__toggle-lbl i { color: #FFD700; margin-right: 7px; }
    /* Which article the reader is in, so the collapsed bar still tells them something. */
    .tc-side__toggle-at {
        flex: 1; min-width: 0; overflow: hidden;
        font-size: 12px; font-weight: 600; color: #8a8a98; white-space: nowrap; text-overflow: ellipsis;
    }
    .tc-side__toggle-caret { flex-shrink: 0; color: #6b6b76; font-size: 12px; transition: transform .2s; }
    .tc-side.is-open .tc-side__toggle-caret { transform: rotate(180deg); }
    .tc-side.is-open .tc-side__toggle { border-radius: 12px 12px 0 0; border-bottom-color: transparent; }

    .tc-side__head,
    .tc-side__bar { display: none; }

    /* Closed by default. A class, not [hidden], so nothing has to out-specify it.
       No border while closed either — a transparent 1px one still measures 1px. */
    .tc-side__scroll {
        max-height: 0; overflow: hidden; padding: 0; border: 0;
    }
    .tc-side.is-open .tc-side__scroll {
        max-height: min(58vh, 460px); overflow-y: auto;
        padding: 8px 8px 10px;
        /* Full shorthand: the closed state zeroes the width, so border-color
           alone would draw nothing. */
        border: 1px solid #1e1e1e; border-top: 0; border-radius: 0 0 12px 12px;
        background: #0d0d0d;
    }
    .tc-side__list a { font-size: 13px; padding: 9px 10px 9px 11px; }
}

/* ── GEM variant ──────────────────────────────────────── */

.tc-page--gem .tc-side__bar-fill { background: linear-gradient(90deg, #7dd3fc, #38bdf8 60%, #0284c7); }
.tc-page--gem .tc-side__scroll { scrollbar-color: rgba(56, 189, 248, .3) transparent; }
.tc-page--gem .tc-side__scroll::-webkit-scrollbar-thumb { background: rgba(56, 189, 248, .26); }
.tc-page--gem .tc-side__scroll::-webkit-scrollbar-thumb:hover { background: rgba(56, 189, 248, .45); }
.tc-page--gem .tc-side__list a.is-current { background: rgba(56, 189, 248, .1); color: #eaf6ff; }
.tc-page--gem .tc-side__list a.is-current::before { background: #38bdf8; }
.tc-page--gem .tc-side__list a.is-current .tc-side__n { color: #38bdf8; }
.tc-page--gem .tc-side__toggle-lbl i { color: #38bdf8; }

@media (prefers-reduced-motion: reduce) {
    .tc-side__bar-fill,
    .tc-side__list a,
    .tc-side__list a::before,
    .tc-side__toggle-caret { transition: none; }
}

/* ── Making the rail actually stick ───────────────────────
   position:sticky is measured against the nearest ancestor that establishes a
   scroll container. Four ancestors here do:
       html   { overflow-x: hidden }        (vegas.css — clips the spotlights)
       body   { overflow-x: hidden }        (same; hidden on one axis forces the
                                            other to auto, which is the classic
                                            sticky killer)
       .page-wrapper { overflow: hidden }   (theme)
       .tc-page      { overflow: hidden }   (clips this page's glows)
   Each one made the rail stick to a box that never scrolls — so it never stuck.

   `overflow: clip` clips identically but does NOT create a scroll container, so
   the rail sticks to the viewport as intended. Scoped with :has() to the pages
   that carry a rail, and behind @supports so anything too old to know `clip`
   keeps today's clipping behaviour. */
@supports (overflow: clip) and selector(:has(*)) {
    html:has(.tc-side) { overflow-x: clip; }
    body:has(.tc-side) { overflow-x: clip; }
    body:has(.tc-side) .page-wrapper { overflow: clip; }
    .tc-page:has(.tc-side) { overflow: clip; }
}
