:root {
    /* FLDynamicColor values from the app. */
    --vermilion: #e34334;
    --prussian: #004a80;
    --ink: #000000;
    --text-secondary: #555c61;
    --paper: #ffffff;
    --dot: #cccccc;
    /* HandDrawnStyle.lineWidth: the weight of the pen and of every outline in the interface. */
    --line: 2px;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --vermilion: #a63126;
        /* The app's dark Prussian blue (#005899) is too dark to read as link text on black. */
        --prussian: color-mix(in srgb, #005899 60%, white);
        --ink: #ffffff;
        --text-secondary: #9aa3a9;
        --paper: #000000;
        --dot: #3a3a3a;
    }
}

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

/* The dot grid from the logo, positioned so the home page's logo, drawn at twice its size, sits
   exactly on it: the logo's own dots fall 29.5px right of center and 20.36px below its top, and
   every other dot of the page's grid is one of them. */
html {
    height: 100%;
    --mark-top: 60px;
    background-color: var(--paper);
    background-image: radial-gradient(circle at 15px 15px, var(--dot) 1.0px, transparent 1.0px);
    background-size: 30px 30px;
    background-position: calc(50% + 29.5px) calc(var(--mark-top) + 20.36px - 15px);
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
}

a {
    color: var(--prussian);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

::selection {
    background: color-mix(in srgb, var(--vermilion) 30%, transparent);
}

main {
    flex: 1;
    width: 100%;
    max-width: 40rem;
    margin: 0 auto;
    padding: var(--mark-top) 1rem 2rem;
}

/* MARK: Toolbar parts */

/* An ink-outlined capsule on paper, like HandDrawnGroup. */
.capsule {
    display: inline-flex;
    align-items: stretch;
    background: var(--paper);
    border: var(--line) solid var(--ink);
    border-radius: 999px;
    overflow: hidden;
}

.capsule > * {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 40px;
    padding: 0 1rem;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
}

.capsule > * + * {
    border-left: var(--line) solid var(--ink);
}

.capsule a:hover {
    background: color-mix(in srgb, var(--ink) 6%, var(--paper));
}

.capsule a:active {
    background: color-mix(in srgb, var(--ink) 14%, var(--paper));
}

/* A single round button, like the app's 44pt circles. */
.button-circle {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    background: var(--paper);
    border: var(--line) solid var(--ink);
    border-radius: 50%;
}

.icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--ink);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* A panel: the same outline, and only the faintest shadow. */
.panel {
    background: var(--paper);
    border: var(--line) solid var(--ink);
    border-radius: 22px;
    box-shadow: 0 1px 4px rgb(0 0 0 / 0.06);
    padding: 1.75rem 1.5rem;
}

/* MARK: Home */

.hero {
    text-align: center;
}

.mark {
    display: block;
    width: 250.44px;
    height: 250.44px;
    margin: 0 auto;
    overflow: visible;
}

.mark path {
    fill: none;
    stroke: var(--ink);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mark .vermilion { stroke: var(--vermilion); }
.mark .prussian { stroke: var(--prussian); }

@media (prefers-color-scheme: dark) {
    .mark .prussian { stroke: #005899; }
}

h1 {
    font-size: 3rem;
    letter-spacing: -0.02em;
    margin-top: 0.5rem;
}

.tagline {
    display: inline-block;
    font-size: 1.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    padding-bottom: 18px;
}

@media (prefers-color-scheme: dark) {
    .tagline {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-3 -3 72.8 25.3'%3E%3Cpath d='M0 0c19.8 27.5 44.2-22.4 66.8 10.8' fill='none' stroke='%23a63126' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E");
    }
}

.subhead {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-top: 1.25rem;
    line-height: 1.4;
}

.app-store-badge {
    display: inline-block;
    margin-top: 2rem;
}

/* Drawn with 3-unit strokes, so at this height they're the 2px pen weight. The SVG carries its
   own light and dark colors. */
.app-store-badge img {
    display: block;
    height: 66.2px;
    width: auto;
}

.platforms {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.features {
    list-style: none;
    display: grid;
    gap: 1.5rem;
    margin-top: 3rem;
    text-align: left;
}

.features li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    line-height: 1.5;
    color: var(--text-secondary);
}

.features strong {
    display: block;
    color: var(--ink);
    margin-top: 0.1rem;
    margin-bottom: 0.1rem;
}

.about {
    margin-top: 2rem;
}

/* MARK: Text pages */

article {
    text-align: left;
}

article h1 {
    font-size: 2rem;
    margin: 0 0 1.25rem;
}

article h2 {
    font-size: 1.2rem;
    color: var(--vermilion);
    margin: 2rem 0 0.75rem;
}

article h2:first-child {
    margin-top: 0;
}

article p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

article p:last-child {
    margin-bottom: 0;
}

.home {
    margin-bottom: 1.5rem;
}

.home .icon {
    width: 18px;
    height: 18px;
    margin-left: -0.3rem;
}

/* MARK: Footer */

footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1rem 2.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

@media (max-width: 480px) {
    h1 { font-size: 2.5rem; }
    .tagline { font-size: 1.4rem; }
    .panel { padding: 1.5rem 1.25rem; }
}
