/* Mobile-first base styles */
/* Single dark theme — black background with green accents. */
:root {
    color-scheme: dark;
    --color-bg: #0a0d0a;
    --color-surface: #111811;
    --color-surface-2: #0e140e;
    --color-text: #e8f3e8;
    --color-primary: #22c55e;
    --color-primary-dark: #16a34a;
    --color-accent: #22c55e;
    --color-accent-dark: #16a34a;
    --color-muted: #8fa88f;
    --color-border: #1f2b1f;
    --color-danger: #f87171;
    --color-success: #22c55e;
    --shadow-featured: 0 4px 24px rgba(34, 197, 94, 0.22);
    --max-width: 1100px;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.5;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

/* Header / Nav */
.site-header {
    border-bottom: 1px solid var(--color-border);
}

.navbar {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    position: relative;
}

.brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-text);
    white-space: nowrap;
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 1rem;
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.nav-links.open {
    display: flex;
}

/* Main content */
.site-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    min-height: 60vh;
}

.messages {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.message {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    background: var(--color-surface-2);
    border: 1px solid var(--color-primary);
}

.message.error {
    border-color: var(--color-danger);
}

.message.success {
    border-color: var(--color-success);
}

/* Buttons / forms */
.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius);
    background: var(--color-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background: var(--color-primary-dark);
    text-decoration: none;
}

.form-field {
    margin-bottom: 1rem;
}

.form-field label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
}

/* Honeypot field must stay invisible to humans but present in the DOM for bots */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

/* Hero / sections */
.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.section {
    padding: 2rem 0;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--color-muted);
    font-size: 0.875rem;
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: #fff;
}

.lead {
    font-size: 1.15rem;
    color: var(--color-muted);
    max-width: 42rem;
}

.hero .lead {
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Feature + service card grids */
.feature-grid,
.service-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.feature-card,
.service-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    background: var(--color-surface);
}

.feature-card h3,
.service-card h3 {
    margin-top: 0;
}

.service-card {
    display: flex;
    flex-direction: column;
}

.service-card .bullet-list {
    flex: 1;
}

.service-card.featured {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-featured);
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.25rem 0 1rem;
}

.price span {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--color-muted);
}

.bullet-list {
    padding-left: 1.1rem;
    margin: 0 0 1.25rem;
}

.bullet-list li {
    margin-bottom: 0.4rem;
}

/* CTA band */
.cta-band {
    text-align: center;
    background: var(--color-surface-2);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
}

.cta-band h2 {
    margin-top: 0;
}

/* Contact form */
.contact-form {
    max-width: 34rem;
}

.field-error {
    color: var(--color-danger);
    font-size: 0.875rem;
    margin: 0.25rem 0 0;
}

.field-help {
    color: var(--color-muted);
    font-size: 0.8rem;
    margin: 0.25rem 0 0;
}

.muted {
    color: var(--color-muted);
    font-size: 0.875rem;
}

/* Centred card used by the 404 page */
.notice-section {
    display: flex;
    justify-content: center;
}

.notice-card {
    width: 100%;
    max-width: 26rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    background: var(--color-surface);
    text-align: center;
}

.notice-card h1 {
    margin-top: 0;
}

/* Badge (e.g. "Most popular" on a plan) */
.badge {
    display: inline-block;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.5rem;
}

/* Testimonials */
.testimonial-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.testimonial-card {
    margin: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    background: var(--color-surface-2);
}

.testimonial-card blockquote {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    line-height: 1.6;
}

.testimonial-card blockquote::before {
    content: "\201C";
    color: var(--color-accent);
    font-size: 1.5rem;
    font-weight: 700;
    margin-right: 0.1rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.testimonial-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    align-items: start;
}

.gallery-item {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.gallery-item figcaption {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--color-muted);
}

.center-link {
    text-align: center;
    margin-top: 1.25rem;
}

/* Video embeds (responsive 16:9) */
.video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.video-single {
    max-width: 46rem;
    margin: 0 auto;
}

.video-card {
    margin: 0;
}

.video-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-card figcaption {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

/* Hero eyebrow (small label above the headline) */
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-accent);
    margin: 0 0 0.5rem;
}

/* Tablet and up */
@media (min-width: 768px) {
    .nav-toggle {
        display: none;
    }

    .nav-links {
        position: static;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 1.25rem;
        padding: 0;
        border: none;
        background: none;
    }

    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .service-grid {
        grid-template-columns: repeat(3, 1fr);
        align-items: stretch;
    }

    .testimonial-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- Branding: logo + social icons ---------- */
.nav-left {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.brand-logo {
    display: block;
    /* Height comes from SiteSettings.logo_height as an inline custom property.
       The fallback matches the model default, so the logo still renders sanely
       if the attribute is ever missing. */
    height: var(--logo-height, 48px);
    width: auto;
    /* Caps the width on narrow phones so a tall logo can't push the menu button
       off screen; object-fit keeps the aspect ratio while it shrinks. */
    max-width: min(240px, 42vw);
    object-fit: contain;
}

.social-icons {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
}

/* The brand, four icons and the menu button cannot share a phone-width header,
   so the header set is hidden below the tablet breakpoint. The footer set stays
   visible at every width. */
.nav-left .social-icons {
    display: none;
}

/* Sized down on phones so four targets plus the brand never crowd the menu
   button; scaled up at the tablet breakpoint below. */
.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--color-muted);
    transition: color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.social-icons a:hover {
    color: var(--color-primary);
    background: var(--color-surface-2);
    transform: translateY(-2px);
    text-decoration: none;
}

.social-icon {
    width: 27px;
    height: 27px;
}

.social-icons--footer {
    justify-content: center;
    margin-bottom: 0.75rem;
}

.social-icons--footer .social-icon {
    width: 30px;
    height: 30px;
}

/* ---------- Motion ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--color-bg);
    transition: box-shadow 0.25s ease;
}

.site-header.is-scrolled {
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Lift cards and photos on hover so the page feels responsive to the cursor. */
.feature-card,
.service-card,
.testimonial-card,
.gallery-item {
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.feature-card:hover,
.service-card:hover,
.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
}

.gallery-item {
    overflow: hidden;
}

.gallery-item img {
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.btn {
    transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

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

/* Anyone who asks for less motion gets none of the above. */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal.is-visible {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .feature-card,
    .service-card,
    .testimonial-card,
    .gallery-item,
    .gallery-item img,
    .btn,
    .social-icons a {
        transition: none;
    }

    .feature-card:hover,
    .service-card:hover,
    .testimonial-card:hover,
    .gallery-item:hover img,
    .btn:hover,
    .social-icons a:hover {
        transform: none;
    }
}

/* Must come after the base .nav-left .social-icons rule above: same specificity,
   so source order decides. 1024px rather than the usual 768px because at 768 the
   nav links have just gone horizontal and the two sets collide. */
@media (min-width: 1024px) {
    .nav-left .social-icons {
        display: flex;
    }
}

/* ---------- Type scale & rhythm ----------
   clamp() scales these fluidly between phone and desktop, so they need no
   breakpoints of their own. */
body {
    line-height: 1.6;
}

h1, h2, h3 {
    line-height: 1.15;
    letter-spacing: -0.02em;
}

/* Interior page headings. The hero overrides this with a larger size below. */
h1 {
    font-size: clamp(1.9rem, 4vw, 2.75rem);
}

h2 {
    font-size: clamp(1.45rem, 2.8vw, 2.1rem);
    margin-bottom: 1.25rem;
}

h3 {
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
    letter-spacing: -0.01em;
}

.lead {
    font-size: clamp(1.05rem, 1.8vw, 1.3rem);
    line-height: 1.55;
}

.section {
    padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.eyebrow {
    letter-spacing: 0.14em;
    margin-bottom: 0.75rem;
}

/* ---------- Hero ----------
   Rendered outside .site-main so a photo can run edge to edge; it supplies its
   own horizontal padding and inner max-width. */
.hero {
    text-align: center;
    padding: clamp(3.5rem, 9vw, 7rem) 1rem;
}

.hero-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
}

.hero h1 {
    font-size: clamp(2.4rem, 6.5vw, 4.2rem);
    margin: 0 0 1rem;
}

.hero .lead {
    max-width: 40rem;
}

.hero-actions {
    margin-top: 2rem;
}

/* Photo hero: the image is darkened by a solid overlay so text stays readable
   whatever the photo looks like. Both are set from the admin. */
.hero--image {
    background-image:
        linear-gradient(rgba(0, 0, 0, var(--hero-overlay, 0.55)),
                        rgba(0, 0, 0, var(--hero-overlay, 0.55))),
        var(--hero-image);
    background-size: cover;
    background-position: center;
    min-height: min(72vh, 640px);
    display: flex;
    align-items: center;
    color: #fff;
}

.hero--image h1,
.hero--image .eyebrow,
.hero--image .lead {
    color: #fff;
}

.hero--image .lead {
    opacity: 0.92;
}

.hero--image .btn-outline {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.75);
}

.hero--image .btn-outline:hover {
    background: #fff;
    color: #111;
}

/* My Story page */
.story-intro,
.story-chapter {
    display: grid;
    gap: 1.5rem;
}

.story-intro-text > p:first-child,
.story-chapter-text > h2 {
    margin-top: 0;
}

.story-portrait,
.story-chapter-media {
    margin: 0;
}

.story-portrait img,
.story-chapter-media img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.story-portrait figcaption,
.story-chapter-media figcaption {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* Consecutive chapters would otherwise stack two lots of .section padding. */
.story-chapter + .story-chapter {
    padding-top: 0;
}

/* Appended after the existing 768px block, so the two-column layout needs its
   own media block or it would apply at every width. */
@media (min-width: 768px) {
    .story-intro.has-portrait {
        grid-template-columns: 1.4fr 1fr;
        align-items: center;
        gap: 2.5rem;
    }

    .story-chapter.has-image {
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: 2.5rem;
    }

    /* Even chapters put the photo on the left. Source order stays text-first so
       mobile and screen readers still get the heading before the image. */
    .story-chapter.has-image.is-flipped .story-chapter-text {
        order: 2;
    }

    .story-chapter.has-image.is-flipped .story-chapter-media {
        order: 1;
    }
}

/* Before/after progress photos inside a testimonial card */
.progress-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

/* A card with only one of the two photos shouldn't leave a gap. */
.progress-pair:has(.progress-shot:only-child) {
    grid-template-columns: 1fr;
}

.progress-shot {
    margin: 0;
}

.progress-shot img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.progress-shot figcaption {
    margin-top: 0.4rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
}

/* Tick above the contact confirmation message */
.notice-check {
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--color-primary);
    position: relative;
}

.notice-check::after {
    content: "";
    position: absolute;
    top: 13px;
    left: 18px;
    width: 11px;
    height: 20px;
    border: solid var(--color-bg);
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}
