/* ==========================================================================
   Everworlds — the hero of everworlds.online, brought over as a section.

   Copied from Everworlds/website/styles.css (.hero, .name, .haul, .store,
   .btn-play), with every class prefixed ew- so nothing here touches the rest
   of the page. Type: Bricolage Grotesque, labels in IBM Plex Mono, as on
   everworlds.online. Colours from the game (gem cyan, sky, grass, lava).
   ========================================================================== */

.ew {
    --ew-gem: #68efe3;
    --ew-ink-dim: rgba(246, 243, 238, .66);
    --ew-ink-faint: rgba(246, 243, 238, .45);
    --ew-line-strong: rgba(255, 255, 255, .26);

    position: relative;
    min-height: 100svh;
    display: grid;
    place-items: center;
    overflow: hidden;
    isolation: isolate;
    background: #070b16;
    font-family: var(--joe);
}

.ew-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    touch-action: manipulation;
}

/* vignette, and the top and bottom fading into the sections either side */
.ew::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 55% at 50% 42%, transparent 35%, rgba(5, 6, 8, .55) 100%),
        linear-gradient(to bottom, #04060a, transparent 12%, transparent 84%, rgba(5, 6, 8, .85));
}

/* clicks go through the empty parts to the canvas */
.ew-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 16px 14vh;
    pointer-events: none;
}

.ew-inner a,
.ew-inner .ew-store {
    pointer-events: auto;
}

.ew-label {
    margin-bottom: clamp(10px, 2vh, 18px);
    font-family: var(--roam-mono);
    font-size: .75rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ew-ink-dim);
}

.ew-name {
    font-size: clamp(2.6rem, 11.5vw, 8.4rem);
    line-height: .86;
    letter-spacing: -0.045em;
    font-weight: 600;
    user-select: none;
    -webkit-user-select: none;
    white-space: nowrap;
}

/* Each letter swells as the cursor passes, and a block from the game shows
   through it: the block is the letter's background clipped to the glyph, and
   the cream fill fades out on top. */
.ew-ch {
    --h: 0;
    display: inline-block;
    padding: .1em 0 .05em;
    margin: -.1em 0 -.05em;
    font-weight: 600;
    color: var(--ink);
    background: var(--img, none) center top / auto 100% repeat-x;
    image-rendering: pixelated;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: rgb(246 243 238 / calc(1 - var(--h)));
    filter:
        drop-shadow(0 0 1.5px rgb(255 255 255 / calc(var(--h) * .8)))
        drop-shadow(0 10px 26px rgb(0 0 0 / .5))
        brightness(calc(1 + var(--h) * .12));
    transform: translateY(calc(var(--h) * -0.07em)) scale(calc(1 + var(--h) * .06));
}

.ew-intro {
    margin: clamp(16px, 3vh, 26px) auto 0;
    max-width: 30ch;
    font-size: clamp(1.05rem, 1.7vw, 1.3rem);
    line-height: 1.4;
    color: var(--ew-ink-dim);
    text-shadow: 0 2px 20px rgba(0, 0, 0, .7);
}

.ew-actions {
    margin-top: clamp(22px, 4vh, 34px);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

/* white pill with a gem-coloured glow (Roam's button, in Everworlds colours) */
.ew-btn {
    font-weight: 700;
    background: #fff;
    color: #05070a;
    box-shadow: 0 12px 44px -12px rgba(104, 239, 227, .95);
}

.ew-btn:hover {
    box-shadow: 0 16px 60px -8px rgba(104, 239, 227, 1);
}

.ew-btn-ghost {
    font-weight: 600;
    color: var(--ink);
    background: rgba(0, 0, 0, .45);
    border: 1px solid var(--ew-line-strong);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.ew-btn-ghost:hover {
    border-color: var(--ew-gem);
}

.ew-stores {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* store badges, shaped like roam.community's */
.ew-store {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem .85rem .45rem .75rem;
    border-radius: 11px;
    border: 1px solid var(--ew-line-strong);
    background: rgba(0, 0, 0, .5);
    line-height: 1.05;
    font-weight: 600;
    font-size: .92rem;
    color: var(--ew-ink-dim);
    cursor: default;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.ew-store i {
    font-size: 1.15rem;
}

.ew-store span {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.ew-store small {
    font-size: .62rem;
    font-weight: 500;
    color: var(--ew-ink-faint);
    letter-spacing: .02em;
}

/* the gem counter, styled like the game's (#gem-counter) */
.ew-haul {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .16);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 54%),
        rgba(10, 15, 25, .84);
    color: #e8fbff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .05em;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 16px 36px rgba(0, 0, 0, .28);
    animation: fade-up .5s var(--ease);
}

.ew-haul[hidden] {
    display: none;
}

.ew-haul.bump {
    animation: ew-bump .35s var(--ease);
}

@keyframes ew-bump {
    40% { transform: scale(1.14); }
}

.ew-gem {
    width: 22px;
    height: 18px;
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .4));
}

/* a nudge to try the ground, down in the dirt */
.ew-hint {
    position: absolute;
    left: 50%;
    bottom: 18px;
    translate: -50% 0;
    z-index: 1;
    pointer-events: none;
    font-family: var(--roam-mono);
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .5);
    white-space: nowrap;
}

@media (max-width: 600px) {
    .ew-name {
        font-size: 14.5vw;
    }

    .ew-more {
        display: none;
    }

    .ew-inner {
        padding-bottom: 18vh;
    }

    .ew-hint {
        display: none;
    }
}

.ew a:focus-visible {
    outline-color: #8ee7ff;
}
