:root {
    --img-bg: url("../img/desktop_bg.png");
    --img-bg-mobile: url("../img/mobile_bg.png");

    /* Colours */
    --bg: #04140c;
    --gold-1: #ffe9a6;
    --gold-2: #f5c842;
    --gold-3: #d9a23a;
    --gold-ink: #1f1503;
    --gold-fill: linear-gradient(180deg, #fff0bf 0%, #f8d462 40%, #e2ac3e 75%, #c08a2a 100%);
    --gold-edge: linear-gradient(135deg, #fff0bf 0%, #c8912e 35%, #f5c842 65%, #8a5c14 100%);
    --green-fill: linear-gradient(180deg, #2bbd6c 0%, #0f8446 50%, #0a6435 100%);
    --text: #f4f8f1;
    --text-2: #d9e5dc;
    --muted: #a9bfb1;

    /* Card glass effect: --card-alpha 1 = solid, lower = more see-through */
    --card-alpha: .5;
    --card-blur: 10px;

    --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background-color: var(--bg);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 1.25rem;
    padding:
            clamp(1rem, 4vw, 2.5rem)
            max(.875rem, env(safe-area-inset-right))
            calc(clamp(1rem, 4vw, 2.5rem) + env(safe-area-inset-bottom))
            max(.875rem, env(safe-area-inset-left));
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Fixed page background */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    width: 100%;
    height: 100vh;
    height: 100lvh;
    pointer-events: none;
    background:
            radial-gradient(ellipse 75% 65% at 50% 45%, transparent 0%, rgba(4, 20, 12, 0.6) 100%),
            var(--img-bg) center / cover no-repeat,
            radial-gradient(ellipse 65% 45% at 50% 0%, rgba(20, 184, 102, 0.18), transparent 70%),
            var(--bg);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.icon { width: 1em; height: 1em; fill: currentColor; flex-shrink: 0; }

/* ---------- Card ---------- */
.hub { width: min(100%, 500px); }

.hub-card {
    position: relative;
    isolation: isolate;
    padding: clamp(1.5rem, 5vw, 2.5rem) clamp(1.1rem, 4vw, 2.25rem) clamp(1.25rem, 4vw, 2rem);
    border-radius: 28px;
    background:
            radial-gradient(ellipse 80% 45% at 50% 0%, rgba(20, 184, 102, 0.22), transparent 70%),
            linear-gradient(180deg, rgba(8, 40, 24, var(--card-alpha)), rgba(4, 20, 12, calc(var(--card-alpha) + .04)));
    -webkit-backdrop-filter: blur(var(--card-blur)) saturate(140%);
    backdrop-filter: blur(var(--card-blur)) saturate(140%);
    box-shadow:
            0 0 40px rgba(245, 200, 66, 0.18),
            0 30px 60px -20px rgba(0, 0, 0, 0.8),
            inset 0 1px 0 rgba(255, 233, 166, 0.08);
    text-align: center;
    animation: rise-in .8s cubic-bezier(.2, .7, .2, 1) both;
}

/* Gold gradient border, drawn as a ring so the inside can stay see-through */
.hub-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    padding: 1.5px;
    border-radius: inherit;
    background: var(--gold-edge);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

/* ---------- App icon ---------- */
.hub-logo {
    position: relative;
    width: clamp(150px, 44vw, 210px);
    margin: 0 auto 1.25rem;
}
.hub-logo::before {
    content: "";
    position: absolute;
    inset: 8%;
    z-index: -1;
    background: radial-gradient(circle, rgba(245, 200, 66, 0.35), transparent 65%);
    filter: blur(16px);
}
.hub-logo img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
    animation: float 6s ease-in-out infinite;
}

/* Dashed placeholder while the image file is missing */
.slot--empty img { display: none; }
.slot--empty {
    aspect-ratio: 1;
    border-radius: 22%;
    background:
            repeating-linear-gradient(135deg, rgba(245, 200, 66, 0.06) 0 12px, transparent 12px 24px),
            linear-gradient(180deg, #0b2a1a, #04140c);
}
.slot--empty::after {
    content: attr(data-label);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    white-space: pre-line;
    font-size: .74rem;
    line-height: 1.5;
    color: var(--gold-3);
    border: 1.5px dashed rgba(217, 162, 58, 0.5);
    border-radius: inherit;
}

/* ---------- Text ---------- */
.hub-title {
    margin-bottom: .5rem;
    font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--gold-2);
    background: linear-gradient(180deg, #fff1c2 10%, #f5c842 55%, #d19a33 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}
.hub-sub {
    margin-bottom: 1.5rem;
    font-size: .95rem;
    color: var(--text-2);
    text-wrap: balance;
}

/* ---------- Link buttons ---------- */
.hub-links {
    display: grid;
    gap: 1rem;
    container-type: inline-size; /* lets the button text scale with the card width */
}
.hub-links li { animation: rise-in .6s cubic-bezier(.2, .7, .2, 1) both; }
.hub-links li:nth-child(1) { animation-delay: .25s; }
.hub-links li:nth-child(2) { animation-delay: .35s; }
.hub-links li:nth-child(3) { animation-delay: .45s; }
.hub-links li:nth-child(4) { animation-delay: .55s; }

.hub-btn {
    --lip: #a8731d;
    --glow-c: rgba(245, 200, 66, 0.45);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto; /* [icon + text] [arrow] */
    align-items: center;
    gap: .6rem;
    min-height: 64px;
    padding: .55rem .55rem .55rem 1rem;
    border-radius: 16px;
    border: 1px solid transparent;
    font-size: 1rem;                          /* fallback for older browsers */
    font-size: clamp(.78rem, 4.8cqi, 1.1rem); /* stays on one line on small phones */
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .04em;
    text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
    box-shadow:
            0 4px 0 var(--lip),
            0 14px 24px -12px rgba(0, 0, 0, 0.85),
            inset 0 1px 0 rgba(255, 255, 255, 0.45);
    transition: transform .15s ease, box-shadow .25s ease, filter .25s ease;
}

/* Icon + text, centred in the space beside the arrow */
.hub-btn-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    min-width: 0;
    text-align: center;
    text-wrap: balance;
}
.hub-btn-main .icon { font-size: 1.5em; }

.hub-btn-arrow {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.45rem;
    color: var(--gold-2);
    border: 2px solid transparent;
    background:
            radial-gradient(circle at 50% 35%, #12402a, #05170d 75%) padding-box,
            var(--gold-edge) border-box;
    transition: transform .2s ease;
}

/* Light sweep */
.hub-btn::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: -80%;
    width: 55%;
    transform: skewX(-20deg);
    background: linear-gradient(105deg, transparent 15%, rgba(255, 251, 235, 0.55) 50%, transparent 85%);
    pointer-events: none;
}
.hub-btn.is-pressed::after { left: 135%; transition: left .6s ease; }

/* Pressed: the button sinks onto its lip and glows */
.hub-btn:active,
.hub-btn.is-pressed {
    transform: translateY(3px);
    box-shadow:
            0 1px 0 var(--lip),
            0 8px 16px -10px rgba(0, 0, 0, 0.85),
            inset 0 1px 0 rgba(255, 255, 255, 0.45),
            0 0 0 4px rgba(245, 200, 66, 0.18),
            0 0 30px var(--glow-c);
}

.hub-btn--gold {
    color: var(--gold-ink);
    background: var(--gold-fill);
    border-color: rgba(150, 104, 24, 0.55);
}
.hub-btn--gold .hub-btn-main .icon { color: #0b3d24; }

.hub-btn--green {
    --lip: #064a26;
    --glow-c: rgba(63, 224, 138, 0.4);
    min-height: 68px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    background: var(--green-fill);
    border-color: rgba(120, 240, 170, 0.35);
}
.hub-btn--green::after {
    background: linear-gradient(105deg, transparent 15%, rgba(220, 255, 235, 0.35) 50%, transparent 85%);
}

@media (hover: hover) {
    .hub-btn:hover {
        filter: brightness(1.05) saturate(1.05);
        box-shadow:
                0 4px 0 var(--lip),
                0 14px 24px -12px rgba(0, 0, 0, 0.85),
                inset 0 1px 0 rgba(255, 255, 255, 0.45),
                0 0 26px var(--glow-c);
    }
    .hub-btn:hover::after { left: 135%; transition: left .7s ease; }
    .hub-btn:hover .hub-btn-arrow { transform: translateX(3px); }
}

/* ---------- Note ---------- */
.hub-note {
    margin-top: 1.5rem;
    font-size: .85rem;
    line-height: 1.5;
    color: var(--muted);
    text-wrap: balance;
}
/* Icon sits inline at the start of the sentence, so both wrap and centre together */
.hub-note .icon {
    display: inline-block;
    margin-right: .4rem;
    font-size: 1.2em;
    vertical-align: -0.25em;
    color: var(--gold-2);
}

/* ---------- Footer: always two centred rows ---------- */
.hub-footer {
    display: grid;
    justify-items: center;
    gap: .45rem;
    font-size: .9rem;
    color: var(--text-2);
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    animation: rise-in .6s .65s cubic-bezier(.2, .7, .2, 1) both;
}
.hub-copy { font-size: .85rem; color: var(--muted); }
.age-badge {
    display: inline-grid;
    place-items: center;
    height: 1.6rem;
    margin-right: .5rem;
    padding: 0 .5rem;
    border-radius: 6px;
    border: 1px solid var(--gold-3);
    background: rgba(4, 20, 12, 0.6);
    font-size: .74rem;
    font-weight: 800;
    color: var(--gold-2);
    text-shadow: none;
    vertical-align: middle;
}

/* ---------- Animations ---------- */
@keyframes rise-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}
@keyframes float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -6px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    body::before {
        background:
                radial-gradient(ellipse 90% 70% at 50% 45%, transparent 0%, rgba(4, 20, 12, 0.45) 100%),
                var(--img-bg-mobile) center / cover no-repeat,
                radial-gradient(ellipse 80% 45% at 50% 0%, rgba(20, 184, 102, 0.2), transparent 70%),
                var(--bg);
    }
}

/* Phones: glass card so the background stays visible */
@media (max-width: 760px) {
    :root { --card-alpha: .5; --card-blur: 10px; }
}

/* Very small phones */
@media (max-width: 380px) {
    .hub-btn { min-height: 58px; padding-left: .8rem; }
    .hub-btn--green { min-height: 62px; }
    .hub-btn-arrow { width: 40px; height: 40px; font-size: 1.3rem; }
}

/* Phones in landscape: smaller icon so the links stay visible */
@media (max-height: 640px) and (orientation: landscape) {
    .hub-logo { width: 120px; margin-bottom: .75rem; }
    .hub-sub { margin-bottom: 1rem; }
}

/* Browsers without blur support: keep the card solid so text stays readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    :root { --card-alpha: .9; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}