/* =============================================================================
   EH Team — Landing Page Styles
   A Canadian Gaming & Tech Community

   Table of Contents
   1.  Design tokens (CSS custom properties)
   2.  Reset & base
   3.  Layout helpers
   4.  Accessibility (skip link, focus, reduced motion)
   5.  Buttons
   6.  Header / navigation
   7.  Hero
   8.  Section headings
   9.  Feature cards
   10. About section
   11. Call to action
   12. Footer
   13. Scroll reveal animation
   14. Responsive / media queries
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
    /* Backgrounds */
    --bg-900: #0f172a;
    --bg-800: #111827;

    /* Accents */
    --red: #ef4444;          /* Canadian red */
    --red-dark: #dc2626;
    --blue: #3b82f6;         /* Secondary */
    --blue-dark: #2563eb;

    /* Text */
    --text: #ffffff;
    --text-muted: #cbd5e1;
    --text-dim: #94a3b8;

    /* Surfaces (glassmorphism) */
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(239, 68, 68, 0.4);

    /* Gradients */
    --grad-accent: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    --grad-text: linear-gradient(120deg, #ffffff 0%, #cbd5e1 60%, var(--red) 130%);

    /* Sizing */
    --container: 1160px;
    --header-h: 68px;        /* approx sticky header height — used for hero fill + scroll offset */
    --radius: 18px;
    --radius-sm: 12px;

    /* Effects */
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 12px 40px rgba(239, 68, 68, 0.28);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Type */
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* -----------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px); /* offset for fixed header on anchor jumps */
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    line-height: 1.6;
    background-color: var(--bg-900);
    /* Layered soft gradients for depth */
    background-image:
        radial-gradient(60rem 60rem at 15% -10%, rgba(59, 130, 246, 0.12), transparent 60%),
        radial-gradient(50rem 50rem at 100% 0%, rgba(239, 68, 68, 0.12), transparent 55%),
        linear-gradient(180deg, var(--bg-900) 0%, var(--bg-800) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3 {
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* -----------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 1.5rem;
}

section {
    position: relative;
    padding-block: clamp(4rem, 10vw, 7rem);
}

/* -----------------------------------------------------------------------------
   4. Accessibility
   -------------------------------------------------------------------------- */
.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 1000;
    background: var(--red);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 var(--radius-sm) 0;
    font-weight: 600;
}
.skip-link:focus {
    left: 0;
}

/* Visible, consistent focus outline for keyboard users */
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
    border-radius: 4px;
}

/* -----------------------------------------------------------------------------
   4b. Icons (SVG sprite)
   -------------------------------------------------------------------------- */
.icon {
    width: 1.25em;
    height: 1.25em;
    fill: none;              /* line icons default to stroke-only */
    stroke: currentColor;    /* inherit color from surrounding text */
    vertical-align: middle;
    flex-shrink: 0;
}
/* Maple leaf is a filled glyph, not a stroked one */
.hero__maple,
.site-footer__maple,
.about__panel-maple {
    fill: currentColor;
    stroke: none;
}

/* -----------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
    --btn-py: 0.85rem;
    --btn-px: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: var(--btn-py) var(--btn-px);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition),
                background var(--transition), border-color var(--transition);
    will-change: transform;
}

.btn--large {
    --btn-py: 1.05rem;
    --btn-px: 2.4rem;
    font-size: 1.075rem;
}

.btn--primary {
    background: var(--grad-accent);
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.btn--primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 50px rgba(239, 68, 68, 0.45);
}
.btn--primary:active {
    transform: translateY(-1px);
}

.btn--secondary {
    background: var(--glass-bg);
    color: var(--text);
    border-color: var(--glass-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.btn--secondary:hover {
    transform: translateY(-3px);
    border-color: var(--blue);
    background: rgba(59, 130, 246, 0.12);
}
.btn--secondary:active {
    transform: translateY(-1px);
}

/* -----------------------------------------------------------------------------
   6. Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(15, 23, 42, 0.55);
    border-bottom: 1px solid transparent;
    transition: background var(--transition), border-color var(--transition);
}
/* .is-scrolled toggled via JS once the user scrolls down */
.site-header.is-scrolled {
    background: rgba(15, 23, 42, 0.85);
    border-bottom-color: var(--glass-border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--container);
    margin-inline: auto;
    padding: 0.9rem 1.5rem;
}

.nav__brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.nav__logo {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--grad-accent);
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: var(--shadow-glow);
}

.nav__menu {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
}

.nav__link {
    position: relative;
    padding: 0.5rem 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 8px;
    transition: color var(--transition), background var(--transition);
}
.nav__link:hover {
    color: var(--text);
    background: var(--glass-bg);
}
/* Animated underline accent */
.nav__link::after {
    content: "";
    position: absolute;
    left: 0.9rem;
    right: 0.9rem;
    bottom: 0.3rem;
    height: 2px;
    background: var(--red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
}
.nav__link:hover::after {
    transform: scaleX(1);
}

/* Mobile hamburger toggle — hidden on desktop */
.nav__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    cursor: pointer;
}
.nav__toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    margin-inline: auto;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}
/* Toggle → X animation when menu is open */
.nav__toggle.is-open .nav__toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav__toggle.is-open .nav__toggle-bar:nth-child(2) {
    opacity: 0;
}
.nav__toggle.is-open .nav__toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* -----------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    /* Fill the viewport below the sticky header and center content vertically,
       so the hero fits one screen instead of overflowing. svh accounts for
       mobile browser chrome; the min-height floor keeps it usable on short
       landscape screens. */
    display: flex;
    align-items: center;
    min-height: calc(100svh - var(--header-h));
    padding-block: clamp(2rem, 5vw, 3.5rem);
    text-align: center;
    overflow: hidden;
}

/* Faint tech grid — evokes network/dev aesthetic, masked to fade at edges */
.hero__grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(203, 213, 225, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(203, 213, 225, 0.05) 1px, transparent 1px);
    background-size: 46px 46px;
    /* Fade the grid toward the edges so it never looks like a hard table */
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 78%);
    mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 78%);
}

/* Animated node-network constellation (drawn by js/script.js).
   Reads as connected players / network graph / community links. */
.hero__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.9;
}

/* Decorative soft gradient glows */
.hero__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    z-index: 0;
    pointer-events: none;
}
.hero__glow--red {
    width: 34rem;
    height: 34rem;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.5), transparent 70%);
    top: -8rem;
    right: -6rem;
    animation: float 14s ease-in-out infinite;
}
.hero__glow--blue {
    width: 30rem;
    height: 30rem;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.45), transparent 70%);
    bottom: -10rem;
    left: -6rem;
    animation: float 18s ease-in-out infinite reverse;
}

.hero__inner {
    position: relative;
    z-index: 1;
    max-width: 820px;
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.hero__maple {
    width: 1.05em;
    height: 1.05em;
    color: var(--red);
}

.hero__title {
    font-size: clamp(3.25rem, 12vw, 6.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

.hero__subtitle {
    font-size: clamp(1.15rem, 3vw, 1.6rem);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.hero__tagline {
    font-size: clamp(1rem, 2.4vw, 1.2rem);
    font-weight: 600;
    color: var(--red);
    margin-bottom: 1rem;
}

.hero__text {
    max-width: 620px;
    margin-inline: auto;
    color: var(--text-muted);
    font-size: 1.075rem;
    margin-bottom: 2rem;
}

.hero__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* -----------------------------------------------------------------------------
   8. Section headings
   -------------------------------------------------------------------------- */
.section-heading {
    font-size: clamp(2rem, 5vw, 2.85rem);
    text-align: center;
    margin-bottom: 0.75rem;
}
.section-heading--left {
    text-align: left;
}

.section-subheading {
    text-align: center;
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto 3.5rem;
    font-size: 1.075rem;
}

/* -----------------------------------------------------------------------------
   9. Feature cards (glassmorphism)
   -------------------------------------------------------------------------- */
.features__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.75rem;
}

.card {
    position: relative;
    padding: 2.25rem 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition), border-color var(--transition),
                box-shadow var(--transition), background var(--transition);
    overflow: hidden;
}
/* Subtle gradient sheen along the top edge */
.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--grad-accent);
    opacity: 0;
    transition: opacity var(--transition);
}
.card:hover {
    transform: translateY(-8px);
    border-color: var(--glass-border-hover);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.45);
}
.card:hover::before {
    opacity: 1;
}

.card__icon {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin-bottom: 1.35rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(59, 130, 246, 0.18));
    border: 1px solid var(--glass-border);
    color: var(--red);
    transition: color var(--transition), transform var(--transition);
}
.card__icon .icon {
    width: 28px;
    height: 28px;
}
/* Icon shifts to secondary blue on card hover for a subtle accent */
.card:hover .card__icon {
    color: var(--blue);
    transform: scale(1.05);
}

.card__title {
    font-size: 1.4rem;
    margin-bottom: 0.65rem;
}

.card__text {
    color: var(--text-muted);
    font-size: 1rem;
}

/* -----------------------------------------------------------------------------
   10. About section
   -------------------------------------------------------------------------- */
.about__inner {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3.5rem;
    align-items: center;
}

.about__text {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    max-width: 55ch;
}

.about__highlight {
    margin-top: 1.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}
.about__highlight span {
    color: var(--red);
}

/* Identity / values panel */
.about__panel {
    position: relative;
    padding: 2.5rem 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}
.about__panel-maple {
    position: absolute;
    top: -1rem;
    right: -1.5rem;
    width: 9rem;
    height: 9rem;
    color: var(--red);
    opacity: 0.1;
    pointer-events: none;
}
.about__values {
    list-style: none;
    display: grid;
    gap: 1.25rem;
}
.about__values li {
    display: flex;
    flex-direction: column;
    padding-left: 1rem;
    border-left: 3px solid var(--red);
}
.about__values strong {
    font-size: 1.1rem;
    font-weight: 700;
}
.about__values span {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* -----------------------------------------------------------------------------
   11. Call to action
   -------------------------------------------------------------------------- */
.cta__inner {
    text-align: center;
    max-width: 720px;
    padding: clamp(2.5rem, 6vw, 4rem);
    background:
        radial-gradient(30rem 20rem at 50% -20%, rgba(239, 68, 68, 0.18), transparent 70%),
        var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: calc(var(--radius) + 6px);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
}
.cta__heading {
    font-size: clamp(1.9rem, 5vw, 2.75rem);
    margin-bottom: 0.85rem;
}
.cta__text {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* -----------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--glass-border);
    padding-block: 3rem 2rem;
    background: rgba(15, 23, 42, 0.6);
}
.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}
.site-footer__brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.site-footer__name {
    font-weight: 800;
    font-size: 1.1rem;
}
.site-footer__tag {
    color: var(--text-dim);
    font-size: 0.9rem;
}
.site-footer__nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.site-footer__nav a {
    color: var(--text-muted);
    font-weight: 500;
    transition: color var(--transition);
}
.site-footer__nav a:hover {
    color: var(--red);
}
.site-footer__bottom {
    padding-top: 1.5rem;
    color: var(--text-dim);
    font-size: 0.9rem;
    text-align: center;
}
.site-footer__maple {
    width: 1em;
    height: 1em;
    color: var(--red);
}

/* -----------------------------------------------------------------------------
   13. Scroll reveal animation
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Floating glow keyframes */
@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(2rem, 1.5rem); }
}

/* -----------------------------------------------------------------------------
   14. Responsive / media queries
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
    /* Collapse nav into a mobile dropdown */
    .nav__toggle {
        display: flex;
    }

    .nav__menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        padding: 1rem 1.5rem 1.5rem;
        background: rgba(15, 23, 42, 0.97);
        border-bottom: 1px solid var(--glass-border);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        /* Hidden by default; revealed via .is-open */
        transform: translateY(-12px);
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--transition), transform var(--transition),
                    visibility var(--transition);
    }
    .nav__menu.is-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    .nav__link {
        display: block;
        padding: 0.85rem 0.9rem;
    }
    .nav__link::after {
        display: none;
    }

    /* Stack about section */
    .about__inner {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 520px) {
    .hero__actions {
        flex-direction: column;
    }
    .hero__actions .btn {
        width: 100%;
    }
    .site-footer__inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* -----------------------------------------------------------------------------
   Reduced motion — respect user preference
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        scroll-behavior: auto !important;
    }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .btn:hover,
    .card:hover {
        transform: none;
    }
}
