/* ============================================================
   Party Dungeon — landing site
   Palette and typeface taken from the Android app:
   medieval brown ink (#8C6E44), parchment button fills
   (#E9DCC9 / #D6C4A0), the trade veil brown (#503A20), and the
   bundled MedievalSharp typeface.
   ============================================================ */

@font-face {
    font-family: "MedievalSharp";
    src: url("../assets/fonts/medievalsharp.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}

:root {
    --ink: #43301b;          /* dark brown body text (readable on parchment) */
    --ink-soft: #6e5636;
    --accent: #8c6e44;       /* app medieval_brown */
    --accent-deep: #6b5230;
    --parchment: #f4eee0;    /* page background */
    --parchment-2: #e9dcc9;  /* app button_light_brown — cards */
    --parchment-3: #d6c4a0;  /* app button_pressed_brown — borders */
    --wood: #503a20;         /* app trade veil brown — dark sections */
    --wood-deep: #3a2a17;
    --gold: #c8a24a;

    --radius: 14px;
    --shadow: 0 10px 30px rgba(58, 42, 23, 0.18);
    --shadow-sm: 0 4px 14px rgba(58, 42, 23, 0.14);
    --display: "MedievalSharp", "Cinzel", Georgia, serif;
    --body: Georgia, "Times New Roman", "MedievalSharp", serif;
    --wrap: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--body);
    color: var(--ink);
    background: var(--parchment);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand__name { font-family: var(--display); font-weight: 400; letter-spacing: 0.5px; }

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

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

a { color: var(--accent-deep); }

/* ---------- Buttons ---------- */
.btn {
    --btn-bg: var(--parchment-2);
    --btn-fg: var(--accent-deep);
    display: inline-block;
    padding: 0.75rem 1.6rem;
    border-radius: 999px;
    font-family: var(--display);
    font-size: 1.05rem;
    text-decoration: none;
    color: var(--btn-fg);
    background: var(--btn-bg);
    border: 1.5px solid var(--parchment-3);
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); background: #f1e7d5; }
.btn--primary { --btn-bg: linear-gradient(180deg, #a07d49, #7d5f34); --btn-fg: #fff7e8; border-color: #6b5230; }
.btn--primary:hover { background: linear-gradient(180deg, #ac884f, #6b5230); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--accent-deep); border-color: currentColor; box-shadow: none; }
.btn--ghost:hover { background: rgba(140, 110, 68, 0.1); }
.btn--small { padding: 0.5rem 1.05rem; font-size: 0.95rem; }
.btn--lg { padding: 0.95rem 2.2rem; font-size: 1.2rem; }

/* ---------- Navigation ---------- */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(244, 238, 224, 0.86);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--parchment-3);
}
.nav__inner {
    width: min(100% - 2.5rem, var(--wrap));
    margin-inline: auto;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 0.7rem 0;
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--accent-deep); }
.brand__crest { font-size: 1.4rem; color: var(--accent); }
.brand__name { font-size: 1.5rem; }
.nav__links { display: flex; align-items: center; gap: 1.6rem; }
.nav__links a { text-decoration: none; color: var(--ink); font-family: var(--display); font-size: 1.05rem; transition: color 0.15s ease; }
.nav__links a:not(.btn):hover { color: var(--accent); }
.nav__toggle { display: none; background: none; border: 0; font-size: 1.6rem; color: var(--accent-deep); cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
    position: relative; overflow: hidden;
    min-height: min(88vh, 760px);
    display: flex; align-items: center;
    padding: 5rem 0;
    background: url("../assets/img/background.png") center/cover no-repeat;
}
.hero__veil {
    position: absolute; inset: 0;
    background:
        radial-gradient(120% 90% at 20% 30%, rgba(58, 42, 23, 0.25), transparent 60%),
        linear-gradient(180deg, rgba(58, 42, 23, 0.72), rgba(58, 42, 23, 0.55));
}
.hero__content {
    position: relative; z-index: 2;
    width: min(100% - 2.5rem, var(--wrap));
    margin-inline: auto;
    max-width: 660px; color: #f7ecd8;
}
.eyebrow {
    text-transform: uppercase; letter-spacing: 3px; font-size: 1rem;
    color: var(--gold); margin: 0 0 0.8rem; font-family: var(--display);
}
.hero__title {
    font-size: clamp(3.2rem, 9vw, 6rem);
    margin: 0 0 1rem; line-height: 0.95;
    color: #fdf4e2; text-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}
.hero__tagline { font-size: clamp(1.05rem, 2.2vw, 1.35rem); color: #f0e2c9; margin: 0 0 2rem; max-width: 34ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.hero__meta {
    list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem;
    padding: 0; margin: 0 0 1.6rem; font-family: var(--display); font-size: 1.2rem; color: #e7d6b6;
}
.hero__meta li { position: relative; padding-left: 1.3rem; }
.hero__meta li::before { content: "◆"; position: absolute; left: 0; color: var(--gold); font-size: 0.7rem; top: 0.35em; }

.hero__party { position: absolute; z-index: 1; right: 4%; bottom: -2%; width: min(42vw, 460px); pointer-events: none; }
.hero__token {
    position: absolute; width: 44%;
    filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.5));
    animation: float 6s ease-in-out infinite;
}
.hero__token--1 { right: 24%; bottom: 6%; width: 52%; z-index: 3; }
.hero__token--2 { right: 0; bottom: 20%; width: 42%; animation-delay: -2s; }
.hero__token--3 { right: 46%; bottom: 22%; width: 38%; animation-delay: -4s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* ---------- Decorative rule ---------- */
.rule {
    height: 26px;
    background:
        radial-gradient(circle at center, var(--accent) 0 5px, transparent 6px) center/26px 26px repeat-x;
    opacity: 0.5;
    margin: 0;
}

/* ---------- Sections ---------- */
.section { padding: 5rem 0; }
.section--alt { background: linear-gradient(180deg, var(--parchment-2), #efe6d4); border-block: 1px solid var(--parchment-3); }
.section__title { font-size: clamp(2rem, 4.5vw, 3rem); text-align: center; margin: 0 0 0.6rem; color: var(--accent-deep); }
.section__lead { text-align: center; max-width: 60ch; margin: 0 auto 3rem; color: var(--ink-soft); font-size: 1.1rem; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid--features { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* Feature cards */
.card {
    background: var(--parchment);
    border: 1.5px solid var(--parchment-3);
    border-radius: var(--radius);
    padding: 1.8rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card__icon { font-size: 2rem; margin-bottom: 0.6rem; }
.card h3 { font-size: 1.5rem; margin: 0 0 0.5rem; color: var(--accent-deep); }
.card p { margin: 0; color: var(--ink-soft); }

/* ---------- Steps ---------- */
.steps { list-style: none; padding: 0; margin: 0; max-width: 720px; margin-inline: auto; display: grid; gap: 1.2rem; }
.step { display: flex; gap: 1.2rem; align-items: flex-start; background: var(--parchment); border: 1.5px solid var(--parchment-3); border-radius: var(--radius); padding: 1.4rem 1.6rem; box-shadow: var(--shadow-sm); }
.step__num {
    flex: 0 0 auto;
    width: 2.6rem; height: 2.6rem; display: grid; place-items: center;
    border-radius: 50%; background: linear-gradient(180deg, #a07d49, #6b5230);
    color: #fdf4e2; font-family: var(--display); font-size: 1.4rem;
    box-shadow: var(--shadow-sm);
}
.step h3 { margin: 0.1rem 0 0.3rem; font-size: 1.35rem; color: var(--accent-deep); }
.step p { margin: 0; color: var(--ink-soft); }

/* ---------- Screenshot gallery ---------- */
/* Flex + wrap + center, so the last, shorter row is centered (9 shots = 5 + 4 on desktop). */
.gallery { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2rem; }
.gallery__item {
    flex: 0 1 calc((100% - 4 * 1.2rem) / 5);   /* 5 per row on desktop */
    aspect-ratio: 1200 / 1920;                  /* screenshots are portrait 1200x1920 */
    border-radius: var(--radius);
    overflow: hidden;
    border: 1.5px solid var(--parchment-3);
    background: var(--parchment-2);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery__item:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.gallery__item:hover img { transform: scale(1.04); }
.gallery__item:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

@media (max-width: 900px) { .gallery__item { flex-basis: calc((100% - 2 * 1.2rem) / 3); } }
@media (max-width: 520px) { .gallery { gap: 0.8rem; } .gallery__item { flex-basis: calc((100% - 0.8rem) / 2); } }

/* Lightbox: the full-screen viewer that js/main.js builds. */
.lightbox {
    position: fixed; inset: 0; z-index: 100;
    display: none; align-items: center; justify-content: center;
    background: rgba(30, 21, 11, 0.94);
    padding: 3.5rem 4rem;
}
.lightbox.is-open { display: flex; }
.lightbox__img {
    max-width: 100%; max-height: 100%;
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    user-select: none;
}
.lightbox__btn {
    position: absolute;
    width: 3rem; height: 3rem; display: grid; place-items: center;
    border-radius: 50%; border: 1.5px solid rgba(214, 196, 160, 0.6);
    background: rgba(80, 58, 32, 0.75); color: #fdf4e2;
    font-family: var(--display); font-size: 1.8rem; line-height: 1;
    cursor: pointer; transition: background 0.15s ease;
}
.lightbox__btn:hover { background: rgba(140, 110, 68, 0.9); }
.lightbox__btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.lightbox__close { top: 0.8rem; right: 0.8rem; }
.lightbox__prev { left: 0.8rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 0.8rem; top: 50%; transform: translateY(-50%); }
.lightbox__count {
    position: absolute; bottom: 0.9rem; left: 0; right: 0;
    text-align: center; font-family: var(--display); color: #e7d6b6;
}
body.lightbox-open { overflow: hidden; }

/* On a phone the arrows sit at the bottom so they do not cover the image. */
@media (max-width: 520px) {
    .lightbox { padding: 3.5rem 1rem 4.5rem; }
    .lightbox__prev, .lightbox__next { top: auto; bottom: 0.6rem; transform: none; }
    .lightbox__prev { left: 1rem; }
    .lightbox__next { right: 1rem; }
    .lightbox__count { bottom: 1.4rem; }
}

/* ---------- CTA ---------- */
.cta {
    background:
        linear-gradient(180deg, rgba(58, 42, 23, 0.9), rgba(58, 42, 23, 0.95)),
        url("../assets/img/background.png") center/cover no-repeat;
    color: #f7ecd8; text-align: center; padding: 5.5rem 0;
}
.cta__inner { max-width: 640px; }
.cta h2 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 0 0 1rem; color: #fdf4e2; }
.cta p { color: #ecdcc0; font-size: 1.15rem; margin: 0 0 2rem; }
.cta__buttons { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.cta__note { font-size: 0.9rem; color: #d7c5a3; margin-top: 1.6rem; }

/* ---------- Footer ---------- */
.footer { background: var(--wood-deep); color: #e7d6b6; padding: 2.5rem 0; }
.footer__inner { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; text-align: center; }
.footer .brand__name { font-size: 1.6rem; color: #f3e4c6; }
.footer p { margin: 0; color: #c9b48c; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    .nav__links {
        position: absolute; top: 100%; right: 0; left: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--parchment); border-bottom: 1px solid var(--parchment-3);
        padding: 0.5rem 1.25rem 1rem;
        transform: scaleY(0); transform-origin: top; transition: transform 0.2s ease;
    }
    .nav__links.is-open { transform: scaleY(1); }
    .nav__links a { padding: 0.7rem 0.2rem; border-bottom: 1px solid var(--parchment-3); }
    .nav__links a:last-child { border-bottom: 0; margin-top: 0.5rem; text-align: center; }
    .nav__toggle { display: block; }
    .hero__party { display: none; }
    .hero { min-height: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .hero__token { animation: none; }
    html { scroll-behavior: auto; }
}
