/*
 * Mhara coming soon page.
 *
 * Built from the Figma section "Coming soon" (2480:4709). The dark frames
 * are the default; the light frames apply when the system asks for a light
 * colour scheme. Desktop values come from the 1440 x 900 frames, the layout
 * below 768px from the 393 x 852 mobile frames.
 */

@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/plusjakartasans.woff2') format('woff2');
}

:root {
    /* Primitives used by the design */
    --white: #ffffff;
    --neutral-200: #e4e4e9;
    --neutral-300: #d1d1d9;
    --neutral-400: #a3a3b0;
    --neutral-500: #75758a;
    --neutral-700: #3e3e50;
    --neutral-800: #2a2a38;
    --neutral-900: #1c1c28;
    --crimson-500: #bd3a41;

    /* Roles, dark scheme */
    --page: var(--neutral-900);
    --text-strong: var(--white);
    --text-muted: var(--neutral-400);
    --text-legal: var(--neutral-500);
    --text-link: var(--neutral-300);
    --outline: var(--neutral-700);
    --wheel-near: var(--neutral-700);
    --wheel-far: var(--neutral-800);
    --band: var(--crimson-500);
    --band-text: var(--white);

    /*
   * Wheel sizing from the spec: text clamp(48px, 5.3vw, 76px), rows 88/76
   * of the text and the band 108/76 (the spec rounds them to 1.16x and
   * 1.42x), never below the mobile 64 and 80.
   *
   * The height term keeps the page inside the viewport on short screens:
   * 440px is everything on the desktop page except the wheel (header,
   * footer, copy, badges, gaps and padding), and the wheel is 6.05 times its
   * text size. At 1440 x 900 both terms give the design's 76px.
   */
    --wheel-size: clamp(48px, min(5.3vw, (100vh - 440px) / 6.05), 76px);
    --wheel-row: max(64px, calc(var(--wheel-size) * 88 / 76));
    --wheel-band: max(80px, calc(var(--wheel-size) * 108 / 76));
    /* Keep in step with SLIDE_MS in assets/js/wheel.js */
    --wheel-slide: 500ms;

    color-scheme: dark light;
}

@media (prefers-color-scheme: light) {
    :root {
        --page: var(--white);
        --text-strong: var(--neutral-900);
        --text-muted: var(--neutral-500);
        --text-link: var(--neutral-700);
        --outline: var(--neutral-300);
        --wheel-near: var(--neutral-300);
        --wheel-far: var(--neutral-200);
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow-x: clip;
    background: var(--page);
    color: var(--text-strong);
    font-family:
        'Plus Jakarta Sans',
        system-ui,
        -apple-system,
        'Segoe UI',
        Roboto,
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
p {
    margin: 0;
}

img {
    display: block;
}

/* ---- Header --------------------------------------------------------------- */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 40px 64px 0;
}

/* The wordmark, the mark and its dot, placed as in the IG / Logo component */
.logo {
    position: relative;
    flex: none;
    width: 148px;
    aspect-ratio: 148 / 35.2;
}

.logo img {
    position: absolute;
}

.logo-wordmark {
    top: 6.41%;
    left: 24.41%;
    width: 75.38%;
    height: 83.74%;
}

.logo-mark {
    top: 20.28%;
    left: 0;
    width: 19.92%;
    height: 79.72%;
}

.logo-dot {
    top: 0;
    left: 8.23%;
    width: 5.46%;
    height: 22.99%;
}

.status {
    display: flex;
    flex: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--outline);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
}

/* ---- Main ----------------------------------------------------------------- */

.main {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 32px 0;
}

/*
 * Five visible slots: two rows above the band, the band, two rows below.
 * Slot -1 sits above the wheel and slot 5 below it, both clipped; wheel.js
 * moves every word up one slot per step and CSS animates the move.
 */
.wheel {
    /*
     * Words are placed by the middle of their capitals. Where text-box is
     * supported (see below) a word's box is trimmed to its capitals and this
     * is 0. Elsewhere the box is the 1em line box, in which Plus Jakarta Sans
     * (ascent 1.04, descent 0.22, cap height 0.745) sets the capitals
     * (1.04 - 0.22 - 0.745) / 2 = 0.0375em below the middle.
     */
    --wheel-cap-drop: 0.0375em;

    /*
     * Descenders reach 0.5925em below the middle of the capitals, further
     * than half a desktop row (0.579em), so a g or y above the band would
     * reach into it. The rows above the band move up and the rows below move
     * down by the spread, keeping descenders 0.06em clear of the band and the
     * gaps either side of it equal. Mobile rows are tall enough: no spread.
     */
    --wheel-spread: max(0px, 0.6525em - var(--wheel-row) / 2);

    position: relative;
    width: 100%;
    height: calc(var(--wheel-row) * 4 + var(--wheel-band));
    /*
     * Hides the word leaving at the top and the one waiting below. The bottom
     * edge is 0.15em lower so the last row's descenders are not cut; the
     * waiting word's tallest letters start at least 0.26em below the wheel.
     */
    overflow-x: clip;
    clip-path: inset(0 0 -0.15em);
    font-size: var(--wheel-size);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.wheel-band {
    position: absolute;
    top: calc(var(--wheel-row) * 2);
    right: 0;
    left: 0;
    height: var(--wheel-band);
    background: var(--band);
}

/*
 * Each word is centred on its slot by half its own size: across, so a word
 * wider than the screen stays centred while it clips, and down.
 */
.wheel-word {
    position: absolute;
    top: 0;
    left: 50%;
    width: max-content;
    color: var(--wheel-far);
    white-space: nowrap;
    transform: translate(-50%, calc(var(--y) - 50% - var(--wheel-cap-drop)));
    transition:
        transform var(--wheel-slide) ease-out,
        color var(--wheel-slide) ease-out;
}

/*
 * Trims each word's box to its capitals, so centring the box centres the
 * capitals exactly. The fixed 0.0375em correction is off by up to a pixel
 * where the browser rounds the font metrics.
 */
@supports (text-box: trim-both cap alphabetic) {
    .wheel {
        --wheel-cap-drop: 0px;
    }

    .wheel-word {
        text-box: trim-both cap alphabetic;
    }
}

/* --y is where the middle of the word's capitals sits */
.wheel-word[data-slot='-1'] {
    --y: calc(var(--wheel-row) * -0.5 - var(--wheel-spread));
}

.wheel-word[data-slot='0'] {
    --y: calc(var(--wheel-row) * 0.5 - var(--wheel-spread));
}

.wheel-word[data-slot='1'] {
    --y: calc(var(--wheel-row) * 1.5 - var(--wheel-spread));
    color: var(--wheel-near);
}

.wheel-word[data-slot='2'] {
    --y: calc(var(--wheel-row) * 2 + var(--wheel-band) / 2);
    color: var(--band-text);
}

.wheel-word[data-slot='3'] {
    --y: calc(var(--wheel-row) * 2.5 + var(--wheel-band) + var(--wheel-spread));
    color: var(--wheel-near);
}

.wheel-word[data-slot='4'] {
    --y: calc(var(--wheel-row) * 3.5 + var(--wheel-band) + var(--wheel-spread));
}

.wheel-word[data-slot='5'] {
    --y: calc(var(--wheel-row) * 4.5 + var(--wheel-band) + var(--wheel-spread));
}

/* Set by wheel.js while a word jumps from the top back to the bottom */
.wheel-word.is-resetting {
    transition: none;
}

.copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    text-align: center;
}

.headline {
    font-size: 44px;
    font-weight: 700;
    line-height: 52px;
    letter-spacing: -1px;
    text-wrap: balance;
}

.subline {
    color: var(--text-muted);
    font-size: 18px;
    line-height: 28px;
}

/* ---- Store badges --------------------------------------------------------- */

.stores {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 0 20px;
}

/*
 * Sized in em from the 20px store name, so the mobile badge is the desktop
 * one scaled to 0.88 as in the design by changing only the font size.
 */
.badge {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.45em 0.9em 0.45em 0.7em;
    border: 1px solid var(--outline);
    border-radius: 0.6em;
    font-size: 20px;
}

.badge img {
    flex: none;
    width: 1.4em;
    height: 1.4em;
}

.badge-text {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
}

.badge-caption {
    color: var(--text-muted);
    font-size: 0.55em;
    line-height: 1.2727;
}

.badge-store {
    color: var(--text-strong);
    font-weight: 600;
    line-height: 1.2;
}

/* ---- Footer --------------------------------------------------------------- */

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 64px 32px;
}

.legal {
    color: var(--text-legal);
    font-size: 12px;
    line-height: 16px;
}

.email {
    color: var(--text-link);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    text-decoration: none;
    text-underline-offset: 3px;
}

.email:hover {
    text-decoration: underline;
}

.email:focus-visible {
    border-radius: 2px;
    outline: 2px solid var(--crimson-500);
    outline-offset: 4px;
}

.contact {
    display: flex;
    align-items: center;
    gap: 24px;
}

.social {
    display: flex;
    gap: 8px;
}

/* Web/Social Button: outline like the status pill, glyph in the email colour */
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--outline);
    border-radius: 50%;
    background: var(--page);
    color: var(--text-link);
    transition:
        color 150ms ease-out,
        border-color 150ms ease-out;
}

.social-link svg {
    display: block;
}

/* Hover is not in the design: the glyph and outline step up one shade */
.social-link:hover {
    border-color: var(--text-legal);
    color: var(--text-strong);
}

.social-link:focus-visible {
    outline: 2px solid var(--crimson-500);
    outline-offset: 2px;
}

/* ---- Mobile --------------------------------------------------------------- */

@media (max-width: 767px) {
    .header {
        padding: 24px 20px 0;
    }

    .logo {
        width: 114.7px;
    }

    .status {
        padding: 6px 12px;
        font-size: 12px;
        line-height: 16px;
    }

    .main {
        gap: 36px;
        padding: 32px 0;
    }

    .copy {
        gap: 8px;
    }

    .headline {
        font-size: 32px;
        line-height: 40px;
        letter-spacing: -0.5px;
    }

    .subline {
        font-size: 16px;
        line-height: 24px;
    }

    .stores {
        gap: 10px;
    }

    /* 17.6px is the design's 0.88 scale; 4.5vw keeps both badges on one line down to 320px */
    .badge {
        font-size: min(17.6px, 4.5vw);
    }

    .footer {
        flex-direction: column-reverse;
        gap: 10px;
        padding: 0 20px 28px;
        text-align: center;
    }

    .contact {
        gap: 16px;
    }

    .social-link {
        width: 32px;
        height: 32px;
    }

    .legal-separator {
        display: none;
    }

    .legal-place {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wheel-word,
    .social-link {
        transition: none;
    }
}
