:root {
    --ink: #33281f;
    --paper: #f4ede1;
    --white: #fffdf8;
    --muted: #7d7064;
    --line: #ded1c1;
    --accent: #b47b52;
    --sandstone: #8b6d54;
    --sandstone-deep: #68503e;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.login-page {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: var(--paper);
}

.login-page::before,
.login-page::after {
    content: "";
    position: fixed;
    width: min(62vw, 820px);
    aspect-ratio: 1;
    border-radius: 46% 54% 63% 37% / 42% 38% 62% 58%;
    filter: blur(72px);
    pointer-events: none;
}

.login-page::before {
    top: -32%;
    left: -18%;
    background: rgba(213, 168, 112, .34);
    animation: dune-one 34s ease-in-out infinite alternate;
}

.login-page::after {
    right: -22%;
    bottom: -38%;
    background: rgba(171, 108, 70, .22);
    animation: dune-two 43s ease-in-out infinite alternate;
}

.film-grain {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: .075;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='.62'/%3E%3C/svg%3E");
    background-size: 180px 180px;
}

.login-shell {
    min-height: 100vh;
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px 22px;
}

.wordmark {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .16em;
    text-decoration: none;
}

.wordmark span { color: var(--accent); }
.logo-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
}

.header-logo {
    display: block;
    width: 125px;
    height: auto;
}

.eyebrow {
    margin: 0 0 18px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.portal-shell > h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(48px, 7vw, 88px);
    font-weight: 400;
    line-height: .98;
    letter-spacing: -.045em;
}

.login-card {
    width: min(520px, 100%);
    padding: clamp(32px, 6vw, 52px);
    background: rgba(255, 253, 248, .94);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(83, 61, 43, .12);
    animation: card-arrival 2.25s cubic-bezier(.16, 1, .3, 1) both;
}

.login-logo {
    display: block;
    width: 340px;
    height: auto;
    margin: 0 auto 42px;
    animation: logo-arrival 2.7s .5s cubic-bezier(.16, 1, .3, 1) both;
}

.login-card .eyebrow {
    margin-bottom: 13px;
    text-align: center;
}

.login-card h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(35px, 8vw, 43px);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -.035em;
    text-align: center;
}

.form-intro {
    margin: 14px 0 32px;
    color: var(--muted);
    line-height: 1.6;
    text-align: center;
}

label {
    display: block;
    margin: 20px 0 8px;
    font-size: 13px;
    font-weight: 750;
}

input {
    width: 100%;
    height: 52px;
    padding: 0 15px;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 3px;
    font: inherit;
}

input:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(181,148,98,.18);
}

button,
.button-small {
    border: 0;
    border-radius: 3px;
    color: var(--white);
    background: var(--ink);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

button {
    width: 100%;
    height: 54px;
    margin-top: 26px;
}

button:hover,
.button-small:hover { background: #5a4637; }

.error {
    margin: 0 0 22px;
    padding: 13px 14px;
    color: #7d251e;
    background: #fae7e4;
    border: 1px solid #edc7c2;
    border-radius: 3px;
    font-size: 13px;
}

.site-header {
    height: 78px;
    padding: 0 clamp(24px, 5vw, 70px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.logout { color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.logout:hover { color: var(--ink); }

.portal-shell {
    width: min(1040px, calc(100% - 40px));
    margin: 0 auto;
    padding: 80px 0 100px;
}

.portal-shell > h1 { font-size: clamp(48px, 7vw, 76px); }
.portal-intro { margin: 18px 0 55px; color: var(--muted); font-size: 16px; }

.files-section {
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.section-heading {
    min-height: 68px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.section-heading h2 { margin: 0; font-size: 14px; }
.section-heading span { color: var(--muted); font-size: 12px; }

.file-row {
    min-height: 76px;
    padding: 13px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: inherit;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}

.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: #faf5ec; }

.file-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--accent);
    background: var(--paper);
    border-radius: 50%;
    font-weight: 800;
}

.file-main { min-width: 0; flex: 1; }
.file-main strong { display: block; overflow-wrap: anywhere; font-size: 14px; }
.file-main small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.file-action { color: var(--muted); font-size: 12px; font-weight: 800; }
.button-small { padding: 11px 15px; color: var(--white); }

.empty-state { padding: 55px 22px; color: var(--muted); text-align: center; }

footer { padding: 0 20px 35px; color: var(--muted); font-size: 11px; text-align: center; }

@keyframes dune-one {
    0% { transform: translate3d(-8%, -4%, 0) rotate(-8deg) scale(.9); }
    55% { transform: translate3d(32vw, 18vh, 0) rotate(24deg) scale(1.15); }
    100% { transform: translate3d(12vw, 46vh, 0) rotate(46deg) scale(.98); }
}

@keyframes dune-two {
    0% { transform: translate3d(7%, 8%, 0) rotate(12deg) scale(.92); }
    48% { transform: translate3d(-36vw, -22vh, 0) rotate(-20deg) scale(1.18); }
    100% { transform: translate3d(-14vw, -48vh, 0) rotate(-42deg) scale(1); }
}

@keyframes card-arrival {
    from { opacity: 0; transform: translateY(32px) scale(.985); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes logo-arrival {
    from { opacity: 0; transform: translateY(22px) scale(.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .login-page,
    .login-page::before,
    .login-page::after,
    .login-card,
    .login-logo {
        animation: none;
    }
}

@media (max-width: 760px) {
    .login-shell { padding: 22px 14px; }
    .login-card { padding: 34px 24px; }
    .login-logo { width: 240px; margin-bottom: 32px; }
    .site-header { height: 68px; padding: 0 20px; }
    .header-logo { width: 110px; }
    .portal-shell { width: calc(100% - 28px); padding: 55px 0 70px; }
    .portal-intro { margin-bottom: 35px; }
    .file-row { padding: 13px; }
    .button-small { padding: 10px 11px; }
}
