/*
 * Paper Dawn site styles. Tokens from projects/alarm/DESIGN.md ("Paper-cut Dawn"):
 * cream-paper dawn (light) and night paper (dark), one coral for links and actions,
 * gold for the sun and earned things, sage for the land. Paper pieces have
 * hand-cut corners (strip cut 6/10/8/12, button cut 10/14/12/16) and a solid
 * offset shadow with no blur. Text never sits on the hills. Both themes follow
 * the visitor's system setting, as the app follows the phone's.
 * Gabarito variable (wght 400-900), SIL OFL, no Reserved Font Name.
 */

@font-face {
    font-family: "Gabarito";
    src: url("/paper-dawn/fonts/gabarito-var.woff2") format("woff2");
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light dark;

    /* Light: cream-paper dawn */
    --bg: #FBF4EA;          /* dawn-paper */
    --surface: #F4E7D4;     /* dawn-paper2 */
    --surface-low: #EFDFC7; /* dawn-paper3 */
    --sky: #F8E1C8;         /* dawn-sky */
    --ink: #1B2B4B;         /* dawn-ink */
    --mute: #55617B;        /* dawn-mute */
    --coral: #A5431F;       /* dawn-coral */
    --gold: #8A5A12;        /* dawn-gold (text) */
    --gold-fill: #F7D9A8;   /* dawn-gold-fill */
    --on-gold: #1B2B4B;
    --sage: #4B6A53;        /* dawn-sage */
    --shadow: #D9C4A3;      /* dawn-paper-shadow */
    --outline: #6F7A90;     /* dawn-outline */
    --hairline: #E2CFB2;    /* dawn-outline-variant */
    --sun: #F28C5B;         /* dawn-sun, decorative */
    --hill-far: #A9B9CB;
    --hill-mid: #9DB39F;
    --hill-near: #7E9A84;
    --ground: #6E8B74;
    --star: transparent;

    --font: "Gabarito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --cut-strip: 6px 10px 8px 12px;
    --cut-button: 10px 14px 12px 16px;
    --gutter: 1.25rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark: night paper */
        --bg: #1B2B4B;          /* ink */
        --surface: #22355A;     /* ink2 */
        --surface-low: #16233F; /* ink3 */
        --sky: #1B2B4B;
        --ink: #FBF4EA;         /* cream */
        --mute: #AEB8CB;        /* mute */
        --coral: #F28C5B;       /* coral */
        --gold: #F7D9A8;        /* gold */
        --gold-fill: #F7D9A8;
        --on-gold: #1B2B4B;
        --sage: #9DB8A2;        /* sage-text */
        --shadow: #0F1A30;      /* paper-shadow */
        --outline: #7B88A3;     /* outline */
        --hairline: #2E4470;    /* outline-variant */
        --sun: #F7D9A8;         /* the sun is gold at night */
        --hill-far: #3A5170;
        --hill-mid: #56705F;
        --hill-near: #6E8B74;
        --ground: #4A6352;
        --star: #FBF4EA;
    }
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

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

a {
    color: var(--coral);
    text-underline-offset: 0.18em;
}

a:hover {
    text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0 0 0.6em;
}

h1 {
    font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2.1rem);
}

h3 {
    font-size: 1.25rem;
}

p {
    margin: 0 0 1em;
}

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

.wrap {
    max-width: 68rem;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 10;
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    color: var(--ink);
    border: 2px solid var(--coral);
    border-radius: var(--cut-button);
}

.skip-link:focus {
    top: 1rem;
}

/* Header */

.topbar {
    background: var(--surface-low);
    color: var(--ink);
}

.topbar .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem 1.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 48px;
    color: var(--ink);
    text-decoration: none;
}

.brand img {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
}

.wordmark {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 0.9rem;
    border-radius: 999px;
    color: var(--ink);
    font-weight: 500;
    text-decoration: none;
}

.site-nav a:hover {
    background: var(--surface);
}

.site-nav a[aria-current="page"] {
    background: var(--surface);
    text-decoration: underline;
    text-decoration-color: var(--coral);
    text-decoration-thickness: 2px;
}

/* Hero: text on the sky, the paper hills below it (No Words On Hills) */

.hero {
    background: var(--sky);
    color: var(--ink);
    padding: 2.5rem 0 0;
}

.hero-grid {
    display: grid;
    gap: 2.5rem;
    align-items: center;
    padding-bottom: 2rem;
}

.hero-grid > * {
    min-width: 0;
}

.hero .answer {
    max-width: 36rem;
}

.get {
    margin-top: 1.5rem;
}

.get p,
.cta p {
    color: var(--mute);
    font-size: 0.95rem;
}

.play-badge {
    display: inline-block;
    border-radius: 8px;
}

.play-badge img {
    width: 188px;
    height: 56px;
}

.get .play-badge {
    margin-bottom: 0.5rem;
}

.hero-shot img {
    width: min(20rem, 100%);
    margin: 0 auto;
    border-radius: 20px;
    border: 1px solid var(--outline);
    box-shadow: 0 6px 0 var(--shadow);
}

@media (min-width: 40rem) {
    .hero-grid {
        grid-template-columns: minmax(0, 1fr) 18rem;
    }
}

@media (min-width: 60rem) {
    .hero-grid {
        grid-template-columns: minmax(0, 1fr) 20rem;
        gap: 4rem;
    }
}

.hills {
    display: block;
    width: 100%;
    height: clamp(56px, 9vw, 120px);
}

.hills .sun { fill: var(--sun); }
.hills .far { fill: var(--hill-far); }
.hills .mid { fill: var(--hill-mid); }
.hills .near { fill: var(--hill-near); }
.hills .ground { fill: var(--ground); }
.hills .star { fill: var(--star); }

/* Sections */

.section {
    padding: 2.75rem 0;
}

.section + .section {
    border-top: 1px solid var(--hairline);
}

.answer {
    font-size: 1.125rem;
    max-width: 44rem;
}

.detail {
    color: var(--mute);
    max-width: 44rem;
}

.split {
    display: grid;
    gap: 2rem;
    align-items: center;
}

.split > * {
    min-width: 0;
}

@media (min-width: 48rem) {
    .split-media {
        grid-template-columns: minmax(0, 1fr) 17rem;
        gap: 3rem;
    }
}

.pieces {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 48rem) {
    .pieces {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.paper {
    background: var(--surface);
    color: var(--ink);
    border-radius: var(--cut-strip);
    box-shadow: 3px 4px 0 var(--shadow);
    padding: 1.1rem 1.25rem 1.25rem;
}

.paper h3 {
    font-size: 1.15rem;
    margin-bottom: 0.4em;
}

.paper p {
    color: var(--ink);
}

.shot,
figure {
    margin: 0;
}

.shot img {
    border-radius: 16px;
    border: 1px solid var(--outline);
}

.shot-narrow {
    max-width: 17rem;
    margin: 0 auto;
}

.pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 16rem));
    gap: 1rem;
    margin-top: 1.5rem;
}

.ticks {
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: 44rem;
}

.ticks li {
    display: flex;
    gap: 0.75rem;
    padding: 0.45rem 0;
}

.ticks li > span {
    min-width: 0;
}

.ticks svg {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.2rem;
    fill: none;
    stroke: var(--sage);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.limits {
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: 46rem;
}

.limits li {
    margin-bottom: 0.9rem;
}

.limits strong {
    display: block;
    margin-bottom: 0.2rem;
}

.privacy-note {
    max-width: 46rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 40rem) {
    .gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

figcaption {
    margin-top: 0.5rem;
    color: var(--mute);
    font-size: 0.95rem;
}

.qlinks {
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: 44rem;
}

.qlinks a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 48px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--surface);
    color: var(--ink);
    border-radius: var(--cut-strip);
    box-shadow: 3px 4px 0 var(--shadow);
    text-decoration: none;
}

.qlinks a:hover span {
    text-decoration: underline;
    text-decoration-color: var(--coral);
}

.qlinks svg {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: var(--coral);
    stroke-width: 2.2;
}

.cta {
    text-align: center;
}

/* Tables stack into cards at 600 px and below */

table {
    width: 100%;
    max-width: 52rem;
    border-collapse: collapse;
    margin: 1.5rem 0 0;
}

caption {
    display: block;
    text-align: left;
    font-weight: 650;
    margin-bottom: 0.5rem;
}

th,
td {
    text-align: left;
    vertical-align: top;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--hairline);
}

thead th {
    background: var(--surface);
    color: var(--ink);
}

tbody th {
    font-weight: 650;
}

@media (max-width: 37.5rem) {
    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
    }

    thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    tbody tr {
        margin-bottom: 1rem;
        background: var(--surface);
        color: var(--ink);
        border-radius: var(--cut-strip);
        box-shadow: 3px 4px 0 var(--shadow);
    }

    th,
    td {
        border-bottom: 0;
        padding: 0.4rem 1rem;
    }

    tbody th {
        padding-top: 0.9rem;
    }

    td:last-child {
        padding-bottom: 0.9rem;
    }

    td[data-label]::before {
        content: attr(data-label) ": ";
        font-weight: 650;
    }
}

/* Inner pages */

.page-head {
    background: var(--sky);
    color: var(--ink);
    padding: 1.5rem 0 2rem;
}

.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    color: var(--mute);
    font-size: 0.95rem;
}

.crumbs li + li::before {
    content: "›";
    padding: 0 0.5rem;
}

.crumbs a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
}

.lede {
    font-size: 1.125rem;
    max-width: 44rem;
}

.faq .section h2 {
    font-size: clamp(1.3rem, 1.15rem + 0.8vw, 1.65rem);
}

/* Footer */

.footer {
    background: var(--surface-low);
    color: var(--ink);
    padding: 2.5rem 0;
    font-size: 0.95rem;
}

.footer-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.25rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
}

.fine {
    color: var(--mute);
}

.fine a {
    display: inline-block;
    padding: 0.6rem 0;
}
