:root {
    color-scheme: dark;
    --bg: #0f1720;
    --panel: #172331;
    --panel-strong: #1f3145;
    --line: rgba(148, 163, 184, .22);
    --text: #edf5ff;
    --muted: #a7b4c5;
    --blue: #38bdf8;
    --green: #22c55e;
    --amber: #f59e0b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Pretendard, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.portal-shell {
    min-height: 100vh;
}

.portal-hero {
    position: relative;
    min-height: 58vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.portal-hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(15, 23, 32, .96) 0%, rgba(15, 23, 32, .78) 46%, rgba(15, 23, 32, .38) 100%),
        url("../homepage/main_bg.jpg") center / cover no-repeat;
    transform: scale(1.02);
}

.portal-nav,
.portal-hero-content {
    position: relative;
    z-index: 1;
}

.portal-nav {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
}

.portal-brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.portal-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.portal-nav-links a {
    border: 1px solid rgba(226, 232, 240, .22);
    border-radius: 999px;
    padding: 8px 12px;
    color: #d9e5f2;
    font-size: 13px;
    background: rgba(15, 23, 32, .42);
}

.portal-nav-links a:hover {
    border-color: rgba(56, 189, 248, .7);
    color: #fff;
}

.portal-hero-content {
    width: min(1180px, calc(100% - 40px));
    margin: auto auto 64px;
}

.portal-eyebrow {
    margin: 0 0 12px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(42px, 6vw, 76px);
    line-height: 1;
    letter-spacing: 0;
}

.portal-copy {
    width: min(720px, 100%);
    margin: 20px 0 0;
    color: #d5dfeb;
    font-size: 18px;
    line-height: 1.65;
}

.portal-apps {
    width: min(1180px, calc(100% - 40px));
    margin: -42px auto 0;
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.portal-app {
    min-height: 160px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(23, 35, 49, .96);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 14px;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.portal-app:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, .65);
    background: var(--panel-strong);
}

.portal-app-icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(56, 189, 248, .12);
    color: var(--blue);
    font-size: 22px;
}

.portal-app-pipe .portal-app-icon {
    background: rgba(245, 158, 11, .13);
    color: var(--amber);
}

.portal-app-plant .portal-app-icon {
    background: rgba(34, 197, 94, .13);
    color: var(--green);
}

.portal-app-body strong {
    display: block;
    font-size: 18px;
    line-height: 1.25;
}

.portal-app-body small {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.portal-arrow {
    color: #93a4b8;
}

.portal-status {
    width: min(1180px, calc(100% - 40px));
    margin: 18px auto 40px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.portal-status div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: rgba(15, 23, 32, .72);
}

.portal-status span,
.portal-status strong {
    display: block;
}

.portal-status span {
    color: var(--muted);
    font-size: 12px;
}

.portal-status strong {
    margin-top: 6px;
    font-size: 16px;
}

@media (max-width: 920px) {
    .portal-apps,
    .portal-status {
        grid-template-columns: 1fr;
    }

    .portal-nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-nav-links {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .portal-nav,
    .portal-hero-content,
    .portal-apps,
    .portal-status {
        width: calc(100% - 28px);
    }

    .portal-hero {
        min-height: 64vh;
    }

    .portal-app {
        grid-template-columns: auto 1fr;
    }

    .portal-arrow {
        display: none;
    }
}
