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

:root {
    --sb-track: #EFE8DB;
    --sb-thumb: rgba(58, 30, 20, 0.3);
    --sb-thumb-hover: rgba(58, 30, 20, 0.6);
}

html {
    background-color: #EFE8DB;
    color: #3A1E14;
}

body {
    font-family: 'Roboto Mono', monospace;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100dvh;
    background: transparent;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-color: #EFE8DB;
    background-image: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.6) 40%, rgba(58, 30, 20, 0.2) 100%);
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--sb-track); }
::-webkit-scrollbar-thumb { background: var(--sb-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--sb-thumb-hover); }
html { scrollbar-color: var(--sb-thumb) var(--sb-track); scrollbar-width: thin; }

.noble-f { color: #D44532; font-weight: 900; }
.slogan .noble-f { color: #A32616; -webkit-text-stroke: 1.5px #A32616; }

header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(239, 232, 219, 0.55);
}

.slogan {
    font-family: 'Playfair Display', serif;
    opacity: 0.9;
    font-size: 1.65rem;
    color: inherit;
    text-decoration: none;
}

.slogan i { font-style: italic; font-weight: 400; }
.slogan strong {
    font-weight: 700;
    letter-spacing: 1.3px;
    font-family: 'Roboto Mono', monospace;
    animation: factums-brand-pulse 4s ease-in-out infinite;
}

@keyframes factums-brand-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.1; }
}

@media (prefers-reduced-motion: reduce) {
    .slogan strong { animation: none; }
}

.header-login-btn {
    --btn-color: #3A1E14;
    --btn-bg: #EFE8DB;
    position: relative;
    color: var(--btn-color);
    text-decoration: none;
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 4px 8px;
    z-index: 1;
    transition: color 0.3s ease;
}

.header-login-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--btn-color);
    transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
    z-index: -1;
}

.header-login-btn:hover { color: var(--btn-bg); }
.header-login-btn:hover::after { height: 100%; }

.page-main {
    max-width: 820px;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
}

.page-main--wide {
    max-width: 902px;
}

.page-kicker {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.65;
    margin-bottom: 0.85rem;
}

.page-kicker a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(58, 30, 20, 0.28);
}

.page-kicker a:hover { border-bottom-color: #3A1E14; }

.page-main h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.35rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2.5rem;
}

.page-main h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    font-weight: 700;
    margin: 2.75rem 0 1.15rem;
    scroll-margin-top: 6.5rem;
}

.page-main h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.75rem 0 0.85rem;
}

.page-main p {
    font-size: 1.02rem;
    line-height: 1.7;
    opacity: 0.92;
    margin-bottom: 1.1rem;
}

.page-main ul {
    list-style: none;
    margin: 0 0 1.25rem;
}

.page-main li {
    font-size: 1.02rem;
    line-height: 1.65;
    opacity: 0.92;
    padding-left: 1.15rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.page-main li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 1px;
    background: #D44532;
}

.page-main li strong { font-weight: 700; }

.page-footer {
    padding: 4rem 2rem 4rem;
    text-align: center;
}

.page-footer h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.page-footer p {
    max-width: 660px;
    margin: 0 auto;
    opacity: 0.8;
    line-height: 1.6;
    font-size: 1rem;
}

.page-footer__home {
    display: inline-block;
    margin-top: 2rem;
    position: relative;
    isolation: isolate;
    background: #F7F3EB;
    color: #3A1E14;
    border: 1px solid rgba(58, 30, 20, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(58, 30, 20, 0.05);
    padding: 1.2rem 2.5rem;
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.45, 0, 0.55, 1);
    will-change: transform;
}

.page-footer__home::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 8px;
    border: 1px solid rgba(58, 30, 20, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.45, 0, 0.55, 1);
}

.page-footer__home::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 16px 24px rgba(36, 21, 17, 0.42), 0 32px 64px rgba(36, 21, 17, 0.38);
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.4s cubic-bezier(0.45, 0, 0.55, 1);
}

.page-footer__home:hover,
.page-footer__home:focus-visible {
    opacity: 1;
    transform: translateY(-4px);
}

.page-footer__home:hover::before,
.page-footer__home:focus-visible::before { opacity: 1; }

.page-footer__home:hover::after,
.page-footer__home:focus-visible::after { opacity: 1; }

.page-footer__copy {
    margin-top: 4rem;
    font-size: 0.8rem;
    opacity: 0.5;
}

.page-404-graph {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}

.page-404-graph__edges line {
    stroke: #2C3539;
    stroke-width: 1.5;
    opacity: 0.3;
}

.page-404-graph__nodes circle {
    fill: #2C3539;
}

.page-404 {
    position: relative;
    z-index: 1;
    min-height: calc(100dvh - 6.5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem 3.5rem;
    max-width: 42rem;
    margin: 0 auto;
}

.page-404__copy {
    position: relative;
    padding: 2.75rem 3.15rem 3rem;
    max-width: 100%;
}

.page-404__copy::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(
        ellipse 74% 70% at 50% 50%,
        #F7F3EB 0%,
        rgba(247, 243, 235, 0.88) 38%,
        rgba(247, 243, 235, 0.28) 68%,
        rgba(247, 243, 235, 0) 100%
    );
}

.page-404 .page-404__code {
    font-family: 'Playfair Display', serif;
    font-size: clamp(5.5rem, min(20vw, 22vh), 10rem);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -0.04em;
    margin: 0.15rem 0 -0.35rem;
    color: #2C3539;
    opacity: 0.5;
    white-space: nowrap;
}

.page-404 h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.45rem, 3.2vw, 2.15rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1.25rem;
}

.page-404 p {
    font-size: 1.02rem;
    line-height: 1.7;
    opacity: 0.92;
    margin-bottom: 0;
}

.page-404 .page-footer__home {
    margin-top: 0.35rem;
    padding: 1.15rem 3.4rem;
}

@media (prefers-reduced-motion: reduce) {
    .page-footer__home {
        transition: none;
        will-change: auto;
    }

    .page-footer__home:hover,
    .page-footer__home:focus-visible { transform: none; }
}

@media (max-width: 768px) {
    header { padding: 1rem; }
    .slogan { font-size: 0.9rem; max-width: 70%; line-height: 1.3; }
    .header-login-btn { font-size: 0.85rem; }
    .page-main { padding: 1.5rem 1.15rem 3rem; }
    .page-main h1 { font-size: 1.7rem; margin-bottom: 1.75rem; }
    .page-main h2 { font-size: 1.4rem; }
    .page-main h3 { font-size: 1.12rem; }
    .page-main p,
    .page-main li { font-size: 0.95rem; }
    .page-footer { padding: 3rem 1rem 4rem; }
    .page-footer h2 { font-size: 1.5rem; }
    .page-footer__home { width: 100%; max-width: 22rem; padding: 1rem; font-size: 0.9rem; }
    .page-404 { min-height: calc(100dvh - 5.5rem); padding: 1.5rem 1.15rem 3rem; }
    .page-404__copy { padding: 2.4rem 1.4rem; }
    .page-404 p { font-size: 0.95rem; }
    .page-404 .page-404__code { font-size: clamp(4.75rem, min(28vw, 18vh), 7.5rem); }
    .page-404 .page-footer__home { width: auto; max-width: none; padding: 1.1rem 2.6rem; }
    body:has(.page-404) .slogan { max-width: none; }
}
