/* ============================================================
   Eric Martel — landing page
   Bold & playful. Dark base, vivid gradients, game-industry energy.
   ============================================================ */

:root {
    --bg:        #0c0a1a;
    --bg-2:      #14102b;
    --surface:   #1a1436;
    --surface-2: #221a45;
    --ink:       #f4f1ff;
    --ink-soft:  #b9b2d8;
    --ink-dim:   #7d76a3;
    --line:      rgba(255, 255, 255, .09);

    --pink:   #ff2e93;
    --purple: #7c4dff;
    --cyan:   #00e0c6;
    --yellow: #ffd23f;

    --grad-hot: linear-gradient(120deg, #ff2e93, #7c4dff 55%, #4dd7ff);
    --radius:   22px;
    --shadow:   0 30px 60px -25px rgba(0, 0, 0, .8);
    --maxw:     1180px;
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body:    'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body::before {
    /* subtle grid texture */
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 70%);
    opacity: .5;
    pointer-events: none;
    z-index: 0;
}

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

h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; margin: 0; }

em { font-style: normal; background: var(--grad-hot); -webkit-background-clip: text; background-clip: text; color: transparent; }

.section__title em { padding-right: .05em; }

/* ---------------------------- NAV ---------------------------- */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px clamp(18px, 5vw, 54px);
    transition: background .3s ease, backdrop-filter .3s ease, padding .3s ease;
}
.nav.is-stuck {
    background: rgba(12, 10, 26, .72);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding-top: 12px;
    padding-bottom: 12px;
}
.nav__brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -.02em;
}
.nav__brand span { color: var(--pink); }
.nav__links { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); }
.nav__links a { color: var(--ink-soft); font-weight: 500; font-size: .95rem; transition: color .2s; }
.nav__links a:hover { color: var(--ink); }
.nav__cta {
    background: var(--grad-hot);
    color: #fff !important;
    padding: 9px 18px;
    border-radius: 999px;
    font-weight: 600 !important;
}
@media (max-width: 640px) {
    .nav__links a:not(.nav__cta) { display: none; }
}

/* ---------------------------- HERO ---------------------------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 120px clamp(18px, 5vw, 54px) 90px;
    overflow: hidden;
}
.hero__inner { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; width: 100%; }

.hero__blobs { position: absolute; inset: 0; z-index: 1; }
.hero__canvas { position: absolute; inset: 0; z-index: 1; display: block; }
/* Dims the background behind the headline so text stays crisp. */
.hero__scrim {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
        linear-gradient(100deg, var(--bg) 0%, rgba(12,10,26,.72) 30%, rgba(12,10,26,.22) 62%, rgba(12,10,26,0) 100%),
        linear-gradient(to bottom, var(--bg) 0%, transparent 22%, transparent 80%, var(--bg) 100%);
}
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.blob--1 { width: 46vw; height: 46vw; background: var(--pink);   top: -8%;  left: -6%; }
.blob--2 { width: 40vw; height: 40vw; background: var(--purple); bottom: -14%; right: -4%; }
.blob--3 { width: 30vw; height: 30vw; background: var(--cyan);   top: 30%;  right: 24%; opacity: .38; }

.hero__eyebrow {
    display: inline-block;
    font-weight: 600;
    color: var(--ink-soft);
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--line);
    padding: 7px 16px;
    border-radius: 999px;
    margin: 0 0 26px;
}
.hero__title {
    font-size: clamp(3rem, 9vw, 6.5rem);
    font-weight: 700;
    letter-spacing: -.03em;
    margin-bottom: 26px;
}
.hero__rotator {
    background: var(--grad-hot);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    min-height: 1.05em;
}
.hero__tagline { font-size: clamp(1.15rem, 2.4vw, 1.6rem); font-weight: 500; max-width: 40ch; margin: 0 0 16px; }
.hero__intro { color: var(--ink-soft); max-width: 54ch; margin: 0 0 34px; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 54px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    padding: 15px 28px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .2s;
}
.btn--primary { background: var(--grad-hot); color: #fff; box-shadow: 0 14px 30px -12px var(--pink); }
.btn--primary:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 22px 40px -14px var(--pink); }
.btn--ghost { background: rgba(255, 255, 255, .05); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .1); }
.btn--block { width: 100%; justify-content: center; }

.hero__stats { display: flex; flex-wrap: wrap; gap: clamp(24px, 5vw, 64px); }
.stat__value { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 4vw, 2.8rem); background: var(--grad-hot); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat__label { color: var(--ink-dim); font-size: .9rem; }


/* ---------------------------- SECTIONS ---------------------------- */
.section { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: clamp(70px, 12vw, 140px) clamp(18px, 5vw, 54px); }
.section__head { max-width: 720px; margin-bottom: 54px; }
.section__kicker { display: inline-block; font-family: var(--font-display); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; color: var(--pink); margin-bottom: 14px; }
.section__title { font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 700; letter-spacing: -.03em; }
.section__lead { color: var(--ink-soft); font-size: clamp(1rem, 1.6vw, 1.2rem); margin-top: 16px; }

/* ---------------------------- GAMES ---------------------------- */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 26px; }

.game-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
    will-change: transform;
}
.game-card:hover { transform: translateY(-8px); border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 30px 50px -30px var(--accent); }

.game-card__art {
    position: relative;
    aspect-ratio: 16 / 10;
    display: grid;
    place-items: center;
    background:
        radial-gradient(120% 120% at 20% 10%, color-mix(in srgb, var(--accent) 65%, transparent), transparent 60%),
        linear-gradient(135deg, var(--surface-2), var(--bg-2));
    overflow: hidden;
}
.game-card__art img { width: 100%; height: 100%; object-fit: cover; }
.game-card__monogram { font-family: var(--font-display); font-weight: 700; font-size: 3.4rem; color: #fff; text-shadow: 0 4px 30px rgba(0, 0, 0, .5); letter-spacing: -.03em; }
.game-card__year { position: absolute; top: 12px; right: 12px; font-size: .78rem; font-weight: 600; background: rgba(0, 0, 0, .45); backdrop-filter: blur(6px); padding: 4px 10px; border-radius: 999px; color: #fff; }

.game-card__body { padding: 22px 22px 26px; display: flex; flex-direction: column; gap: 8px; }
.game-card__title { font-size: 1.35rem; font-weight: 700; }
.game-card__role { color: var(--accent); font-weight: 600; font-size: .9rem; margin: 0; }
.game-card__blurb { color: var(--ink-soft); font-size: .95rem; margin: 4px 0 6px; }
.game-card__link { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; color: var(--ink-soft); transition: color .2s; }
.game-card__link:hover { color: var(--ink); }
.metascore { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; color: #06210f; font-family: var(--font-display); font-weight: 700; font-size: .92rem; font-variant-numeric: tabular-nums; box-shadow: 0 4px 12px -4px rgba(0,0,0,.6); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 6px 0 0; }
.tags li { font-size: .74rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-soft); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }

/* ---------------------------- WRITING ---------------------------- */
.writing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 26px; }

.write-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
    will-change: transform;
}
.write-card:hover { transform: translateY(-8px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 30px 50px -30px var(--accent); }

.write-card__cover {
    position: relative;
    aspect-ratio: 3 / 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
    overflow: hidden;
    background:
        radial-gradient(130% 100% at 80% 0%, color-mix(in srgb, var(--accent) 70%, transparent), transparent 55%),
        linear-gradient(135deg, var(--surface-2), var(--bg-2));
}
.write-card__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.write-card__cover img.is-contain { object-fit: contain; padding: 18px; background: linear-gradient(135deg, var(--surface-2), var(--bg-2)); filter: drop-shadow(0 10px 20px rgba(0,0,0,.5)); }
.write-card__cover.is-book { background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 2px, transparent 2px 18px), radial-gradient(130% 100% at 80% 0%, color-mix(in srgb, var(--accent) 70%, transparent), transparent 55%), linear-gradient(135deg, var(--surface-2), var(--bg-2)); }
.write-card__icon { font-size: 2.6rem; filter: drop-shadow(0 6px 16px rgba(0,0,0,.5)); }
.write-card__coverTitle { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: #fff; max-width: 22ch; }

.write-card__body { padding: 22px 22px 26px; display: flex; flex-direction: column; gap: 8px; }
.badge { align-self: flex-start; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--bg); background: var(--accent); padding: 4px 11px; border-radius: 999px; }
.write-card__title { font-size: 1.2rem; font-weight: 700; }
.write-card__meta { color: var(--ink-dim); font-size: .85rem; margin: 0; }
.write-card__blurb { color: var(--ink-soft); font-size: .95rem; }
.write-card__link { margin-top: auto; font-weight: 600; color: var(--accent); }

/* ---------------------------- CONNECT ---------------------------- */
.connect {
    max-width: 760px; margin: 0 auto; text-align: center;
    background: linear-gradient(160deg, var(--surface), var(--bg-2));
    border: 1px solid var(--line); border-radius: 30px;
    padding: clamp(36px, 6vw, 72px); box-shadow: var(--shadow);
}
.connect .section__lead { margin: 16px auto 0; max-width: 52ch; }

.connect__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 36px; }
.social {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 15px 24px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--line);
    font-weight: 600;
    transition: transform .18s ease, background .2s, border-color .2s;
}
.social:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .08); }
.social__emoji { font-size: 1.2rem; }
.social--linkedin { background: #0a66c2; border-color: transparent; color: #fff; }
.social--linkedin:hover { background: #338be0; }

/* ---------------------------- FOOTER ---------------------------- */
.footer { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 30px clamp(18px, 5vw, 54px) 60px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--ink-dim); border-top: 1px solid var(--line); }
.footer__top { color: var(--ink-soft); font-weight: 600; }

/* ---------------------------- REVEAL ----------------------------
   Content is VISIBLE by default (no-JS / reduced-motion / any failure).
   The pre-hidden state is only applied once JS confirms it will animate,
   by adding `.js-motion` to <html> (see the inline script in <head>).
   Inline opacity written by anime.js always wins over these rules, so a
   completed or safety-net'd element stays visible. */
.js-motion [data-reveal],
.js-motion [data-game],
.js-motion [data-write] { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; scroll-behavior: auto; }
    [data-reveal], [data-game], [data-write] { opacity: 1 !important; transform: none !important; }
}
