/* Landing page on top of the app's css/app.css (variables, metal frames with corners, buttons, light / dark mode).
   css/, fonts/, images/, items/ and the icons are copied from the app by LandingBuilder (backend start in Development, deploy), not in git. */
/* Same fonts as app.css, but text shows at once in a fallback font while they load (app.css blocks it), these later rules win */
@font-face { font-family: 'OpenSans'; src: url('fonts/OpenSans-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'OpenSans'; src: url('fonts/OpenSans-Semibold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'MedievalSharp'; src: url('fonts/MedievalSharp.ttf') format('truetype'); font-weight: 400; font-display: swap; }

:root {
    --font-text: 'OpenSans', sans-serif;
    --width: 960px;
}

/* The sources in pages/ hold both languages (data-l), LandingBuilder writes de/ and en/ with one; previewing a source shows German */
[data-l="en"] { display: none !important; }
/* Language links in the header, styled like the app's mode switch buttons */
.mode-switch a { padding: 4px 10px; border-radius: 999px; color: var(--text-muted); font-size: 0.8125rem; text-decoration: none; }
.mode-switch a.active { background: var(--btn-bg); color: var(--btn-text); text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); }

/* app.css has overflow-x: hidden, which makes body a scroll container and breaks the sticky header; clip cuts the same without one */
html, body { font-family: var(--font-text); line-height: 1.55; overflow-x: clip; }
body { font-size: 1rem; }
h1, h2, h3, .brand, .btn { font-family: var(--font-medieval); font-weight: 400; }
h1 { font-size: clamp(2.125rem, calc(6vw * var(--font-scale)), 3.375rem); line-height: 1.15; color: var(--gold-text); text-shadow: var(--gold-shadow); }
h2 { font-size: 1.875rem; margin: 0 0 20px; }
h3 { font-size: 1.375rem; margin: 0 0 4px; color: var(--gold-text); text-shadow: var(--gold-shadow); }
a { color: inherit; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--width); margin: 0 auto; padding: 0 20px; }
section { padding: 44px 0; }
.muted { color: var(--text-muted); }

/* Header */
/* Stays on top while scrolling, so "Found a guild" is always in reach */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--outline); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.site-header .wrap { display: flex; align-items: center; gap: 14px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.375rem; text-decoration: none; margin-right: auto; }
.brand img { width: 38px; height: 38px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-size: 0.8125rem; color: var(--gold-text); letter-spacing: 0.08em; }
.site-header .btn { min-height: 40px; padding: 4px 16px; font-size: 1.0625rem; }
.login-link { font-family: var(--font-medieval); font-size: 1.0625rem; text-decoration: none; white-space: nowrap; }
.login-link:hover { text-decoration: underline; }
@media (max-width: 560px) {
    .brand-text { display: none; }
    .site-header .wrap { gap: 10px; padding: 0 12px; }
    .site-header .btn { padding: 4px 10px; font-size: 0.9375rem; }
    .login-link { font-size: 0.9375rem; }
}
/* Anchors land below the sticky header */
html { scroll-padding-top: 76px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { font-size: 1.125rem; text-decoration: none; }
a.btn-secondary { border-color: var(--outline); }

/* Hero */
.hero .wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
.hero .lead { font-size: 1.1875rem; margin: 16px 0 26px; }
.hero .muted { margin-top: 14px; font-size: 0.875rem; }
@media (max-width: 760px) {
    .hero .wrap { grid-template-columns: 1fr; }
    .hero .wrap > .shot { order: 1; }
}

/* TL;DR: the whole page in three sentences */
.tldr { padding-top: 8px; }
.tldr .card { max-width: 900px; margin: 0 auto; padding: 22px 28px; align-items: center; text-align: center; }
.tldr h2 { margin: 0 0 8px; font-size: 2.125rem; color: var(--gold-text); text-shadow: var(--gold-shadow); letter-spacing: 0.06em; }
.tldr ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 1.125rem; text-wrap: balance; }
/* Small ornament between the sentences: ──◆── fading out to the sides */
.tldr li + li::before {
    content: "◆"; display: block; width: 120px; margin: 0 auto 6px; font-size: 0.5625rem; line-height: 1; color: #727171; /* grey like quests without points (.points-0) */
    background: linear-gradient(90deg, transparent, currentColor 35%, transparent 44%, transparent 56%, currentColor 65%, transparent) center / 100% 1px no-repeat;
}

/* Three per row, an incomplete last row is centered */
.grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.grid > * { flex: 0 1 calc((100% - 40px) / 3); min-width: 260px; }
@media (max-width: 620px) { .grid > * { flex-basis: 100%; } }
.card { padding: 18px 22px; gap: 6px; }

/* Phone screenshot: a static copy of an app page (shots/*.html) in an iframe, rendered at 390px and scaled by landing.js; --shot-h = height of the page part shown */
/* Inner padding keeps the frame's corner ornaments visible around the page */
.shot { width: 100%; max-width: 380px; margin: 0 auto; padding: 14px 10px; --frame-fill: var(--bg); }
.shot-view { position: relative; width: 100%; aspect-ratio: 390 / var(--shot-h); overflow: hidden; }
.shot-frame { position: absolute; top: 0; left: 0; width: 390px; height: calc(var(--shot-h) * 1px); border: 0; transform-origin: 0 0; pointer-events: none; }

/* Short text below a section that leads to the next one */
.section-note { margin-top: 26px; text-align: center; font-size: 1.125rem; text-wrap: balance; }

/* Steps with a big number */
.steps { counter-reset: step; }
.steps .card { position: relative; padding-left: 70px; }
.steps .card::before {
    counter-increment: step; content: counter(step);
    position: absolute; left: 24px; top: 14px;
    font-family: var(--font-medieval); font-size: 2.375rem; line-height: 1; color: var(--gold-text); text-shadow: var(--gold-shadow);
}

/* The golden ? the app uses to hand in a quest */
/* Centered on the whole card: the number on the left shifts the text area 24px to the right ((70px - 22px padding) / 2) */
.step-mark { align-self: center; position: relative; left: -24px; margin-top: 8px; font-family: var(--font-medieval); font-size: 4rem; }

.cta { text-align: center; }
.cta .muted { margin-bottom: 22px; }
.cta .actions { justify-content: center; }

/* Footer */
.site-footer { border-top: 1px solid var(--outline); padding: 24px 0; font-size: 0.875rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer nav { display: flex; gap: 18px; }

/* Legal pages */
.legal { max-width: 780px; }
.legal h1 { font-size: 2.375rem; margin-bottom: 20px; }
.legal h2 { text-align: left; font-size: 1.5rem; margin: 32px 0 8px; }
.legal h3 { font-size: 1.1875rem; margin-top: 18px; }
.legal p { margin-bottom: 8px; }
.legal .lang-note { margin-bottom: 20px; }

/* Changelog (pages/changelog.html): one card per version */
.release { margin-top: 24px; padding: 4px 22px 14px; border: 1px solid var(--outline); border-radius: 10px; }
.release ul { margin: 0; padding-left: 20px; }
.release li { margin-bottom: 6px; }

/* Help for installing the APK (start page) */
.apk-help { max-width: 780px; text-align: center; }
.apk-help p { margin-bottom: 10px; text-wrap: balance; }

/* Checkout page (pages/checkout.html) */
.checkout-card { max-width: 520px; margin: 0 auto; align-items: center; gap: 12px; padding: 28px; }
.checkout-card h1 { font-size: 2.125rem; }
.checkout-icon { width: 72px; height: 72px; }
.checkout-card .actions { justify-content: center; }

/* Texts still to write */
.todo { background: rgba(232, 232, 0, 0.18); outline: 1px dashed var(--gold-text); padding: 0 4px; }

/* Accessibility (js/display.js, button made by landing.js): font size and font, the same choice as in the web app (same origin) */
.display-btn {
    position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 52px; height: 52px; padding: 0; border-radius: 50%;
    border: 2px solid #9a9a9a; background: var(--btn-bg); color: var(--btn-text); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    font-family: 'OpenSans', sans-serif; font-size: 20px; font-weight: 600; text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8); cursor: pointer;
}
.display-panel { position: fixed; right: 16px; bottom: 80px; z-index: 40; width: min(340px, calc(100vw - 32px)); gap: 8px; }
.display-panel[hidden] { display: none; }
.display-panel h3 { font-size: 1.25rem; margin: 0; }
.display-panel .label { font-size: 0.875rem; color: var(--text-muted); }
.display-panel .mode-switch { display: flex; flex-wrap: wrap; border-radius: 18px; }
.display-panel .mode-switch button { flex: 1; padding: 6px 10px; border: none; border-radius: 999px; background: none; color: var(--text); font-size: 0.9375rem; cursor: pointer; }
.display-panel .mode-switch button.active { background: var(--btn-bg); color: var(--btn-text); text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); }
