/* ============================================================================
   pimaso — main stylesheet

   Dark first, because the app is dark-only and for the same reason: a camera
   app is used in the dark. A light palette follows in section 10 for anyone
   whose system asks for one.
   ============================================================================ */

/* ============================================================================
   1. TOKENS
   ============================================================================ */

:root {
    color-scheme: dark light;

    --bg: #0b0d10;
    --surface: #12161b;
    --surface-2: #171d24;
    --border: #232c35;
    --text: #e8edf2;
    --muted: #a5b1bd;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 28px rgba(0, 0, 0, .35);

    /* Overridden per page in section 9. */
    --accent: #4da3ff;
    --accent-dark: #2b7fd8;
    --accent-wash: rgba(77, 163, 255, .08);

    --radius: 10px;
    --measure: 68ch;
}

/* ============================================================================
   2. RESET & BASE
   ============================================================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 3px;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .88em;
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    padding: .1em .4em;
    border-radius: 4px;
    overflow-wrap: break-word;
}

/* ============================================================================
   3. LAYOUT
   ============================================================================ */

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px 56px;
}

main {
    display: block;
}

section {
    margin: 44px 0;
}

/* ============================================================================
   4. HEADER
   ============================================================================ */

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
}

.brand:hover {
    text-decoration: none;
}

.logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: block;
}

.brand-name {
    font-size: 1.35em;
    font-weight: 700;
    letter-spacing: -.01em;
}

header nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: .95em;
}

header nav a {
    color: var(--muted);
    font-weight: 500;
    padding-bottom: 2px;
}

header nav a:hover {
    color: var(--accent);
    text-decoration: none;
}

header nav a[aria-current='page'] {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

/* ============================================================================
   5. TYPOGRAPHY
   ============================================================================ */

h1 {
    font-size: 2.1em;
    line-height: 1.2;
    letter-spacing: -.02em;
    margin-bottom: 14px;
    color: var(--accent);
}

h2 {
    font-size: 1.4em;
    line-height: 1.3;
    margin-bottom: 14px;
    color: var(--text);
}

h3 {
    font-size: 1.08em;
    margin-bottom: 8px;
    color: var(--accent);
}

p, li {
    max-width: var(--measure);
    line-height: 1.75;
}

p {
    margin-bottom: 14px;
}

ul, ol {
    margin: 0 0 16px 22px;
}

li {
    margin-bottom: 8px;
}

strong {
    color: var(--text);
    font-weight: 600;
}

.lede {
    font-size: 1.15em;
    color: var(--muted);
    max-width: var(--measure);
    margin-bottom: 28px;
}

.updated {
    color: var(--muted);
    font-size: .92em;
    margin-bottom: 28px;
}

.muted {
    color: var(--muted);
}

/* ============================================================================
   6. HERO (home)
   ============================================================================ */

.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 26px;
}

.badge {
    font-size: .82em;
    color: var(--muted);
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 12px;
    white-space: nowrap;
}

/* ============================================================================
   7. SECTIONS & BOXES
   ============================================================================ */

.purpose {
    background-color: var(--accent-wash);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 22px 24px 8px;
    margin: 32px 0;
}

.purpose h2 {
    color: var(--accent);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.feature {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.feature p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: .95em;
}

.feature-icon {
    font-size: 1.05em;
}

.note, .important, .offline {
    padding: 16px 18px;
    margin: 24px 0;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    background-color: var(--surface);
}

.note > :last-child,
.important > :last-child,
.offline > :last-child {
    margin-bottom: 0;
}

.important {
    border-left-color: #e8a33d;
    background-color: rgba(232, 163, 61, .07);
}

.offline {
    border-left-color: #e05c5c;
    background-color: rgba(224, 92, 92, .07);
}

.contact-section {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px 8px;
    margin-top: 36px;
}

/* -------- Screenshot strip -------- */

/* A row of phone shots, scrolled sideways. Sized by height rather than width so
   the one landscape shot sits in the row at the same height as the portrait
   ones instead of being squeezed into their shape. */
.shots {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 14px;
    margin: 24px 0;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
}

.shot {
    scroll-snap-align: start;
    flex: 0 0 auto;
}

.shot img {
    display: block;
    height: 440px;
    width: auto;
    max-width: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface);
}

.shot figcaption {
    color: var(--muted);
    font-size: .85em;
    margin-top: 8px;
    text-align: center;
}

/* -------- Tables -------- */

.table-wrap {
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: .95em;
}

th, td {
    text-align: left;
    vertical-align: top;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: var(--surface-2);
    font-weight: 600;
    white-space: nowrap;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* -------- Licenses -------- */

.dependency {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 14px;
}

.dependency-name {
    font-weight: 600;
    color: var(--accent);
    font-size: 1.02em;
}

.dependency-version {
    color: var(--muted);
    font-size: .88em;
}

.dependency-description {
    color: var(--muted);
    font-size: .93em;
    margin: 6px 0 0;
}

.license-badge {
    display: inline-block;
    background-color: var(--accent);
    color: var(--bg);
    padding: 1px 8px;
    border-radius: 999px;
    font-size: .78em;
    font-weight: 700;
    margin-left: 8px;
    vertical-align: 2px;
}

/* ============================================================================
   8. BUTTONS
   ============================================================================ */

.cta-buttons {
    margin: 32px 0 12px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 26px;
    font-size: 1.02em;
    font-weight: 600;
    border-radius: 8px;
    display: inline-block;
    transition: background-color .2s ease, box-shadow .2s ease, color .2s ease;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: var(--accent);
    color: #06131f;
}

.btn-primary:hover {
    background-color: var(--accent-dark);
    box-shadow: 0 6px 18px var(--accent-wash);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-secondary:hover {
    background-color: var(--accent-wash);
}

.cta-note {
    color: var(--muted);
    font-size: .9em;
    margin-bottom: 32px;
}

/* ============================================================================
   9. PER-PAGE ACCENTS
   ============================================================================ */

.page-about {
    --accent: #63b3ff;
    --accent-dark: #3a8fe0;
    --accent-wash: rgba(99, 179, 255, .08);
}

.page-privacy {
    --accent: #4bd18a;
    --accent-dark: #2fae6c;
    --accent-wash: rgba(75, 209, 138, .08);
}

.page-terms {
    --accent: #ff9552;
    --accent-dark: #e0763a;
    --accent-wash: rgba(255, 149, 82, .08);
}

.page-licenses {
    --accent: #9d8cff;
    --accent-dark: #7b68e6;
    --accent-wash: rgba(157, 140, 255, .08);
}

.page-404 {
    --accent: #a5b1bd;
    --accent-dark: #8b97a3;
    --accent-wash: rgba(165, 177, 189, .08);
}

/* ============================================================================
   10. LIGHT PALETTE
   ============================================================================ */

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f4f6f9;
        --surface: #ffffff;
        --surface-2: #eef1f5;
        --border: #dde3ea;
        --text: #1b1f24;
        --muted: #5d6b7a;
        --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);

        --accent: #0b62c4;
        --accent-dark: #084b99;
        --accent-wash: rgba(11, 98, 196, .06);
    }

    .container {
        background-color: var(--surface);
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: var(--shadow);
        margin-top: 24px;
        margin-bottom: 24px;
    }

    .btn-primary {
        color: #ffffff;
    }

    .license-badge {
        color: #ffffff;
    }

    .page-about  { --accent: #0078d4; --accent-dark: #005ea8; --accent-wash: rgba(0, 120, 212, .06); }
    .page-privacy { --accent: #107c10; --accent-dark: #0c5f0c; --accent-wash: rgba(16, 124, 16, .06); }
    .page-terms  { --accent: #c2410c; --accent-dark: #9a3009; --accent-wash: rgba(194, 65, 12, .06); }
    .page-licenses { --accent: #5b46d6; --accent-dark: #4735ad; --accent-wash: rgba(91, 70, 214, .06); }
    .page-404    { --accent: #5d6b7a; --accent-dark: #47535f; --accent-wash: rgba(93, 107, 122, .06); }
}

/* ============================================================================
   11. FOOTER
   ============================================================================ */

footer {
    margin-top: 56px;
    padding-top: 26px;
    border-top: 1px solid var(--border);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin-bottom: 18px;
    font-size: .95em;
}

.footer-links a {
    font-weight: 500;
}

.footer-text {
    color: var(--muted);
    font-size: .87em;
    max-width: none;
    margin-bottom: 0;
}

/* ============================================================================
   12. RESPONSIVE & MOTION
   ============================================================================ */

@media (max-width: 640px) {
    .container {
        padding: 24px 16px 40px;
    }

    header {
        gap: 12px;
    }

    header nav {
        gap: 14px;
        font-size: .9em;
    }

    h1 {
        font-size: 1.7em;
    }

    .lede {
        font-size: 1.05em;
    }

    .btn {
        flex: 1 1 auto;
        text-align: center;
    }

    .shot img {
        height: 340px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition: none !important;
    }
}
