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

:root {
    --white: #ffffff;
    --ink: #111010;
    --ink-faint: #c0bbb0;
    --ink-mid: #7a756a;
    --dot-off: #e8e4dc;
    --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;
    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-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    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-back:hover {
    color: var(--ink);
}

.stage {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transform: translateY(12px);
    animation: fadeUp 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

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

.signin-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
}
.signin-gate .quote-rule {
    margin: 0;
}
.signin-gate[hidden] {
    display: none;
}

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

.signin-status {
    font-family: "DM Mono", monospace;
    font-size: 0.65rem;
    color: var(--ink-mid);
    text-align: center;
    max-width: 320px;
}
.signin-status[hidden] {
    display: none;
}

.identity-signin {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: none;
    border: 1px solid var(--dot-off);
    border-radius: 999px;
    padding: 0.7rem 1.4rem;
    font-family: "DM Mono", monospace;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    color: var(--ink-mid);
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        color 0.2s ease;
}
.identity-signin:hover {
    border-color: var(--ink-mid);
    color: var(--ink);
}
.identity-signin[hidden] {
    display: none;
}

.projects-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.projects-content[hidden] {
    display: none;
}

.projects-empty {
    text-align: center;
    color: var(--ink-mid);
}
.projects-empty i {
    font-size: 1.7rem;
    color: var(--ink-faint);
}
.quote-rule {
    width: 32px;
    height: 1px;
    background: var(--ink-faint);
    margin: 1.3rem auto;
}
.projects-empty p {
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    font-size: 1.05rem;
    color: var(--ink-mid);
}

.footer {
    position: sticky;
    bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    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 {
    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;
}

@media (max-width: 480px) {
    .footer-center {
        font-size: 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stage {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
