:root {
    /* Brand Colors */
    --clay: #9c6644;
    --clay-light: #e6ccb2;
    --clay-dark: #7f5539;
    --sand: #ede0d4;
    --terracotta: #b08968;
    --moss: #606c38;
    --brick: #8f4a42;

    /* Neutral Colors */
    --slate: #333f48;
    --white: #ffffff;
    --bg-light: #f9f6f2;

    /* Semantic Colors */
    --success: #155724;
    --success-bg: #d4edda;
    --warning: #856404;
    --warning-bg: #fff3cd;
    --danger: #721c24;
    --danger-bg: #f8d7da;
    --info: #0c5460;
    --info-bg: #d1ecf1;
    --danger-action: #c0392b;
    --danger-action-hover: #a93226;

    /* Accessible Neutrals
       --text-muted passes 4.5:1 on white, sand and bg-light.
       --border-input passes 3:1 on white (WCAG non-text contrast). */
    --text-muted: #506471;
    --border-input: #8596a3;

    /* Typography */
    --font-heading: 'Bitter', serif;
    --font-body: 'Karla', sans-serif;

    /* Spacing */
    --section-padding: 6rem;
    --section-padding-mobile: 4rem;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;

    /* Shadows */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-full: 30px;
    --navbar-height: 70px;
}

html {
    scroll-padding-top: calc(var(--navbar-height) + 10px);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--slate);
    background-color: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

button {
    font-family: inherit;
    cursor: pointer;
}

/* -----------------------------------------------------------------------------
   Typography
   ----------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--clay-dark);
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1, h2, h3 {
    text-wrap: balance;
}

h1 { font-size: clamp(2rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h4 { font-size: clamp(1.125rem, 2.5vw, 1.25rem); }

p {
    margin-bottom: 1rem;
    text-wrap: pretty;
}

p:last-child {
    margin-bottom: 0;
}

/* -----------------------------------------------------------------------------
   Layout
   ----------------------------------------------------------------------------- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

main {
    padding-top: var(--navbar-height);
}

section {
    padding: var(--section-padding) 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    width: 80px;
    height: 3px;
    background: var(--clay);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* -----------------------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------------------- */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: -0.125em;
    /* Font glyphs overshoot the em box a little; do not clip them. */
    overflow: visible;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--clay);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.5;
    text-align: center;
    transition: all var(--transition-normal);
    border: 2px solid var(--clay);
    cursor: pointer;
}

.btn:hover {
    background-color: transparent;
    color: var(--clay-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-outline:hover {
    background-color: var(--white);
    color: var(--clay);
}

.btn-outline-dark {
    background: transparent;
    color: var(--slate);
    border-color: var(--slate);
}

.btn-outline-dark:hover {
    background: var(--slate);
    color: var(--white);
}

.btn-danger {
    background-color: var(--danger-action);
    border-color: var(--danger-action);
}

.btn-danger:hover {
    background-color: var(--danger-action-hover);
    border-color: var(--danger-action-hover);
    color: var(--white);
}

.btn-ghost-danger {
    background-color: transparent;
    border-color: transparent;
    color: var(--text-muted);
}

.btn-ghost-danger:hover {
    background-color: transparent;
    border-color: currentColor;
    color: var(--danger-action);
    transform: none;
    box-shadow: none;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* -----------------------------------------------------------------------------
   Utility Classes
   ----------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Caps a block of prose at a comfortable reading measure. */
.measure { max-width: 68ch; }

/* -----------------------------------------------------------------------------
   Mobile Base Styles
   ----------------------------------------------------------------------------- */
@media (max-width: 768px) {
    section {
        padding: var(--section-padding-mobile) 0;
    }

    .btn {
        padding: 10px 24px;
    }
}

/* -----------------------------------------------------------------------------
   HTMX Pending States

   HTMX puts .htmx-request on the element carrying the hx-* attribute. For a
   button that is the button itself. For a form it is the form, so the submit
   button is matched through a descendant selector.
   ----------------------------------------------------------------------------- */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.htmx-request.btn::after,
form.htmx-request button[type="submit"]::after {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 0.5rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    vertical-align: -0.125em;
}

.htmx-request.btn,
form.htmx-request button[type="submit"] {
    pointer-events: none;
    opacity: 0.75;
}

@media (prefers-reduced-motion: reduce) {
    .htmx-request.btn::after,
    form.htmx-request button[type="submit"]::after {
        animation: none;
        border-right-color: currentColor;
        opacity: 0.5;
    }
}

/* -----------------------------------------------------------------------------
   Focus
   ----------------------------------------------------------------------------- */
:focus-visible {
    outline: 3px solid var(--clay-dark);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* -----------------------------------------------------------------------------
   Reduced Motion
   ----------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .btn:hover,
    .achievement-item:hover,
    .pricing-card:hover,
    .agenda-day:hover {
        transform: none;
    }
}