/* Shared styles for cowcowtech.com */

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

/* Colour is an EVENT, not a constant: the sky gradient is spent on the hero, the home splash and
   the band at the top of each page, and everything below it sits on white. An all-over saturated
   field behind body copy is what made the old page read heavy, and it forced navy-on-sky, which is
   one hue doing two jobs.

   Two ink scales, because there are two grounds. --text/--text-dim are tuned for white; --on-sky
   and --on-sky-dim for the hero, where the *deep* end of the gradient (--sky-bottom) is the worst
   case and is what they clear 4.5:1 against, not the pale end, where anything looks fine.

   The Play developer-page header wears --sky-top/--sky-bottom too; see
   scripts/play/generate-developer-page.py. Change one and change the other. */
:root {
    --sky-top: #8ec5f0;
    --sky-bottom: #5a9fd8;

    --text: #16202b;
    --text-dim: #5a6472;
    --accent: #1b6ca8;

    --on-sky: #16202b;
    --on-sky-dim: #163140;

    --hairline: rgba(22, 32, 43, 0.12);
    --sky-wash: linear-gradient(135deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #fff;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    /* Mobile Safari inflates type in landscape unless this is pinned, which throws off every size
       the phone block below sets. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Centered layout (home, privacy), opt in with <body class="centered"> */
body.centered {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
}
body.centered .container { padding: 2rem; max-width: 700px; }

/* The home splash is the hero, the whole viewport is the sky. Privacy is `centered` too and is
   deliberately NOT a hero: it's a document, and it stays on white. */
body.hero {
    background: var(--sky-wash);
    color: var(--on-sky);
}
body.hero .tagline,
body.hero .mission,
body.hero .quiet { color: var(--on-sky-dim); }

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 1.5rem 3rem;
}

/* Headings */
/* The hero band at the top of an inner page.
   An APP page wears its own brand colour (--hero-*, derived from its --accent by
   scripts/site/brand.py); the portfolio's pages, /apps/, and the home splash, have no accent of
   their own and fall back to sky. One shared sky hero is what put Dronie's yellow icon on a blue
   field, and it clashed on every app whose brand isn't blue. */
header {
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg,
        var(--hero-top, var(--sky-top)) 0%,
        var(--hero-bottom, var(--sky-bottom)) 100%);
    color: var(--hero-ink, var(--on-sky));
    border-radius: 18px;
    padding: 2.5rem 1.5rem;
}
/* The tagline can't take a dim ink here: it would have to be dim against an unknown brand colour.
   It keeps the hero's own derived label and separates by size and weight instead. */
header .tagline,
header h1 { color: var(--hero-ink, var(--on-sky)); }
header .tagline { opacity: 0.88; }
.emoji-logo { font-size: 3.5rem; margin-bottom: 1rem; }
.app-icon {
    width: 128px;
    height: 128px;
    margin: 0 auto 1rem;
    display: block;
    border-radius: 28.6px; /* iOS squircle approximation (22.37% of size) */
    box-shadow: 0 8px 24px rgba(22, 32, 43, 0.22);
}
h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.02em;
}
.tagline {
    color: var(--text-dim);
    font-size: 1.15rem;
    margin-top: 0.5rem;
}
/* The "every one is free" line, the page's one boast. It was an inline color:#fff, which was
   legible only while the page behind it was dark. */
.tagline.strong { font-weight: 600; }
.lede {
    color: var(--text);
    font-size: 1.1rem;
    margin: 2rem 0;
    text-align: center;
}
h2 {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 500;
    margin: 2.5rem 0 0.75rem;
    letter-spacing: 0.04em;
}
/* Splits one h2 list into platform halves, so it sits tight under the list above rather than apart. */
h3 {
    color: var(--text-dim);
    font-size: 1rem;
    font-weight: 500;
    margin: 1.25rem 0 0.5rem;
    letter-spacing: 0.04em;
}
p { color: var(--text); margin-bottom: 1rem; }
ul { color: var(--text); padding-left: 1.25rem; }
li { margin-bottom: 0.4rem; }

/* Inline links in body copy: the accent, underlined (the most accessible affordance). Scoped to
   copy so it never touches badges, footer links, the back link, or cards, those style their own. */
.container p a,
.container li a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.container p a:hover,
.container li a:hover { color: var(--text); }

/* CTA */
.cta { text-align: center; margin: 3rem 0 2rem; }
/* The top CTA sits under the lede as part of the opening block, so it hugs it (tighter top margin)
   rather than floating a full 3rem below like the closing CTA does after the feature list. */
.cta.cta-top { margin: 1.5rem 0 2.5rem; }
.coming-soon {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--text-dim);
    color: var(--text-dim);
    border-radius: 8px;
    font-size: 0.95rem;
}
/* The accent-filled pill, a FAQ/support "email us", the home "our apps". It fills with the page's
   own --accent, so its LABEL is derived from that accent, never stated: white on a dark accent, ink
   on a light one. The same call as the apps' CoreKit `Color.onAccent`, for the same reason, a
   hard-coded label is a thing a page can get wrong, and both were wrong somewhere: white is
   unreadable on Dronie's #ffcd1f (1.5:1), ink on VideoFreezer's #5c4dcc (2.6:1). The store CTA was
   once this pill; it's Apple's/Google's own art now (.store-badge, below).

   `scripts/site/brand.py` derives --on-accent and --badge-bg from the accent and writes them into
   each page; it checks them too, so a page can't quietly ship an unreadable pill. The fallback here
   is what a page gets if it never ran. */
.badge {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    background: var(--badge-bg, var(--accent));
    color: var(--on-accent, #fff);
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1rem;
}
.badge:hover { opacity: 0.9; }
/* Space the chrome pills that share a .cta, support's "email us" / "join discord", a FAQ's
   "email us". (Store-CTA badges are .store-badge and set their own spacing.) */
.cta .badge { margin: 0.35rem; }
/* On the sky, a sky-coloured pill would vanish, the home CTA inverts to ink. */
body.hero .badge { background: var(--text); }

/* Official store badges on app pages: Apple's and Google's own lockups (site/badges/), the
   universally recognised "get the app" mark. Apple's SVG is tight; Google's PNG bakes ~33%
   transparent clear-space top/bottom (visible body is 67% of the canvas), so it renders taller
   (66 vs 44px) for the two visible badges to line up, measured from the PNG, not eyeballed. */
.cta .store-badge { display: inline-block; margin: 0.4rem 0.3rem; vertical-align: middle; }
.cta .store-badge img { display: block; height: 44px; width: auto; }
.cta .store-badge.play img { height: 66px; }
.cta .store-badge:hover { opacity: 0.85; }
/* `hidden` is only a UA-stylesheet `display: none`, so the rule above outranks it and the badge
   platform.js demoted would stay on screen without this. */
.cta .store-badge[hidden] { display: none; }

/* The other platform's store, once platform.js has decided which one the visitor isn't on. It stays
   a real link, never a removal: a page read on an iPhone is still the page someone sends to an
   Android friend. Padding is the tap target, the 0.9rem type alone would be a 20px one. */
.cta .alt-store {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.6rem 0.5rem;
    color: var(--text-dim);
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cta .alt-store:hover { color: var(--text); }

/* Footer */
footer {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--hairline);
    color: var(--text-dim);
    font-size: 0.85rem;
}
footer a {
    color: var(--text-dim);
    text-decoration: none;
    margin: 0 0.6rem;
}
footer a:hover { color: var(--accent); }

/* Home page */
.home-logo {
    width: 160px;
    height: 160px;
    margin: 0 auto 1.25rem;
    display: block;
    background: #fff;
    border-radius: 50%;
    padding: 18px;
}
body.centered h1 {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--on-sky);
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
}
body.centered .tagline {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}
.mission {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.8;
}

/* Privacy page, `centered`, but a document: white ground, ink type. */
body.centered:not(.hero) h1,
body.centered:not(.hero) h2 { color: var(--text); }
.back {
    display: inline-block;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}
.back:hover { color: var(--text); }
body.centered h2 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: normal;
}
body.centered p {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}
.updated {
    color: var(--text-dim) !important;
    font-size: 0.85rem !important;
    margin-bottom: 2rem !important;
}

/* Apps listing */
.apps {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}
/* White cards with the app's brand colour as a 3px edge.
   The colour is spent on the RULE, not on the app's name, and that is the whole point: as type on a
   card, four of the ten accents fail contrast on white and one fails on dark (#5c4dcc, 2.75:1),
   they were picked to be brand marks, not body text. As a rule, no contrast floor applies, every
   app keeps its exact colour, and the name is ink and always legible. */
.card {
    display: block;
    padding: 1.5rem 1.75rem;
    background: #fff;
    border: 1px solid var(--hairline);
    border-left: 3px solid var(--chip, var(--accent));
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 1px 2px rgba(22, 32, 43, 0.06);
    transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(22, 32, 43, 0.12);
}
@media (prefers-reduced-motion: reduce) {
    .card { transition: none; }
    .card:hover { transform: none; }
}
.card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.icon { font-size: 1.75rem; line-height: 1; }
.icon-img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: block;
    flex-shrink: 0;
}
.name { font-size: 1.4rem; font-weight: 600; color: var(--text); }
.status {
    margin-left: auto;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    border: 1px solid var(--hairline);
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    white-space: nowrap;
}
/* No accent-coloured "live" pill. The text already says where the app is ("iOS & Android", "On the
   App Store"), and an outlined pill inside an already-clickable card reads as a second button. */
.status.live { color: var(--text-dim); border-color: var(--hairline); }
.blurb { color: var(--text-dim); font-size: 1rem; margin: 0; }

/* Section labels above each group of cards */
.section-label { color: var(--text-dim); }

/* A deliberately quiet link (the splash's privacy link). */
.quiet { color: var(--text-dim); text-decoration: none; }
.quiet:hover { color: var(--text); }

/* App brand colours. They set a custom property rather than a text colour, the card spends it on
   its left edge (see .card). */
.accent-dronie { --chip: #ffcd1f; }
.accent-rewind { --chip: #bf5af2; }
.accent-cadencekeeper { --chip: #007aff; }
.accent-videofreezer { --chip: #5c4dcc; }
.accent-panpan { --chip: #21c7bd; }
.accent-panels { --chip: #ec4f80; }
.accent-plateshift { --chip: #2680eb; }
.accent-fingertaptest { --chip: #0a6bff; }
.accent-triptracker { --chip: #2f9c60; }
.accent-pbsplits { --chip: #61b000; }
.accent-virtualbackyardultra { --chip: #6aa524; }
.accent-mahjongsage { --chip: #3daf66; }
.accent-overlap { --chip: #0ea5e9; }
.accent-timebound { --chip: #b0667f; }
.accent-starship { --chip: #6ad7ff; }

/* Phones. The layout was always fluid, so nothing here is about reflow: it is about the metrics a
   720px column takes for granted. At 390pt the desktop values spend roughly a fifth of the first
   screen on padding and hero before a word of copy appears, and the footer's five links sit at a
   22px tap height, half of the 44px minimum.
   640px, not a device width: it is where the two-up card grid in /apps/ collapses, and one
   breakpoint is easier to keep honest than two. */
@media (max-width: 640px) {
    .container { padding: 2.25rem 1.1rem 2.5rem; }
    body.centered .container { padding: 1.5rem; }

    header {
        padding: 1.75rem 1.15rem;
        margin-bottom: 2rem;
        border-radius: 14px;
    }
    h1, body.centered h1 { font-size: 1.9rem; }
    h2 { margin: 2rem 0 0.6rem; }
    .tagline, body.centered .tagline { font-size: 1.05rem; }

    .app-icon {
        width: 96px;
        height: 96px;
        border-radius: 21.5px; /* holds the squircle's 22.37% of size */
        margin-bottom: 0.85rem;
    }
    .emoji-logo { font-size: 2.75rem; }
    .home-logo { width: 128px; height: 128px; padding: 14px; }

    /* Centred prose ragged on both edges is a desktop luxury; at this width it reads as damage. */
    .lede { font-size: 1.05rem; margin: 1.5rem 0; text-align: left; }

    .back { margin-bottom: 1.25rem; padding: 0.35rem 0; }

    /* The name plus a status pill plus a 44px icon does not fit one line here. */
    .card { padding: 1.15rem 1.25rem; }
    .card-head { flex-wrap: wrap; gap: 0.6rem; }
    .name { font-size: 1.2rem; }

    footer { margin-top: 2.5rem; }
    footer a { display: inline-block; padding: 0.7rem 0.2rem; margin: 0 0.35rem; }
}
