/*
 * Shared foundation: reset, typography, buttons, tags, navigation, footer
 * and the olive-sprig ornaments. Used by every page.
 */

/* ---------- Reset ---------- */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: var(--text-body);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

img,
svg {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote {
    margin: 0;
}

ul[role="list"],
ol[role="list"] {
    list-style: none;
    padding: 0;
}

a {
    color: inherit;
}

button {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2.5px solid var(--brand);
    outline-offset: 3px;
    border-radius: 6px;
}

::selection {
    background: var(--brand-tint);
    color: var(--ink);
}

.visually-hidden {
    position: absolute !important;
    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: var(--space-4);
    top: -100px;
    z-index: 100;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-pill);
    background: var(--brand-fill);
    color: var(--on-brand-fill);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: var(--space-4);
}

/* ---------- Layout ---------- */

.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    padding-block: var(--section-y);
}

/* ---------- Typography ---------- */

.serif {
    font-family: var(--font-serif);
}

.eyebrow {
    font-family: var(--font-sans);
    font-size: var(--text-label);
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--brand);
}

.display {
    font-family: var(--font-serif);
    font-size: var(--text-display);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.h2 {
    font-family: var(--font-serif);
    font-size: var(--text-h2);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

.h3 {
    font-family: var(--font-serif);
    font-size: var(--text-h3);
    font-weight: 500;
    line-height: 1.2;
}

.subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem);
    line-height: 1.35;
    color: var(--ink-2);
}

.lead {
    font-size: var(--text-lead);
    line-height: 1.6;
    color: var(--ink-2);
    text-wrap: pretty;
}

.muted {
    color: var(--ink-2);
}

.scripture-ref {
    color: var(--scripture);
    font-weight: 600;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: var(--space-3) var(--space-6);
    border: 0;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 240ms var(--ease-out), box-shadow 240ms var(--ease-out), background-color 240ms;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn--primary {
    background: var(--brand-fill);
    color: var(--on-brand-fill);
    box-shadow: 0 8px 20px -10px rgb(75 93 51 / 0.7);
}

.btn--secondary {
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-card);
}

/* Official App Store badge */
.store-badge {
    display: inline-block;
    border-radius: 12px;
    transition: transform 280ms var(--ease-out), filter 280ms;
}

.store-badge img {
    height: 56px;
    width: auto;
}

.store-badge--lg img {
    height: 64px;
}

.store-badge:hover {
    transform: translateY(-2px) scale(1.02);
}

/* ---------- Tags ---------- */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: var(--text-label);
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.tag--subtle {
    background: var(--brand-tint);
    color: var(--brand);
}

.tag--scripture {
    background: var(--scripture-tint);
    color: var(--scripture);
}

.tag--filled {
    background: var(--brand-fill);
    color: var(--on-brand-fill);
}

.tag--outline {
    box-shadow: inset 0 0 0 1px var(--hairline);
    color: var(--ink-2);
}

/* ---------- Ornaments ---------- */

.sprig-divider {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: min(180px, 100%);
    margin-inline: auto;
    color: var(--ornament);
}

.sprig-divider::before,
.sprig-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: 0.55;
}

.sprig-divider svg {
    width: 34px;
    height: 18px;
    flex: none;
}

.sprig-divider--start {
    margin-inline: 0;
}

.leaf-list {
    display: grid;
    gap: var(--space-4);
    list-style: none;
    padding: 0;
}

.leaf-list li {
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: var(--space-3);
    align-items: start;
}

.leaf-list li::before {
    content: "";
    width: 16px;
    height: 6px;
    margin-top: 0.6em;
    border-radius: 50%;
    background: var(--leaf);
    transform: rotate(-45deg);
}

/* SVG colour helpers – illustrations take colours from tokens */
.f-page { fill: var(--illo-page); }
.f-leaf { fill: var(--leaf); }
.f-leaf-light { fill: var(--leaf-light); }
.f-fruit { fill: var(--olive-fruit); }
.f-ornament { fill: var(--ornament); }
.f-brand { fill: var(--brand); }
.f-brand-tint { fill: var(--brand-tint); }
.f-brand-fill { fill: var(--brand-fill); }
.f-scripture-tint { fill: var(--scripture-tint); }
.s-brand { stroke: var(--brand); }
.s-line { stroke: var(--illo-line); }
.s-ornament { stroke: var(--ornament); }
.s-fruit { stroke: var(--olive-fruit); }
.s-brand-fill { stroke: var(--brand-fill); }

.illo {
    overflow: visible;
}

.illo .stroke {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.illo .object {
    stroke-width: 2.5;
    stroke-linejoin: round;
}

/* ---------- Navigation ---------- */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background-color 300ms, box-shadow 300ms, backdrop-filter 300ms;
}

.site-nav.is-scrolled {
    background: var(--glass);
    -webkit-backdrop-filter: saturate(1.4) blur(18px);
    backdrop-filter: saturate(1.4) blur(18px);
    box-shadow: 0 1px 0 var(--hairline);
}

.site-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: 72px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--ink);
}

.brand-mark img {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    box-shadow: 0 2px 6px rgb(0 0 0 / 0.12);
}

.site-nav__links {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav__links a:not(.btn) {
    position: relative;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink-2);
    text-decoration: none;
    transition: color 200ms;
}

.site-nav__links a:not(.btn)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 1.5px;
    background: var(--ornament);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 320ms var(--ease-out);
}

.site-nav__links a:not(.btn):hover {
    color: var(--ink);
}

.site-nav__links a:not(.btn):hover::after {
    transform: scaleX(1);
}

.site-nav__cta {
    padding-block: 10px;
    min-height: 40px;
}

@media (max-width: 760px) {
    .site-nav__links li:not(:last-child) {
        display: none;
    }

    .brand-mark span {
        font-size: 1.0625rem;
    }
}

/* ---------- Footer ---------- */

.site-footer {
    padding-block: var(--space-16) var(--space-12);
    border-top: 1px solid var(--hairline);
    font-size: 0.9375rem;
    color: var(--ink-2);
}

.site-footer__grid {
    display: grid;
    gap: var(--space-8);
    grid-template-columns: 1fr;
}

@media (min-width: 760px) {
    .site-footer__grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.site-footer h2 {
    margin-bottom: var(--space-3);
    font-family: var(--font-sans);
    font-size: var(--text-label);
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--ink);
}

.site-footer ul {
    display: grid;
    gap: var(--space-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer a {
    text-decoration: none;
    transition: color 200ms;
}

.site-footer a:hover {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-footer__about p {
    max-width: 36ch;
    margin-top: var(--space-3);
}

.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: var(--space-12);
    padding-top: var(--space-6);
    border-top: 1px solid var(--hairline);
    font-size: var(--text-label);
}

.site-footer__bottom .sprig-divider {
    margin: 0;
    width: 120px;
}
