/* Fill the Space website. Colours follow the app's Theme (FillTheSpace/UI/Theme.swift):
   dark only, like the app. System fonts only, so nothing shifts when a webfont arrives.
   The about, privacy and 404 pages; the game has its own styles. Icons are one-off resizes of the app icon:
     sips -Z 32  FillTheSpace/Assets.xcassets/AppIcon.appiconset/AppIcon.png --out web/public/assets/favicon-32.png
     sips -Z 180 FillTheSpace/Assets.xcassets/AppIcon.appiconset/AppIcon.png --out web/public/assets/icon-180.png */

:root {
    color-scheme: dark;

    --bg: #1E1E1C;
    --surface: #282826;
    --text: #EDEBE6;
    --muted: #9E9B94;
    --accent: #A9C48F;
    --rule: #2A2A28;

    /* Era 1 piece colours, for the bullet tiles. */
    --tile-1: #C9A27E;
    --tile-2: #9DB4A0;
    --tile-3: #D1B872;

    --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.55;
}

img { max-width: 100%; }

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

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Landing */

.landing {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

.hero {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 56px;
    padding-top: 48px;
    padding-bottom: 48px;
}

.hero-text { flex: 1; min-width: 0; }

.app-icon {
    display: block;
    width: 96px;
    height: 96px;
    border-radius: 22px;
}

.hero h1 {
    margin: 20px 0 4px;
    font-size: 56px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.tagline {
    margin: 0 0 28px;
    font-size: 22px;
    font-weight: 500;
    color: var(--muted);
}

.how {
    list-style: none;
    margin: 0 0 32px;
    padding: 0;
    font-size: 17px;
}

.how li {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

/* Small tiles in the piece colours, like the room's cells. */
.how li::before {
    content: "";
    flex: none;
    width: 12px;
    height: 12px;
    margin-top: 7px;
    border-radius: 3px;
    background: var(--tile-1);
}
.how li:nth-child(2)::before { background: var(--tile-2); }
.how li:nth-child(3)::before { background: var(--tile-3); }

.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.play-btn {
    display: inline-flex; align-items: center; height: 54px; padding: 0 22px;
    border-radius: 12px; background: var(--accent); color: var(--bg);
    font-weight: 600; font-size: 17px; text-decoration: none;
}
.store-badge { display: inline-block; }
.store-badge img { display: block; width: 162px; height: 54px; }

.hero-shot { flex: none; }

.hero-shot img {
    display: block;
    width: 280px;
    height: auto;
    aspect-ratio: 560 / 1218;
    border-radius: 36px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Gallery: the App Store screenshots (tools/caption.py writes them). */

.gallery { padding-bottom: 40px; }

.gallery h2 {
    margin: 0 0 20px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.shots {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.shots img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.site-footer {
    padding-top: 20px;
    padding-bottom: 28px;
    font-size: 13px;
    color: var(--muted);
}

.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .sep { margin: 0 8px; opacity: 0.6; }

@media (max-width: 720px) {
    .hero {
        flex-direction: column;
        align-items: stretch;
        gap: 40px;
        padding-top: 32px;
    }
    .hero-text { flex: none; }
    .hero h1 { font-size: 44px; }
    .tagline { font-size: 20px; }
    .hero-shot img { width: 260px; margin: 0 auto; }
    .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Documents (privacy, 404) */

.doc {
    max-width: 720px;
    padding-top: 32px;
    padding-bottom: 48px;
}

.doc-back { margin: 0 0 24px; font-size: 15px; }
.doc-back a { text-decoration: none; }

.doc h1 {
    margin: 0 0 4px;
    font-size: 40px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.doc-date { margin: 0 0 28px; color: var(--muted); font-size: 15px; }

.doc h2 {
    margin: 36px 0 8px;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
    font-size: 21px;
    font-weight: 700;
}

.doc h3 { margin: 24px 0 6px; font-size: 17px; font-weight: 700; }

.doc ul { padding-left: 22px; }
.doc li { margin-bottom: 8px; }

/* Archive (served by the `archive` function) and guides */

.archive .room { padding: 20px 0 4px; border-top: 1px solid var(--rule); }
.archive .room h2 { margin: 4px 0 4px; padding: 0; border: 0; font-size: 21px; }
.archive .room-facts { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.archive figure { margin: 0 0 14px; }
.room-figure { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.archive details { margin: 0 0 14px; padding: 10px 14px; background: var(--surface); border-radius: 12px; }
.archive summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.archive details[open] summary { margin-bottom: 12px; }
.archive details p { margin: 0 0 4px; }
.archive .crowd ul { list-style: none; padding: 0; }
.archive .day-nav { display: flex; justify-content: space-between; gap: 12px; margin: 28px 0; padding-top: 20px; border-top: 1px solid var(--rule); }
.archive .day-list { list-style: none; padding: 0; }
.archive .day-list li { margin-bottom: 14px; }
.archive .day-rooms { color: var(--muted); font-size: 15px; }
.archive .ad { display: flex; justify-content: center; min-height: 250px; margin: 8px 0 20px; }
.archive .archive-cta { margin: 32px 0 16px; }
.archive .archive-footer { color: var(--muted); font-size: 14px; }
.archive .archive-footer a { color: inherit; }
.guide-list { list-style: none; padding: 0; }
.guide-list li { margin-bottom: 16px; }
.guide-list .blurb { display: block; color: var(--muted); font-size: 15px; }
.archive figcaption { color: var(--muted); font-size: 14px; text-align: center; margin-top: 6px; }

/* Guides: reach maps, score tables */
.reach { display: grid; grid-template-columns: repeat(var(--cols), 40px); gap: 4px; justify-content: center; }
.reach span { height: 40px; display: flex; align-items: center; justify-content: center; background: #2A2A28; border-radius: 5px; font-weight: 600; color: var(--muted); }
.reach .tight { background: var(--accent); color: var(--bg); }
.reach .wall { background: #111110; }
.score-table { border-collapse: collapse; margin: 0 0 16px; font-size: 15px; }
.score-table th, .score-table td { padding: 6px 16px 6px 0; text-align: left; border-bottom: 1px solid var(--rule); }
.score-table th { color: var(--muted); font-weight: 600; }
.guide-next { margin-top: 28px; font-weight: 600; }
