/*
 * Amen — the app's own dark theme, on the web.
 *
 * The colours are `ui/Theme.kt`'s night palette, hex for hex: Marian blue for the ground,
 * gold for anything that marks a place, paper for the words. Nothing here is a web idea
 * of what a prayer app looks like; it is what the app looks like.
 *
 * The page is strung on one cord. It runs down the left of every section, beaded, and
 * ends on a cross in the footer — which is what a rosary is: a counted thread, large beads
 * where you stop, small ones in between. The features sit on the large beads.
 */

:root {
    /* ui/Theme.kt */
    --night: #10141c;
    --night-card: #1a202b;
    --marian: #26406e;
    --marian-deep: #16263f;
    --marian-light: #9db6e0;
    --gold: #b07d1f;
    --gold-light: #e3be72;
    --paper: #f6f2e9;

    --ink: var(--paper);
    --ink-quiet: #a6aebd;
    --rule: rgba(246, 242, 233, 0.1);

    --display: "EB Garamond", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
    --body: "EB Garamond", Georgia, "Times New Roman", serif;
    --label: "IBM Plex Sans", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;

    /* The cord's distance from the content's left edge, and the beads' sizes. */
    --cord: 15px;
    --bead-large: 15px;
    --bead-small: 5px;

    color-scheme: dark;
}

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

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

body {
    margin: 0;
    background:
        radial-gradient(90rem 48rem at 18% -10%, rgba(38, 64, 110, 0.55), transparent 60%),
        radial-gradient(60rem 40rem at 110% 8%, rgba(176, 125, 31, 0.1), transparent 55%),
        var(--night);
    background-attachment: fixed;
    color: var(--ink);
    font-family: var(--body);
    font-size: 1.0625rem;
    line-height: 1.62;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
}

a {
    color: var(--gold-light);
    text-decoration-color: rgba(227, 190, 114, 0.45);
    text-underline-offset: 0.22em;
}

a:hover {
    text-decoration-color: currentColor;
}

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

.wrap {
    width: 100%;
    max-width: 54rem;
    margin-inline: auto;
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------------------------------------------------------------- the masthead */

.masthead {
    padding-block: 22px 8px;
}

.masthead .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--display);
    font-size: 1.35rem;
    letter-spacing: 0.01em;
    color: var(--ink);
    text-decoration: none;
}

.wordmark img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.masthead nav {
    font-family: var(--label);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.masthead nav a {
    color: var(--ink-quiet);
    text-decoration: none;
}

.masthead nav a:hover {
    color: var(--gold-light);
}

/* ---------------------------------------------------------------------- the cord
 *
 * One thread down the page: small beads repeating along it, large beads placed by the
 * sections that sit on them.
 */

.cord {
    position: relative;
}

.cord::before {
    content: "";
    position: absolute;
    left: calc(var(--cord) - 1px);
    top: 0;
    bottom: 0;
    width: 2px;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(176, 125, 31, 0.55) 0 var(--bead-small),
            rgba(176, 125, 31, 0.12) var(--bead-small) calc(var(--bead-small) * 3.4)
        );
}

.strung {
    position: relative;
    padding-left: calc(var(--cord) + 30px);
}

.strung::before {
    content: "";
    position: absolute;
    left: calc(var(--cord) - var(--bead-large) / 2);
    top: 0.55em;
    width: var(--bead-large);
    height: var(--bead-large);
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, var(--gold-light), var(--gold) 62%, #6d4c10);
    box-shadow: 0 0 0 4px var(--night), 0 0 14px rgba(227, 190, 114, 0.22);
}

/* --------------------------------------------------------------------- the hero */

.hero {
    padding-block: 26px 44px;
}

.hero h1 {
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(2.9rem, 9vw, 4.6rem);
    line-height: 1.02;
    letter-spacing: -0.015em;
    margin: 0 0 0.3em;
    text-wrap: balance;
}

.hero h1 em {
    display: block;
    font-style: normal;
    font-size: 0.44em;
    line-height: 1.25;
    letter-spacing: 0.005em;
    color: var(--marian-light);
    margin-top: 0.42em;
}

.lede {
    max-width: 34rem;
    margin: 0;
    font-size: 1.2rem;
    color: #d8d3c7;
}

.hero-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr;
    align-items: start;
}

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

/* Today's mysteries, worked out the way the app works them out. */
.today {
    min-width: 0;
    border: 1px solid var(--rule);
    border-radius: 16px;
    background: linear-gradient(170deg, rgba(38, 64, 110, 0.5), rgba(26, 32, 43, 0.75));
    padding: 18px 20px;
}

.today .eyebrow {
    display: block;
    font-family: var(--label);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold-light);
}

.today .set {
    display: block;
    font-family: var(--display);
    font-size: 1.7rem;
    line-height: 1.15;
    margin-top: 6px;
}

.today .set-note {
    display: block;
    margin-top: 8px;
    font-size: 0.95rem;
    color: var(--ink-quiet);
}

/* -------------------------------------------------------------------- the stores */

.stores {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.store {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    padding: 11px 18px 11px 15px;
    border-radius: 13px;
    border: 1px solid rgba(246, 242, 233, 0.22);
    background: rgba(246, 242, 233, 0.04);
    color: var(--ink);
    text-decoration: none;
    font-family: var(--label);
    line-height: 1.15;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.store:hover {
    border-color: var(--gold-light);
    background: rgba(227, 190, 114, 0.08);
    transform: translateY(-1px);
}

.store svg {
    flex: none;
}

.store span {
    display: block;
}

.store .small {
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-quiet);
}

.store .big {
    font-size: 1.05rem;
    letter-spacing: 0.005em;
}

.store[aria-disabled="true"] {
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}

.free-line {
    margin: 16px 0 0;
    font-family: var(--label);
    font-size: 0.86rem;
    color: var(--ink-quiet);
}

/* ------------------------------------------------------------------ the features */

.section-label {
    font-family: var(--label);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin: 0 0 26px;
}

.features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 34px;
}

.features h2 {
    font-family: var(--display);
    font-weight: 500;
    font-size: 1.62rem;
    line-height: 1.2;
    margin: 0 0 0.26em;
    text-wrap: balance;
}

.features p {
    margin: 0;
    max-width: 38rem;
    color: #cfc9bc;
}

/* ------------------------------------------------------------------- the asking */

.ask {
    margin-block: 52px 0;
    border: 1px solid var(--rule);
    border-radius: 18px;
    background: rgba(26, 32, 43, 0.66);
    padding: 26px;
}

.ask h2 {
    font-family: var(--display);
    font-weight: 500;
    font-size: 1.72rem;
    margin: 0 0 0.3em;
}

.ask p {
    margin: 0 0 14px;
    max-width: 38rem;
    color: #cfc9bc;
}

.mail {
    font-family: var(--label);
    font-size: 1rem;
    letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------------- the cross
 *
 * Where the cord ends, as it does on a rosary.
 */

.ending {
    padding-block: 54px 10px;
    text-align: left;
}

.ending svg {
    display: block;
    margin-left: calc(var(--cord) - 13px);
}

.ending p {
    margin: 18px 0 0;
    max-width: 32rem;
    font-family: var(--display);
    font-size: 1.3rem;
    color: #d8d3c7;
}

/* --------------------------------------------------------------------- the footer */

footer {
    border-top: 1px solid var(--rule);
    margin-top: 40px;
    padding-block: 26px 38px;
    font-family: var(--label);
    font-size: 0.85rem;
    color: var(--ink-quiet);
}

footer .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    align-items: baseline;
    justify-content: space-between;
}

footer a {
    color: var(--ink-quiet);
    text-decoration: none;
}

footer a:hover {
    color: var(--gold-light);
    text-decoration: underline;
}

/* ------------------------------------------------------------- the written pages */

.document {
    padding-block: 10px 20px;
    max-width: 40rem;
}

.document h1 {
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(2.1rem, 6vw, 2.9rem);
    line-height: 1.1;
    margin: 0 0 0.2em;
}

.document .updated {
    font-family: var(--label);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin: 0 0 28px;
}

.document h2 {
    font-family: var(--label);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin: 36px 0 10px;
    padding-top: 18px;
    border-top: 1px solid var(--rule);
}

.document p {
    margin: 0 0 16px;
}

.document ul {
    margin: 0 0 16px;
    padding-left: 1.2em;
}

.document li {
    margin-bottom: 8px;
}

.back {
    display: inline-block;
    margin-bottom: 26px;
    font-family: var(--label);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink-quiet);
}

.back:hover {
    color: var(--gold-light);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
