/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
*:not(dialog) {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

/* Hide the page scrollbar (the page still scrolls) */
html {
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  font-family: var(--font-serif);
  /* 4. Increase line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
  background-color: var(--estate-ivory);
  color: var(--onyx);
}

/* 6. Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root, #__next {
  isolation: isolate;
}

ul {
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Hidden on screen but still read by screen readers, e.g. a heading
   that labels a section whose purpose is obvious by looking at it */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

:root {
    --heirloom-gold: #B08D57;
    --estate-ivory: #F8F5EC;
    --onyx: #14120F;
    --antique-bronze: #8A6A3B;   /* darker gold, readable as small text on ivory */
    --parchment: color-mix(in srgb, var(--estate-ivory) 88%, var(--heirloom-gold));

    /* sizes */
    --text-body: 1.125rem;
    --text-small: 0.875rem;
    --text-h1: 3.5rem;
    --text-h2: 2.5rem;
    --text-h3: 1.75rem;
    --text-hero: clamp(2.5rem, 5.5vw, 5rem);
    --text-tag: clamp(.75rem, 1vw, 2rem);
    --text-subtitle: 1.5rem;


    /* spacing */
    --gutter: clamp(1rem, 5vw, 4rem);
    --section-space: clamp(3rem, 8vw, 7rem);

    /* weights */
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-bold: 700;

    --font-serif: "EB Garamond", Garamond, Georgia, serif;
    --font-cinzel: "Cinzel", serif;
    --font-cormorant: "Cormorant Garamond", serif;
}

/* Heading defaults, overriding the browser's built-in sizes */
h1 { font-family: var(--font-cormorant); font-size: var(--text-h1); font-weight: var(--weight-medium); line-height: 1.5;}
h2 { font-family: var(--font-cormorant); font-size: var(--text-h2); font-weight: var(--weight-medium); line-height: 1.4;}
h3 { font-family: var(--font-cormorant); font-size: var(--text-h3); font-weight: var(--weight-bold); line-height: 1.3;}
p { font-family: var(--font-serif); font-size: var(--text-body); font-weight: var(--weight-regular);}

/* Phones and tablets: the header stays pinned to the top while scrolling.
   z-index keeps it above the page sections (and the menu card) that scroll under it */
header {
    position: sticky;
    top: 0;
    z-index: 3;
}

.main-header {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding-block: 1.25rem;
    padding-inline: var(--gutter);
    background-color: var(--onyx);
    color: var(--estate-ivory);
    border-bottom: 1px solid var(--heirloom-gold);
}

/* Logo grows with the screen: 180px on phones up to 230px on wide screens.
   height: auto keeps its shape, overriding the height attribute in the HTML */
.logo img {
    display: block;
    width: clamp(180px, 16vw, 230px);
    height: auto;
}

/* Phones: header links are hidden, the slide-out card is used instead */
.main-header ul{
    display: none;
    font-family: var(--font-cinzel);
    font-size: var(--text-body);
    letter-spacing: 0.15em;
}

.main-header ul a {
    position: relative;
    padding-block: 0.25em;
    transition: color 0.3s;
}

/* Thin gold underline that grows out from the middle on hover */
.main-header ul a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--heirloom-gold);
    transform: scaleX(0);
}

.main-header ul a:hover,
.main-header ul a[aria-current="page"] {
    color: var(--heirloom-gold);
}

.main-header ul a:hover::after,
.main-header ul a[aria-current="page"]::after {
    transform: scaleX(1);
}

.main-header a:focus-visible,
.primary-menu a:focus-visible {
    outline: 1px solid var(--heirloom-gold);
    outline-offset: 4px;
}

/* Slide-out card: parked off-screen to the right until opened */
.toggle-menu {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1;
    width: min(80vw, 320px);
    min-height: 100dvh;
    padding: 6rem 2rem 2rem;
    background-color: var(--onyx);
    color: var(--estate-ivory);
    border-left: 1px solid var(--heirloom-gold);
    transform: translateX(100%);
    visibility: hidden;   /* keeps the off-screen links out of the Tab order */
}

.toggle-menu.is-open {
    transform: translateX(0);
    visibility: visible;
}

.primary-menu {
    display: flex;
    flex-direction: column;
    font-family: var(--font-cinzel);
    font-size: var(--text-body);
    letter-spacing: 0.15em;
}

/* Faint gold dividers between the card links */
.primary-menu li + li {
    border-top: 1px solid color-mix(in srgb, var(--heirloom-gold) 30%, transparent);
}

.primary-menu a {
    display: block;
    padding-block: 1em;
    transition: color 0.3s;
}

.primary-menu a:hover,
.primary-menu a[aria-current="page"] {
    color: var(--heirloom-gold);
}

/* Sits above the card so it can be clicked again to close it */
.hamburger {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: .5em;
    background: none;
    border: none;
}

.hamburger:focus-visible {
    outline: 1px solid var(--heirloom-gold);
    outline-offset: 4px;
}

.bar {
    display: block;
    width: 28px;
    height: 2px;
    background: var(--estate-ivory);
}

/* Turn the three bars into an X when open (8px = 6px gap + 2px bar) */
.hamburger[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Gold X while the card is open */
.hamburger[aria-expanded="true"] .bar { background: var(--heirloom-gold); }

/* Sliding, rotating and growing only for visitors who haven't asked to reduce motion */
@media (prefers-reduced-motion: no-preference) {
    .main-header ul a::after { transition: transform 0.3s ease; }
    .toggle-menu { transition: transform 0.3s ease, visibility 0.3s; }
    .bar { transition: transform 0.3s, opacity 0.3s; }
}

/* Desktop: no hamburger or card, header links always visible in a row.
   1024px rather than 768px so the bigger logo and links fit on one line */
@media (min-width: 1024px) {
    /* Desktop: the header scrolls away with the page again */
    header {
        position: static;
    }

    .hamburger,
    .toggle-menu {
        display: none;
    }

    .main-header ul{
        display: flex;
        flex-direction: row;
        gap: 3em;
    }
}

.hero {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    /* Phones: even dark layer over the photo, since the text spans the full width */
    background-image:
        linear-gradient(color-mix(in srgb, var(--onyx) 78%, transparent), color-mix(in srgb, var(--onyx) 78%, transparent)),
        url(/public/city.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding-block: var(--section-space);
    padding-inline: var(--gutter);
    color: var(--estate-ivory);
}

/* Desktop: darkest behind the text on the left, letting the mountain show on the right */
@media (min-width: 768px) {
    .hero {
        background-image:
            linear-gradient(to right,
                color-mix(in srgb, var(--onyx) 92%, transparent) 0%,
                color-mix(in srgb, var(--onyx) 70%, transparent) 50%,
                color-mix(in srgb, var(--onyx) 25%, transparent) 100%),
            url(/public/city.png);
    }
}

/* Auto margins above the text and above the ribbon split the spare space,
   so the text sits centred in the area above the ribbon */
.hero-text {
    margin-top: auto;
}

/* Small gold label above the heading, led by a short gold line */
.hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.75em;
    margin-bottom: 1.25rem;
    color: var(--heirloom-gold);
    font-family: var(--font-cinzel);
    font-size: var(--text-small);
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.hero-eyebrow::before {
    content: "";
    width: 2.5rem;
    height: 1px;
    background-color: var(--heirloom-gold);
}

/* Scales with screen width so it fits on one line on laptops and desktops */
.hero-text h1 {
    font-size: var(--text-hero);
    font-weight: var(--weight-bold);
    line-height: 1.1;
}

.hero-text h1 em {
    color: var(--heirloom-gold);
    font-style: italic;
}

.hero-text h2 {
    font-size: var(--text-subtitle);
    font-weight: var(--weight-regular);
    margin-top: 0.75em;
    color: color-mix(in srgb, var(--estate-ivory) 85%, transparent);
}

/* Phones: buttons stacked, each stretching the full width inside the hero padding */
.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2.5rem;
}

/* Desktop: buttons side by side, only as wide as their text */
@media (min-width: 768px) {
    .hero-buttons {
        flex-direction: row;
    }
}

/* Links styled as buttons */
.btn {
    display: inline-block;
    padding: 0.9em 2.2em;
    text-align: center;
    border: 1px solid var(--onyx);
    font-family: var(--font-cinzel);
    font-size: var(--text-small);
    font-weight: var(--weight-medium);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.btn-primary {
    background-color: var(--onyx);
    color: var(--estate-ivory);
}

.btn-primary:hover {
    background-color: var(--heirloom-gold);
    border-color: var(--heirloom-gold);
    color: var(--onyx);
}

.btn-secondary {
    background-color: transparent;
    color: var(--onyx);
}

.btn-secondary:hover {
    background-color: var(--onyx);
    color: var(--estate-ivory);
}

.btn:focus-visible {
    outline: 2px solid var(--heirloom-gold);
    outline-offset: 3px;
}

/* Buttons on dark sections (hero and final call to action) flip to gold and ivory */
:is(.hero, .cta) .btn-primary {
    background-color: var(--heirloom-gold);
    border-color: var(--heirloom-gold);
    color: var(--onyx);
}

:is(.hero, .cta) .btn-primary:hover {
    background-color: var(--estate-ivory);
    border-color: var(--estate-ivory);
}

.hero .btn-secondary {
    border-color: var(--estate-ivory);
    color: var(--estate-ivory);
}

.hero .btn-secondary:hover {
    background-color: var(--estate-ivory);
    color: var(--onyx);
}

/* Hero content fades up into place on load, one piece after another */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Only plays for visitors who haven't asked their device to reduce motion */
@media (prefers-reduced-motion: no-preference) {
    .hero-eyebrow,
    .hero-text h1,
    .hero-text h2,
    .hero-buttons,
    .hero-tags {
        animation: fade-up 0.8s ease-out both;
    }

    .hero-text h2 { animation-delay: 0.15s; }
    .hero-buttons { animation-delay: 0.3s; }
    .hero-tags { animation-delay: 0.5s; }
}

/* Pinned to the bottom of the hero and stretched edge to edge past the gutter */
.hero-tags {
    margin-top: auto;
    margin-inline: calc(-1 * var(--gutter));
    padding-top: 3rem;
}

/* Onyx ribbon with a gold rule above and below */
.hero-tags .scroller {
    padding-block: 1.1em;
    padding-inline: var(--gutter);
    background-color: var(--onyx);
    border-block: 3px solid var(--heirloom-gold);
}

/* By default the tags sit still and wrap onto extra lines if they don't fit */
.hero-tags .inner-scroller {
    display: flex;
    flex-direction: row;
    justify-content: left;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5em 0;   /* space between rows only; the diamond's margins space the tags */
    color: var(--estate-ivory);
    font-family: var(--font-cinzel);
    font-size: var(--text-tag);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    max-width: 100%;
}

.hero-tags li {
    white-space: nowrap;
    /* Cancels the 0.2em letter-spacing left after each tag's last letter */
    margin-right: -0.2em;
}

/* Small gold diamond between tags, echoing the logo */
.hero-tags li::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-inline: 1.5em;
    vertical-align: middle;
    background-color: var(--heirloom-gold);
    transform: rotate(45deg);
}

/* Slide the track left by half its width. Half the track is an exact copy
   of the other half, so the jump back to the start can't be seen */
@keyframes scroll-left {
    to {
        transform: translateX(-50%);
    }
}

/* Scroller mode, only for visitors who haven't asked to reduce motion and
   once script.js has copied the tags (data-animated): one line, clipped at
   the edges, fading into black at both ends, sliding left forever */
@media (prefers-reduced-motion: no-preference) {
    .scroller[data-animated="true"] {
        position: relative;
        overflow: hidden;
        padding-inline: 0;
    }

    .scroller[data-animated="true"] .inner-scroller {
        width: max-content;   /* as wide as all the tags, not the screen */
        max-width: none;
        flex-wrap: nowrap;
        animation: scroll-left 40s linear infinite;
    }

    /* Hovering pauses it, so people can read a tag */
    .scroller[data-animated="true"]:hover .inner-scroller {
        animation-play-state: paused;
    }

    /* Layer over the words: solid onyx at both edges, clear in the middle */
    .scroller[data-animated="true"]::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(
            90deg,
            var(--onyx),
            transparent 10%,
            transparent 90%,
            var(--onyx)
        );
        pointer-events: none;
    }
}

/* Scroll reveal: script.js adds .reveal to each piece of a section, then
   .is-visible when it scrolls into view. It reuses the hero's fade-up */
@media (prefers-reduced-motion: no-preference) {
    .reveal:not(.is-visible) {
        opacity: 0;
    }

    .reveal.is-visible {
        animation: fade-up 0.8s ease-out backwards;
    }
}

/* ---------- Sections below the hero ---------- */

/* Shared spacing. The max() keeps the gutter on small screens, and on wide
   screens grows the side padding so content never gets wider than 1200px */
main > section:not(.hero) {
    padding-block: var(--section-space);
    padding-inline: max(var(--gutter), (100% - 1200px) / 2);
}

main > section h2 {
    margin-bottom: 0.5em;
    line-height: 1.15;
}

/* Small label above each section heading, led by a short line */
.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.75em;
    margin-bottom: 1rem;
    color: var(--antique-bronze);
    font-family: var(--font-cinzel);
    font-size: var(--text-small);
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 2.5rem;
    height: 1px;
    background-color: currentColor;
}

/* Space between paragraphs and lists that follow each other (the reset at
   the top removes all margins). Only element names, no classes, so any
   class rule that sets its own margin still wins over this */
main > section :is(p, ul) + :is(p, ul) {
    margin-top: 1em;
}

/* Bigger opening paragraph */
.lead {
    font-family: var(--font-cormorant);
    font-size: var(--text-subtitle);
    line-height: 1.45;
}

/* A question pulled out in large italic type, with a short gold rule above it */
.big-question {
    margin-block: 1.5rem;
    font-family: var(--font-cormorant);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-style: italic;
    line-height: 1.3;
}

.big-question::before {
    content: "";
    display: block;
    width: 3rem;
    height: 1px;
    margin-bottom: 1rem;
    background-color: var(--heirloom-gold);
}

/* Gold diamond bullets, matching the ribbon */
.diamond-list {
    display: grid;
    gap: 0.75rem;
    margin-block: 1.5rem;
    padding-left: 0;   /* the diamonds replace the browser's list indent */
}

.diamond-list li {
    display: flex;
    align-items: baseline;
    gap: 0.9em;
}

.diamond-list li::before {
    content: "";
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    background-color: var(--heirloom-gold);
    transform: translateY(-0.15em) rotate(45deg);
}

/* 1. Introduction: centred heading, then the book, then where leaders are sent */
.intro {
    display: grid;
    gap: clamp(3rem, 7vw, 5rem);
    background-color: var(--estate-ivory);
}

.intro-header,
.intro-positioned {
    max-width: 46rem;
    margin-inline: auto;
    text-align: center;
}

/* Wider, so the row of places fits on one line on desktop */
.intro-positioned {
    max-width: 60rem;
}

.intro-positioned > p {
    max-width: 46rem;
    margin-inline: auto;
}

.intro-header .eyebrow {
    justify-content: center;
}

/* Book cover and outcomes: stacked on phones, side by side on desktop */
.intro-book {
    display: grid;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 900px) {
    .intro-book {
        grid-template-columns: 2fr 3fr;
        column-gap: 5rem;
    }
}

/* Book cover photo with a soft shadow, shown whole at its own shape */
.book-cover {
    width: 100%;
    max-width: 20rem;
    height: auto;
    margin-inline: auto;
    box-shadow: 0 24px 60px color-mix(in srgb, var(--onyx) 25%, transparent);
}

/* Outcomes: roman numerals in gold, each row split by a faint gold rule */
.outcomes {
    margin-top: 1.5rem;
    padding-left: 0;
    list-style: none;
    counter-reset: outcome;
}

.outcomes li {
    display: grid;
    grid-template-columns: 3rem 1fr;
    align-items: baseline;
    padding-block: 1rem;
    border-top: 1px solid color-mix(in srgb, var(--heirloom-gold) 35%, transparent);
    font-family: var(--font-cormorant);
    font-size: var(--text-subtitle);
    line-height: 1.3;
}

.outcomes li:last-child {
    border-bottom: 1px solid color-mix(in srgb, var(--heirloom-gold) 35%, transparent);
}

.outcomes li::before {
    counter-increment: outcome;
    content: counter(outcome, upper-roman);
    color: var(--heirloom-gold);
    font-style: italic;
}

/* Places: hidden on phones and tablets. From 1000px, one row split by
   gold diamonds like the hero ribbon */
.places {
    display: none;
    justify-content: center;
    margin-top: 1.5rem;
    padding-left: 0;
    color: var(--antique-bronze);
    font-family: var(--font-cinzel);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.places li {
    display: flex;
    align-items: center;
    margin-right: -0.2em;   /* cancels the letter-spacing after the last letter */
}

@media (min-width: 1000px) {
    .places {
        display: flex;
    }

    .places li + li::before {
        content: "";
        width: 6px;
        height: 6px;
        margin-inline: 1.25em;
        background-color: var(--heirloom-gold);
        transform: rotate(45deg);
    }
}

.intro .btn {
    margin-top: 2.5rem;
}

/* 2. Journey: dark section with two outlined cards */
.journey {
    background-color: var(--onyx);
    color: var(--estate-ivory);
    counter-reset: step;
}

.journey .eyebrow {
    color: var(--heirloom-gold);
}

.journey-intro {
    max-width: 40rem;
    color: color-mix(in srgb, var(--estate-ivory) 80%, transparent);
}

/* Phones: one card per row. Desktop: two side by side */
.journey-steps {
    display: grid;
    gap: 1.5rem;
    margin-top: 3rem;
}

@media (min-width: 768px) {
    .journey-steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

.step {
    padding: 2.5rem 2rem;
    border: 1px solid color-mix(in srgb, var(--heirloom-gold) 40%, transparent);
    transition: border-color 0.3s;
}

.step:hover {
    border-color: var(--heirloom-gold);
}

/* The hover lift is motion, so it only happens without a reduce-motion setting */
@media (prefers-reduced-motion: no-preference) {
    .step {
        transition: transform 0.3s ease, border-color 0.3s;
    }

    .step:hover {
        transform: translateY(-4px);
    }
}

/* Roman numeral above each card title: I, II */
.step::before {
    counter-increment: step;
    content: counter(step, upper-roman);
    display: block;
    margin-bottom: 1rem;
    color: var(--heirloom-gold);
    font-family: var(--font-cormorant);
    font-size: 2.5rem;
    font-style: italic;
    line-height: 1;
}

.step h3 {
    margin-bottom: 0.5em;
    line-height: 1.2;
}

.step :is(p, li) {
    color: color-mix(in srgb, var(--estate-ivory) 80%, transparent);
}

/* Closing line under the cards, in gold italic */
.journey-summary {
    margin-top: 3rem;
    color: var(--heirloom-gold);
    font-family: var(--font-cormorant);
    font-size: var(--text-subtitle);
    font-style: italic;
    text-align: center;
}

/* 3. City impact: text beside a card of ways to serve, with the goal underneath */
.city-impact {
    display: grid;
    gap: 3rem;
    background-color: var(--parchment);
}

@media (min-width: 900px) {
    .city-impact {
        grid-template-columns: 3fr 2fr;
        column-gap: 4rem;
        align-items: center;
    }
}

/* Ivory card with a thin gold frame set inside it, like the form card */
.impact-ways {
    padding: clamp(1.5rem, 4vw, 2.5rem);
    background-color: var(--estate-ivory);
    border: 1px solid color-mix(in srgb, var(--heirloom-gold) 50%, transparent);
    outline: 1px solid color-mix(in srgb, var(--heirloom-gold) 30%, transparent);
    outline-offset: -10px;
}

.impact-ways .diamond-list {
    margin-bottom: 0;
}

/* Spans both columns, split off by a faint gold rule */
.impact-goal {
    grid-column: 1 / -1;
    padding-top: 2.5rem;
    border-top: 1px solid color-mix(in srgb, var(--heirloom-gold) 40%, transparent);
    font-family: var(--font-cormorant);
    font-size: var(--text-subtitle);
    line-height: 1.4;
    text-align: center;
}

/* 4. Your Church: text and photo, stacked on phones and side by side on desktop */
.your-church {
    display: grid;
    gap: 3rem;
    align-items: center;
    background-color: var(--estate-ivory);
}

@media (min-width: 900px) {
    .your-church {
        grid-template-columns: 1fr 1fr;
    }
}

.church-text .btn {
    margin-top: 2rem;
}

/* Photo with a thin gold frame set slightly inside it */
.church-image {
    width: 100%;
    height: auto;   /* lets aspect-ratio decide, instead of the height attribute in the HTML */
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center top;   /* crop from the bottom so the spire's tip stays in */
    outline: 1px solid color-mix(in srgb, var(--estate-ivory) 70%, transparent);
    outline-offset: -12px;
}

/* 5. Why it matters: dark, centred, with the question in gold */
.pathway {
    background-color: var(--onyx);
    color: var(--estate-ivory);
    text-align: center;
}

.pathway > * {
    max-width: 44rem;
    margin-inline: auto;
}

.pathway .eyebrow {
    justify-content: center;
    color: var(--heirloom-gold);
}

.pathway p:not(.eyebrow, .big-question) {
    color: color-mix(in srgb, var(--estate-ivory) 80%, transparent);
}

.pathway .big-question {
    color: var(--heirloom-gold);
}

.pathway .big-question::before {
    margin-inline: auto;
}

/* 6. Getting started: three numbered steps on a parchment band */
.get-started {
    background-color: var(--parchment);
    counter-reset: start-step;
}

.get-started .eyebrow {
    justify-content: center;
}

.get-started h2 {
    text-align: center;
}

/* Phones: steps stacked. Desktop: three side by side */
.start-steps {
    display: grid;
    gap: 2.5rem;
    margin-top: 3rem;
    padding-left: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .start-steps {
        grid-template-columns: repeat(3, 1fr);
        column-gap: 3rem;
    }
}

/* Each step: a gold rule on top, then a large gold number */
.start-steps li {
    padding-top: 1.5rem;
    border-top: 1px solid var(--heirloom-gold);
}

.start-steps li::before {
    counter-increment: start-step;
    content: counter(start-step, decimal-leading-zero);
    display: block;
    margin-bottom: 0.75rem;
    color: var(--antique-bronze);
    font-family: var(--font-cormorant);
    font-size: 2.5rem;
    font-style: italic;
    line-height: 1;
}

.start-steps h3 {
    margin-bottom: 0.4em;
    line-height: 1.2;
}

.form-hint {
    margin-top: 1rem;
    font-size: var(--text-small);
    color: color-mix(in srgb, var(--onyx) 70%, transparent);
}

/* 7. Final call to action: dark, centred, with the gold button from the hero */
.cta {
    background-color: var(--onyx);
    color: var(--estate-ivory);
    text-align: center;
    border-top: 1px solid var(--heirloom-gold);
}

.cta p {
    margin-bottom: 2rem;
    color: color-mix(in srgb, var(--estate-ivory) 80%, transparent);
}
/* ---------- Inner pages (About, Contact, Sign up, Log in) ---------- */

/* Page header: a shorter dark banner, like a small version of the hero */
.page-header {
    background-color: var(--onyx);
    color: var(--estate-ivory);
}

.page-header .eyebrow {
    color: var(--heirloom-gold);
}

.page-header h1 {
    font-size: var(--text-hero);
    font-weight: var(--weight-bold);
    line-height: 1.1;
    margin-bottom: 0.4em;
}

.page-header p:not(.eyebrow) {
    max-width: 36rem;
    color: color-mix(in srgb, var(--estate-ivory) 85%, transparent);
}

/* Photo banners (Contact, Sign up, Log in): photo behind a dark gradient,
   darkest behind the text. The extra bottom padding leaves room for the
   form card to overlap it. Each page picks its photo with --header-photo */
main > section:is(.contact-header, .auth-header) {   /* "section" makes it beat the shared section padding rule */
    padding-bottom: calc(var(--section-space) + 8rem);
    background-image:
        linear-gradient(to right,
            color-mix(in srgb, var(--onyx) 92%, transparent) 0%,
            color-mix(in srgb, var(--onyx) 75%, transparent) 55%,
            color-mix(in srgb, var(--onyx) 45%, transparent) 100%),
        var(--header-photo);
    background-size: cover;
    background-position: center 60%;
}

.contact-header { --header-photo: url(/public/erico-marcelino-91QHQ3GGh9I-unsplash-1600.jpg); }
.auth-header { --header-photo: url(/public/city.png); }

/* Contact: form and details stacked on phones, side by side on desktop */
.contact {
    display: grid;
    gap: 3rem;
    align-items: start;
}

@media (min-width: 900px) {
    .contact {
        grid-template-columns: 3fr 2fr;
        column-gap: 4rem;
    }
}

/* Form card pulled up over the banner, so the two sections overlap
   instead of meeting at a hard line. Shared by Contact, Sign up and Log in */
.form-card {
    display: grid;
    gap: 1.5rem;
    margin-top: calc(-1 * (var(--section-space) + 6rem));
    padding: clamp(1.5rem, 4vw, 3rem);
    background-color: var(--estate-ivory);
    border: 1px solid color-mix(in srgb, var(--heirloom-gold) 50%, transparent);
    box-shadow: 0 24px 60px color-mix(in srgb, var(--onyx) 18%, transparent);
    /* Thin gold frame set inside the card, like the Your Church photo */
    outline: 1px solid color-mix(in srgb, var(--heirloom-gold) 30%, transparent);
    outline-offset: -10px;
}

.form-field {
    display: grid;
    gap: 0.5rem;
}

.form-field label {
    font-family: var(--font-cinzel);
    font-size: var(--text-small);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.optional {
    font-family: var(--font-serif);
    letter-spacing: 0;
    text-transform: none;
    color: color-mix(in srgb, var(--onyx) 60%, transparent);
}

.form-field :is(input, textarea, select) {
    width: 100%;
    padding: 0.8em 1em;
    background-color: var(--estate-ivory);
    border: 1px solid color-mix(in srgb, var(--onyx) 35%, transparent);
    transition: border-color 0.3s;
}

.form-field textarea {
    resize: vertical;   /* can be made taller, but not wider than the card */
}

.form-field :is(input, textarea, select):hover {
    border-color: var(--onyx);
}

.form-field :is(input, textarea, select):focus-visible {
    outline: 2px solid var(--antique-bronze);
    outline-offset: 2px;
}

.form-card .btn {
    justify-self: start;
}

/* Hints sit under their box; the field's gap already spaces them */
.form-field .form-hint {
    margin-top: 0;
}

/* Links inside the card: gold underline, darker on hover */
.form-card a {
    border-bottom: 1px solid var(--heirloom-gold);
    transition: color 0.3s;
}

.form-card a:hover {
    color: var(--antique-bronze);
}

/* Details: small labels split by faint gold rules */
.contact-details h3 {
    color: var(--antique-bronze);
    font-family: var(--font-cinzel);
    font-size: var(--text-small);
    font-weight: var(--weight-regular);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.contact-details h3:not(:first-child) {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid color-mix(in srgb, var(--heirloom-gold) 30%, transparent);
}

.contact-details a {
    border-bottom: 1px solid var(--heirloom-gold);
    transition: color 0.3s;
}

.contact-details a:hover {
    color: var(--antique-bronze);
}

/* How far the video hangs below the dark banner into the next section */
main {
    --video-overlap: clamp(4rem, 14vw, 12rem);
}

/* About banner: heading on top, video below filling the full content width */
.about-header {
    display: grid;
    gap: clamp(2rem, 5vw, 3.5rem);
}

/* Video with a thin gold border and a deep shadow.
   The negative bottom margin lets it hang out of the banner by --video-overlap
   (it cancels the banner's bottom padding, then goes further) */
.about-video {
    position: relative;   /* with z-index, keeps it drawn above the next section */
    z-index: 1;
    display: block;   /* an iframe is inline by default, which leaves a gap under it */
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin-bottom: calc(-1 * (var(--section-space) + var(--video-overlap)));
    background-color: var(--onyx);
    border: 1px solid color-mix(in srgb, var(--heirloom-gold) 50%, transparent);
    box-shadow: 0 24px 60px color-mix(in srgb, var(--onyx) 35%, transparent);
}

/* Whichever section comes right after the banner makes room for the part
   of the video hanging into it */
main > section.about-header + section {
    padding-top: calc(var(--section-space) + var(--video-overlap));
}

/* Story: keep lines to a comfortable reading width */
.about-story > * {
    max-width: 44rem;
}

/* Mission and vision: two framed cards on a parchment band, the mission on
   the left and the vision on the right. Inside each, a small gold italic
   "Our" over the title, a hairline gold rule, then the statement */
.mission {
    display: grid;
    gap: 2rem;
    background-color: var(--parchment);
}

/* Ivory card with a thin gold frame set inside it, like the contact form */
.mission article {
    width: 100%;
    max-width: 44rem;
    padding: clamp(2rem, 4vw, 3rem);
    background-color: var(--estate-ivory);
    border: 1px solid color-mix(in srgb, var(--heirloom-gold) 50%, transparent);
    outline: 1px solid color-mix(in srgb, var(--heirloom-gold) 30%, transparent);
    outline-offset: -10px;
    box-shadow: 0 18px 40px color-mix(in srgb, var(--onyx) 8%, transparent);
}

/* Second card: pushed to the right, with its text right-aligned.
   Phones skip this, since both cards are full width there */
@media (min-width: 768px) {
    .mission {
        --card-overlap: clamp(3rem, 6vw, 5rem);   /* how far the vision card rides up */
    }

    /* Extra empty space at the bottom of the mission card for the vision
       card to sit on, so it never covers the mission text */
    .mission article:nth-of-type(1) {
        padding-bottom: calc(clamp(2rem, 4vw, 3rem) + var(--card-overlap));
    }

    .mission article:nth-of-type(2) {
        justify-self: end;
        text-align: right;
        /* Pull it up past the 2rem gap and into that space.
           position + z-index keep it drawn on top */
        position: relative;
        z-index: 1;
        margin-top: calc(-2rem - var(--card-overlap));
    }
}

.mission h3 {
    padding-bottom: 1rem;
    border-bottom: 1px solid color-mix(in srgb, var(--heirloom-gold) 70%, transparent);
    font-size: var(--text-h2);
    font-weight: var(--weight-medium);
    line-height: 1.1;
}

/* "Our" on its own line: smaller, italic and gold */
.mission h3 span {
    display: block;
    margin-bottom: 0.1em;
    color: var(--antique-bronze);
    font-size: 0.6em;
    font-style: italic;
    font-weight: var(--weight-regular);
}

.mission p {
    padding-top: 1.5rem;
    font-family: var(--font-cormorant);
    font-size: var(--text-subtitle);
    line-height: 1.5;
}

/* Values: a plain list laid out as a grid */
.values-list {
    display: grid;
    gap: 2.5rem;
    margin-top: 2.5rem;
    padding-left: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .values-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

.values-list h3 {
    margin-bottom: 0.5em;
    line-height: 1.2;
}

/* Values: outlined blocks with a Roman numeral on top, like the
   12-week journey cards on the home page */
.values {
    counter-reset: value;
}

.values-list li {
    padding: 2.5rem 2rem;
    border: 1px solid color-mix(in srgb, var(--heirloom-gold) 45%, transparent);
    transition: border-color 0.3s;
}

.values-list li:hover {
    border-color: var(--heirloom-gold);
}

/* The hover lift is motion, so it only happens without a reduce-motion setting */
@media (prefers-reduced-motion: no-preference) {
    .values-list li {
        transition: transform 0.3s ease, border-color 0.3s;
    }

    .values-list li:hover {
        transform: translateY(-4px);
    }
}

.values-list li::before {
    counter-increment: value;
    content: counter(value, upper-roman);
    display: block;
    margin-bottom: 1rem;
    color: var(--antique-bronze);   /* darker gold, readable on ivory */
    font-family: var(--font-cormorant);
    font-size: 2.5rem;
    font-style: italic;
    line-height: 1;
}

/* Meet Melton: picture beside a short introduction, stacked on phones */
.meet-founder {
    display: grid;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 768px) {
    .meet-founder {
        grid-template-columns: 2fr 3fr;
        column-gap: 4rem;
    }
}

.founder-image {
    width: 100%;
    max-width: 30rem;
    height: auto;
    margin-inline: auto;
    box-shadow: 0 24px 60px color-mix(in srgb, var(--onyx) 25%, transparent);
}

/* His title under his name, in gold italic */
.founder-title {
    color: var(--antique-bronze);
    font-family: var(--font-cormorant);
    font-size: 1.25rem;
    font-style: italic;
}

/* Credentials at a glance: two per row, each a big gold word over its meaning */
.credential-highlights {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 2rem;
    margin-top: 2rem;
    padding: 1.5rem 0 0;
    border-top: 1px solid color-mix(in srgb, var(--heirloom-gold) 40%, transparent);
    list-style: none;
    font-size: var(--text-small);
    line-height: 1.4;
}

.credential-highlights strong {
    display: block;
    color: var(--antique-bronze);
    font-family: var(--font-cormorant);
    font-size: 1.75rem;
    font-weight: var(--weight-medium);
    line-height: 1.1;
}

.founder-text .btn {
    margin-top: 2rem;
}

/* ---------- Melton's page ---------- */

/* Banner: text beside his photo on desktop, photo below on phones */
.melton-header {
    display: grid;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 900px) {
    .melton-header {
        grid-template-columns: 1fr 1fr;
        column-gap: 4rem;
    }
}

/* Photo with a thin gold border, like the about page video */
.melton-photo {
    width: 100%;
    max-width: 30rem;
    height: auto;
    justify-self: center;
    border: 1px solid color-mix(in srgb, var(--heirloom-gold) 50%, transparent);
    box-shadow: 0 24px 60px color-mix(in srgb, #000 40%, transparent);
}

/* Story and background: a comfortable reading width */
:is(.melton-story, .melton-background) > * {
    max-width: 44rem;
}

.melton-story h3 {
    margin-top: 2.5rem;
    margin-bottom: 0.5em;
}

/* "Business is the means. Your city is the assignment." set apart with a gold rule */
.pull-quote {
    margin-top: 2.5rem !important;   /* beats the shared paragraph spacing rule */
    padding-left: 1.5rem;
    border-left: 2px solid var(--heirloom-gold);
    font-family: var(--font-cormorant);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-style: italic;
    line-height: 1.25;
}

.melton-background {
    background-color: var(--parchment);
}

/* Education and experience: stacked on phones, side by side on desktop */
.credentials-grid {
    display: grid;
    gap: 2.5rem;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .credentials-grid {
        grid-template-columns: 1fr 1.5fr;
        column-gap: 4rem;
    }
}

.credentials-grid h3 {
    padding-top: 1.5rem;
    border-top: 1px solid var(--heirloom-gold);
}

.melton-book {
    background-color: var(--parchment);
}

/* Newsletter: a small centred invitation card on a parchment band.
   "section" makes the padding beat the shared section padding rule */
main > section.newsletter {
    padding-block: clamp(3rem, 6vw, 5rem);
    background-color: var(--parchment);
}

/* Ivory card with a thin gold frame set inside it, like the mission cards */
.newsletter-card {
    max-width: 38rem;
    margin-inline: auto;
    padding: clamp(2rem, 5vw, 3.5rem);
    background-color: var(--estate-ivory);
    border: 1px solid color-mix(in srgb, var(--heirloom-gold) 50%, transparent);
    outline: 1px solid color-mix(in srgb, var(--heirloom-gold) 30%, transparent);
    outline-offset: -10px;
    text-align: center;
}

.newsletter .eyebrow {
    justify-content: center;
}

.newsletter .btn {
    margin-top: 2rem;
}

/* Sign up and Log in: one narrow card in the middle of the page */
.auth .form-card {
    max-width: 34rem;
    margin-inline: auto;
}

.auth .btn {
    justify-self: stretch;   /* full-width button */
}

/* Dropdown: the browser's own arrow is removed (it ignores our styles),
   and a thin gold chevron is drawn as a background image instead */
.form-field select {
    appearance: none;
    padding-right: 2.5em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238A6A3B' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1em center;
    background-size: 0.75em;
    cursor: pointer;
}

/* Label on the left, "Forgot password?" on the right */
.field-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.field-row a {
    font-size: var(--text-small);
}

/* Password box with the Show/Hide button sitting inside its right edge */
.password-input {
    position: relative;
}

.password-input input {
    padding-right: 5.5em;   /* so typing never runs under the button */
}

.password-toggle {
    position: absolute;
    inset-block: 0;
    right: 0;
    padding-inline: 1em;
    background: none;
    border: none;
    color: var(--antique-bronze);
    font-family: var(--font-cinzel);
    font-size: var(--text-small);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
}

.password-toggle:hover {
    color: var(--onyx);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--antique-bronze);
    outline-offset: -4px;
}

/* "Already have an account?" line under the button, split off by a faint gold rule */
.form-switch {
    padding-top: 1.5rem;
    border-top: 1px solid color-mix(in srgb, var(--heirloom-gold) 30%, transparent);
    text-align: center;
}

/* Sign up: fields grouped under small gold headings (fieldset + legend) */
.form-group {
    display: grid;
    gap: 1.5rem;
    min-width: 0;   /* fieldsets refuse to shrink below their content without this */
    margin: 0;
    padding: 0;
    border: none;
}

.form-group + .form-group {
    padding-top: 2rem;
    border-top: 1px solid color-mix(in srgb, var(--heirloom-gold) 30%, transparent);
}

.form-group > legend {
    float: left;   /* lets the legend sit inside the grid like a normal item */
    width: 100%;
    padding: 0;
    color: var(--antique-bronze);
    font-family: var(--font-cinzel);
    font-size: var(--text-small);
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.form-group > .form-hint {
    margin-top: -0.75rem;   /* tuck the hint up under its legend */
}

/* City and state: side by side once there's room */
.form-row {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 500px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* "Me" / "Someone else" radio buttons in a row */
.choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
}

.choice {
    display: flex;
    align-items: center;
    gap: 0.6em;
    cursor: pointer;
}

.choice input {
    width: 1.1em;
    height: 1.1em;
    accent-color: var(--onyx);   /* colours the browser's own radio button */
}

/* Fields that only appear after a choice (the contact person, the phone
   number): hidden while switched off (disabled) */
.conditional-fields {
    display: grid;
    gap: 1.5rem;
    min-width: 0;
    margin: 0;
    padding: 0 0 0 1.25rem;
    border: none;
    border-left: 1px solid var(--heirloom-gold);
}

.conditional-fields:disabled {
    display: none;
}

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

/* Keeps the footer at the bottom of the window on short pages: the page
   becomes a column, and main grows to fill whatever space is left over */
body {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

main {
    flex: 1;
}

/* Dark band with a faint gold line on top, so it's only just set apart */
.site-footer {
    padding: 1.5rem var(--gutter);
    background-color: var(--onyx);
    border-top: 1px solid color-mix(in srgb, var(--heirloom-gold) 20%, transparent);
    text-align: center;
}

/* Small grey print */
.site-credit {
    color: color-mix(in srgb, var(--estate-ivory) 50%, transparent);
    font-size: var(--text-small);
    letter-spacing: 0.05em;
}

/* Thank-you page after registering: the banner is the whole page, so it
   doesn't need the extra bottom space other banners leave for a form card */
main > section.registered {
    padding-bottom: var(--section-space);
}

.registered .btn {
    margin-top: 2rem;
}
