:root {
    --bg: #ffffff;
    --text: #000000;
    --muted: #aaa;
    --border: #f6f6f6;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --text: #ffffff;
        --muted: #aaa;
        --border: #222222;
    }
}

/* Dark Mode */
html.theme-dark {
    --bg: #000000;
    --text: #ffffff;
    --muted: #aaa;
    --border: #222222;
}


/* =========================
   Base
   ========================= */

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

/* =========================
   Content wrapper
   ========================= */

.wrap {
    max-width: 940px;
    width: 90%;
    margin: 200px auto 0;
}

/* =========================
   Typography
   ========================= */

p, h1 {
    font-size: 64px;
    font-weight: 400;
    letter-spacing: -0.03em;
    margin: 64px 0 0.2em;
    color: var(--text);
}

h2 {
    font-size: 28px;
    font-weight: 500;
    color: var(--muted);
    margin-top: 64px;
}

.case-text {
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin: 16px 0 0.2em;
}

a {
    text-decoration: none;
    color: var(--text);
    transition: color 0.2s;
}

a:hover {
    text-decoration: underline;
}

a:hover {
    color: var(--text);
}

/* =========================
   Media
   ========================= */

.wrap img,
.wrap video {
    width: 100%;
    margin-top: 60px;
    margin-bottom: 60px;
    display: block;
}

#small-video {
    width: 640px;
    margin: 0 auto;
    position: relative;
    z-index: -1;
}

.last-img {
    padding-bottom: 100px;
}

/* =========================
   Project meta
   ========================= */

.project-meta {
    width: 96%;
    margin: 0 auto;
}

.project-meta__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 0fr;
    gap: 32px;
    margin-bottom: 80px;
}

.project-meta__item {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 16px;
    font-size: 16px;
    line-height: 24px;
}

.project-meta dt {
    color: var(--muted);
    white-space: nowrap;
}

.project-meta dd {
    margin: 0;
    color: var(--text);
}

.project-meta__item--right {
    justify-self: end;
    text-align: right;
}

/* =========================
   Footer
   ========================= */

#bottom-menu {
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 12px 0 16px;
    text-align: center;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

#bottom-menu a {
    font-size: 18px;
    color: var(--muted);
    letter-spacing: -0.02em;
    padding: 8px;
    transition: color 0.2s, opacity 0.2s;
}

#bottom-menu a:hover {
    color: var(--text);
    opacity: 1;
    text-decoration: none;
}


/* Floating button */
#floating-button-cases {
    opacity: 0;
    padding: 12px 12px 12px 16px;
    pointer-events: none;
    background-color: rgba(255,255,255,0.8);
    position: fixed;
    bottom: 64px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    border-radius: 24px;
    backdrop-filter: blur(4px);
    border: 1px solid white;
    transition: .2s;
}
#floating-button-cases:hover { bottom: 68px; text-decoration: none; }

#floating-button-cases.show { opacity: 1; pointer-events: auto; }


/* Intro two-column block */
.intro-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 64px;
    margin-top: 80px;
    margin-bottom: 80px;

}

.intro-grid p {
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    margin: 0;
}

.timeline-date {
    color: var(--muted);
}

.timeline-text {
    color: var(--text);
}

.intro-muted {
    color: var(--muted);
}

@media (max-width: 640px) {
    .intro-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        margin-top: 48px;
    }
}


/* =========================
   Mobile
   ========================= */

   @media (max-width: 640px) {

    body {
        font-size: 16px;
    }

    .wrap {
        margin-top: 80px;
        width: 92%;
    }

    p, h1 {
        font-size: 28px;
        letter-spacing: -0.02em;
        margin-top: 32px;
    }

    h2, .case-text {
        font-size: 20px;
    }

    .project-meta {
        width: 92%;
    }

    .project-meta__grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 48px;
    }

    .project-meta__item {
        grid-template-columns: 1fr;
        row-gap: 4px;
    }

    .project-meta dt {
        font-size: 16px;
    }

    .project-meta dd {
        font-size: 16px;
    }

    #small-video {
        width: 100%;
        margin-top: 24px;
    }

    .last-img {
        padding-bottom: 48px;
    }

    #bottom-menu {
        position: static;
        padding: 16px 0;
    }

    #bottom-menu a {
        font-size: 16px;
    }

    #floating-button-cases {
        bottom: 20px;
    }
}