*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --white: #ffffff;
    --ink: #111010;
    --ink-faint: #c0bbb0;
    --ink-mid: #7a756a;
    --dot-off: #e8e4dc;
    --dot-on: #8a7f6f;
    --bar-height: 44px;
}

html,
body {
    height: 100%;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--white);
    color: var(--ink);
    font-family: "EB Garamond", Georgia, serif;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 180px 180px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: env(safe-area-inset-top, 0px) 2rem 0;
    height: calc(var(--bar-height) + env(safe-area-inset-top, 0px));
    background-color: var(--white);
}

.nav-icon-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.nav-logo,
.nav-link,
.nav-gallery {
    font-family: "DM Mono", monospace;
    font-size: 0.6rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: var(--ink-mid);
    text-decoration: none;
    transition: color 0.2s ease;
}
.nav-logo:hover,
.nav-link:hover,
.nav-gallery:hover {
    color: var(--ink);
}

.nav-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
}

.stage {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 2.5rem 1.5rem 3rem;
}

.doc-wrap {
    width: 100%;
    max-width: 640px;
    opacity: 0;
    transform: translateY(12px);
    animation: fadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.doc-title {
    font-family: "EB Garamond", Georgia, serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    color: var(--ink);
    letter-spacing: 0.01em;
}

.doc-updated {
    margin-top: 0.5rem;
    font-family: "DM Mono", monospace;
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    color: var(--ink-faint);
    text-transform: uppercase;
}

.quote-rule {
    width: 32px;
    height: 1px;
    background: var(--ink-faint);
    margin: 1.4rem 0 1.8rem;
}

.doc-wrap p {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--ink);
    margin-bottom: 1.1rem;
}

.doc-wrap h2 {
    font-family: "EB Garamond", Georgia, serif;
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--ink);
    margin: 2.2rem 0 0.8rem;
}

.doc-wrap ul {
    margin: 0 0 1.1rem 1.3rem;
}

.doc-wrap li {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--ink);
    margin-bottom: 0.4rem;
}

.doc-wrap a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.doc-wrap a:hover {
    color: var(--ink-mid);
}

.footer {
    position: sticky;
    bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem env(safe-area-inset-bottom, 0px);
    height: calc(var(--bar-height) + env(safe-area-inset-bottom, 0px));
    background-color: var(--white);
}

.footer-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
}

.footer-copy {
    font-family: "DM Mono", monospace;
    font-size: 0.55rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    color: var(--ink-mid);
}

.footer-legal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-mid);
    font-size: 0.7rem;
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}
.footer-legal-icon:hover {
    opacity: 1;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.footer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-mid);
    font-size: 0.8rem;
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}
.footer-icon:hover {
    opacity: 1;
}

@media (max-width: 480px) {
    .footer-center {
        display: none;
    }
    .doc-wrap p,
    .doc-wrap li {
        font-size: 0.92rem;
    }
}
