/**
 * Clur Ministries Design System
 * Bold, Editorial, High-Impact Aesthetic
 * Based on 2819church.org design language
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;800;900&family=Space+Grotesk:wght@400;700&display=swap');

/* ========================================
   COLOR PALETTE
   ======================================== */

:root {
    /* Light Mode — based on 2819church.org */
    --color-bg: #FFFFFF;
    --color-bg-secondary: #F5F5F5;
    --color-text-primary: #000000;
    --color-text-secondary: #333333;
    --color-text-tertiary: #666666;
    --color-accent: rgb(82, 75, 70);        /* Warm charcoal grey */
    --color-accent-alt: rgb(110, 100, 92);
    --color-border: #000000;
    --color-divider: #CCCCCC;

    /* Dark Mode */
    --color-bg-dark: #000000;
    --color-bg-secondary-dark: #111111;
    --color-text-primary-dark: #FFFFFF;
    --color-text-secondary-dark: #E0E0E0;
    --color-text-tertiary-dark: #999999;
    --color-accent-dark: rgb(180, 170, 160);
    --color-border-dark: #FFFFFF;
    --color-divider-dark: #333333;

    /* Typography Scale — Inter + Space Grotesk like 2819church.org */
    --font-family-display: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-family-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-nav: 'Space Grotesk', 'Inter', sans-serif;

    --font-size-display-xl: clamp(3rem, 10vw, 8rem);
    --font-size-display-lg: 3.5rem;
    --font-size-display-md: 2.5rem;
    --font-size-display-sm: 1.75rem;
    --font-size-lg: 1.25rem;
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-xs: 0.75rem;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;
    --space-4xl: 8rem;

    /* Line Heights */
    --lh-tight: 0.9;
    --lh-snug: 1;
    --lh-normal: 1.5;
    --lh-relaxed: 1.75;

    /* Letter Spacing */
    --ls-tight: -0.02em;
    --ls-normal: 0;
    --ls-wide: 0.05em;
    --ls-wider: 0.1em;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 100;
    --z-fixed: 50;
    --z-modal: 1500;
}

/* Dark Mode Override */
html[data-theme="dark"],
html.dark {
    --color-bg: var(--color-bg-dark);
    --color-bg-secondary: var(--color-bg-secondary-dark);
    --color-text-primary: var(--color-text-primary-dark);
    --color-text-secondary: var(--color-text-secondary-dark);
    --color-text-tertiary: var(--color-text-tertiary-dark);
    --color-accent: var(--color-accent-dark);
    --color-border: var(--color-border-dark);
    --color-divider: var(--color-divider-dark);
}

/* ========================================
   BASE STYLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-body);
    background-color: var(--color-bg);
    background-image: url('/assets/images/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--color-text-primary);
    line-height: var(--lh-normal);
    transition: background-color var(--transition-base), color var(--transition-base);
}

html[data-theme="dark"] body {
    background-image: url('/assets/images/background-dark.jpg');
    background-color: #000;
}


/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-display);
    font-weight: 900;
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
    color: var(--color-text-primary);
}

h1 {
    font-size: var(--font-size-display-lg);
}

h2 {
    font-size: var(--font-size-display-md);
}

h3 {
    font-size: var(--font-size-display-sm);
}

h4, h5, h6 {
    font-size: var(--font-size-lg);
}

p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

p + p {
    margin-top: var(--space-md);
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

a:hover {
    opacity: 0.8;
}

/* ========================================
   DISPLAY TEXT (Hero)
   ======================================== */

.display-text {
    font-family: var(--font-family-display);
    font-size: var(--font-size-display-xl);
    font-weight: 900;
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
    color: var(--color-text-primary);
}

.display-text strong,
.hero-text strong {
    color: var(--color-accent);
}

/* ========================================
   CONTAINERS & SECTIONS
   ======================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section {
    padding: var(--space-4xl) 0;
    position: relative;
}

.section-inner {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ========================================
   BUTTONS & CTAs
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-family-display);
    font-size: var(--font-size-base);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
    background: transparent;
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn::before {
    content: '( ';
}

.btn::after {
    content: ' )';
}

.btn:hover {
    background-color: var(--color-accent);
    color: var(--color-bg);
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-bg);
    border-color: var(--color-accent);
}

.btn-primary:hover {
    background-color: var(--color-accent-alt);
    border-color: var(--color-accent-alt);
}

.btn-large {
    font-size: var(--font-size-base);
    padding: var(--space-md) var(--space-xl);
}

/* ========================================
   NAVIGATION
   ======================================== */

.navbar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background-color: rgba(245, 245, 245, 0.35);
    border-bottom: 1px solid var(--color-divider);
    transition: all var(--transition-base);
}

html[data-theme="dark"] .navbar {
    background-color: rgba(17, 17, 17, 0.35);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-sm) var(--space-lg);
    gap: var(--space-lg);
}

.navbar-brand {
    font-family: var(--font-family-display);
    font-size: var(--font-size-lg);
    font-weight: 700;
    letter-spacing: var(--ls-tight);
    color: var(--color-text-primary);
    white-space: nowrap;
    text-decoration: none;
}

.navbar-brand strong {
    color: var(--color-accent);
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: var(--space-lg);
    align-items: center;
}

.navbar-menu a {
    font-family: var(--font-family-nav, var(--font-family-display));
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--ls-tight);
    color: var(--color-text-primary);
    text-decoration: none;
    padding: var(--space-sm);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.navbar-menu a:hover {
    border-bottom-color: var(--color-accent);
    color: var(--color-accent);
}

.navbar-menu a.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.navbar-actions {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    width: 40px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 5px;
    transition: all var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.menu-toggle span {
    display: block;
    height: 2px;
    min-height: 2px;
    background-color: var(--color-text-primary);
    border-radius: 2px;
    transition: all var(--transition-base);
}

.menu-toggle span:nth-child(1) { width: 22px; }
.menu-toggle span:nth-child(2) { width: 16px; }
.menu-toggle span:nth-child(3) { width: 22px; }

.menu-toggle:hover span {
    background-color: var(--color-accent);
}

.menu-toggle:hover span:nth-child(2) {
    width: 22px;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    width: 22px;
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    width: 22px;
}

/* ========================================
   THEME TOGGLE
   ======================================== */

.theme-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--color-divider);
    border-radius: 50%;
    cursor: pointer;
    color: var(--color-text-primary);
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   HERO SECTION — 2819-STYLE
   Technique: mix-blend-mode exclusion
   White text + white bg = renders black
   White text + dark image = renders white
   ======================================== */

.hero {
    position: relative;
    height: 100vh;
    background-color: transparent;
    overflow: hidden;
}

html[data-theme="dark"] .hero {
    background-color: transparent;
}

.hero-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* --- HERO TEXT (the big stacked words) --- */

.hero-text {
    position: absolute;
    z-index: 3;
    font-size: clamp(5rem, 14vw, 13.75rem);
    font-family: var(--font-family-display);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    white-space: pre;
    color: #fff;
    mix-blend-mode: exclusion;
}

html[data-theme="dark"] .hero-text {
    color: #fff;
    mix-blend-mode: normal;
}

/* REVIVAL — top-left area */
.hero-line-1 {
    top: 12%;
    left: 3%;
}

/* STARTS — middle, offset right */
.hero-line-2 {
    top: 36%;
    left: 20%;
}

/* HERE — lower, right-aligned */
.hero-line-3 {
    top: 58%;
    right: 3%;
    left: auto;
}

/* Accent color word — "all" on 2819, "REVIVAL" for us */
.hero-text-accent {
    color: var(--color-accent);
    mix-blend-mode: normal;
}

html[data-theme="dark"] .hero-text-accent {
    color: var(--color-accent);
}

/* --- PAGE TAGLINE (fixed watermark behind content) --- */
.page-tagline {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    font-family: var(--font-family-display);
    font-size: clamp(2rem, 6vw, 5.5rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: var(--ls-tight);
    text-transform: uppercase;
    text-align: center;
    pointer-events: none;
    user-select: none;
    display: flex;
    flex-direction: column;
    gap: 0.1em;
    color: rgba(0, 0, 0, 0.14);
    white-space: nowrap;
}

.page-tagline .tagline-accent {
    color: rgba(82, 75, 70, 0.45);
}

html[data-theme="dark"] .page-tagline {
    color: rgba(255, 255, 255, 0.16);
}

html[data-theme="dark"] .page-tagline .tagline-accent {
    color: rgba(180, 170, 160, 0.55);
}

@media (max-width: 768px) {
    .page-tagline {
        display: none;
    }
}

/* --- SCATTERED IMAGES --- */

.scattered-img {
    position: absolute;
    object-fit: cover;
    object-position: center top;
    filter: grayscale(100%);
    z-index: 1;
    pointer-events: none;
    border-radius: 12px;
}

html[data-theme="dark"] .scattered-img {
    opacity: 0.5;
}

.split-media img {
    border-radius: 12px;
}

/* Hero images */
.hero-img-1 { top: 3%; left: 26%; width: 42%; height: 57%; }
.hero-img-2 { top: 55%; left: 2%; width: 13%; height: 20%; }
.hero-img-3 { top: 15%; right: 3%; width: 16%; height: 25%; left: auto; }

/* Section images — positioned within their parent section */
.section { overflow: hidden; }

.section-img-1 { top: 8%; right: 5%; width: 22%; height: 55%; left: auto; }
.section-img-2 { bottom: 8%; left: 3%; width: 16%; height: 45%; top: auto; }
.section-img-3 { top: 10%; left: 8%; width: 18%; height: 60%; }
.section-img-4 { top: 8%; right: 8%; width: 20%; height: 55%; left: auto; }
.section-img-5 { top: 5%; left: 50%; width: 14%; height: 50%; transform: translateX(-50%); }
.section-img-6 { bottom: 8%; right: 3%; width: 28%; height: 70%; top: auto; left: auto; }
.section-img-7 { top: 15%; left: 2%; width: 15%; height: 45%; }

/* --- SUB-PAGE HERO (About, Sermons, Podcast, Events, Give) --- */
.hero-sub {
    height: auto;
    min-height: 45vh;
    padding: var(--space-2xl) 0 var(--space-xl);
    position: relative;
    overflow: hidden;
}

.hero-sub .hero-container {
    max-width: var(--container-xl, 1400px);
    margin: 0 auto;
    padding: 0 var(--space-2xl);
    height: auto;
    min-height: 38vh;
    position: relative;
}

.hero-sub .hero-text {
    position: relative;
    font-size: clamp(3.5rem, 10vw, 9rem);
    display: block;
    top: auto; left: auto; right: auto; bottom: auto;
    color: var(--color-text-primary);
    mix-blend-mode: normal;
    line-height: 0.95;
    max-width: 60%;
}

html[data-theme="dark"] .hero-sub .hero-text {
    color: #fff;
    mix-blend-mode: normal;
}

.hero-sub .hero-text-accent,
html[data-theme="dark"] .hero-sub .hero-text-accent {
    color: var(--color-accent);
}

.hero-sub-intro {
    position: relative;
    z-index: 3;
    max-width: 540px;
    margin-top: var(--space-xl);
    font-size: var(--font-size-lg);
    line-height: var(--lh-relaxed);
}

.hero-sub .section-label {
    position: relative;
    z-index: 3;
    margin-bottom: var(--space-md);
}

/* Sub-hero scattered images — right side, out of title's way */
.sub-hero-img-1 { top: 5%; right: 3%; width: 20%; height: 65%; left: auto; }
.sub-hero-img-2 { bottom: 5%; right: 26%; width: 13%; height: 40%; top: auto; left: auto; }
.sub-hero-img-3 { top: 10%; left: 50%; width: 14%; height: 50%; }

@media (max-width: 768px) {
    .hero-sub-intro { max-width: 100%; }
    .sub-hero-img-1, .sub-hero-img-2, .sub-hero-img-3 { display: none; }
}

/* --- BOTTOM BAR: CTAs left, Video right --- */

.hero-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 4;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 var(--space-2xl) var(--space-lg);
    gap: var(--space-xl);
}

/* Video block — right side */
.hero-video {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    flex-shrink: 0;
}

.hero-video h3 {
    font-family: var(--font-family-display);
    font-size: var(--font-size-sm);
    font-weight: 800;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 4px;
    letter-spacing: var(--ls-wide);
}

.hero-video-link {
    font-family: var(--font-family-nav);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--color-text-primary);
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
}

.hero-video-link:hover {
    color: var(--color-accent);
}

.hero-video-thumb {
    position: relative;
    width: 320px;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    cursor: pointer;
}

.hero-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
}

.hero-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    pointer-events: none;
}

/* CTA links — bottom left */
.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    align-items: flex-end;
}

.hero-cta a {
    font-family: var(--font-family-nav);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
    white-space: nowrap;
}

/* Red brackets like 2819 */
.hero-cta .bracket {
    color: var(--color-accent);
}

.hero-cta a:hover {
    color: var(--color-accent);
}

.hero p {
    display: none;
}

/* --- SERVICE INFO (optional, positioned like 2819) --- */
.hero-info {
    position: absolute;
    z-index: 4;
    top: 48%;
    right: 3%;
    left: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero-info h5 {
    font-family: var(--font-family-display);
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.3;
    color: var(--color-text-primary);
}

/* --- MOBILE --- */

@media (max-width: 768px) {
    .hero-image {
        display: none;
    }

    .hero-text {
        font-size: clamp(3rem, 16vw, 5rem);
    }

    .hero-line-1 { top: 20%; left: 5%; }
    .hero-line-2 { top: 35%; left: 15%; }
    .hero-line-3 { top: 50%; right: 5%; }

    .hero-bottom {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 var(--space-lg) var(--space-lg);
    }

    .hero-video {
        align-items: flex-start;
        text-align: left;
    }

    .hero-video-thumb {
        width: 100%;
    }

    .hero-info {
        display: none;
    }
}

/* ========================================
   EDITORIAL SECTIONS — 2819-STYLE
   ======================================== */

.section-editorial {
    text-align: center;
    max-width: 900px;
}

.editorial-heading {
    font-family: var(--font-family-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
    margin-bottom: var(--space-lg);
}

.editorial-body {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-xl);
    line-height: 1.6;
}

.text-accent {
    color: var(--color-accent);
}

.section-label {
    font-family: var(--font-family-nav);
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--color-accent);
    margin-bottom: var(--space-md);
}

.cta-link {
    font-family: var(--font-family-nav);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
    display: inline-block;
}

.cta-link:hover {
    color: var(--color-accent);
}

.bracket {
    color: var(--color-accent);
}

/* Dark section */
.section-dark {
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
}

.section-dark .editorial-heading,
.section-dark h2, .section-dark h3, .section-dark h5 {
    color: #fff;
}

.section-dark p {
    color: #ccc;
}

.section-dark .cta-link {
    color: #fff;
}

html[data-theme="dark"] .section-dark {
    background-color: rgba(17, 17, 17, 0.9);
    color: #fff;
}

/* Split layout */
.section-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
    text-align: left;
}

.split-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Connect grid */
.connect-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2xl);
    margin-top: var(--space-2xl);
    text-align: left;
}

.connect-item h3 {
    font-size: var(--font-size-display-sm);
    margin-bottom: var(--space-sm);
}

.connect-item p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
}

/* --- CONTACT FORM --- */
.section-contact {
    padding: var(--space-2xl) 0 var(--space-4xl);
}

.contact-wrapper {
    display: flex;
    justify-content: flex-start;
}

.contact-card {
    width: 100%;
    max-width: 620px;
    margin-left: 0;
    padding: var(--space-2xl);
    background-color: rgba(255, 255, 255, 0.35);
    border: 2px solid var(--color-text-primary);
    border-radius: 16px;
    text-align: left;
}

html[data-theme="dark"] .contact-card {
    background-color: rgba(0, 0, 0, 0.35);
    border-color: #fff;
}

.contact-card .section-label {
    margin-bottom: var(--space-sm);
}

.contact-card .editorial-heading {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    margin-bottom: var(--space-lg);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-family: var(--font-family-nav);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--color-accent);
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font-family-body);
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    background-color: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--color-text-primary);
    border-radius: 10px;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
    box-sizing: border-box;
}

.form-field textarea {
    min-height: 140px;
    resize: vertical;
    font-family: var(--font-family-body);
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(82, 75, 70, 0.15);
}

html[data-theme="dark"] .form-field input,
html[data-theme="dark"] .form-field textarea {
    background-color: rgba(0, 0, 0, 0.4);
    color: #fff;
    border-color: #fff;
}

html[data-theme="dark"] .form-field input:focus,
html[data-theme="dark"] .form-field textarea:focus {
    background-color: rgba(0, 0, 0, 0.7);
    border-color: var(--color-accent);
}

.contact-submit {
    align-self: flex-start;
    margin-top: var(--space-sm);
    padding: 12px 22px;
    font-family: var(--font-family-nav);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
    background: transparent;
    border: 1.5px solid var(--color-text-primary);
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}

.contact-submit:hover {
    background-color: var(--color-text-primary);
    color: var(--color-bg);
}

.contact-submit:hover .bracket {
    color: var(--color-bg);
}

.contact-submit .bracket {
    color: var(--color-accent);
}

html[data-theme="dark"] .contact-submit {
    color: #fff;
    border-color: #fff;
}

html[data-theme="dark"] .contact-submit:hover {
    background-color: #fff;
    color: #000;
}

.form-message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-top: var(--space-md);
    font-weight: 700;
    font-size: var(--font-size-sm);
}

.form-message-success {
    background-color: rgba(81, 207, 102, 0.15);
    border: 1px solid rgba(81, 207, 102, 0.5);
    color: #2B8A3E;
}

.form-message-error {
    background-color: rgba(82, 75, 70, 0.1);
    border: 1px solid rgba(82, 75, 70, 0.5);
    color: var(--color-accent);
}

html[data-theme="dark"] .form-message-success {
    color: #8CE99A;
}

@media (max-width: 768px) {
    .contact-card {
        padding: var(--space-xl) var(--space-lg);
    }
}

@media (max-width: 768px) {
    .section-split {
        grid-template-columns: 1fr;
    }

    .connect-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   LAYERED TEXT & IMAGE
   ======================================== */

.text-image-overlap {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4xl);
    align-items: center;
}

.text-image-overlap-image {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.text-image-overlap-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.text-image-overlap-text {
    position: relative;
    z-index: 2;
}

/* ========================================
   CARDS & COMPONENTS
   ======================================== */

.card {
    background-color: var(--color-bg-secondary);
    border: 2px solid var(--color-border);
    padding: var(--space-2xl);
    transition: all var(--transition-base);
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--color-accent);
}

.card-title {
    font-size: var(--font-size-display-sm);
    margin-bottom: var(--space-md);
}

.card-description {
    color: var(--color-text-secondary);
}

/* ========================================
   GRID
   ======================================== */

.grid {
    display: grid;
    gap: var(--space-lg);
}

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

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

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

/* ========================================
   FOOTER
   ======================================== */

.footer {
    background-color: rgba(245, 245, 245, 0.35);
    border-top: 1px solid var(--color-divider);
    padding: var(--space-xl) 0 var(--space-md);
    margin-top: var(--space-2xl);
}

html[data-theme="dark"] .footer {
    background-color: rgba(17, 17, 17, 0.35);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.footer-section h3,
.footer-section h4 {
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    margin-bottom: var(--space-sm);
    color: var(--color-text-primary);
}

.footer-section p,
.footer-section li {
    font-size: var(--font-size-sm);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: var(--space-sm);
}

.footer-section a {
    color: var(--color-text-secondary);
    text-decoration: none;
}

.footer-section a:hover {
    color: var(--color-accent);
}

.social-links {
    display: flex;
    gap: var(--space-md);
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-divider);
    border-radius: 50%;
    color: var(--color-text-primary);
    transition: all var(--transition-fast);
}

.social-links a:hover {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-bg);
}

.social-links svg {
    width: 16px;
    height: 16px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-divider);
    color: var(--color-text-tertiary);
    font-size: var(--font-size-xs);
}

.footer-developer {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-text-tertiary);
    font-size: var(--font-size-xs);
    cursor: default;
    user-select: none;
}

.footer-developer img {
    height: 16px;
    width: auto;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.footer-developer:hover img {
    opacity: 1;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .text-image-overlap {
        grid-template-columns: 1fr;
    }

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

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

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

@media (max-width: 768px) {
    .navbar-menu {
        display: none;
    }

    .navbar-menu.active {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: center;
        background-color: var(--color-bg);
        border-bottom: 2px solid var(--color-border);
        padding: var(--space-2xl) var(--space-lg);
        gap: var(--space-lg);
        z-index: var(--z-dropdown);
    }

    .menu-toggle {
        display: flex;
    }

    .hero {
        height: auto;
        min-height: 100vh;
    }

    .hero-content {
        padding: 80px var(--space-lg) var(--space-lg);
    }

    .hero-text {
        font-size: clamp(3rem, 14vw, 5rem);
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .section {
        padding: var(--space-2xl) 0;
    }
}

@media (max-width: 480px) {
    .navbar-container {
        padding: var(--space-md);
    }

    .navbar-brand {
        font-size: var(--font-size-lg);
    }

    .hero-text {
        font-size: clamp(2.5rem, 14vw, 3.5rem);
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   MOBILE OVERRIDES — solid backgrounds, tighter spacing
   ======================================== */

/*
   iOS Safari ignores `background-attachment: fixed` on body.
   To get a true sticky background on iPhone/iPad we use a
   position:fixed pseudo-element that covers the viewport.
*/
@media (max-width: 1024px) {
    body {
        background-image: none !important;
        background-attachment: scroll !important;
        background-color: transparent !important;
    }

    html {
        background-color: var(--color-bg);
    }

    html[data-theme="dark"] {
        background-color: #000;
    }

    body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: -1;
        background-image: url('/assets/images/background-tablet.jpg');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        pointer-events: none;
    }

    html[data-theme="dark"] body::before {
        background-image: url('/assets/images/background-dark-tablet.jpg');
    }
}

@media (max-width: 768px) {
    body::before {
        background-image: url('/assets/images/background-mobile.jpg');
    }

    html[data-theme="dark"] body::before {
        background-image: url('/assets/images/background-dark-mobile.jpg');
    }

    /* Hide all taglines on mobile */
    .page-tagline {
        display: none !important;
    }

    /* Hide decorative scattered images on mobile — they clutter small screens */
    .section .scattered-img,
    .hero .scattered-img {
        display: none;
    }

    /* Sub-hero hero text sizing */
    .hero-sub {
        min-height: auto;
        padding: var(--space-xl) 0 var(--space-lg);
    }

    .hero-sub .hero-container {
        padding: 0 var(--space-lg);
        min-height: auto;
    }

    .hero-sub .hero-text {
        max-width: 100%;
        font-size: clamp(3rem, 14vw, 5rem);
    }

    .hero-sub-intro {
        margin-top: var(--space-lg);
        font-size: var(--font-size-md);
    }

    /* Section spacing tighter on mobile */
    .section {
        padding: var(--space-xl) 0;
    }

    .section-inner {
        padding: 0 var(--space-lg);
    }

    /* Editorial headings scale down on small screens */
    .editorial-heading {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }

    /* Contact form: full-width card, tighter padding */
    .contact-card {
        padding: var(--space-lg);
        max-width: 100%;
        border-radius: 12px;
    }

    .contact-wrapper {
        padding: 0 var(--space-md);
    }

    /* Split sections stack cleanly */
    .section-split {
        gap: var(--space-xl);
    }

    .split-media img {
        width: 100%;
        height: auto;
    }

    /* Navbar — tighter on mobile */
    .navbar-container {
        padding: var(--space-md) var(--space-lg);
    }

    .navbar-brand {
        font-size: var(--font-size-md);
    }

    /* Footer bottom — centered, stacked, with spacing */
    .footer-bottom {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        gap: var(--space-md);
    }

    .footer-bottom p {
        text-align: center;
    }

    .footer-developer {
        justify-content: center;
    }

    /* Home hero — stack naturally on mobile instead of absolute-positioned chaos */
    .hero {
        height: auto;
        min-height: 0;
        padding: var(--space-2xl) 0 var(--space-xl);
    }

    .hero-container {
        height: auto;
        padding: 0 var(--space-lg);
        display: flex;
        flex-direction: column;
        gap: var(--space-md);
    }

    .hero-text {
        position: static;
        display: block;
        font-size: clamp(3rem, 15vw, 5rem);
        line-height: 0.95;
        white-space: normal;
        mix-blend-mode: normal;
        color: var(--color-text-primary);
    }

    html[data-theme="dark"] .hero-text {
        color: #fff;
        mix-blend-mode: normal;
    }

    /* Keep REVIVAL accent red on mobile */
    .hero-text.hero-text-accent,
    html[data-theme="dark"] .hero-text.hero-text-accent {
        color: var(--color-accent);
    }

    .hero-line-1,
    .hero-line-2,
    .hero-line-3 {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
    }

    .hero-line-2 {
        margin-left: var(--space-lg);
    }

    .hero-line-3 {
        align-self: flex-end;
    }

    /* Stack service info below the big words, full width */
    .hero-info {
        position: static;
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        gap: var(--space-md);
        margin-top: var(--space-lg);
        top: auto;
        right: auto;
        left: auto;
    }

    .hero-bottom {
        position: static;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
        padding: var(--space-lg) 0 0;
    }

    .hero-cta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

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

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        color-scheme: dark;
    }
}
