/* =========================================================
   SPANNABIS CHAMPIONS CUP 2027 — cinematic entry
   Re-skin via the :root palette (pulled from the poster).
   ========================================================= */

:root {
    /* ---- PALETTE (sampled from the poster) ---- */
    --c-base:         #102018;  /* deep forest green → page background */
    --c-base-2:       #16291d;  /* lighter, for card gradients */
    --c-text:         #f3ead0;  /* warm cream → body text */
    --c-text-soft:    #e6dab4;  /* dimmer text */
    --c-accent:       #e7d49a;  /* THE accent (poster gold-khaki) */
    --c-accent-bright:#f4e6ba;  /* highlight version */
    --c-accent-deep:  #c8ad63;  /* shadow version */
    --c-warm:         #6f7d49;  /* secondary moss tone (glows only) */
    --c-deep:         #1d5238;  /* secondary deep green (glows only) */
    --c-ink:          #0b1610;  /* near-black, for text on the accent */

    /* accent as raw channels → reuse in rgba() everywhere */
    --acc: 231,212,154;
    --base: 16,32,24;

    --grad-accent: linear-gradient(135deg,#f4e6ba 0%,#e7d49a 50%,#c8ad63 100%);

    --radius-md: 14px;
    --radius-full: 999px;
    --max-w: 1320px;
    --ease: cubic-bezier(.16,1,.3,1);

    /* Shared width: the emblem and the place line both key off this.
       min(vw, vh) keeps the emblem from dominating short viewports. */
    --brand-width: clamp(170px, min(25vw, 32vh), 300px);
}

/* ---------- Reset ---------- */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }      /* single screen, no scroll */
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--c-base);
    color: var(--c-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.5;
    position: relative;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .25s var(--ease); }
::selection { background: var(--c-accent); color: var(--c-ink); }

.sr-only {
    position: absolute !important; width: 1px !important; height: 1px !important;
    padding: 0 !important; margin: -1px !important; overflow: hidden !important;
    clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important;
}

/* =========================================================
   BACKGROUND — stacked layers create cinematic depth
   poster → skyline → vignette → grain → glows → particles
   ========================================================= */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }

/* 1. The key visual (green wall texture). Ken Burns = slow drift. */
.bg__poster {
    position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: center;
    filter: saturate(1.05) contrast(1.06);
    animation: kenBurns 22s ease-in-out infinite alternate;
    will-change: transform; transform-origin: center center;
}
@keyframes kenBurns {
    0%   { transform: scale(1.08) translate(0,0)      rotate(0deg); }
    50%  { transform: scale(1.16) translate(-2%,1.4%) rotate(.4deg); }
    100% { transform: scale(1.12) translate(2%,-1.4%) rotate(-.4deg); }
}

/* 1b. Faint Bilbao skyline, low on the frame. */
.bg__skyline {
    position: absolute; z-index: 2; left: 50%; bottom: clamp(40px, 8vh, 92px);
    width: min(1280px, 128vw); height: auto; transform: translateX(-50%);
    opacity: .12; mix-blend-mode: screen; pointer-events: none;
    filter: drop-shadow(0 0 1px rgba(var(--acc),.2));
}

/* 2. Vignette: darkens edges + top/bottom so text always reads. */
.bg__vignette {
    position: absolute; inset: 0; z-index: 1;
    background:
        radial-gradient(ellipse at center, rgba(var(--base),.12) 0%, rgba(var(--base),.68) 55%, rgba(var(--base),.95) 100%),
        linear-gradient(180deg, rgba(var(--base),.9) 0%, rgba(var(--base),.42) 26%, rgba(var(--base),.55) 68%, rgba(var(--base),.98) 100%);
}

/* 3. Film grain: tiny SVG noise, overlay-blended at low opacity. */
.bg__grain {
    position: absolute; inset: 0; z-index: 3; opacity: .07; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
}

/* 4. Big blurred colour glows drifting behind everything. */
.ambient-lights { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.ambient { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(120px); will-change: transform; }
.ambient--accent { top:-22%; left:-12%;  background: radial-gradient(circle,var(--c-accent), transparent 60%); opacity:.16; animation: drift 16s ease-in-out infinite alternate; }
.ambient--deep   { bottom:-32%; right:-22%; background: radial-gradient(circle,var(--c-deep), transparent 60%);  opacity:.6;  animation: drift 20s ease-in-out infinite alternate-reverse; }
.ambient--warm   { top:48%; left:42%;     background: radial-gradient(circle,var(--c-warm), transparent 60%);  opacity:.3;  animation: drift 13s ease-in-out infinite alternate; }
@keyframes drift {
    0%   { transform: translate(0,0)      scale(1)    rotate(0deg); }
    50%  { transform: translate(6vw,-4vh) scale(1.15) rotate(8deg); }
    100% { transform: translate(-8vw,7vh) scale(.95)  rotate(-6deg); }
}

/* 5. Floating dust motes — subtle life, screen-blended. */
.bg::after {
    content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 12% 18%, rgba(var(--acc),.5), transparent),
        radial-gradient(1.5px 1.5px at 28% 72%, rgba(var(--acc),.4), transparent),
        radial-gradient(1px 1px at 55% 35%, rgba(255,248,224,.55), transparent),
        radial-gradient(2px 2px at 78% 82%, rgba(var(--acc),.45), transparent),
        radial-gradient(1.5px 1.5px at 88% 24%, rgba(255,248,224,.4), transparent),
        radial-gradient(1px 1px at 38% 55%, rgba(var(--acc),.35), transparent);
    animation: particlesFloat 26s linear infinite; mix-blend-mode: screen; opacity: .75;
}
@keyframes particlesFloat { 0% { transform: translate3d(0,0,0); } 100% { transform: translate3d(0,-40px,0); } }

/* =========================================================
   HEADER — venue logo (left) + language switcher (right)
   ========================================================= */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50; padding: 14px clamp(16px,3vw,34px);
    background: linear-gradient(180deg, rgba(var(--base),.92) 0%, rgba(var(--base),.5) 72%, rgba(var(--base),0) 100%);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.header-inner { max-width: var(--max-w); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.venue {
    display: inline-flex; align-items: center; opacity: 0; transform: translateY(-10px);
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.6));
    animation: partnerEnter .8s var(--ease) .25s forwards;
    transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.venue:hover { opacity: 1 !important; transform: translateY(-1px); }
.venue img { height: clamp(30px, 4.4vh, 42px); width: auto; object-fit: contain; }
@keyframes partnerEnter { to { opacity: .92; transform: translateY(0); } }

/* Language switcher */
.lang-switcher {
    display: flex; align-items: center; gap: 4px; padding: 5px 6px;
    background: rgba(var(--base),.62); border: 1px solid rgba(var(--acc),.3);
    border-radius: var(--radius-full); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    opacity: 0; transform: translateY(-10px); animation: partnerEnter .8s var(--ease) .4s forwards;
    box-shadow: 0 6px 18px -8px rgba(0,0,0,.6);
}
.lang { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: var(--radius-full); opacity: .82; transition: all .3s var(--ease); }
.lang:hover, .lang:focus-visible { opacity: 1; background: linear-gradient(135deg, rgba(var(--acc),.28), rgba(var(--acc),.08)); transform: translateY(-1px); outline: none; }
.lang--active { opacity: 1; background: linear-gradient(135deg, rgba(var(--acc),.2), rgba(var(--acc),.05)); box-shadow: inset 0 0 0 1px rgba(var(--acc),.3); }
.lang--active .lang__code { color: var(--c-accent-bright); }
.lang__code { font-family: 'Bebas Neue', sans-serif; font-size: 16px; letter-spacing: 2px; color: var(--c-text); line-height: 1; }
.flag { width: 20px; height: 14px; border-radius: 3px; overflow: hidden; display: inline-flex; box-shadow: 0 0 0 1px rgba(255,255,255,.15), 0 1px 3px rgba(0,0,0,.4); }
.flag svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.lang-sep { width: 1px; height: 18px; background: rgba(var(--acc),.28); }

/* =========================================================
   HERO LOCKUP
   ========================================================= */
.hero {
    position: relative; z-index: 5; width: 100%;
    height: 100vh; height: 100dvh;
    display: flex; align-items: flex-start; justify-content: center;
    padding: clamp(86px, 12vh, 132px) clamp(16px,4vw,28px) clamp(28px,5vh,52px);
}
.hero__inner {
    width: 100%; max-width: 1040px; text-align: center;
    display: flex; flex-direction: column; align-items: center;
    gap: clamp(9px, 1.5vh, 16px);
}

/* Edition / date mark */
.hero__edition { display: flex; justify-content: center; }
.date-pill {
    display: inline-flex; align-items: center; gap: .55em;
    font-family: 'Bebas Neue', sans-serif; font-size: clamp(13px, 1.5vw, 18px);
    letter-spacing: .26em; text-transform: uppercase; color: var(--c-accent);
    padding: .5em 1.15em .42em; border-radius: var(--radius-full);
    background: rgba(var(--base),.5); border: 1px solid rgba(var(--acc),.34);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 6px 20px -10px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.05);
}
.date-pill .dot { opacity: .5; }

.hero__brand { display: flex; justify-content: center; }
.hero__wordmark {
    width: var(--brand-width);
    filter: drop-shadow(0 12px 34px rgba(0,0,0,.6)) drop-shadow(0 0 30px rgba(var(--acc),.16));
    animation: brandFloat 7.5s ease-in-out infinite; animation-delay: 1.9s; will-change: transform;
}
@keyframes brandFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* SIGNATURE MOVE: place line is a fraction of --brand-width, letters spread
   edge-to-edge so its ends align with the emblem above. Tune the multiplier. */
.hero__place {
    position: relative; width: calc(var(--brand-width) * 0.95);
    margin: clamp(2px, .8vh, 8px) auto 0;
    font-family: 'Anton', 'Bebas Neue', sans-serif; font-weight: 400;
    font-size: clamp(34px, 6.6vw, 82px); line-height: .9;
    text-transform: uppercase; color: transparent;
}
.hero__place-letters, .hero__place-shine {
    display: flex; justify-content: space-between; align-items: baseline; width: 100%; line-height: 1;
}
.hero__place-letters > span, .hero__place-shine > span { display: inline-block; line-height: 1; transform-origin: 50% 60%; }
.hero__place-letters { position: relative; z-index: 2; color: var(--c-accent); filter: drop-shadow(0 10px 30px rgba(var(--acc),.3)); }

.hero__place-letters > span {
    opacity: 0; transform: translateY(-46px) scale(.85) rotate(-3deg);
    animation: letterDrop 1s cubic-bezier(.34,1.56,.64,1) forwards;
    animation-delay: calc(0.45s + var(--i) * 85ms);
}
@keyframes letterDrop {
    0%  { opacity: 0; transform: translateY(-46px) scale(.85) rotate(-3deg); }
    55% { opacity: 1; transform: translateY(8px)  scale(1.06) rotate(1deg); }
    80% { transform: translateY(-2px) scale(.99) rotate(-.5deg); }
    100%{ opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
.hero__place-shine {
    position: absolute; top: 0; left: 0; z-index: 3; pointer-events: none; opacity: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255,248,224,.6) 50%, transparent 70%);
    background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    animation: shineAppear .6s var(--ease) forwards 1.5s, shine 7s ease-in-out infinite 1.8s;
}
@keyframes shineAppear { to { opacity: 1; } }
@keyframes shine { 0% { background-position: 200% 0; } 60%,100% { background-position: -100% 0; } }

/* =========================================================
   INFO CARDS (key facts + CTA)
   ========================================================= */
.info-cards {
    display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: clamp(10px,1.2vw,16px);
    width: 100%; max-width: 900px; margin: clamp(8px, 1.6vh, 20px) auto 0;
}
.info-card {
    position: relative; display: flex; align-items: center; gap: 15px; padding: 15px 18px;
    text-align: left; isolation: isolate; overflow: hidden; border-radius: var(--radius-md);
    background: linear-gradient(160deg, rgba(var(--base),.8) 0%, rgba(22,41,29,.8) 100%);
    border: 1px solid rgba(var(--acc),.24);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px -8px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.04);
    transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
    opacity: 0; transform: translateY(26px) scale(.96);
    animation: cardEnter 1.05s cubic-bezier(.34,1.46,.64,1) forwards;
}
.info-card:nth-child(1){animation-delay:1.5s} .info-card:nth-child(2){animation-delay:1.6s} .info-card:nth-child(3){animation-delay:1.7s}
@keyframes cardEnter {
    0%  { opacity: 0; transform: translateY(26px) scale(.96); }
    60% { opacity: 1; transform: translateY(-4px) scale(1.015); }
    100%{ opacity: 1; transform: translateY(0) scale(1); }
}
.info-card:hover { border-color: rgba(var(--acc),.55); transform: translateY(-3px); box-shadow: 0 14px 36px -10px rgba(0,0,0,.65), 0 6px 18px -6px rgba(var(--acc),.22); }

.info-card__icon {
    flex-shrink: 0; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    color: var(--c-accent); border-radius: 10px; background: rgba(var(--acc),.08); border: 1px solid rgba(var(--acc),.2);
    transition: all .35s var(--ease);
}
.info-card__icon svg { width: 25px; height: 25px; }
.info-card:hover .info-card__icon { background: rgba(var(--acc),.16); transform: rotate(-4deg) scale(1.04); }

.info-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.info-card__label { font-size: 10px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--c-accent); opacity: .82; }
.info-card__value { font-family: 'Anton','Bebas Neue',sans-serif; font-size: clamp(19px,1.9vw,25px); letter-spacing: 1.2px; color: var(--c-text); line-height: 1; text-transform: uppercase; margin-top: 3px; }
.info-card__sub { font-size: 10.5px; font-weight: 500; letter-spacing: 1px; color: var(--c-text-soft); opacity: .72; text-transform: uppercase; margin-top: 4px; line-height: 1.3; }

/* The CTA card: brighter, breathes + pings to pull the eye. */
.info-card--cta {
    cursor: pointer; border-color: rgba(var(--acc),.5);
    background: linear-gradient(160deg, rgba(var(--acc),.14) 0%, rgba(var(--base),.84) 100%);
    animation: cardEnter 1.05s cubic-bezier(.34,1.46,.64,1) forwards, ctaBreathe 3.4s ease-in-out infinite 2.5s;
}
.info-card--cta:hover { border-color: rgba(var(--acc),.85); box-shadow: 0 14px 40px -10px rgba(0,0,0,.7), 0 6px 24px -6px rgba(var(--acc),.5); animation-play-state: paused, paused; }
.info-card--cta .info-card__icon { background: rgba(var(--acc),.2); border-color: rgba(var(--acc),.45); color: var(--c-accent-bright); position: relative; overflow: visible; }
.info-card--cta .info-card__icon::before { content:''; position:absolute; inset:-3px; border:1.5px solid rgba(var(--acc),.7); border-radius:12px; opacity:0; animation: ctaPing 2.5s cubic-bezier(0,0,.2,1) infinite 2.7s; pointer-events:none; }
@keyframes ctaPing { 0% { opacity:.9; transform:scale(1); } 70%,100% { opacity:0; transform:scale(1.45); } }
@keyframes ctaBreathe {
    0%,100% { box-shadow: 0 8px 24px -8px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.04), 0 0 0 0 rgba(var(--acc),0); }
    50%     { box-shadow: 0 14px 30px -8px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08), 0 0 28px 4px rgba(var(--acc),.24); }
}
.info-card--cta .info-card__value { color: var(--c-accent-bright); }
.info-card__arrow { display: inline-block; margin-left: 3px; transition: transform .3s var(--ease); animation: arrowNudge 2.6s ease-in-out infinite 3s; }
.info-card--cta:hover .info-card__arrow { transform: translateX(4px); animation-play-state: paused; }
@keyframes arrowNudge { 0%,90%,100% { transform: translateX(0); } 93% { transform: translateX(3px); } 96% { transform: translateX(0); } }

/* =========================================================
   ENTRANCE
   ========================================================= */
.reveal { opacity: 0; transform: translateY(22px); animation: revealUp 1s var(--ease) forwards; animation-delay: var(--d, 0ms); }
@keyframes revealUp { to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   RESPONSIVE — shrink to fit, never add scroll
   ========================================================= */
@media (max-width: 900px) {
    .site-header { padding: 10px 16px; }
}
@media (max-width: 720px) {
    .header-inner { gap: 10px; }
    .venue img { height: 26px; }
    .lang { padding: 5px 9px; }
    .hero { padding: 78px 16px clamp(22px,5vh,40px); }
    :root { --brand-width: clamp(150px, min(54vw, 28vh), 280px); }
    .info-cards { grid-template-columns: 1fr; gap: 8px; max-width: 380px; }
    .info-card { padding: 11px 15px; gap: 13px; }
    .info-card__value { font-size: 19px; }
    .info-card__icon { width: 40px; height: 40px; }
    .bg__skyline { bottom: clamp(50px,9vh,80px); opacity: .1; }
}
/* ---- Height tiers: shrink to fit, never scroll ----
   Real 1366x768 laptops expose only ~660px of viewport once browser chrome
   is subtracted, so these key off height, not width. */

/* Tight height (short laptops, phones): compress the lockup so it never
   scrolls. The full-size treatment is reserved for taller screens (>720px).
   The emblem is also height-bound via min() in :root. */
@media (max-height: 720px) {
    .hero__inner { gap: clamp(6px, 1.1vh, 12px); }
    .hero { padding-top: clamp(60px, 8.5vh, 92px); }
    .info-card__sub { display: none; }
    .info-card { padding: 10px 14px; gap: 12px; }
    .info-card__icon { width: 40px; height: 40px; }
    .info-card__value { font-size: clamp(17px, 1.8vw, 22px); }
    .hero__place { font-size: clamp(26px, 5vw, 56px); }
    .date-pill { font-size: 12px; padding: .42em 1em; }
}

/* Very short (landscape phones): minimal. */
@media (max-height: 480px) {
    :root { --brand-width: clamp(104px, 30vh, 168px); }
    .hero { padding-top: 50px; padding-bottom: 12px; }
    .hero__inner { gap: 4px; }
    .info-cards { grid-template-columns: repeat(3, minmax(0,1fr)); max-width: 760px; gap: 8px; }
    .info-card { padding: 8px 11px; gap: 9px; }
    .info-card__value { font-size: 16px; }
    .hero__edition { display: none; }
}

/* =========================================================
   REDUCED MOTION — kill decorative animation
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important;
    }
    .reveal,
    .bg__poster, .ambient, .bg::after, .bg__skyline,
    .hero__wordmark, .hero__place-letters > span, .hero__place-shine,
    .info-card, .info-card--cta, .info-card--cta .info-card__icon::before, .info-card__arrow,
    .venue, .lang-switcher {
        animation: none !important; opacity: 1 !important; transform: none !important;
    }
    .venue, .lang-switcher { opacity: .92 !important; }
    .bg__poster { transform: scale(1.06) !important; }
    .bg__skyline { opacity: .12 !important; transform: translateX(-50%) !important; }
}
