/* Canonical TrackGlance tokens. All presentation remains local and system-font based. */
:root {
    color-scheme: light dark;
    --tg-background: #f4fbf6;
    --tg-surface: #ffffff;
    --tg-text: #1e293b;
    --tg-muted: #475569;
    --tg-border: #cbd5e1;
    --tg-primary: #006c4c;
    --tg-on-primary: #ffffff;
    --tg-primary-container: #d2f8e8;
    --tg-code: #e8f2ec;
    --tg-table-alt: #e8f3ec;
    --tg-table-header: #d2f8e8;
    --tg-sidebar: #1e293b;
    --tg-sidebar-text: #f1f5f9;
    --tg-shadow: rgba(30, 41, 59, 0.12);
}

@media (prefers-color-scheme: dark) {
    :root {
        --tg-background: #0f172a;
        --tg-surface: #1e293b;
        --tg-text: #f1f5f9;
        --tg-muted: #cbd5e1;
        --tg-border: #475569;
        --tg-primary: #34d399;
        --tg-on-primary: #003829;
        --tg-primary-container: #00513a;
        --tg-code: #334155;
        --tg-table-alt: #27364a;
        --tg-table-header: #00513a;
        --tg-sidebar: #0f172a;
        --tg-sidebar-text: #f1f5f9;
        --tg-shadow: rgba(0, 0, 0, 0.35);
    }
}

body,
button,
input,
select,
textarea {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body,
.wy-body-for-nav,
.wy-nav-content-wrap,
.wy-nav-content {
    background: var(--tg-background);
    color: var(--tg-text);
}

h1,
h2,
h3,
h4,
h5,
h6,
.rst-content h1,
.rst-content h2,
.rst-content h3,
.rst-content h4,
.rst-content h5,
.rst-content h6 {
    color: var(--tg-text);
    font-family: inherit;
}

a,
.rst-content a:visited {
    color: var(--tg-primary);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--tg-primary);
    outline-offset: 3px;
}

.wy-nav-side {
    background: var(--tg-sidebar);
    border-right: 1px solid var(--tg-border);
}

.wy-side-nav-search,
.wy-nav-top {
    background: var(--tg-primary-container);
    color: var(--tg-text);
}

.wy-side-nav-search > a,
.wy-side-nav-search .wy-dropdown > a,
.wy-nav-top a {
    color: var(--tg-text);
    font-family: inherit;
}

.wy-side-nav-search input[type="text"] {
    min-height: 44px;
    border: 1px solid var(--tg-border);
    background: var(--tg-surface);
    color: var(--tg-text);
}

.wy-menu-vertical a,
.wy-menu-vertical header,
.wy-menu-vertical p.caption {
    color: var(--tg-sidebar-text);
}

.wy-menu-vertical a {
    min-height: 44px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.wy-menu-vertical a:hover,
.wy-menu-vertical li.current > a:hover {
    background: var(--tg-primary-container);
    color: var(--tg-text);
}

.wy-menu-vertical li.current,
.wy-menu-vertical li.toctree-l1.current > a {
    background: var(--tg-surface);
    color: var(--tg-text);
}

.wy-menu-vertical li.current a {
    border-color: var(--tg-border);
    color: var(--tg-text);
}

.wy-nav-content {
    max-width: 960px;
}

.rst-content code.literal,
.rst-content pre,
.rst-content div[class^="highlight"] {
    border-color: var(--tg-border);
    background: var(--tg-code);
    color: var(--tg-text);
}

.rst-content table.docutils,
.rst-content table.docutils td,
.rst-content table.docutils th {
    border-color: var(--tg-border);
    background: var(--tg-surface);
    color: var(--tg-text);
}

.rst-content table.docutils:not(.field-list) thead tr th,
.rst-content table.docutils:not(.field-list) thead tr td {
    border-color: var(--tg-border);
    background: var(--tg-table-header);
    color: var(--tg-text);
}

.rst-content table.docutils:not(.field-list) tbody tr:nth-child(odd) td {
    border-color: var(--tg-border);
    background: var(--tg-surface);
    color: var(--tg-text);
}

.rst-content table.docutils:not(.field-list) tbody tr:nth-child(even) td {
    border-color: var(--tg-border);
    background: var(--tg-table-alt);
    color: var(--tg-text);
}

.rst-content table.docutils:not(.field-list) th p,
.rst-content table.docutils:not(.field-list) td p,
.rst-content table.docutils:not(.field-list) th strong,
.rst-content table.docutils:not(.field-list) td strong {
    color: inherit;
}

.rst-content table.docutils:not(.field-list) th a,
.rst-content table.docutils:not(.field-list) th a:visited,
.rst-content table.docutils:not(.field-list) td a,
.rst-content table.docutils:not(.field-list) td a:visited {
    color: var(--tg-primary);
    text-decoration: underline;
}

.rst-content table.docutils caption,
.rst-content .figure .caption,
.rst-content figure figcaption {
    background: var(--tg-background);
    color: var(--tg-text);
}

.rst-content table.docutils caption .caption-text,
.rst-content .figure .caption .caption-text,
.rst-content figure figcaption .caption-text {
    color: inherit;
}

.rst-content table.docutils caption .headerlink,
.rst-content table.docutils caption .headerlink:visited,
.rst-content .figure .caption .headerlink,
.rst-content .figure .caption .headerlink:visited,
.rst-content figure figcaption .headerlink,
.rst-content figure figcaption .headerlink:visited {
    color: var(--tg-primary);
}

@media (max-width: 600px) {
    .rst-content .wy-table-responsive table.docutils:not(.field-list) {
        width: 100%;
        table-layout: fixed;
    }

    .rst-content .wy-table-responsive table.docutils:not(.field-list) th,
    .rst-content .wy-table-responsive table.docutils:not(.field-list) td {
        padding: 6px;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .rst-content .wy-table-responsive table.docutils:not(.field-list) td img {
        display: block;
        width: 100% !important;
        height: auto;
    }
}

.rst-content .admonition,
.rst-content .topic,
.rst-content .sidebar {
    border: 1px solid var(--tg-border);
    border-radius: 12px;
    background: var(--tg-surface);
    color: var(--tg-text);
    box-shadow: 0 4px 16px var(--tg-shadow);
}

.rst-content .admonition-title {
    background: var(--tg-primary-container);
    color: var(--tg-text);
}

.btn,
.btn-neutral {
    min-height: 44px;
    border: 1px solid var(--tg-primary);
    border-radius: 12px;
    background: var(--tg-primary);
    color: var(--tg-on-primary);
    box-shadow: none;
}

.btn:hover,
.btn-neutral:hover {
    background: var(--tg-primary-container);
    color: var(--tg-text);
}

.trackglance-lockup {
    display: flex;
    max-width: 520px;
    min-height: 160px;
    margin: 0 auto 2rem;
    padding: 24px;
    align-items: center;
    gap: 24px;
    border: 1px solid var(--tg-border);
    border-radius: 12px;
    background: var(--tg-surface);
    box-shadow: 0 8px 24px var(--tg-shadow);
}

.trackglance-lockup__mark {
    width: 112px;
    height: 112px;
    flex: 0 0 auto;
    border-radius: 24px;
}

.trackglance-lockup__name,
.trackglance-lockup__bridge {
    display: block;
    line-height: 1.1;
}

.trackglance-lockup__name {
    color: var(--tg-text);
    font-size: 2rem;
    font-weight: 750;
}

.trackglance-lockup__bridge {
    margin-top: 8px;
    color: var(--tg-primary);
    font-size: 1.35rem;
    font-weight: 650;
    letter-spacing: 0.18em;
}

@media (max-width: 480px) {
    .trackglance-lockup {
        padding: 16px;
        gap: 16px;
    }

    .trackglance-lockup__mark {
        width: 80px;
        height: 80px;
        border-radius: 18px;
    }

    .trackglance-lockup__name {
        font-size: 1.5rem;
    }
}

.watch-pair {
    display: grid;
    max-width: 520px;
    margin: 1.75rem auto 2.25rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    align-items: end;
}

.watch-pair__watch {
    display: flex;
    position: relative;
    min-width: 0;
    margin: 34px 0;
    flex-direction: column;
    align-items: center;
}

.watch-pair__watch::before,
.watch-pair__watch::after {
    position: absolute;
    left: 31%;
    width: 38%;
    height: 42px;
    content: "";
    background: linear-gradient(90deg, #202326, #3b4145 50%, #202326);
}

.watch-pair__watch::before {
    top: -32px;
}

.watch-pair__watch::after {
    bottom: 2px;
}

.watch-pair__case {
    position: relative;
    z-index: 1;
    padding: 8px;
    background: linear-gradient(145deg, #737b80, #25292c 38%, #111315 72%, #555d62);
    box-shadow: 0 10px 24px var(--tg-shadow), inset 0 0 0 2px #0c0d0e;
}

.watch-pair__case img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0;
    border: 2px solid #080909;
}

.watch-pair__watch--emery .watch-pair__case {
    border-radius: 18px;
}

.watch-pair__watch--emery .watch-pair__case img {
    width: 124px;
    border-radius: 9px;
}

.watch-pair__watch--gabbro .watch-pair__case,
.watch-pair__watch--gabbro .watch-pair__case img {
    border-radius: 50%;
}

.watch-pair__watch--gabbro .watch-pair__case img {
    width: 148px;
}

.watch-pair figcaption {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--tg-surface);
    color: var(--tg-muted);
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 420px) {
    .watch-pair {
        gap: 12px;
    }

    .watch-pair__watch--emery .watch-pair__case img {
        width: 96px;
    }

    .watch-pair__watch--gabbro .watch-pair__case img {
        width: 116px;
    }

    .watch-pair figcaption {
        font-size: 0.78rem;
    }
}

.watch-hero {
    margin: 2rem auto 2.5rem;
    text-align: center;
}

.watch-hero__strap {
    display: inline-flex;
    position: relative;
    padding: 78px 28px;
    justify-content: center;
    background: linear-gradient(90deg, transparent 25%, #202326 25%, #353a3e 50%, #202326 75%, transparent 75%);
}

.watch-hero__strap::before,
.watch-hero__strap::after {
    position: absolute;
    left: 25%;
    width: 50%;
    height: 2px;
    content: "";
    background: rgba(255, 255, 255, 0.14);
}

.watch-hero__strap::before {
    top: 44px;
}

.watch-hero__strap::after {
    bottom: 44px;
}

.watch-hero__case {
    position: relative;
    z-index: 1;
    padding: 13px;
    background: linear-gradient(145deg, #737b80, #25292c 38%, #111315 72%, #555d62);
    box-shadow: 0 18px 30px rgba(38, 50, 56, 0.3), inset 0 0 0 2px #0c0d0e;
}

.watch-hero__case img {
    display: block;
    margin: 0;
    border: 2px solid #080909;
}

.watch-hero--emery .watch-hero__case {
    border-radius: 27px;
}

.watch-hero--emery .watch-hero__case img {
    width: 200px;
    border-radius: 13px;
}

.watch-hero--gabbro .watch-hero__strap {
    padding-top: 64px;
    padding-bottom: 64px;
}

.watch-hero--gabbro .watch-hero__case,
.watch-hero--gabbro .watch-hero__case img {
    border-radius: 50%;
}

.watch-hero--gabbro .watch-hero__case img {
    width: 260px;
}

.watch-hero__button {
    position: absolute;
    width: 7px;
    height: 28px;
    border: 1px solid #090a0b;
    background: linear-gradient(90deg, #101214, #34393d);
}

.watch-hero__button--left {
    top: calc(50% - 14px);
    left: -7px;
    border-radius: 4px 0 0 4px;
}

.watch-hero__button--right-top,
.watch-hero__button--right-middle,
.watch-hero__button--right-bottom {
    right: -7px;
    border-radius: 0 4px 4px 0;
}

.watch-hero__button--right-top {
    top: 20%;
}

.watch-hero__button--right-middle {
    top: calc(50% - 14px);
}

.watch-hero__button--right-bottom {
    bottom: 20%;
}

.watch-hero--gabbro .watch-hero__button--right-top,
.watch-hero--gabbro .watch-hero__button--right-bottom {
    right: 16px;
}

.watch-hero--gabbro .watch-hero__button--right-top {
    top: 54px;
    transform: rotate(-32deg);
}

.watch-hero--gabbro .watch-hero__button--right-bottom {
    bottom: 54px;
    transform: rotate(32deg);
}

.watch-hero p {
    margin: 0.75rem 0 0;
    color: var(--tg-muted);
    font-size: 0.9rem;
}
