:root {
    color-scheme: light;
    --background: #f3f0e8;
    --text: #20231f;
    --muted: #62675f;
    --accent: #a33a2b;
    --line: #cbc7bb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
}

.shell {
    width: min(100% - 40px, 960px);
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 84px;
    border-bottom: 1px solid var(--line);
}

.brand {
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-decoration: none;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    gap: 24px;
}

.site-nav a,
.text-link {
    color: var(--accent);
    text-underline-offset: 4px;
}

main {
    display: grid;
    align-content: center;
    min-height: calc(100vh - 164px);
    padding: 64px 0;
}

.eyebrow {
    margin: 0 0 16px;
    color: var(--accent);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1 {
    max-width: 780px;
    margin: 0;
    font-size: clamp(2.8rem, 8vw, 6.5rem);
    font-weight: 400;
    line-height: 0.95;
    letter-spacing: 0;
}

.intro {
    max-width: 600px;
    margin: 32px 0 0;
    color: var(--muted);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.1rem;
    line-height: 1.7;
}

.home-main {
    align-content: start;
    padding-top: clamp(64px, 10vh, 112px);
}

.home-hero h1 {
    max-width: none;
    font-size: clamp(4rem, 10vw, 7.5rem);
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: clamp(48px, 8vh, 80px);
}

.portal-item {
    min-width: 0;
}

.portal-card {
    display: grid;
    place-items: center;
    min-height: 230px;
    padding: 32px 20px;
    border: 1px solid var(--line);
    background: #faf8f2;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

a.portal-card:hover {
    border-color: var(--accent);
    background: #fffdf8;
    transform: translateY(-4px);
}

a.portal-card:focus-visible {
    outline: 3px solid rgb(163 58 43 / 28%);
    outline-offset: 3px;
}

.portal-card.is-disabled {
    color: #7d7f79;
    background: #e9e7e1;
    cursor: not-allowed;
    opacity: 0.62;
}

.portal-icon {
    width: 78px;
    height: 78px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.4;
}

.portal-status {
    margin: 12px 0 0;
    color: var(--muted);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
}

.site-footer {
    min-height: 80px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.85rem;
}

@media (max-width: 560px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 12px;
    }

    .site-nav {
        gap: 18px;
    }

    main {
        min-height: calc(100vh - 190px);
    }

    .home-main {
        padding-top: 52px;
    }

    .portal-grid {
        grid-template-columns: 1fr;
        margin-top: 44px;
    }

    .portal-card {
        min-height: 180px;
    }
}