/* memester.fun: the same look as the app. Cream and violet, black outlines,
   sticker shadows, gold for everything funny. Dark mode follows the device. */

@font-face { font-family: 'Bricolage'; src: url('/fonts/BricolageGrotesque_500Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url('/fonts/BricolageGrotesque_700Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url('/fonts/BricolageGrotesque_800ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }

:root {
    --bg: #FFF6DF;
    --surface: #FFFFFF;
    --surface-muted: #FBEFD2;
    --ink: #111111;
    --muted: #6B6456;
    --line: #111111;
    --shadow: #6A4CFF;
    --accent: #6A4CFF;
    --accent-line: #6A4CFF;
    --on-accent: #FFFFFF;
    --gold: #F1A919;
    --nope: #FF4D6D;
    --mac-red: #FF5F57;
    --radius: 22px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #100E17;
        --surface: #1B1826;
        --surface-muted: #27233A;
        --ink: #F3F0FF;
        --muted: #A59FBD;
        --line: #6E6690;
        --shadow: #3A2F66;
        --accent-line: #8F7BFF;
        --nope: #FF5C79;
    }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 500 17px/1.6 'Bricolage', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* ---- Sticker surfaces: outline plus an offset shadow, like the logo */
.sticker {
    background: var(--surface);
    border: 2.5px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 5px 5px 0 var(--shadow);
}
.pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 22px;
    border: 2.5px solid var(--line);
    border-radius: 999px;
    font-weight: 700; font-size: 16px; text-decoration: none;
    box-shadow: 4px 4px 0 var(--line);
    transition: transform .12s, box-shadow .12s;
}
.pill:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--line); }
.pill.primary { background: var(--accent); color: var(--on-accent); }
.pill.secondary { background: var(--surface); color: var(--ink); }
.pill.soon { cursor: default; }
.pill.soon:hover { transform: none; box-shadow: 4px 4px 0 var(--line); }

/* ---- Navigation */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 26px; letter-spacing: -0.5px; }
.brand img { width: 38px; height: auto; }
.brand b { font-weight: 800; }
.brand span { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { text-decoration: none; font-weight: 700; color: var(--muted); }
.nav-links a:hover { color: var(--ink); }
.nav-links .pill { padding: 8px 16px; font-size: 14px; color: var(--on-accent); box-shadow: 3px 3px 0 var(--line); }

/* ---- Hero */
.hero { padding: 56px 0 88px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 700; }
.eyebrow i { width: 9px; height: 9px; border-radius: 50%; background: var(--nope); animation: led 1.4s infinite; }
h1 { font-size: clamp(44px, 7vw, 84px); line-height: .98; letter-spacing: -2.5px; font-weight: 800; margin: 22px 0; }
h1 em { font-style: normal; color: var(--accent-line); }
h1 .gold { color: var(--gold); -webkit-text-stroke: 2px var(--line); paint-order: stroke fill; }
.lead { font-size: 20px; color: var(--muted); max-width: 520px; margin: 0 0 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.note { margin-top: 18px; font-size: 14px; color: var(--muted); }

/* ---- The phone */
.phone {
    position: relative;
    width: 310px; aspect-ratio: 9 / 19;
    margin-inline: auto;
    background: var(--bg);
    border: 3px solid var(--line);
    border-radius: 46px;
    box-shadow: 10px 10px 0 var(--shadow);
    padding: 18px 14px;
    overflow: hidden;
}
.phone::before { content: ''; position: absolute; top: 10px; left: 50%; translate: -50%; width: 90px; height: 24px; border-radius: 20px; background: var(--line); }
.screen-top { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; font-weight: 800; font-size: 17px; }
.screen-top img { width: 22px; display: inline-block; vertical-align: -4px; margin-right: 4px; }
.screen-top span { color: var(--gold); }
.chip { border: 2px solid var(--line); border-radius: 999px; padding: 1px 9px; font-size: 11px; font-weight: 700; background: var(--surface); }
.stack { position: relative; height: 380px; margin-top: 16px; }
.card { position: absolute; inset: 0; background: var(--surface); border: 2.5px solid var(--line); border-radius: 18px; box-shadow: 4px 4px 0 var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card.back { transform: scale(.94) translateY(8px); }
.card.front { animation: swipe 5s ease-in-out infinite; transform-origin: 50% 120%; }
.card-head { display: flex; gap: 8px; align-items: center; padding: 8px 10px; font-size: 12px; font-weight: 700; }
.card-head i { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); background: #00BC8C; color: #fff; display: grid; place-items: center; font-style: normal; font-size: 12px; rotate: -4deg; }
.card-head small { display: block; font-weight: 500; color: var(--muted); font-size: 10px; }
/* The swipe card's meme: the "no / yes" format, redrawn with the memeSter Shiba */
.meme { flex: 1; background: #fff; border-block: 2px solid var(--line); display: grid; place-items: center; padding: 8px; }
.meme .nope-yes { width: 100%; height: auto; display: block; border: 2px solid var(--line); }
.card-foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; font-size: 12px; font-weight: 700; }
.send { background: var(--accent); color: #fff; border-radius: 999px; padding: 3px 10px; font-size: 11px; }
.stamp { position: absolute; top: 8px; right: 14px; padding: 0 10px; border: 3px solid var(--line); border-radius: 10px; background: var(--gold); color: #111; font-weight: 800; font-size: 28px; rotate: -12deg; opacity: 0; animation: stamp 5s ease-in-out infinite; }
.buttons { display: flex; justify-content: center; gap: 22px; margin-top: 16px; }
.buttons b { width: 48px; height: 48px; border-radius: 50%; border: 2.5px solid var(--line); display: grid; place-items: center; font-size: 20px; color: #111; box-shadow: 3px 3px 0 var(--shadow); }
.buttons .x { background: var(--nope); }
.buttons .h { background: var(--gold); }
.tabbar { position: absolute; left: 12px; right: 12px; bottom: 14px; height: 50px; border: 2.5px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: 3px 3px 0 var(--shadow); display: flex; justify-content: space-around; align-items: center; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar .plus { width: 34px; height: 28px; border-radius: 8px; border: 2px solid var(--line); background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; rotate: -3deg; }

@keyframes swipe {
    0%, 30% { transform: none; }
    45%, 52% { transform: translateX(150px) rotate(14deg); opacity: 1; }
    60% { transform: translateX(420px) rotate(24deg); opacity: 0; }
    61% { transform: none; opacity: 0; }
    75%, 100% { transform: none; opacity: 1; }
}
@keyframes stamp {
    0%, 32% { opacity: 0; }
    45%, 55% { opacity: 1; }
    61%, 100% { opacity: 0; }
}
@keyframes led { 0%, 8% { opacity: 1; } 35%, 100% { opacity: .15; } }

/* ---- Sections */
section { padding: 88px 0; }
.kicker { font-weight: 800; color: var(--accent-line); text-transform: uppercase; letter-spacing: 1.5px; font-size: 14px; }
h2 { font-size: clamp(34px, 4.6vw, 54px); line-height: 1.05; letter-spacing: -1.5px; font-weight: 800; margin: 10px 0 40px; max-width: 760px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { padding: 28px; }
.step .num { width: 46px; height: 46px; border-radius: 14px; border: 2.5px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: 22px; background: var(--gold); color: #111; rotate: -4deg; margin-bottom: 16px; }
.step:nth-child(2) .num { background: var(--accent); color: #fff; }
.step:nth-child(3) .num { background: var(--nope); color: #111; }
.step h3 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.5px; }
.step p { margin: 0; color: var(--muted); }

.teaser { text-align: center; font-weight: 700; font-size: 19px; color: var(--muted); margin: 44px 0 0; }

/* ---- Closing band */
.band { padding: 0 0 96px; }
.band .inner { background: var(--accent); color: #fff; border: 3px solid var(--line); border-radius: 32px; box-shadow: 8px 8px 0 var(--line); padding: 56px; display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; }
.band h2 { margin: 0 0 10px; color: #fff; }
.band p { margin: 0; opacity: .9; font-size: 19px; }
.band img { width: 150px; rotate: 6deg; }
.band .pill.secondary { background: #fff; color: #111; border-color: #111; box-shadow: 4px 4px 0 #111; }

/* ---- Footer */
footer { border-top: 2.5px solid var(--line); padding: 36px 0 48px; font-size: 15px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; }
footer a { text-decoration: none; font-weight: 700; color: var(--ink); }
footer a:hover { color: var(--accent-line); }
.social { display: flex; gap: 12px; }
.social a { width: 40px; height: 40px; border-radius: 12px; border: 2.5px solid var(--line); display: grid; place-items: center; background: var(--surface); }
.social svg { width: 18px; height: 18px; fill: var(--ink); }

/* ---- 404 */
.lost { min-height: calc(100vh - 72px); display: grid; place-items: center; text-align: center; padding: 40px 0; }
.lost img { width: 170px; margin: 0 auto 10px; rotate: -8deg; }
.lost h1 { margin: 10px 0; }

/* ---- Small screens */
@media (max-width: 900px) {
    .hero .wrap { grid-template-columns: 1fr; gap: 48px; text-align: center; }
    .lead, .hero .actions { margin-inline: auto; justify-content: center; }
    .steps { grid-template-columns: 1fr; }
    .band .inner { grid-template-columns: 1fr; padding: 36px 28px; text-align: center; }
    .band img { margin: 0 auto; width: 110px; }
    .band .actions { justify-content: center; }
    .nav-links a:not(.pill) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .card.front, .stamp, .eyebrow i { animation: none; }
    .stamp { opacity: 1; }
    html { scroll-behavior: auto; }
}

/* A meme as a card, like the app's deck (memester.fun/m/...): a fixed portrait frame
   with the sticker border and shadow, the meme fitted inside over a blurred copy of
   itself, the creator above and the caption below. */
.meme-card {
    width: 100%;
    max-width: 420px;
    margin: 28px auto 8px;
    text-align: left;
    background: var(--surface);
    border: 2.5px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 4px 4px 0 var(--shadow);
    overflow: hidden;
}
.meme-card__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
}
.meme-card__mark {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--line);
    background: var(--gold);
    color: #111111;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 15px;
}
.meme-card__who { min-width: 0; line-height: 1.25; }
.meme-card__who b, .meme-card__who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meme-card__who b { color: var(--ink); font-size: 15px; }
.meme-card__who span { color: var(--muted); font-size: 13px; }
.meme-card__media {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--surface-muted);
    border-top: 2px solid var(--line);
    border-bottom: 2px solid var(--line);
}
/* The blurred copy behind, slightly larger so its soft edges fall outside the frame */
.meme-card__media::before {
    content: "";
    position: absolute;
    inset: -10%;
    background: var(--img) center / cover no-repeat;
    filter: blur(28px);
}
.meme-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.25);
}
.meme-card__media img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.meme-card__foot {
    padding: 12px 14px 14px;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.35;
}
.meme-card__foot b { font-weight: 800; }
.meme-card__foot a { color: var(--muted); font-size: 13px; }
@media (prefers-color-scheme: dark) {
    .meme-card__media::after { background: rgba(34, 29, 56, 0.4); }
}

/* ---- A shared meme's page (memester.fun/m/...): the card first, phone-sized text */
.shared-meme { text-align: center; padding: 20px 0 48px; overflow-x: clip; } /* cards fly out sideways */
.shared-meme h1 { font-size: clamp(28px, 7.5vw, 48px); letter-spacing: -1px; line-height: 1.05; margin: 14px 0 0; }
.shared-meme .meme-card { width: calc(100% - 6px); }
.shared-meme .lead { font-size: 17px; margin: 22px auto 22px; }
.shared-meme .actions { justify-content: center; }

/* ---- The taster deck on a shared meme's page (public/js/taster.js): cards stacked in
   one grid cell, the top one draggable; only for the website. */
.taster {
    display: grid;
    width: 100%;
    max-width: 420px;
    margin: 28px auto 0;
}
.taster > * { grid-area: 1 / 1; margin: 0 !important; position: relative; }
/* The order on screen is set by taster.js (z-index): shrunk cards would otherwise be
   painted over the unshrunk top one */
.taster > .taster__end { z-index: 0; }
.taster.is-live > [data-card] {
    touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab;
    /* Each card on its own layer: dragging moves it without redrawing its blurred
       background on every frame */
    will-change: transform; backface-visibility: hidden; transform: translateZ(0);
}
.taster.is-live img { -webkit-user-drag: none; user-select: none; }
.taster.is-live > [data-card]:active { cursor: grabbing; }
.taster.is-live > .is-gone { visibility: hidden; pointer-events: none; }
/* The cards under the top one sit slightly smaller, like the app's deck */
.taster.is-live > .is-under { transform: scale(0.95); }
.meme-card__stamp {
    position: absolute;
    top: 18px;
    z-index: 2;
    padding: 4px 12px;
    border: 3px solid currentColor;
    border-radius: 10px;
    font-weight: 900;
    font-size: 26px;
    letter-spacing: 1px;
    opacity: 0;
    pointer-events: none;
}
.meme-card__stamp--like { left: 16px; color: var(--gold); background: rgba(17, 17, 17, 0.55); rotate: -12deg; }
.meme-card__stamp--nope { right: 16px; color: #ffffff; background: var(--nope); rotate: 12deg; }
.taster__end {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 22px;
    text-align: center;
}
.taster__end h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; margin: 0; }
.taster__end p { color: var(--muted); font-size: 16px; margin: 0 0 8px; }
.taster__end .actions { justify-content: center; }
.taster__logo { width: 110px; height: auto; rotate: -8deg; }
.taster__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 18px auto 0;
}
.taster__controls[hidden] { display: none; }
.taster__hint { color: var(--muted); font-size: 13px; max-width: 170px; }
.taster__button {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 2.5px solid var(--line);
    box-shadow: 3px 3px 0 var(--shadow);
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    color: #111111;
}
.taster__button--pass { background: var(--nope); color: #ffffff; }
.taster__button--like { background: var(--gold); }
.taster__button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
@media (prefers-reduced-motion: reduce) {
    .taster.is-live > .is-under { transform: none; }
}
