/* cwilson.app
 *
 * Monospace, dark by default, no webfonts. The font stack is entirely local, so
 * the site makes zero network requests beyond the HTML and this file — which is
 * the same claim the apps make, and it would be odd to break it on the page
 * where you say it.
 */

:root {
    --bg: #0b0d10;
    --surface: #12151a;
    --border: #232831;
    --text: #d5dbe3;
    --bright: #f0f4f8;
    --secondary: #79828f;
    --accent: #6cb1ff;
    --green: #4ec97a;
    --radius: 6px;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #ffffff;
        --surface: #f6f8fa;
        --border: #d9dee4;
        --text: #24292f;
        --bright: #0d1117;
        --secondary: #616a75;
        --accent: #0862d4;
        --green: #167c3a;
    }
}

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

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

body {
    margin: 0;
    padding: 0 1.5rem 6rem;
    background: var(--bg);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                 "Liberation Mono", monospace;
    font-size: 15px;
    line-height: 1.75;
    font-variant-numeric: tabular-nums;
}

main,
header,
footer { max-width: 74ch; margin: 0 auto; }

header { padding: 4.5rem 0 0; }

::selection { background: var(--accent); color: var(--bg); }

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

/* --- the prompt device -------------------------------------------------- */

/* Each page opens with a command that describes it. One per page; more than
 * that and it stops being a signal. */
.prompt {
    color: var(--secondary);
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
}
.prompt::before { content: "$ "; color: var(--green); }

h1 {
    font-size: 1.75rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--bright);
    margin: 0 0 0.6rem;
    font-weight: 600;
}

/* A block cursor after the title. Purely decoration, so it is hidden from
 * assistive tech and stops moving when the system asks it to. */
h1 .cursor {
    display: inline-block;
    width: 0.55em;
    height: 1.05em;
    margin-left: 0.15em;
    vertical-align: -0.16em;
    background: var(--accent);
    animation: blink 1.15s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
    h1 .cursor { animation: none; opacity: 0.55; }
}

h2 {
    font-size: 1rem;
    color: var(--bright);
    margin: 3rem 0 0.9rem;
    font-weight: 600;
}
h2::before { content: "## "; color: var(--secondary); font-weight: 400; }

h3 {
    font-size: 0.95rem;
    color: var(--bright);
    margin: 2rem 0 0.5rem;
    font-weight: 600;
}
h3::before { content: "### "; color: var(--secondary); font-weight: 400; }

p { margin: 0 0 1.05rem; }

/* Comment-styled prose. The marker is generated, so it is never selected when
 * someone copies the text. */
.comment { color: var(--secondary); }
.comment::before { content: "// "; }

.lead { color: var(--secondary); margin-bottom: 2.5rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

ul { padding-left: 0; margin: 0 0 1.05rem; list-style: none; }
li { margin-bottom: 0.45rem; padding-left: 1.5rem; position: relative; }
li::before {
    content: "-";
    position: absolute;
    left: 0.25rem;
    color: var(--green);
}

/* --- directory-style app listing ---------------------------------------- */

.apps { margin: 2.5rem 0 0; }

.app-row {
    display: block;
    padding: 0.95rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: inherit;
    margin-bottom: 0.75rem;
}
.app-row:hover { border-color: var(--accent); text-decoration: none; }
.app-row .name { color: var(--accent); font-weight: 600; }
.app-row .meta { color: var(--secondary); font-size: 0.9rem; }
.app-row .desc { display: block; margin-top: 0.3rem; }

/* --- app icon beside the title ------------------------------------------ */

.title-row {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}
.title-row h1 { margin-bottom: 0.35rem; }
.title-row .lead { margin-bottom: 0; }

/* The asset is a full-bleed square — iOS applies the squircle, so the page has
 * to apply its own or the icon reads as a sticker. */
.appicon {
    width: 76px;
    height: 76px;
    flex: none;
    border-radius: 17px;
    border: 1px solid var(--border);
}

@media (max-width: 34rem) {
    .title-row { gap: 0.85rem; }
    .appicon { width: 58px; height: 58px; border-radius: 13px; }
}

/* --- screenshots -------------------------------------------------------- */

/* Three phones side by side, collapsing to a scrollable row on narrow screens
 * rather than stacking — stacked, each shot is taller than the viewport and the
 * set stops reading as a set. */
.shots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.85rem;
    margin: 0 0 0.75rem;
}

.shots figure { margin: 0; }

.shots img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #000;
}

.shots figcaption {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--secondary);
    text-align: center;
}

.credit {
    font-size: 0.8rem;
    color: var(--secondary);
    margin: 0 0 2rem;
}

@media (max-width: 46rem) {
    .shots {
        grid-auto-flow: column;
        grid-auto-columns: 62%;
        grid-template-columns: none;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        scroll-snap-type: x mandatory;
    }
    .shots figure { scroll-snap-align: start; }
}

/* --- code blocks and key/value dumps ------------------------------------ */

pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin: 0 0 1.5rem;
    overflow-x: auto;          /* wide content scrolls itself, never the page */
    font-size: 0.9rem;
    line-height: 1.65;
}
pre .key { color: var(--secondary); }
pre .val { color: var(--green); }
pre .cmd { color: var(--accent); }

code {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.1em 0.35em;
    font-size: 0.9em;
}

.scroll { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
}
th, td {
    text-align: left;
    padding: 0.55rem 1rem 0.55rem 0;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
th { color: var(--secondary); font-weight: 600; }

/* --- boxes -------------------------------------------------------------- */

.box {
    padding: 1.1rem 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 2px solid var(--accent);
    border-radius: var(--radius);
    margin: 2rem 0 0;
}
.box p:last-child { margin-bottom: 0; }
.box .label {
    color: var(--secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
}

/* --- navigation and chrome ---------------------------------------------- */

.path {
    display: block;
    margin-bottom: 2.25rem;
    font-size: 0.9rem;
    color: var(--secondary);
}
.path a { color: var(--secondary); }
.path a:hover { color: var(--accent); }

.updated { color: var(--secondary); font-size: 0.9rem; margin-bottom: 2.5rem; }

footer {
    margin-top: 5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--secondary);
    font-size: 0.9rem;
}
footer a { color: var(--secondary); }
footer a:hover { color: var(--accent); }
footer p { margin: 0 0 0.35rem; }

@media (max-width: 34rem) {
    body { font-size: 14px; padding: 0 1.1rem 4rem; }
    header { padding-top: 3rem; }
    h1 { font-size: 1.4rem; }
}

