:root {
    --bg: #03060c;
    --bg-light: #0a101b;

    --text: #f0eee9;
    --text-muted: #a9adb6;

    --copper: #c88768;
    --copper-light: #e0a080;
    --copper-dark: #805443;

    /* Link palette sampled from the warm copper/peach used in
       “Time” and “Essence” in the Time App banner. */
    --link-copper: #d9a58d;
    --link-copper-hover: #ebc1ab;
    --link-copper-underline: rgba(217, 165, 141, 0.58);

    --border: rgba(210, 146, 111, 0.28);

    --shadow:
        0 0 40px rgba(177, 119, 90, 0.08),
        0 20px 60px rgba(0, 0, 0, 0.55);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;

    display: flex;
    flex-direction: column;
    align-items: center;

    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background:
        radial-gradient(
            circle at 72% 18%,
            rgba(91, 116, 154, 0.13) 0,
            transparent 35%
        ),
        radial-gradient(
            circle at 28% 40%,
            rgba(164, 98, 68, 0.06) 0,
            transparent 30%
        ),
        linear-gradient(
            180deg,
            #02050a 0%,
            #050914 50%,
            #02040a 100%
        );

    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;

    background-image:
        radial-gradient(circle, rgba(255,255,255,.55) 0 1px, transparent 1.2px),
        radial-gradient(circle, rgba(255,255,255,.25) 0 1px, transparent 1.2px);

    background-size:
        173px 173px,
        251px 251px;

    background-position:
        18px 41px,
        106px 124px;

    opacity: 0.22;
}

main {
    position: relative;
    z-index: 1;

    width: min(1120px, 100%);
    min-height: calc(100dvh - 80px);

    padding:
        clamp(24px, 5vh, 64px)
        clamp(18px, 4vw, 48px)
        40px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero {
    width: 100%;
    text-align: center;
}

.logo-wrap {
    position: relative;

    width: min(100%, 1024px);
    margin: 0 auto;

    border-radius: 20px;
    overflow: hidden;

    box-shadow: var(--shadow);
}

.logo-wrap::after {
    content: "";
    position: absolute;
    inset: 0;

    border: 1px solid rgba(231, 177, 147, 0.16);
    border-radius: inherit;

    pointer-events: none;
}

.logo {
    display: block;

    width: 100%;
    height: auto;

    max-width: 1024px;

    object-fit: contain;
}

.content {
    width: min(680px, 100%);
    margin: clamp(28px, 5vh, 50px) auto 0;
}

.intro {
    margin: 0 auto clamp(26px, 4vh, 38px);

    color: var(--text-muted);

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: clamp(1rem, 2.4vw, 1.2rem);
    line-height: 1.7;

    letter-spacing: 0.015em;
}

.actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    row-gap: 24px;

    width: 100%;
}

.actions-row {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 14px;
    row-gap: 14px;
    column-gap: 14px;
    width: 100%;
}

.button {
    min-height: 58px;
    padding: 16px 26px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    flex: 1 1 0;

    border-radius: 12px;
    border: 1px solid var(--border);

    color: var(--text);
    text-decoration: none;

    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.025em;

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.035),
            rgba(255,255,255,0.015)
        );

    box-shadow:
        inset 0 1px rgba(255,255,255,0.04),
        0 8px 26px rgba(0,0,0,0.25);

    transition:
        transform 160ms ease,
        border-color 160ms ease,
        background 160ms ease,
        box-shadow 160ms ease;
}

.button:hover {
    transform: translateY(-2px);

    border-color: rgba(224, 160, 128, 0.65);

    background:
        linear-gradient(
            180deg,
            rgba(200,135,104,0.14),
            rgba(200,135,104,0.05)
        );

    box-shadow:
        0 10px 32px rgba(0,0,0,0.38),
        0 0 22px rgba(200,135,104,0.07);
}

.button:active {
    transform: translateY(0);
}

.button:focus-visible {
    outline: 2px solid var(--copper-light);
    outline-offset: 4px;
}

.button-primary {
    color: #fff7f2;

    border-color: rgba(224, 160, 128, 0.48);

    background:
        linear-gradient(
            135deg,
            rgba(150, 91, 64, 0.50),
            rgba(91, 57, 48, 0.35)
        );
}

.icon {
    width: 20px;
    height: 20px;

    flex: 0 0 auto;

    stroke: currentColor;
    stroke-width: 1.7;
    fill: none;

    opacity: 0.92;
}

footer {
    position: relative;
    z-index: 1;

    width: 100%;

    padding:
        20px
        max(20px, env(safe-area-inset-right))
        max(24px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));

    color: rgba(210, 214, 222, 0.42);

    text-align: center;

    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.accent {
    color: var(--copper-light);
}

/* Document pages (Privacy, History, Hypothesis) */

.doc-main {
    justify-content: flex-start;
}

.doc-shell {
    width: min(860px, 100%);
    margin: 0 auto;
}

.doc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.doc-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 24px;
}

.brand-link {
    color: var(--text);
    text-decoration: none;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.3rem, 3vw, 2rem);
    letter-spacing: 0.01em;
}

.brand-link span {
    color: var(--copper-light);
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
}

.back-link:hover {
    color: var(--copper-light);
}

.doc-card {
    border: 1px solid var(--border);
    border-radius: 18px;

    padding: clamp(24px, 5vw, 48px);

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.028),
            rgba(255,255,255,0.012)
        );

    box-shadow: var(--shadow);
}

.doc-card h1 {
    margin: 0 0 8px;

    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 6vw, 3.4rem);
    font-weight: 400;
    letter-spacing: -0.02em;
}

.doc-meta {
    margin: 0 0 36px;
    color: var(--copper-light);
    font-size: 0.94rem;
    letter-spacing: 0.04em;
}

.doc-intro {
    color: var(--text-muted);
    font-size: 1.03rem;
    line-height: 1.75;
}

.doc-section {
    padding-top: 28px;
    margin-top: 28px;
    border-top: 1px solid rgba(210, 146, 111, 0.14);
}

.doc-section h2 {
    margin: 0 0 14px;

    color: var(--copper-light);

    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.doc-section p {
    margin: 0 0 14px;
    color: var(--text-muted);
    line-height: 1.75;
}

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

.contact-block {
    margin-top: 14px;
    padding: 18px 20px;

    border: 1px solid rgba(210, 146, 111, 0.18);
    border-radius: 12px;

    background: rgba(255,255,255,0.018);
}

.contact-block p {
    margin: 0;
}

.contact-block a {
    color: var(--copper-light);
    text-decoration: none;
}

.contact-block a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    main {
        min-height: calc(100dvh - 65px);

        padding-top: 24px;
        padding-bottom: 28px;

        justify-content: center;
    }

    .logo-wrap {
        border-radius: 13px;
    }

    .content {
        margin-top: 28px;
    }

    .intro {
        width: 92%;
        line-height: 1.55;
    }

    .actions {
        gap: 24px;
    }

    .actions-row {
        flex-direction: column;
        gap: 0;
    }

    .actions-row > * + * {
        margin-top: 14px;
    }

    .button {
        width: 100%;
        min-height: 56px;
    }

    .doc-main {
        justify-content: flex-start;
    }

    .doc-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .doc-card {
        border-radius: 14px;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    main {
        justify-content: flex-start;

        padding-top: 20px;
        padding-bottom: 24px;
    }

    .logo-wrap {
        width: min(76vw, 820px);
    }

    .content {
        margin-top: 20px;
    }

    .intro {
        margin-bottom: 18px;
        font-size: 0.95rem;
    }

    .button {
        min-height: 48px;
        padding: 12px 22px;
    }

    footer {
        padding-top: 12px;
        padding-bottom: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Banner-matched hypothesis links */

/*
 * Avoid the browser-default blue/purple hyperlink palette inside the
 * research document.  #d9a58d is a light copper-peach taken from the
 * brighter mid-tones of the “Time” / “Essence” lettering, giving good
 * separation from the dark background without looking neon.
 */
.hypothesis-card a,
.hypothesis-card a:visited {
    color: var(--link-copper);
    text-decoration-color: var(--link-copper-underline);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.hypothesis-card a:hover,
.hypothesis-card a:focus-visible {
    color: var(--link-copper-hover);
    text-decoration-color: var(--link-copper-hover);
}

.hypothesis-card a:focus-visible {
    outline: 2px solid rgba(235, 193, 171, 0.8);
    outline-offset: 3px;
    border-radius: 3px;
}

/* Keep the privacy-page contact links in the same family. */
.contact-block a,
.contact-block a:visited {
    color: var(--link-copper);
}

.contact-block a:hover,
.contact-block a:focus-visible {
    color: var(--link-copper-hover);
}
/* Global branded text-link fallback */

/*
 * Ensures ordinary hyperlinks never fall back to browser-default blue/purple.
 * Class-specific styles such as .button and .brand-link remain in control
 * because they have higher selector specificity.
 */
a:not(.button):not(.brand-link) {
    color: var(--link-copper);
    text-decoration-color: var(--link-copper-underline);
}

a:not(.button):not(.brand-link):visited {
    color: var(--link-copper);
}

a:not(.button):not(.brand-link):hover,
a:not(.button):not(.brand-link):focus-visible {
    color: var(--link-copper-hover);
    text-decoration-color: var(--link-copper-hover);
}

/* History page styles */

.history-kicker {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--copper-light);
    margin-bottom: 12px;
}

.history-list {
    margin: 16px 0;
    padding-left: 1.5rem;
    color: var(--text-muted);
    line-height: 1.75;
}

.history-list li {
    margin-bottom: 12px;
}

.history-list li:last-child {
    margin-bottom: 0;
}

.history-closing {
    margin-top: 20px;
    color: var(--copper-light);
    font-style: italic;
}

.history-cta {
    margin-top: 20px;
}

/* Hierarchical hypothesis table of contents */

.toc-hierarchical {
    display: block;
    margin-top: 30px;
    overflow: hidden;

    border: 1px solid rgba(217, 165, 141, 0.24);
    border-radius: 14px;

    background:
        linear-gradient(
            180deg,
            rgba(217, 165, 141, 0.055),
            rgba(255, 255, 255, 0.012)
        );
}

.toc-hierarchical .hypothesis-toc-title {
    padding: 18px 22px 12px;

    border-bottom: 0;

    color: var(--text);

    font-size: 0.93rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.toc-overview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;

    margin: 0 22px 18px;
    padding: 11px 13px;

    border: 1px solid rgba(217, 165, 141, 0.14);
    border-radius: 9px;

    color: rgba(240, 238, 233, 0.66);
    background: rgba(0, 0, 0, 0.16);

    font-size: 0.82rem;
    line-height: 1.5;
}

.toc-overview-label {
    color: var(--link-copper);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.toc-root,
.toc-stage-children,
.toc-part-children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-root {
    padding: 0 22px 22px;
}

.toc-stage {
    margin-top: 18px;
}

.toc-stage:first-child {
    margin-top: 0;
}

.toc-stage > a {
    display: block;

    padding: 10px 12px;

    border-left: 3px solid var(--link-copper);
    border-radius: 0 8px 8px 0;

    color: var(--link-copper-hover) !important;
    background:
        linear-gradient(
            90deg,
            rgba(217, 165, 141, 0.11),
            rgba(217, 165, 141, 0.018)
        );

    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none !important;
}

.toc-stage > a:hover,
.toc-stage > a:focus-visible {
    background:
        linear-gradient(
            90deg,
            rgba(235, 193, 171, 0.16),
            rgba(235, 193, 171, 0.025)
        );
}

.toc-stage-children {
    margin: 8px 0 0 16px;
    padding-left: 16px;

    border-left: 1px solid rgba(217, 165, 141, 0.18);
}

.toc-part {
    margin-top: 15px;
}

.toc-part > a {
    display: block;
    margin-left: -5px;
    padding: 4px 8px;

    color: #e5b79f !important;

    font-size: 0.84rem;
    font-weight: 750;
    letter-spacing: 0.055em;
    line-height: 1.45;
    text-transform: uppercase;
    text-decoration: none !important;
}

.toc-part > a::before {
    content: "◆";
    margin-right: 8px;

    color: rgba(217, 165, 141, 0.62);

    font-size: 0.58rem;
    vertical-align: 0.12em;
}

.toc-part-children {
    margin: 5px 0 0 11px;
    padding-left: 15px;

    border-left: 1px solid rgba(217, 165, 141, 0.12);
}

.toc-section {
    margin: 2px 0;
}

.toc-section > a {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    align-items: baseline;
    gap: 6px;

    padding: 5px 8px;

    border-radius: 6px;

    color: #d9a58d !important;

    font-size: 0.91rem;
    line-height: 1.42;
    text-decoration: none !important;
}

.toc-section > a:hover,
.toc-section > a:focus-visible {
    color: #ebc1ab !important;
    background: rgba(217, 165, 141, 0.065);
}

.toc-number {
    color: rgba(235, 193, 171, 0.72);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.toc-label {
    min-width: 0;
}

.toc-subpoint {
    margin: 2px 0 2px 3.1rem;
    padding-left: 10px;

    border-left: 1px dotted rgba(217, 165, 141, 0.22);

    color: rgba(169, 173, 182, 0.72);

    font-size: 0.79rem;
    line-height: 1.4;
}

.toc-appendix {
    margin: 3px 0;
}

.toc-appendix > a {
    display: block;
    padding: 5px 8px 5px 12px;

    color: #d9a58d !important;

    font-size: 0.89rem;
    line-height: 1.4;
    text-decoration: none !important;
}

.toc-appendix > a::before {
    content: "↳";
    margin-right: 8px;
    color: rgba(217, 165, 141, 0.54);
}

.toc-appendix > a:hover,
.toc-appendix > a:focus-visible {
    color: #ebc1ab !important;
    background: rgba(217, 165, 141, 0.055);
}

@media (min-width: 900px) {
    .toc-root {
        padding-right: 26px;
    }
}

@media (max-width: 720px) {
    .toc-hierarchical {
        margin-top: 24px;
    }

    .toc-root {
        padding: 0 14px 16px;
    }

    .toc-hierarchical .hypothesis-toc-title {
        padding-left: 16px;
        padding-right: 16px;
    }

    .toc-overview {
        margin-left: 16px;
        margin-right: 16px;
    }

    .toc-stage-children {
        margin-left: 9px;
        padding-left: 10px;
    }

    .toc-part-children {
        margin-left: 5px;
        padding-left: 9px;
    }

    .toc-section > a {
        grid-template-columns: 1.9rem minmax(0, 1fr);
        padding-left: 4px;
        padding-right: 4px;
    }

    .toc-subpoint {
        margin-left: 2.25rem;
    }
}

/* ── Secondary actions (subtle link row) ──────────────────────── */

.secondary-actions {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

.link-subtle {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--text-muted, rgba(255,255,255,0.38));
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 160ms ease;
}

.link-subtle:hover {
    color: var(--text, rgba(255,255,255,0.7));
}

/* button element reset to match .button anchor style */
button.button {
    cursor: pointer;
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.035),
            rgba(255,255,255,0.015)
        );
    font-family: inherit;
}

/* ── YouTube Video Modal ──────────────────────────────────────── */

.video-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.video-modal.is-open {
    display: flex;
}

.video-modal-inner {
    position: relative;
    width: 100%;
    max-width: 860px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 32px 80px rgba(0,0,0,0.6),
        0 0 0 1px rgba(255,255,255,0.06);
    animation: modal-in 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.video-embed-wrap {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    background: #000;
}

.video-embed-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    color: rgba(255,255,255,0.85);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;

    transition: background 160ms ease, color 160ms ease;
}

.video-modal-close:hover {
    background: rgba(200,135,104,0.35);
    color: #fff;
}

/* Warning / Outdated Version Banner */
.warning-banner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 32px;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.06) 100%);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
    color: var(--text);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.warning-banner-icon {
    flex-shrink: 0;
    color: #f59e0b;
    margin-top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.warning-banner-content {
    flex: 1;
}

.warning-banner-title {
    display: block;
    color: #fbbf24;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.warning-banner-text {
    margin: 0;
    color: #e2e8f0;
    font-size: 0.96rem;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .warning-banner {
        gap: 12px;
        padding: 14px 16px;
        margin-bottom: 24px;
    }

    .warning-banner-text {
        font-size: 0.9rem;
    }
}

