/* =========================================================
   Early Marks Studio Visual Design
   Warm paper palette + editorial serif/sans pairing
   v3 — aligned to the "scribble to signature" redesign
   ========================================================= */

:root {
    /* Core palette — warm paper, ink, pine green, clay & crayon accents */
    --paper: #FAF6EF;
    --paper-warm: #F1E7D6;
    --paper-deep: #EADCC3;
    --ink: #2C2A25;
    --ink-soft: #55503F;
    --ink-light: #7A7468;
    --pine: #3F5D45;
    --pine-deep: #253A29;
    --clay: #C9744F;
    --clay-deep: #A85E3D;
    --crayon: #E3A93E;
    --line: rgba(44, 42, 37, 0.12);
    --line-strong: rgba(44, 42, 37, 0.22);

    /* Site aliases (kept for backward compatibility with existing markup) */
    --page-bg: var(--paper);
    --page-bg-deep: var(--paper-deep);
    --surface: var(--paper);
    --surface-soft: var(--paper-warm);
    --text-main: var(--ink);
    --text-soft: var(--ink-soft);
    --text-light: var(--ink-light);
    --heading: var(--pine-deep);
    --heading-accent: var(--clay);
    --nav-bg: rgba(250, 246, 239, 0.94);
    --nav-text: var(--ink-soft);
    --nav-hover: var(--pine-deep);
    --border-soft: var(--line);
    --shadow-soft: 0 12px 32px rgba(44, 42, 37, 0.08);
    --shadow-card: 0 6px 18px rgba(44, 42, 37, 0.06);
    --shadow-card-hover: 0 14px 30px rgba(44, 42, 37, 0.10);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Base */
html {
    font-size: 16px;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text-main);
    font-family: "Public Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--page-bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Text selection */
::selection {
    background: rgba(227, 169, 62, 0.35);
    color: var(--text-main);
}

/* Accessible focus ring */
a:focus-visible,
button:focus-visible,
.ems-btn:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--clay);
    outline-offset: 3px;
    border-radius: 8px;
}

/* Remove harsh Bootstrap white look */
.bg-white {
    background-color: var(--nav-bg) !important;
}

.border-bottom {
    border-bottom: 1px solid var(--border-soft) !important;
}

.border-top {
    border-top: 1px solid var(--border-soft) !important;
}

/* Layout */
.container {
    max-width: 1180px;
}

/* Navbar */
.navbar {
    min-height: 80px;
    background: var(--nav-bg) !important;
    border-bottom: 1px solid var(--border-soft);
    box-shadow: none;
}

.navbar-brand {
    color: var(--pine-deep) !important;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    transition: color 160ms var(--ease);
}

    .navbar-brand:hover {
        color: var(--clay) !important;
    }

.navbar-nav {
    gap: 1rem;
}

.nav-link {
    position: relative;
    color: var(--nav-text) !important;
    font-family: "Public Sans", system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    padding: 0.55rem 0.65rem !important;
    border-radius: 999px;
    transition: color 160ms var(--ease), background-color 160ms var(--ease);
}

    /* Animated underline */
    .nav-link::after {
        content: "";
        position: absolute;
        left: 0.65rem;
        right: 0.65rem;
        bottom: 0.28rem;
        height: 2px;
        border-radius: 2px;
        background: var(--clay);
        transform: scaleX(0);
        transform-origin: left center;
        transition: transform 200ms var(--ease);
    }

    .nav-link:hover,
    .nav-link:focus {
        color: var(--nav-hover) !important;
        background-color: rgba(63, 93, 69, 0.08);
    }

        .nav-link:hover::after,
        .nav-link:focus::after,
        .nav-link.active::after {
            transform: scaleX(1);
        }

    .nav-link.active {
        color: var(--pine-deep) !important;
        font-weight: 700;
    }

/* Main content */
main {
    min-height: calc(100vh - 190px);
}

/* Section eyebrow label */
.ems-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
    padding: 0;
    border-radius: 0;
    background: none;
    color: var(--clay);
    font-family: "Public Sans", system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

    .ems-eyebrow::before {
        content: "";
        display: inline-block;
        width: 20px;
        height: 1px;
        background: var(--clay);
    }

/* Hero section */
.ems-hero-simple {
    position: relative;
    min-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5rem 1.5rem;
    border-bottom: 1px solid var(--border-soft);
    background: var(--paper-warm);
}

.ems-hero-inner {
    max-width: 1040px;
    margin: 0 auto;
    animation: emsFadeUp 700ms var(--ease) both;
}

.ems-hero-title {
    margin: 0 0 1.25rem;
    color: var(--pine-deep);
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(2.6rem, 7vw, 5.2rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.01em;
}

    .ems-hero-title em {
        font-style: italic;
        color: var(--clay);
    }

.ems-hero-subtitle {
    max-width: 780px;
    margin: 0 auto 1.6rem;
    color: var(--ink);
    font-family: "Public Sans", system-ui, sans-serif;
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.ems-hero-description {
    max-width: 760px;
    margin: 0 auto;
    color: var(--ink-soft);
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    font-weight: 400;
    line-height: 1.6;
}

/* Optional buttons */
.ems-actions {
    margin-top: 2.2rem;
    display: flex;
    justify-content: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.ems-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0.78rem 1.6rem;
    border-radius: 999px;
    font-family: "Public Sans", system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 150ms var(--ease), box-shadow 150ms var(--ease), background-color 150ms var(--ease);
}

.ems-btn-primary {
    color: var(--paper);
    background-color: var(--pine-deep);
    box-shadow: none;
}

    .ems-btn-primary:hover {
        background-color: var(--pine);
        transform: translateY(-1px);
    }

.ems-btn-secondary {
    color: var(--ink);
    background-color: transparent;
    border: 1px solid var(--line-strong);
}

    .ems-btn-secondary:hover {
        border-color: var(--ink);
        transform: translateY(-1px);
    }

/* Standard headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--heading);
    font-family: "Fraunces", Georgia, serif;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

p {
    color: var(--text-main);
}

/* General page sections */
.ems-page-section {
    max-width: 1020px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
    animation: emsFadeUp 600ms var(--ease) both;
}

    .ems-page-section h1 {
        font-size: clamp(2.4rem, 5vw, 3.6rem);
        margin-bottom: 1rem;
    }

    /* Decorative accent under the top-level section heading */
    .ems-page-section > h1::after {
        content: "";
        display: block;
        width: 56px;
        height: 3px;
        margin-top: 1rem;
        border-radius: 3px;
        background: var(--clay);
    }

    .ems-page-section p {
        color: var(--text-soft);
        font-size: 1.05rem;
    }

/* Cards */
.ems-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 2.25rem;
}

.ems-card {
    position: relative;
    overflow: hidden;
    padding: 1.7rem 1.5rem 1.5rem;
    border-radius: var(--radius-md);
    background: var(--paper);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
    transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), border-color 200ms var(--ease);
}

    /* Accent bar along the left edge of every card */
    .ems-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 4px;
        background: var(--crayon);
    }

    /* Rotate the accent color so a 3-card row feels intentional */
    .ems-card:nth-child(3n + 1)::before {
        background: var(--crayon);
    }

    .ems-card:nth-child(3n + 2)::before {
        background: var(--clay);
    }

    .ems-card:nth-child(3n + 3)::before {
        background: var(--pine);
    }

    .ems-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-card-hover);
        border-color: var(--line-strong);
    }

    .ems-card h3 {
        color: var(--ink);
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .ems-card p {
        color: var(--text-soft);
        font-size: 0.95rem;
        margin-bottom: 0;
    }

/* Optional circular icon inside a card */
.ems-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: var(--paper-warm);
    color: var(--pine-deep);
    font-size: 1.3rem;
}

/* Pull quote — used for the philosophy statement on Home and Our Philosophy */
.ems-quote {
    max-width: 30ch;
    margin: 0 auto 2.5rem;
    color: var(--pine-deep);
    font-family: "Fraunces", Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.25rem, 2.4vw, 1.6rem);
    line-height: 1.5;
}

.ems-page-section .ems-quote {
    margin: 0 0 2.5rem;
    text-align: left;
}

/* Further reading / external link callout */
.ems-further-reading {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--line);
}

    .ems-further-reading a {
        color: var(--pine);
        font-weight: 600;
        text-decoration: none;
    }

        .ems-further-reading a:hover {
            color: var(--clay);
            text-decoration: underline;
        }

/* Honeypot field for the contact form — hidden off-screen rather than
   display:none, since some bots skip fields they detect as not rendered. */
.ems-honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* Simple form styling for the contact page */
.ems-form {
    max-width: 560px;
    margin-top: 1.5rem;
}

.ems-form label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.92rem;
}

.ems-form .form-control {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--paper);
    color: var(--ink);
    padding: 0.65rem 0.85rem;
}

    .ems-form .form-control:focus {
        border-color: var(--pine);
        box-shadow: 0 0 0 3px rgba(63, 93, 69, 0.14);
    }

.ems-form .mb-3 {
    margin-bottom: 1.3rem !important;
}

.ems-form .text-danger {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.85rem;
}

.ems-alert-success {
    max-width: 560px;
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    background: rgba(63, 93, 69, 0.10);
    border: 1px solid rgba(63, 93, 69, 0.25);
    color: var(--pine-deep);
    font-weight: 600;
}

/* Footer */
.footer {
    background: var(--paper-warm);
    color: var(--text-soft) !important;
    font-family: "Public Sans", system-ui, sans-serif;
    font-size: 0.9rem;
    line-height: 60px;
    border-top: 1px solid var(--border-soft);
}

    .footer a {
        color: var(--pine);
        font-weight: 600;
        text-decoration: none;
        text-underline-offset: 4px;
        transition: color 160ms var(--ease);
    }

        .footer a:hover {
            color: var(--clay);
            text-decoration: underline;
        }

/* Bootstrap button overrides */
.btn-primary {
    background-color: var(--pine-deep);
    border-color: var(--pine-deep);
}

    .btn-primary:hover {
        background-color: var(--pine);
        border-color: var(--pine);
    }

/* Entrance animation */
@keyframes emsFadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .navbar {
        min-height: auto;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .navbar-brand {
        font-size: 1.3rem;
    }

    .navbar-nav {
        gap: 0.25rem;
        padding-top: 1rem;
    }

    .ems-hero-simple {
        min-height: 480px;
        padding: 3.5rem 1.25rem;
    }

    .ems-hero-title {
        font-size: clamp(2.2rem, 12vw, 3.4rem);
    }

    .ems-hero-subtitle {
        font-size: 1.1rem;
    }

    .ems-hero-description {
        font-size: 1rem;
    }

    .ems-page-section {
        padding: 2.75rem 1.25rem;
    }

    .ems-card-grid {
        grid-template-columns: 1fr;
    }
}
