:root {
    color-scheme: light;
    --bg: #e1e2e0;
    --text: #111111;
    --text-soft: #3a3a3a;
    --line: #cccccc;
    --line-strong: #9a9a9a;
}

@font-face {
    font-family: 'ShareTechMono';
    src: url('/assets/fonts/ShareTechMono-Regular.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Unna';
    src: url('/assets/fonts/Unna-Regular.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'DMSerifText';
    src: url('/assets/fonts/DMSerifText-Regular.ttf') format('truetype');
    font-display: swap;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #e6e7e5 0%, var(--bg) 100%);
    color: var(--text);
    font-family: 'Unna', 'Georgia', serif;
    font-size: 22px;
    line-height: 1.75;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 34px 18px 48px;
}

.lab-shell,
.experiment-wrapper {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.lab-header,
.experiment-header {
    text-align: left;
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.lab-label,
.experiment-label,
.meta-heading {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    font-family: 'ShareTechMono', 'Courier New', monospace;
    font-size: 0.78rem;
    color: #222222;
}

.lab-title,
.experiment-header h1 {
    margin: 0 0 10px;
    font-family: 'DMSerifText', 'Times New Roman', serif;
    font-size: clamp(2.05rem, 4.4vw, 3.05rem);
    line-height: 1.18;
    color: #000000;
}

.lab-subtitle,
.experiment-summary {
    margin: 0 auto;
    max-width: 74ch;
    color: var(--text-soft);
    font-size: clamp(1.12rem, 1.95vw, 1.36rem);
    line-height: 1.68;
    text-align: center;
}

body.experiment-policy-page .experiment-summary {
    margin: 0;
    text-align: left;
}

.experiment-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
    padding: 0 0 18px;
    border-bottom: 1px solid var(--line);
}

.experiment-meta > div p {
    margin: 0;
}

.experiment-content {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.experiment-content section {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.experiment-content section + section {
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.experiment-content h2 {
    margin: 0 0 8px;
    font-family: 'DMSerifText', 'Times New Roman', serif;
    font-size: clamp(1.5rem, 2.7vw, 2rem);
    line-height: 1.25;
    color: #000000;
}

.experiment-content h3 {
    margin: 14px 0 8px;
    font-family: 'ShareTechMono', 'Courier New', monospace;
    font-size: clamp(0.88rem, 1.5vw, 0.98rem);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1a1a1a;
}

.experiment-content p,
.experiment-content li {
    margin-top: 0;
    margin-bottom: 10px;
    color: #111111;
    font-size: clamp(1.14rem, 1.9vw, 1.42rem);
    line-height: 1.8;
}

.experiment-content p:last-child,
.experiment-content li:last-child {
    margin-bottom: 0;
}

.experiment-content ul,
.experiment-content ol {
    margin: 0;
    padding-left: 24px;
}

.experiment-content code {
    font-family: 'ShareTechMono', 'Courier New', monospace;
    font-size: 0.86em;
    color: #000000;
    background: #f3f3f3;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 2px 6px;
}

.lab-link,
.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 26px;
    padding: 10px 18px;
    border: 1px solid #111111;
    border-radius: 999px;
    background: #e3e4e2;
    color: #111111;
    text-decoration: none;
    text-transform: uppercase;
    font-family: 'ShareTechMono', 'Courier New', monospace;
    letter-spacing: 1px;
    font-size: 0.78rem;
    font-weight: 600;
}

.lab-link:hover,
.lab-link:focus-visible,
.back-link:hover,
.back-link:focus-visible {
    background: #111111;
    color: #ffffff;
}

.site-footer {
    margin: 36px auto 0;
    text-align: center;
    font-size: 0.82rem;
    font-family: 'ShareTechMono', 'Courier New', monospace;
    letter-spacing: 1px;
    color: #3d3d3d;
}

.site-footer a {
    margin-left: 10px;
    color: #111111;
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    text-decoration: underline;
}

.return-home {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 30;
    display: inline-flex;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: #e3e4e2;
    border: 1px solid #1a1a1a;
}

.return-home img {
    width: 34px;
    height: 34px;
}

.return-home:focus-visible {
    outline: 2px solid #000000;
    outline-offset: 3px;
}

.icon-click-feedback {
    animation: icon-click-highlight 1s ease;
}

@keyframes icon-click-highlight {
    0% {
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
        transform: scale(1);
    }
    35% {
        box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.16), 0 0 0 10px rgba(0, 0, 0, 0.08);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
        transform: scale(1);
    }
}

.experiment-nav {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 30;
    display: flex;
    gap: 10px;
}

.experiment-nav .return-home {
    position: static;
}

.auto-up-button {
    position: fixed;
    left: calc(100vw - 68px);
    bottom: 24px;
    z-index: 32;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid #1a1a1a;
    background: #e3e4e2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
    transition: left 0.38s linear, transform 0.2s ease, box-shadow 0.2s ease;
}

.auto-up-button:hover,
.auto-up-button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.34);
}

.auto-up-button img {
    width: 26px;
    height: 26px;
}

.auto-up-button.is-context {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.36);
}

@media (max-width: 900px) {
    body {
        font-size: 21px;
        padding: 88px 14px 30px;
    }

    .experiment-meta {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 560px) {
    .experiment-nav {
        top: 12px;
        right: 12px;
        gap: 8px;
    }

    .return-home {
        width: 44px;
        height: 44px;
    }

    .return-home img {
        width: 28px;
        height: 28px;
    }

    .auto-up-button {
        width: 42px;
        height: 42px;
        bottom: 16px;
    }

    .auto-up-button img {
        width: 22px;
        height: 22px;
    }

    .site-footer {
        line-height: 1.6;
        padding: 0 8px;
    }
}
