/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
    --bg: #060812;
    --bg-card: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-primary: #f0f4ff;
    --text-secondary: #8892aa;
    --text-muted: #4a5268;
    --teal: #2dd4bf;
    --purple: #7c3aed;
    --pink: #ec4899;
    --blue: #3b82f6;
    --font: 'Outfit', sans-serif;
    --radius-card: 18px;
    --radius-btn: 100px;
    --shadow-glass: 0 8px 32px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.08);
    --speed: 0.45s;
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);

    --header-h: 68px;
    --footer-h: 46px;
    --card-gap: 1.1rem;
    --page-pad: 2rem;     /* horizontal padding for the card row */
    --row-pad: 0.85rem;   /* vertical padding above/below card row */
    --actions-h: 50px;    /* approx height of the card action bar */
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   BACKGROUND CANVAS
   ============================================================ */
.bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Floating gradient orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    will-change: transform;
    animation: float-orb linear infinite;
}
.orb-1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(124,58,237,0.55) 0%, transparent 70%);
    top: -180px; left: -180px;
    animation-duration: 22s;
}
.orb-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(45,212,191,0.4) 0%, transparent 70%);
    bottom: 0; right: -120px;
    animation-duration: 28s;
    animation-direction: reverse;
}
.orb-3 {
    width: 440px; height: 440px;
    background: radial-gradient(circle, rgba(236,72,153,0.3) 0%, transparent 70%);
    top: 35%; left: 45%;
    animation-duration: 18s;
}
.orb-4 {
    width: 340px; height: 340px;
    background: radial-gradient(circle, rgba(59,130,246,0.28) 0%, transparent 70%);
    bottom: 10%; left: 20%;
    animation-duration: 32s;
    animation-direction: reverse;
}

@keyframes float-orb {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(45px, -35px) scale(1.08); }
    66%  { transform: translate(-25px, 25px) scale(0.95); }
    100% { transform: translate(0, 0) scale(1); }
}

/* ---- Full-page hover background videos ---- */
.bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Heavy blur + very low opacity so it blends with orbs */
    filter: blur(40px) saturate(1.4) brightness(0.55);
    opacity: 0;
    transition: opacity 0.7s var(--ease-smooth);
    /* Slight scale to hide blur edges */
    transform: scale(1.06);
    mix-blend-mode: screen;
}

.bg-video.active {
    opacity: 0.28;
}

.noise-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.3;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
    background-size: 256px;
}

/* ============================================================
   SCREEN WRAPPER
   ============================================================ */
.screen-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 0;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    flex: 0 0 var(--header-h);
    display: flex;
    align-items: center;
    padding: 0 var(--page-pad);
    background: rgba(6,8,18,0.65);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    width: 100%;
}

.nav-logo-link { display: flex; align-items: center; flex-shrink: 0; }

.nav-logo {
    height: 36px;
    width: auto;
    mix-blend-mode: screen;
    filter: brightness(1.35);
}

.header-text { flex: 1; min-width: 0; }

.main-title {
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gradient-text {
    background: linear-gradient(135deg, var(--teal) 0%, var(--purple) 50%, var(--pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradient-shift 5s ease infinite;
}

@keyframes gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.subtitle {
    font-size: clamp(0.65rem, 1vw, 0.82rem);
    color: var(--text-secondary);
    font-weight: 300;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(45,212,191,0.1);
    border: 1px solid rgba(45,212,191,0.3);
    border-radius: 100px;
    padding: 0.32rem 0.9rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--teal);
}

.badge-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--teal);
    animation: pulse-dot 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.5); }
}

/* ============================================================
   SHOWCASE — centred row of portrait cards
   ============================================================ */
.showcase-container {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: row;
    align-items: center;        /* vertically centre the row of cards */
    justify-content: center;
    gap: var(--card-gap);
    padding: var(--row-pad) var(--page-pad);
    overflow: hidden;
}

/* ============================================================
   CARD
   Key idea:
   - The available height of the row is H = 100dvh - header - footer - row-pad*2
   - Each card must be at most H tall
   - Each card must also fit 4-across: width <= (100vw - page-pad*2 - gap*3) / 4
   - Cards maintain 9:16 portrait aspect ratio
   We achieve this purely in CSS using aspect-ratio + height + max-width.
   ============================================================ */
.card {
    /*
     * SIZING LOGIC — width-first approach:
     * We pick the SMALLEST of three constraints:
     *   A) Width derived from 85% of available row height at 9:16 ratio
     *      → prevents cards being taller than the screen
     *   B) Width to fit 4 cards side-by-side with gaps
     *      → prevents horizontal overflow
     *   C) Absolute max cap of 210px
     *      → prevents cards being huge on tall monitors
     * Height is then auto-derived from width via aspect-ratio (no stretching).
     */
    --avail-h: calc(100dvh - var(--header-h) - var(--footer-h) - 2 * var(--row-pad));
    width: min(
        calc(var(--avail-h) * 0.85 * 9 / 16),
        calc((100vw - 2 * var(--page-pad) - 3 * var(--card-gap)) / 4),
        210px
    );
    height: auto;
    aspect-ratio: 9 / 16;
    flex: 0 0 auto;

    display: flex;
    flex-direction: column;
    border-radius: var(--radius-card);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-glass);
    overflow: hidden;
    transition:
        transform var(--speed) var(--ease-smooth),
        box-shadow var(--speed) ease;
    animation: fade-up 0.6s var(--ease-smooth) both;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.12s; }
.card:nth-child(3) { animation-delay: 0.19s; }
.card:nth-child(4) { animation-delay: 0.26s; }

@keyframes fade-up {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow:
        0 28px 55px rgba(0,0,0,0.65),
        0 0 0 1px rgba(255,255,255,0.15),
        inset 0 1px 0 rgba(255,255,255,0.1);
    z-index: 2;
}

/* ---- Media area: fills everything above the action bar ---- */
.card-media-wrapper {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    background: #000;
    /* Ensure the media area is visible (not collapsed) */
    min-height: 60px;
}

.background-video {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: filter var(--speed) ease, transform var(--speed) var(--ease-smooth);
}

.card:hover .background-video { transform: scale(1.04); }

.background-video.blurred {
    filter: blur(16px) brightness(0.3) saturate(0.4);
    transform: scale(1.12);
}

/* Ambient teal glow at bottom */
.card-glow {
    position: absolute;
    bottom: -25%; left: 50%;
    transform: translateX(-50%);
    width: 70%; height: 40%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(45,212,191,0.3), transparent 70%);
    filter: blur(22px);
    pointer-events: none;
    z-index: 1;
}

/* ---- Text overlay ---- */
.card-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 2.2rem 1rem 0.9rem;
    background: linear-gradient(
        to top,
        rgba(4,5,12,0.97) 0%,
        rgba(4,5,12,0.7) 50%,
        transparent 100%
    );
    z-index: 2;
    pointer-events: none;
    transition: opacity var(--speed) ease;
}

.card-overlay.fade-out { opacity: 0; }

.card-tag {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--teal);
    background: rgba(45,212,191,0.12);
    border: 1px solid rgba(45,212,191,0.3);
    padding: 0.18rem 0.5rem;
    border-radius: 100px;
    margin-bottom: 0.35rem;
}

.card-title {
    font-size: clamp(0.9rem, 1.2vw, 1.15rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.card-description {
    font-size: clamp(0.66rem, 0.85vw, 0.78rem);
    color: #b8c3d4;
    line-height: 1.48;
    font-weight: 300;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- QR overlay ---- */
.qr-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    transition: opacity var(--speed) ease, visibility var(--speed);
}

.qr-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.qr-glass-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    padding: 1.1rem 0.9rem;
    border-radius: 16px;
    background: rgba(10,12,26,0.78);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1);
    transform: scale(0.84);
    transition: transform var(--speed) var(--ease-bounce);
    width: 84%;
}

.qr-overlay:not(.hidden) .qr-glass-card { transform: scale(1); }

.qr-image {
    width: min(140px, 58%);
    height: auto;
    aspect-ratio: 1;
    border-radius: 10px;
    display: block;
}

.qr-label {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.qr-url {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--teal);
    text-decoration: none;
    background: rgba(45,212,191,0.1);
    border: 1px solid rgba(45,212,191,0.25);
    padding: 0.28rem 0.75rem;
    border-radius: 100px;
    transition: background 0.3s ease, border-color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.qr-url:hover {
    background: rgba(45,212,191,0.22);
    border-color: rgba(45,212,191,0.5);
}

/* ---- Action bar ---- */
.card-actions {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.85rem;
    background: rgba(8,10,22,0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    font-family: var(--font);
    font-size: 0.76rem;
    font-weight: 600;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: var(--radius-btn);
    padding: 0.28rem 0.48rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.action-btn i { font-size: 0.82rem; }

.qr-toggle-btn:hover,
.qr-toggle-btn.active {
    color: var(--teal);
    background: rgba(45,212,191,0.1);
}

.visit-btn {
    color: var(--text-primary);
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--glass-border);
    padding: 0.28rem 0.75rem;
}

.visit-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.22);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    flex: 0 0 var(--footer-h);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0 var(--page-pad);
    background: rgba(6,8,18,0.7);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-top: 1px solid var(--glass-border);
}

.powered-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.footer-logo-link { display: inline-flex; align-items: center; }

.footer-logo {
    height: 26px;
    width: auto;
    mix-blend-mode: screen;
    filter: brightness(1.3);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.footer-logo:hover {
    filter: brightness(1.7);
    transform: scale(1.06);
}

.footer-sep {
    display: block;
    width: 1px;
    height: 16px;
    background: var(--glass-border);
}

.footer-copy {
    font-size: 0.67rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.03em;
}

/* ============================================================
   MOBILE: portrait phones and small screens - 2x2 grid
   ============================================================ */
@media (max-width: 680px) {
    :root {
        --header-h: 56px;
        --footer-h: 40px;
        --card-gap: 0.6rem;
        --page-pad: 0.7rem;
        --row-pad: 0.5rem;
    }

    .header-badge, .subtitle { display: none; }
    .nav-logo { height: 26px; }
    .main-title { font-size: 0.95rem; }

    /* Switch to 2x2 grid - cards sized to half viewport */
    .showcase-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        align-items: stretch;
        justify-items: stretch;
    }

    .card {
        /* Reset to simple aspect-ratio grid cell */
        width: auto;
        max-width: none;
        height: auto;
        aspect-ratio: 9 / 16;
        flex: unset;
    }

    .card-title { font-size: 0.82rem; }
    .card-description { -webkit-line-clamp: 2; font-size: 0.68rem; }
    .card-tag { font-size: 0.52rem; }
    .btn-label { display: none; }
    .action-btn { padding: 0.3rem 0.4rem; }
    .visit-btn { padding: 0.3rem 0.55rem; }
    .qr-image { width: min(110px, 55%); }
    .qr-glass-card { padding: 0.8rem 0.65rem; gap: 0.38rem; }
    .qr-url { font-size: 0.68rem; }

    .footer-copy, .footer-sep { display: none; }
    .powered-label { font-size: 0.62rem; }
}

/* Very small phones */
@media (max-width: 360px) {
    :root {
        --header-h: 50px;
        --footer-h: 36px;
        --card-gap: 0.45rem;
        --page-pad: 0.5rem;
    }
}

/* Medium/large tablets in landscape: keep the row but tighten up */
@media (min-width: 681px) and (max-width: 1024px) {
    :root {
        --page-pad: 1.2rem;
        --card-gap: 0.8rem;
    }
    .header-badge { display: none; }
}
