/* ===== Homeward - community lost-pet registry =====
   Uses the mindiweik.com design tokens so the demo reads as part of the site:
   dark-first canvas, role-named accents as FILLS with --ink on top, and the
   three type roles (display / mono / body). No hue-named or hardcoded colors. */

:root {
    /* Fallbacks only. When this page is served from the site these come from
       global.css; standalone they keep the app legible. */
    --bg: #0b0e14;
    --surface: #11151f;
    --border: rgba(255, 255, 255, 0.1);
    --text: #ececf1;
    --text-muted: rgba(236, 236, 241, 0.6);
    --ink: #0b0e14;
    --accent-blog: #6e7bff;
    --accent-primary: var(--accent-blog);
    --font-display: 'Space Grotesk Variable', ui-sans-serif, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono Variable', ui-monospace, 'SF Mono', Menlo, monospace;
    --font-body: 'Inter Variable', ui-sans-serif, system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.55;
}

/* ===== Header ===== */

.site-header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.1rem 1.5rem;
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.brand-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 7px;
    /* Accent as a FILL, ink glyph on top. */
    background: var(--accent-primary);
    color: var(--ink);
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-header h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.tagline {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ===== Layout ===== */

main {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 2.5rem;
    flex: 1;
}

h2 {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 1.8rem 0 0.9rem;
}

/* ===== Controls ===== */

.controls {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.controls label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

select {
    font-family: var(--font-body);
    font-size: 0.92rem;
    padding: 0.45rem 0.7rem;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
}

/* ===== Pet cards ===== */

#lost-pets-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.pet-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pet-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 7px;
    display: block;
}

.photo-missing {
    width: 100%;
    height: 150px;
    border-radius: 7px;
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.pet-card h3 {
    margin: 0.6rem 0 0;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.muted {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 0;
}

.pet-card p {
    margin: 0.15rem 0 0;
    font-size: 0.9rem;
}

/* ===== Map panel ===== */

#map-slot {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-height: 150px;
    max-width: 560px;
    padding: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-placeholder {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    text-align: center;
}

/* ===== Access gate ===== */

#access-gate {
    max-width: 560px;
    margin-top: 1.2rem;
    padding: 1.2rem 1.3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.gate-intro {
    margin: 0 0 0.9rem;
    font-size: 0.92rem;
    line-height: 1.55;
}

.gate-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

#gate-email {
    flex: 1;
    min-width: 14rem;
    font-family: var(--font-body);
    font-size: 0.92rem;
    padding: 0.55rem 0.7rem;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.gate-note {
    margin: 0.7rem 0 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-muted);
}

#gate-status {
    max-width: 560px;
    margin-top: 1.2rem;
    padding: 1.2rem 1.3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.gate-timer-line {
    margin: 0 0 0.8rem;
    font-size: 0.9rem;
}

.gate-progress {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.gate-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent-primary);
}

.gate-count {
    margin: 0.6rem 0 0;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.gate-approved {
    margin: 0.2rem 0 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-speaking);
}

.gate-next {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
}

/* ===== Modal ===== */

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* Author-level display on .modal overrides the UA's [hidden] rule, so the
   hidden attribute has to be re-asserted here or the modal never closes. */
.modal[hidden] {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    z-index: 101;
}

.modal-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text);
}

/* ===== Buttons ===== */

.btn {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: none;
    border-radius: 7px;
    padding: 0.6rem 1.1rem;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--ink);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.map-btn {
    margin-top: 0.7rem;
    background: transparent;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
    align-self: flex-start;
}

.map-btn:hover {
    background: var(--accent-primary);
    color: var(--ink);
}

.report-row {
    margin-top: 2rem;
    text-align: center;
}

/* ===== Empty state ===== */

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 2rem 0;
}

/* ===== Footer ===== */

footer {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    padding: 1.2rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

footer p {
    margin: 0;
}

/* ===== Light theme =====
   Mirrors the site: light mode overrides canvas tokens only, accents stay. */

body.light {
    --bg: #fafaf7;
    --surface: #ffffff;
    --border: rgba(11, 14, 20, 0.12);
    --text: #1a1d24;
    --text-muted: rgba(26, 29, 36, 0.68);
}

.no-scroll { overflow: hidden; }
