.page-home #content {
    --home-gutter: clamp(12px, 2.65vw, 40px);
    --home-row: clamp(14px, 2.25vw, 30px);
    --home-section-gap: clamp(16px, 1.85vw, 28px);
    --home-rule: color-mix(in srgb, var(--crest-bronze) 70%, var(--crest-steel));
    --home-divider: color-mix(in srgb, var(--home-rule) 56%, transparent);
    --home-wash: #bfd7e317;
}

#content .unified-home {
    display: grid;
    gap: var(--home-section-gap);
    inline-size: 100%;
    padding: var(--home-section-gap) var(--home-gutter);
}

#content .unified-home-hero {
    --home-hero-inset: clamp(19px, 3.15vw, 48px);
    display: grid;
    grid-template-columns: minmax(0, .98fr) minmax(0, 1.02fr);
    align-items: center;
    column-gap: clamp(6px, 1.15vw, 16px);
    min-inline-size: 0;
    padding-inline-start: var(--home-hero-inset);
    background: #10252d;
}

#content .unified-home-intro {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: clamp(12px, 1.6vw, 25px);
    min-inline-size: 0;
    padding-block: clamp(21px, 2.9vw, 43px);
}

#content .unified-home-hero-logo {
    position: relative;
    grid-row: 1 / 4;
    align-self: start;
    display: block;
    inline-size: clamp(76px, 8.8vw, 132px);
    aspect-ratio: 120 / 94;
    margin-block-start: 3px;
}

#content .unified-home-hero-logo img {
    display: block;
    inline-size: 100%;
    block-size: auto;
}

.unified-home-crest-light { display: none; }

#content .unified-home-intro > :is(h1, p, .unified-home-actions) { grid-column: 2; }

.page-home #content .unified-home-mark {
    max-inline-size: 21ch;
    margin: 0;
    color: var(--unified-ink);
    font: 700 clamp(1.9rem, 3.45vw, 3.1rem)/1.05 var(--unified-serif);
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

#content .unified-home-description {
    max-inline-size: 54ch;
    margin: 13px 0 0;
    color: var(--unified-muted);
    font-size: clamp(.94rem, 1.1vw, 1.06rem);
    line-height: 1.55;
    text-wrap: pretty;
    overflow-wrap: anywhere;
}

#content .unified-home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-block-start: clamp(13px, 1.8vw, 24px);
}

body.element-site.page-home #content .unified-home-action {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-block-size: 46px;
    padding: 7px clamp(10px, 1vw, 15px);
    font: 700 clamp(.91rem, 1.12vw, 1.06rem)/1.2 var(--unified-serif);
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
}

#content .unified-home-game-icon {
    display: block;
    inline-size: 40px;
    block-size: 40px;
    flex: none;
    object-fit: contain;
}

#content .unified-home-action > .unified-home-game-icon {
    inline-size: 23px;
    block-size: 23px;
    border-radius: 2px;
}

#content .unified-home :is(.unified-home-band, .home-calendar) {
    min-inline-size: 0;
    margin: 0;
    border: 1px solid var(--home-rule);
    border-radius: 4px;
    background: var(--unified-surface);
}

.unified-home > [data-home-element='earth'] {
    --home-element-heading: #394330;
    --home-element-surface: #1c2b26;
    --home-element-metal: #9a916b;
    --home-frame-art: url('home-frames/earth.webp');
    --home-drip-art: url('home-frames/earth-drip.webp');
    --home-drip-anchor: 24%;
    --home-frame-radius: 3px;
}

.unified-home > [data-home-element='air'] {
    --home-element-heading: #334753;
    --home-element-surface: #1d3039;
    --home-element-metal: #8fabb7;
    --home-frame-art: url('home-frames/air.webp');
    --home-drip-art: url('home-frames/air-drip.webp');
    --home-drip-anchor: 69%;
    --home-frame-radius: 6px;
}

.unified-home > [data-home-element='fire'] {
    --home-element-heading: #49352d;
    --home-element-surface: #2a2324;
    --home-element-metal: #b48870;
    --home-frame-art: url('home-frames/fire.webp');
    --home-drip-art: url('home-frames/fire-drip.webp');
    --home-drip-anchor: 43%;
    --home-frame-radius: 3px;
}

.unified-home > [data-home-element='water'] {
    --home-element-heading: #234053;
    --home-element-surface: #152b39;
    --home-element-metal: #739cad;
    --home-frame-art: url('home-frames/water.webp');
    --home-drip-art: url('home-frames/water-drip.webp');
    --home-drip-anchor: 63%;
    --home-frame-radius: 10px;
}

#content .unified-home > [data-home-element] {
    position: relative;
    isolation: isolate;
    --home-rule: color-mix(in srgb, var(--home-element-metal) 87%, var(--crest-bronze));
    --home-divider: color-mix(in srgb, var(--home-rule) 55%, transparent);
    --home-wash: color-mix(in srgb, var(--home-element-metal) 14%, transparent);
    --home-frame-width: clamp(5px, .5vw, 6px);
    --home-frame-overhang: clamp(1px, .14vw, 2px);
    --home-drip-height: min(clamp(12px, 1.55vw, 22px), var(--home-section-gap) - 4px);
    border-color: color-mix(in srgb, var(--home-rule) 57%, transparent);
    border-radius: var(--home-frame-radius);
    background: linear-gradient(112deg, var(--home-element-surface), var(--crest-slate));
}

#content .unified-home > [data-home-element]::after {
    position: absolute;
    inset: calc(-1px - var(--home-frame-overhang));
    z-index: 1;
    border: var(--home-frame-width) solid transparent;
    /* The 384px WebP textures reserve 64 source pixels for each edge. */
    border-image: var(--home-frame-art) 64 stretch;
    mask-image: linear-gradient(#000 6px, transparent 46px, transparent calc(100% - 27px), #0005 calc(100% - 5px));
    opacity: .76;
    filter: saturate(.9);
    pointer-events: none;
    content: '';
}

html[data-element-theme='light'] #content .unified-home > [data-home-element]::after {
    opacity: .72;
    filter: saturate(.84);
}

#content .unified-home > [data-home-element]::before,
#content .home-edge-particles {
    position: absolute;
    inset-block-start: calc(100% - 1px);
    inset-inline-start: var(--home-drip-anchor);
    z-index: 1;
    inline-size: clamp(76px, 10vw, 144px);
    translate: -50% 0;
    pointer-events: none;
}

#content .unified-home > [data-home-element]::before {
    block-size: var(--home-drip-height);
    background: var(--home-drip-art) center top / 100% 100% no-repeat;
    opacity: .86;
    content: '';
}

html:not([data-element-theme='light']) #content .unified-home > [data-home-element='earth']::before,
html:not([data-element-theme='light']) #content [data-home-element='earth'] .home-edge-particle {
    filter: brightness(1.35);
}

#content .home-edge-particles {
    block-size: min(var(--home-drip-height) + 4px, var(--home-section-gap) - 1px);
    overflow: clip;
}

#content .home-edge-particle {
    position: absolute;
    display: block;
    opacity: 0;
}

#content .unified-home .unified-home-heading,
body.element-site.page-home #content .unified-home .home-calendar__header {
    display: flex;
    align-items: center;
    min-block-size: 52px;
    margin: 0;
    padding: 10px var(--home-row);
    border-block-end: 1px solid var(--home-rule);
    border-radius: calc(var(--home-frame-radius, 4px) - 1px) calc(var(--home-frame-radius, 4px) - 1px) 0 0;
    color: var(--unified-ink);
    background: linear-gradient(105deg, var(--home-element-heading, #243d48), var(--home-element-surface, #162b35) 88%);
    font: 700 clamp(1.34rem, 2.25vw, 1.9rem)/1.1 var(--unified-serif);
    font-variant-caps: small-caps;
    text-shadow: 0 1px 2px #0a171b;
}

#content .unified-home .unified-home-heading::before,
#content .unified-home .unified-home-heading::after { content: none; }

#content .unified-home-topics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    column-gap: clamp(10px, 2.1vw, 32px);
    padding: 6px var(--home-row);
}

#content .unified-home-topic { min-inline-size: 0; }
#content .unified-home-topic + .unified-home-topic { border-block-start: 1px solid var(--home-divider); }

#content .unified-home-topic > summary,
#content .unified-home-tools > a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(9px, 1.13vw, 16px);
    min-inline-size: 0;
    min-block-size: 60px;
    padding: 8px 7px;
    color: var(--unified-ink);
    text-decoration: none;
}

#content .unified-home-topic > summary {
    font: 700 clamp(1.05rem, 1.6vw, 1.35rem)/1.18 var(--unified-serif);
    list-style: none;
    cursor: pointer;
    overflow-wrap: anywhere;
}

#content .unified-home-topic > summary::-webkit-details-marker { display: none; }

#content .unified-home-topic[open] {
    background: var(--home-wash);
}

#content .unified-home :is(.unified-home-topic, .unified-home-tools, .unified-home-headlines) .icon {
    inline-size: 16px;
    block-size: 16px;
    flex: none;
    color: var(--unified-gold);
}

#content .unified-home-topic[open] > summary .icon { rotate: 90deg; }

#content .unified-home :is(.unified-home-topic > ul, .unified-home-headlines) {
    margin: 0;
    padding: 0;
    list-style: none;
}

#content .unified-home-topic > ul { padding-inline: 8px; }

#content .unified-home-topic li a,
#content .unified-home-headlines a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-block-size: 44px;
    padding: 8px 7px;
    border-block-start: 1px solid var(--home-divider);
    color: var(--unified-ink);
    font-size: .91rem;
    line-height: 1.35;
    text-decoration: none;
}

#content .unified-home :is(.unified-home-topic > summary, .unified-home-topic li a, .unified-home-tools > a, .unified-home-headlines a):is(:hover, :focus-visible) {
    background-color: var(--home-wash);
    color: #fff0cf;
}

#content .unified-home-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#content .unified-home-tools > a {
    min-block-size: 78px;
    padding: 11px var(--home-row);
}

#content .unified-home-tools > a:nth-child(even) { border-inline-start: 1px solid var(--home-divider); }
#content .unified-home-tools > a:nth-child(n+3) { border-block-start: 1px solid var(--home-divider); }

#content .unified-home-tools :is(strong, small) {
    display: block;
    overflow-wrap: anywhere;
}

#content .unified-home-tools strong,
#content .unified-home-headlines strong {
    font: 700 clamp(1.02rem, 1.23vw, 1.13rem)/1.22 var(--unified-serif);
}

#content .unified-home-tools small {
    margin-block-start: 4px;
    color: var(--unified-muted);
    font-size: .84rem;
    line-height: 1.4;
    text-wrap: pretty;
}

body.element-site.page-home #content .unified-home-news-heading {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0 12px;
    padding-block: 4px;
}

body.element-site.page-home #content .unified-home-news-heading h2 {
    margin: 0;
    color: inherit;
    font: inherit;
    font-variant-caps: inherit;
}

#content .unified-home-news-heading > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-block-size: 44px;
    color: var(--unified-gold);
    font: 600 .84rem/1.2 var(--element-sans, system-ui, sans-serif);
    text-decoration: none;
}

#content .unified-home-news-heading > a:hover { text-decoration: underline; }
#content .unified-home-news-heading > a .icon { inline-size: 16px; block-size: 16px; }

#content .unified-home-headlines > li:first-child > a { border-block-start: 0; }
#content .unified-home-headlines a { min-block-size: 48px; padding-inline: var(--home-row); }

#content .unified-home-headlines a > span {
    display: grid;
    grid-template-columns: 6.2rem minmax(0, 1fr);
    align-items: baseline;
    gap: 4px 13px;
    min-inline-size: 0;
    overflow-wrap: anywhere;
}

#content .unified-home-headlines time {
    color: var(--unified-gold);
    font-size: .79rem;
    font-variant-numeric: tabular-nums;
}

#content .unified-home-news-empty {
    margin: 0;
    padding: 12px var(--home-row);
    color: var(--unified-muted);
}

#content .unified-home :is(a, button, summary, select):focus-visible {
    outline: 2px solid #f5d693;
    outline-offset: -2px;
}

#content .unified-home > [data-home-element] :is(a, button, summary, select):focus-visible {
    position: relative;
    z-index: 2;
    outline-color: var(--light-focus, #f5d693);
}

#content .unified-home > [data-home-element] :is(.unified-home-tools > a, .unified-home-headlines a, .home-league):focus-visible {
    outline-offset: calc(var(--home-frame-overhang) - var(--home-frame-width));
}

@media (min-width: 1280px) {
    #content .unified-home-tools { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    #content .unified-home-tools > a + a { border-inline-start: 1px solid var(--home-divider); }
    #content .unified-home-tools > a:nth-child(n+3) { border-block-start: 0; }
}

@media (max-width: 780px) {
    #content .unified-home-hero {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0;
        padding-inline-start: 0;
    }

    #content .unified-home-intro {
        padding: 17px var(--home-hero-inset) 10px;
    }
}

@media (max-width: 1060px) {
    #content .unified-home-hero-logo {
        grid-row: 1;
        align-self: center;
        inline-size: clamp(56px, 9.8vw, 90px);
        margin-block-start: 0;
    }

    #content .unified-home-intro > :is(p, .unified-home-actions) { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
    .page-home #content .unified-home-mark { font-size: clamp(1.55rem, 7.05vw, 2rem); }

    #content .unified-home-actions {
        display: grid;
        grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    }

    body.element-site.page-home #content .unified-home-action {
        gap: 5px;
        padding-inline: 6px;
        font-size: .9rem;
        white-space: normal;
    }

    #content .unified-home-action > .unified-home-game-icon {
        inline-size: 19px;
        block-size: 19px;
    }

    #content :is(.unified-home-topics, .unified-home-tools) {
        grid-template-columns: minmax(0, 1fr);
    }

    #content .unified-home-topic-group + .unified-home-topic-group { border-block-start: 1px solid var(--home-divider); }
    #content .unified-home-topic > summary { min-block-size: 54px; }
    #content .unified-home-tools > a { min-block-size: 68px; }

    #content .unified-home-tools > a + a {
        border-inline-start: 0;
        border-block-start: 1px solid var(--home-divider);
    }

    #content .unified-home-headlines a > span { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

@media (prefers-reduced-motion: no-preference) {
    #content .unified-home > .home-edge-animated:not([data-home-element='air'])::before {
        mask-image: linear-gradient(#000 55%, transparent 69%);
    }

    .page-home[data-element-enter] #content .unified-home-crest-light {
        position: absolute;
        inset: 0;
        display: block;
        pointer-events: none;
        -webkit-mask: url('reference-ui/brand.webp') center / 100% 100% no-repeat;
        mask: url('reference-ui/brand.webp') center / 100% 100% no-repeat;
    }

    .page-home[data-element-enter] #content .unified-home-crest-light > span {
        position: absolute;
        inset: var(--crest-zone);
        background-color: var(--crest-light-color);
        -webkit-mask-image: radial-gradient(ellipse closest-side, #000, transparent);
        mask-image: radial-gradient(ellipse closest-side, #000, transparent);
        animation: element-crest-awaken 440ms cubic-bezier(.22, .75, .35, 1) var(--crest-light-delay) both;
    }

    .unified-home-crest-light > [data-crest-element='fire'] {
        --crest-zone: 18% 50% 25% 6%;
        --crest-light-color: #ffba65db;
        --crest-light-in: 6% 18%;
        --crest-light-out: -12% -26%;
        --crest-light-delay: 120ms;
    }

    .unified-home-crest-light > [data-crest-element='air'] {
        --crest-zone: 4% 20% 58% 26%;
        --crest-light-color: #f3faffd7;
        --crest-light-in: -24% 10%;
        --crest-light-out: 22% -7%;
        --crest-light-delay: 570ms;
    }

    .unified-home-crest-light > [data-crest-element='water'] {
        --crest-zone: 29% 8% 29% 51%;
        --crest-light-color: #71dcffc7;
        --crest-light-in: -20% -13%;
        --crest-light-out: 18% 22%;
        --crest-light-delay: 1020ms;
    }

    .unified-home-crest-light > [data-crest-element='earth'] {
        --crest-zone: 50% 27% 8% 28%;
        --crest-light-color: #dbdb86c9;
        --crest-light-in: 5% 14%;
        --crest-light-out: -3% -17%;
        --crest-light-delay: 1470ms;
    }

    @keyframes element-crest-awaken {
        0% { translate: var(--crest-light-in); scale: .79; opacity: 0; }
        40% { opacity: .69; }
        100% { translate: var(--crest-light-out); scale: 1.1; opacity: 0; }
    }
}

@media (forced-colors: active) {
    #content .unified-home > [data-home-element] { border-color: CanvasText; }
    #content .unified-home > [data-home-element]::before,
    #content .unified-home > [data-home-element]::after { content: none; }
    #content .home-edge-particles { display: none; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    #content .unified-home-topic > summary .icon {
        transition: scale 190ms ease-out, translate 150ms ease-out, rotate 160ms ease-out;
    }
}
