/* ============================================================
   Treasure Hunt — site stylesheet
   Amber / light / warm M3-inspired palette.
   Keep dependencies minimal: pure CSS, grid + flex.
   ============================================================ */

:root {
    /* Amber primary (M3 seed Colors.amber ~= #FFC107) */
    --amber-50:  #fff8e1;
    --amber-100: #ffecb3;
    --amber-200: #ffe082;
    --amber-300: #ffd54f;
    --amber-400: #ffca28;
    --amber-500: #ffc107;
    --amber-600: #ffb300;
    --amber-700: #ffa000;
    --amber-800: #ff8f00;
    --amber-900: #ff6f00;

    /* Warm neutrals */
    --bg:        #fdfaf3;          /* warm off-white */
    --bg-card:   #ffffff;
    --bg-alt:    #fbf2dc;          /* tinted panel */
    --ink-900:   #1f2937;          /* slate-900 headings */
    --ink-700:   #374151;
    --ink-600:   #4b5563;
    --ink-500:   #6b7280;
    --ink-400:   #9ca3af;
    --border:    #ead9b3;
    --border-soft: #f0e3c5;
    --shadow-sm: 0 1px 2px rgba(31, 41, 55, 0.05);
    --shadow-md: 0 6px 18px rgba(31, 41, 55, 0.08);
    --shadow-lg: 0 18px 40px rgba(31, 41, 55, 0.12);

    --radius-sm: 6px;
    --radius:    12px;
    --radius-lg: 20px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --max-w: 1120px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink-700);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--amber-800);
    text-decoration: none;
    transition: color .15s ease;
}
a:hover { color: var(--amber-900); text-decoration: underline; }

h1, h2, h3, h4, h5 {
    color: var(--ink-900);
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 .5em;
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }

ul, ol { padding-left: 1.25em; }
li { margin-bottom: .35em; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

img { max-width: 100%; height: auto; display: block; }

button {
    font: inherit;
    cursor: pointer;
}

hr {
    border: 0;
    height: 1px;
    background: var(--border-soft);
    margin: 3rem 0;
}

/* ====== Layout shell ====== */

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(253, 250, 243, 0.92);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border-soft);
}

.site-header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: .85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none !important;
    color: var(--ink-900) !important;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}
.brand-mark {
    width: 32px; height: 32px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .4rem .55rem;
    color: var(--ink-700);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: .25rem;
}
.site-nav a {
    color: var(--ink-700);
    padding: .5rem .85rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: .95rem;
    transition: background .15s ease, color .15s ease;
}
.site-nav a:hover {
    background: var(--amber-50);
    color: var(--amber-900);
    text-decoration: none;
}
.site-nav a.active {
    background: var(--amber-100);
    color: var(--amber-900);
}

.cta-nav {
    background: var(--amber-700);
    color: #fff !important;
    padding: .55rem 1rem !important;
    border-radius: 999px !important;
    box-shadow: var(--shadow-sm);
}
.cta-nav:hover { background: var(--amber-800) !important; color: #fff !important; }

@media (max-width: 820px) {
    .nav-toggle { display: inline-flex; }
    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border-soft);
        padding: .5rem 1rem 1rem;
    }
    .site-nav.open { display: flex; }
    .site-nav a { padding: .75rem 1rem; }
    .cta-nav { text-align: center; margin-top: .5rem; }
}

main.site-main {
    flex: 1;
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ====== Hero ====== */

.hero {
    position: relative;
    padding: 5rem 1.5rem 4rem;
    overflow: hidden;
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(255, 193, 7, 0.30), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(255, 143, 0, 0.18), transparent 60%),
        linear-gradient(180deg, #fff8e7 0%, #fdfaf3 100%);
}
.hero-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 3rem;
    align-items: center;
}
.hero h1 {
    font-size: clamp(2.5rem, 5.5vw, 4rem);
    margin-bottom: 1rem;
}
.hero .eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .78rem;
    font-weight: 600;
    color: var(--amber-900);
    background: var(--amber-100);
    padding: .35rem .75rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}
.hero .lead {
    font-size: 1.2rem;
    color: var(--ink-600);
    max-width: 540px;
    margin-bottom: 1.75rem;
}
.hero-art {
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--amber-50);
    transform: rotate(-2deg);
    border: 6px solid #fff;
}
.hero-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 820px) {
    .hero { padding: 3rem 1.5rem 3rem; }
    .hero-inner { grid-template-columns: 1fr; gap: 2.25rem; }
    .hero-art { max-width: 360px; margin: 0 auto; transform: none; }
}

/* ====== Buttons ====== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .85rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    text-decoration: none !important;
    transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
    box-shadow: var(--shadow-sm);
}
.btn-primary {
    background: var(--amber-700);
    color: #fff !important;
}
.btn-primary:hover {
    background: var(--amber-800);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-secondary {
    background: #fff;
    color: var(--ink-900) !important;
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--amber-600);
    color: var(--amber-900) !important;
}
.btn-lg { padding: 1.05rem 2rem; font-size: 1.05rem; }

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
}

/* Google Play badge */
.gp-badge {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1.25rem;
    border-radius: 12px;
    background: #1f2937;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: var(--shadow-md);
    transition: transform .12s ease, background .15s ease;
}
.gp-badge:hover { background: #0f172a; transform: translateY(-1px); }
.gp-badge svg { width: 28px; height: 28px; flex-shrink: 0; }
.gp-badge .gp-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.gp-badge .gp-small { font-size: .68rem; opacity: .85; letter-spacing: .04em; text-transform: uppercase; }
.gp-badge .gp-big   { font-size: 1.05rem; font-weight: 700; }

/* ====== Sections ====== */

.section {
    padding: 4.5rem 0;
}
.section-tight { padding: 3rem 0; }
.section-alt {
    background: var(--bg-alt);
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
}

.section-head {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 3rem;
}
.section-head .eyebrow {
    color: var(--amber-900);
    text-transform: uppercase;
    letter-spacing: .14em;
    font-weight: 600;
    font-size: .78rem;
    margin-bottom: .75rem;
    display: block;
}
.section-head h2 { margin-bottom: .75rem; }
.section-head p {
    color: var(--ink-600);
    font-size: 1.1rem;
}

/* ====== Cards ====== */

.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--amber-200);
}
.card-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: var(--amber-50);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}
.card-icon img { width: 32px; height: 32px; object-fit: contain; }
.card h3 { color: var(--ink-900); margin-bottom: .35rem; }
.card p { color: var(--ink-600); margin-bottom: 0; }

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.feature-card .feature-mark {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--amber-100);
    color: var(--amber-900);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}
.feature-card h4 { color: var(--ink-900); margin-bottom: .25rem; }
.feature-card p { color: var(--ink-600); font-size: .96rem; margin-bottom: 0; }

/* ====== Steps ====== */

.steps {
    counter-reset: step;
    display: grid;
    gap: 1.5rem;
}
.steps-flow {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.step {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1.5rem;
    position: relative;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: -16px;
    left: 16px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--amber-700);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}
.step h3 { margin-top: .35rem; color: var(--ink-900); font-size: 1.1rem; }
.step p { color: var(--ink-600); font-size: .95rem; margin-bottom: 0; }

/* ====== Map type diagram cards ====== */

.maptype {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.maptype-art {
    background: var(--amber-50);
    padding: 1.5rem;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}
.maptype-art svg { width: 100%; height: 100%; max-height: 260px; }
.maptype-body { padding: 1.5rem; }
.maptype-body h3 { margin-bottom: .5rem; }
.maptype-tag {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    background: var(--amber-100);
    color: var(--amber-900);
    padding: .25rem .65rem;
    border-radius: 999px;
    margin-bottom: .75rem;
}
.maptype-body p { color: var(--ink-600); margin-bottom: 0; }

/* SVG diagram styling */
.diagram .node { fill: #fff; stroke: var(--amber-700); stroke-width: 2; }
.diagram .node-start { fill: var(--amber-200); }
.diagram .node-end   { fill: #d1fae5; stroke: #047857; }
.diagram text { font-family: var(--font-sans); font-size: 11px; fill: var(--ink-900); font-weight: 600; text-anchor: middle; dominant-baseline: middle; }
.diagram .edge { stroke: var(--amber-800); stroke-width: 2; fill: none; }
.diagram .edge-dashed { stroke-dasharray: 4 3; }

/* ====== FAQ accordion (native details/summary) ====== */

.faq {
    max-width: 780px;
    margin: 0 auto;
    display: grid;
    gap: .75rem;
}
.faq details {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
    transition: border-color .15s ease;
}
.faq details[open] { border-color: var(--amber-300); }
.faq summary {
    list-style: none;
    cursor: pointer;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--ink-900);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+";
    font-size: 1.4rem;
    color: var(--amber-800);
    transition: transform .2s ease;
    line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq .faq-body {
    padding: 0 1.5rem 1.25rem;
    color: var(--ink-600);
}
.faq .faq-body p:last-child { margin-bottom: 0; }

/* ====== Download page ====== */

.download-hero {
    text-align: center;
    padding: 4rem 1.5rem 2rem;
}
.download-hero h1 { margin-bottom: .5rem; }
.download-hero p { color: var(--ink-600); font-size: 1.15rem; max-width: 640px; margin: 0 auto 2rem; }

.download-cards {
    max-width: 720px;
    margin: 2rem auto 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 640px) {
    .download-cards { grid-template-columns: 1fr; }
}
.download-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
}
.download-card .platform {
    font-weight: 600;
    color: var(--ink-900);
    font-size: 1.1rem;
    margin-bottom: .25rem;
}
.download-card .platform-sub {
    color: var(--ink-500);
    font-size: .9rem;
    margin-bottom: 1.25rem;
}
.download-card .soon-badge {
    display: inline-block;
    background: var(--amber-50);
    color: var(--amber-900);
    padding: .65rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
    border: 1px dashed var(--amber-300);
}

/* ====== Privacy / long-form prose ====== */

.prose {
    max-width: 760px;
    margin: 0 auto;
}
.prose h2 { margin-top: 2.5rem; margin-bottom: .75rem; font-size: 1.5rem; }
.prose h3 { margin-top: 1.75rem; }
.prose p, .prose li { color: var(--ink-700); }
.prose .updated {
    color: var(--ink-500);
    font-size: .9rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-soft);
}

/* ====== Contact ====== */
.contact-card {
    max-width: 560px;
    margin: 2rem auto;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    text-align: center;
}
.contact-card .email-pill {
    display: inline-block;
    background: var(--amber-50);
    color: var(--amber-900);
    border: 1px solid var(--amber-200);
    padding: .75rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
    margin-top: .5rem;
}

/* ====== Footer ====== */
.site-footer {
    margin-top: auto;
    background: #1f1a14;
    color: #c8b894;
    padding: 3rem 1.5rem 2rem;
}
.site-footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
    align-items: flex-start;
}
.site-footer h4 { color: #fff; margin-bottom: .65rem; font-size: 1rem; }
.site-footer p, .site-footer a { color: #c8b894; }
.site-footer a:hover { color: var(--amber-300); }
.site-footer .footer-brand { max-width: 320px; }
.site-footer .footer-brand p { font-size: .92rem; line-height: 1.6; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer-bottom {
    max-width: var(--max-w);
    margin: 2.5rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid #3b3225;
    font-size: .85rem;
    color: #8a7a5e;
    text-align: center;
}

/* ====== Misc utility ====== */
.center { text-align: center; }
.muted { color: var(--ink-500); }
.small { font-size: .9rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0 !important; }

/* Blazor error UI */
#blazor-error-ui {
    color-scheme: light only;
    background: #fff8e1;
    border-top: 2px solid var(--amber-700);
    bottom: 0;
    box-shadow: 0 -1px 8px rgba(0,0,0,.15);
    display: none;
    left: 0;
    padding: .9rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: var(--ink-900);
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: .65rem;
}
