/* Platform landing — / */

body[data-portal="home"] {
    --home-hero-bg: #172521;
    --home-hero-ink: #fff;
    --home-hero-muted: #9eb0aa;
    --home-hero-accent: #8ad0b4;
    --home-ring: color-mix(in srgb, var(--accent) 55%, transparent);
    --home-card-bg: #172521;
    --home-card-hover: #20332d;
    --home-grid-line: #ffffff1c;
    --home-feature-bg: var(--surface);
    --home-feature-border: var(--line);
    min-height: 100vh;
    color: var(--ink);
    background: var(--paper);
}

html[data-theme="light"] body[data-portal="home"] {
    --home-hero-bg: linear-gradient(145deg, #172521 0%, #1f342d 52%, #245847 100%);
    --home-card-bg: color-mix(in srgb, var(--surface) 92%, #172521);
    --home-card-hover: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
    --home-grid-line: var(--line);
}

html[data-theme="dark"] body[data-portal="home"] {
    --home-feature-bg: var(--surface-raised);
}

.home-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.home-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px clamp(20px, 4vw, 48px);
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.home-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.home-brand b {
    font-size: 15px;
    letter-spacing: .06em;
}

.home-brand span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.home-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-topbar-actions .theme-toggle {
    min-width: 88px;
}

.home-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(48px, 8vw, 110px) clamp(20px, 4vw, 48px) clamp(56px, 7vw, 96px);
    color: var(--home-hero-ink);
    background: var(--home-hero-bg);
}

.home-hero::before,
.home-hero::after {
    content: "";
    position: absolute;
    border: 1px solid var(--home-ring);
    border-radius: 50%;
    pointer-events: none;
}

.home-hero::before {
    width: 70vw;
    height: 70vw;
    right: -28vw;
    top: -42vw;
    box-shadow: 0 0 0 10vw #ffffff06, 0 0 0 20vw #ffffff04;
}

.home-hero::after {
    width: 34vw;
    height: 34vw;
    left: -12vw;
    bottom: -20vw;
    opacity: .45;
}

.home-hero-inner {
    position: relative;
    max-width: 1120px;
    margin: 0 auto;
}

.home-hero .eyebrow {
    color: var(--home-hero-accent);
}

.home-hero h1 {
    max-width: 900px;
    margin: 0;
    font: 500 clamp(42px, 7vw, 88px)/1.04 Georgia, "Songti SC", serif;
    letter-spacing: -.045em;
}

.home-hero-lead {
    max-width: 680px;
    margin: 22px 0 0;
    color: var(--home-hero-muted);
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1.85;
}

.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.home-hero-actions a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: .18s ease;
}

.home-hero-actions .primary {
    color: var(--nav);
    background: var(--home-hero-accent);
}

.home-hero-actions .primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.home-hero-actions .secondary {
    color: var(--home-hero-ink);
    border: 1px solid #ffffff33;
    background: #ffffff10;
}

.home-hero-actions .secondary:hover {
    background: #ffffff1a;
}

.home-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin-top: clamp(36px, 5vw, 56px);
    background: var(--home-grid-line);
    border: 1px solid var(--home-grid-line);
}

.home-metric {
    padding: 18px 20px;
    background: #ffffff08;
}

.home-metric b {
    display: block;
    font: 500 28px/1 Georgia, "Songti SC", serif;
    color: var(--home-hero-accent);
}

.home-metric span {
    display: block;
    margin-top: 8px;
    color: var(--home-hero-muted);
    font-size: 12px;
    line-height: 1.6;
}

.home-section {
    padding: clamp(48px, 7vw, 88px) clamp(20px, 4vw, 48px);
}

.home-section-inner {
    max-width: 1120px;
    margin: 0 auto;
}

.home-section-head {
    max-width: 720px;
    margin-bottom: clamp(28px, 4vw, 42px);
}

.home-section-head h2 {
    margin: 8px 0 0;
    font: 500 clamp(28px, 4vw, 42px)/1.15 Georgia, "Songti SC", serif;
    letter-spacing: -.03em;
}

.home-section-head p {
    margin: 14px 0 0;
    color: var(--muted);
    line-height: 1.8;
}

.home-features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.home-feature {
    min-height: 220px;
    padding: 22px;
    border: 1px solid var(--home-feature-border);
    border-radius: 18px;
    background: var(--home-feature-bg);
    box-shadow: var(--shadow);
}

.home-feature-num {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
}

.home-feature h3 {
    margin: 18px 0 0;
    font-size: 18px;
    line-height: 1.35;
}

.home-feature p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.75;
}

.home-flow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.home-flow-step {
    position: relative;
    padding: 20px 18px 18px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface) 88%, var(--paper));
}

.home-flow-step::after {
    content: "→";
    position: absolute;
    top: 50%;
    right: -12px;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 18px;
}

.home-flow-step:last-child::after {
    content: none;
}

.home-flow-step small {
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
}

.home-flow-step b {
    display: block;
    margin-top: 10px;
    font-size: 16px;
}

.home-flow-step span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.home-portals {
    padding-top: 0;
}

.home-portal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--home-grid-line);
    border: 1px solid var(--home-grid-line);
}

.home-portal-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-flow-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-portal-link {
    min-height: 240px;
    padding: 26px;
    display: flex;
    flex-direction: column;
    color: var(--home-hero-ink);
    background: var(--home-card-bg);
    text-decoration: none;
    transition: .2s ease;
}

.home-portal-link:hover {
    background: var(--home-card-hover);
    transform: translateY(-4px);
}

.home-portal-link small {
    color: #718b82;
    font-size: 10px;
    letter-spacing: .12em;
}

.home-portal-link b {
    margin-top: auto;
    font: 500 24px/1.2 Georgia, "Songti SC", serif;
}

.home-portal-link span {
    margin-top: 10px;
    color: #8fa49d;
    font-size: 12px;
    line-height: 1.65;
}

.home-portal-link i {
    margin-top: 22px;
    color: var(--home-hero-accent);
    font-style: normal;
    font-weight: 600;
}

.home-portals .home-section-head,
.home-portals .home-section-head h2,
.home-portals .home-section-head p {
    color: var(--home-hero-ink);
}

.home-portals .home-section-head p {
    color: var(--home-hero-muted);
}

.home-portals-wrap {
    padding: clamp(48px, 7vw, 88px) clamp(20px, 4vw, 48px);
    color: var(--home-hero-ink);
    background: var(--home-hero-bg);
}

.home-footer {
    margin-top: auto;
    padding: 28px clamp(20px, 4vw, 48px) 36px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.home-footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.home-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.home-footer-links a {
    color: var(--muted);
    text-decoration: none;
}

.home-footer-links a:hover {
    color: var(--accent);
}

@media (max-width: 980px) {
    .home-metrics,
    .home-features,
    .home-flow,
    .home-flow-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-flow-step:nth-child(2)::after,
    .home-flow-3 .home-flow-step:nth-child(2)::after {
        content: none;
    }

    .home-portal-grid,
    .home-portal-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .home-topbar {
        padding-inline: 16px;
    }

    .home-metrics,
    .home-features,
    .home-flow,
    .home-portal-grid {
        grid-template-columns: 1fr;
    }

    .home-flow-step::after {
        content: none;
    }

    .home-portal-link {
        min-height: 190px;
    }
}
