:root {
    color-scheme: light;
    --ink: #17191c;
    --muted: #8d949b;
    --paper: #f4f5f7;
    --card: #ffffff;
    --line: rgba(23, 25, 28, 0.08);
    --shadow: 0 20px 60px rgba(38, 45, 52, 0.08);
    --shadow-strong: 0 26px 80px rgba(38, 45, 52, 0.14);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.95), transparent 34%),
        linear-gradient(180deg, #f7f8fa 0%, var(--paper) 100%);
}

.portal-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 56px;
}

.topbar {
    min-height: 54px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 0;
    padding: 8px 10px 8px 16px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.brand-mark,
.quick-nav a,
.feature-card-link,
.card-link,
.map-peek,
.social-card {
    color: inherit;
    text-decoration: none;
}

.brand-mark { font-size: 15px; font-weight: 850; }
.quick-nav { display: flex; gap: 8px; }
.quick-nav a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    font-weight: 760;
}

.portal-layout-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: 92px;
    gap: 18px;
    grid-auto-flow: row dense;
}

.portal-layout-block {
    min-width: 0;
    min-height: 0;
}

.profile-card,
.hello-card,
.social-card,
.map-peek,
.feature-card,
.updates-panel,
.section-header-card,
.topbar {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--card);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.portal-block-header { min-height: 54px; }

.section-header-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px 24px;
}

.section-header-card h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.1;
}

.profile-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 34px;
    text-align: center;
}

.portrait {
    width: 176px;
    height: 176px;
    flex: 0 0 176px;
    display: block;
    margin-bottom: 28px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.75), transparent 28%),
        linear-gradient(135deg, #c9e3db, #8aa2b7 46%, #ddbea4);
    color: #fff;
    font-size: 70px;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38), 0 16px 34px rgba(42, 58, 68, 0.18);
    overflow: hidden;
}
.portrait img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 42%;
}
.portrait span {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
    margin-bottom: 10px;
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1;
    letter-spacing: 0;
}
.profile-lead {
    max-width: 320px;
    margin-bottom: 24px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
    font-weight: 650;
}
.hello-card {
    height: 100%;
    padding: 32px;
}
.eyebrow {
    margin: 0 0 12px;
    color: #2f8be6;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}
.hello-card h2,
.section-title h2 {
    margin-bottom: 14px;
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.08;
}
.hello-card p:not(.eyebrow) {
    max-width: 680px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.8;
    font-weight: 650;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.social-card {
    min-height: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 22px;
    color: #fff;
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.26), transparent 28%),
        linear-gradient(135deg, color-mix(in srgb, var(--brand-color) 88%, #ffffff), var(--brand-color));
}
.social-card.card-size-wide { grid-column: span 2; }
.social-card.card-size-tall { min-height: 220px; }
.social-card.card-size-large { grid-column: span 2; min-height: 220px; }
.social-card span { font-size: 20px; font-weight: 850; }
.social-card small { margin-top: 6px; color: rgba(255,255,255,.72); font-weight: 700; }
.social-card.pending { opacity: .92; }

.map-peek {
    position: relative;
    display: block;
    min-height: 100%;
    height: 100%;
}
.map-peek img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: top center;
    filter: saturate(.65) contrast(1.04) brightness(1.05);
}
.map-peek::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(255,255,255,.66), rgba(255,255,255,0) 58%);
}
.map-peek span {
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 1;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.82);
    font-weight: 850;
}

.feature-card {
    position: relative;
    min-height: 100%;
    height: 100%;
    transition: transform 180ms ease, box-shadow 180ms ease;
}
.card-shape-soft { border-radius: 24px; }
.card-shape-rounded { border-radius: 32px; }
.card-shape-pill { border-radius: 999px; }
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-strong);
}
.feature-card-link {
    position: absolute;
    inset: 0;
    display: block;
}
.feature-card-link > img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: top center;
    transition: transform 260ms ease;
}
.feature-card:hover .feature-card-link > img { transform: scale(1.035); }
.feature-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(12, 18, 22, .66), rgba(12, 18, 22, .20) 54%, rgba(12, 18, 22, .04));
}
.feature-card.no-preview .feature-card-link {
    background: linear-gradient(135deg, #ffffff, #edf0f5);
}
.feature-card.no-preview .feature-card-link::after { background: none; }
.feature-content {
    position: absolute;
    inset: auto 0 0;
    z-index: 1;
    padding: 24px;
    color: #fff;
}
.no-preview .feature-content { color: var(--ink); }
.card-topline {
    width: fit-content;
    max-width: 100%;
    margin-bottom: 12px;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,.82);
    color: #33383d;
    font-size: 12px;
    font-weight: 840;
}
.feature-card h2 {
    margin-bottom: 10px;
    font-size: clamp(30px, 4vw, 52px);
    line-height: 1;
}
.feature-card:nth-child(n + 3) h2 { font-size: clamp(28px, 3vw, 38px); }
.feature-card p {
    max-width: 560px;
    margin-bottom: 18px;
    color: rgba(255,255,255,.84);
    line-height: 1.75;
    font-weight: 620;
}
.no-preview .feature-card p { color: var(--muted); }
.card-link { font-weight: 850; }
.card-link::after { content: " ->"; }
.card-link.muted { color: var(--muted); }
.card-link.muted::after { content: ""; }

.updates-panel {
    height: 100%;
    margin-top: 0;
    padding: 24px;
}
.section-heading h2 { margin-bottom: 18px; font-size: 24px; }
.update-list { display: grid; gap: 10px; }
.update-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}
.update-item:first-child { border-top: 0; padding-top: 0; }
.update-index { color: var(--muted); font-weight: 850; }
.update-item h3 { margin-bottom: 4px; font-size: 16px; }
.update-item p { margin-bottom: 0; color: var(--muted); line-height: 1.7; }

@media (max-width: 980px) {
    .portal-layout-grid {
        grid-auto-rows: auto;
    }
    .portal-layout-block {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }
}

@media (max-width: 640px) {
    .portal-shell { width: min(100% - 24px, 520px); padding-top: 14px; }
    .topbar { align-items: stretch; flex-direction: column; }
    .quick-nav { display: grid; grid-template-columns: 1fr 1fr; }
    .profile-card,
    .hello-card,
    .updates-panel { padding: 24px; }
    .portrait { width: 148px; height: 148px; flex-basis: 148px; font-size: 58px; }
    .portal-block-feature_link { min-height: 330px; }
    .portal-block-preview_link { min-height: 220px; }
    .portal-block-social_link { min-height: 104px; }
    .portal-block-header { min-height: 104px; }
    .feature-content { padding: 20px; }
}
