:root {
    --color-primary: #64748b;
    --color-on-primary: #ffffff;
    --color-accent: #ea580c;
    --color-on-accent: #000000;
    --color-background: #f8fafc;
    --color-foreground: #334155;
    --color-heading: #0f172a;
    --color-card: #ffffff;
    --color-muted: #ebf0f5;
    --color-muted-foreground: #475569;
    --color-border: #e2e8f0;
    --color-destructive: #dc2626;
    --color-on-destructive: #ffffff;
    --color-ring: #64748b;
    --color-result: #f0fdf4;
    --color-result-border: #bbf7d0;
    --color-footer: #0f172a;
    --font-display: "EB Garamond", Georgia, "Iowan Old Style", serif;
    --font-body: Lato, "Segoe UI", system-ui, sans-serif;
    --radius: 8px;
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 48px;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.08);
    --header-offset: 4.5rem;
    --ease: ease;
    --duration: 200ms;
}

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

html {
    scroll-behavior: smooth;
}

.dhc-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-background);
    color: var(--color-foreground);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.55;
    overflow-x: hidden;
}

a {
    color: #9a3412;
}

a:hover {
    color: #7c2d12;
}

.dhc-skip {
    position: absolute;
    left: var(--space-2);
    top: -100px;
    z-index: 2000;
    background: var(--color-heading);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    text-decoration: none;
}

.dhc-skip:focus {
    top: var(--space-2);
    color: #fff;
}

.dhc-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.dhc-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
}

.dhc-header .dhc-nav {
    background: #fff;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.dhc-header .navbar-brand {
    color: var(--color-heading) !important;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.dhc-header .nav-link {
    color: var(--color-foreground) !important;
    font-weight: 600;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.dhc-header .nav-link:hover {
    color: var(--color-heading) !important;
}

.dhc-header .nav-link:focus-visible,
.dhc-header .navbar-brand:focus-visible,
.dhc-header .navbar-toggler:focus-visible {
    outline: 2px solid var(--color-ring);
    outline-offset: 2px;
}

.dhc-header .navbar-toggler {
    border-color: var(--color-border);
    min-height: 44px;
    min-width: 44px;
    cursor: pointer;
}

.dhc-nav-cta.nav-link {
    background: var(--color-accent) !important;
    color: var(--color-on-accent) !important;
    border-radius: 6px;
    padding: 0.45rem 0.95rem !important;
    margin-left: 0.35rem;
    font-weight: 700;
}

.dhc-nav-cta.nav-link:hover {
    background: #c2410c !important;
    color: var(--color-on-accent) !important;
}

.dhc-main {
    flex: 1;
    padding: var(--space-3) 0 var(--space-5);
}

.dhc-page-home .dhc-main {
    padding-top: 0;
}

#main,
#calculator,
#result,
#dhc-error-summary,
.dhc-field {
    scroll-margin-top: var(--header-offset);
}

.dhc-hero h1,
.dhc-prose h1,
.dhc-calc h1 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--color-heading);
    margin: 0.2rem 0 0.75rem;
    font-size: clamp(1.85rem, 4vw, 2.75rem);
    line-height: 1.15;
    text-wrap: balance;
}

.dhc-section h2,
.dhc-panel h2,
.dhc-result h2,
.dhc-prose h2,
.dhc-error-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-heading);
    margin: 0 0 0.75rem;
}

.dhc-kicker {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    font-weight: 700;
    color: #9a3412;
    margin: 0 0 var(--space-1);
}

.dhc-lede {
    font-size: 1.125rem;
    color: var(--color-muted-foreground);
    max-width: 38rem;
    margin: 0 0 var(--space-3);
}

.dhc-hero--home {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: var(--space-5) max(1.25rem, calc(50vw - 570px)) var(--space-4);
    background:
        linear-gradient(180deg, #ffffff 0%, var(--color-background) 100%);
    border-bottom: 1px solid var(--color-border);
}

.dhc-hero-grid {
    display: grid;
    gap: var(--space-4);
    align-items: center;
}

.dhc-hero-visual {
    display: none;
}

.dhc-hero-compact {
    margin-bottom: var(--space-3);
}

.dhc-btn,
button.dhc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--color-accent);
    color: var(--color-on-accent) !important;
    text-decoration: none;
    border: 0;
    border-radius: 6px;
    padding: 0.7rem 1.2rem;
    font-weight: 700;
    font-size: 1rem;
    font-family: inherit;
    min-height: 44px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: background-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.dhc-btn:hover {
    background: #c2410c;
    color: var(--color-on-accent) !important;
}

.dhc-btn:focus-visible {
    outline: 2px solid var(--color-ring);
    outline-offset: 3px;
}

.dhc-btn-ghost {
    background: #fff;
    color: var(--color-heading) !important;
    border: 1px solid var(--color-border);
}

.dhc-btn-ghost:hover {
    background: var(--color-muted);
    color: var(--color-heading) !important;
}

.dhc-section {
    margin: var(--space-5) 0;
}

.dhc-card-grid {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: 1fr;
}

.dhc-card,
.dhc-panel,
.dhc-result {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-3);
    box-shadow: var(--shadow);
}

.dhc-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: box-shadow var(--duration) var(--ease);
}

.dhc-card:hover {
    box-shadow: var(--shadow-hover);
}

.dhc-card h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--color-heading);
}

.dhc-card p {
    margin: 0 0 auto;
    color: var(--color-muted-foreground);
}

.dhc-card .dhc-btn {
    align-self: flex-start;
    margin-top: var(--space-1);
}

.dhc-card.is-soon {
    background: var(--color-muted);
    box-shadow: none;
}

.dhc-card.is-soon:hover {
    box-shadow: none;
}

.dhc-cat {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin: 0;
}

.dhc-cat-heading {
    margin: 1.25rem 0 0.75rem;
}

.dhc-value-strip {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: var(--space-3) max(1.25rem, calc(50vw - 570px));
    background: #fff;
    border-bottom: 1px solid var(--color-border);
}

.dhc-value-grid {
    display: grid;
    gap: var(--space-3);
}

.dhc-value-item {
    display: grid;
    grid-template-columns: 2.5rem 1fr;
    gap: var(--space-2);
    align-items: start;
}

.dhc-value-item h2 {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    color: var(--color-heading);
}

.dhc-value-item p {
    margin: 0;
    color: var(--color-muted-foreground);
    font-size: 0.95rem;
}

.dhc-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: #9a3412;
}

.dhc-tool-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-3);
}

.dhc-tool-list li {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    justify-content: space-between;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--color-border);
    min-height: 44px;
}

.dhc-soon {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--color-muted);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
}

.dhc-steps {
    margin: 0;
    padding-left: 1.2rem;
}

.dhc-steps li {
    margin-bottom: 0.5rem;
}

.dhc-faq details {
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 0;
}

.dhc-faq summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--color-heading);
    min-height: 44px;
    display: flex;
    align-items: center;
    list-style: none;
}

.dhc-faq summary::-webkit-details-marker {
    display: none;
}

.dhc-faq summary::after {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    margin-left: auto;
    border-right: 2px solid var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    transform: rotate(45deg);
    transition: transform var(--duration) var(--ease);
}

.dhc-faq details[open] summary::after {
    transform: rotate(225deg);
}

.dhc-faq summary:focus-visible {
    outline: 2px solid var(--color-ring);
    outline-offset: 2px;
}

.dhc-faq p {
    margin: 0.35rem 0 0.5rem;
    color: var(--color-muted-foreground);
}

.dhc-crumbs {
    background: transparent;
    padding: 0;
    margin-bottom: var(--space-2);
    font-size: 0.9rem;
}

.dhc-crumbs a {
    color: var(--color-muted-foreground);
}

.dhc-form-row {
    margin-bottom: var(--space-2);
}

.dhc-field label {
    display: block;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 0.35rem;
}

.dhc-field input,
.dhc-field select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.45rem 0.65rem;
    background: #fff;
    color: var(--color-heading);
    font: inherit;
}

.dhc-field input:focus-visible,
.dhc-field select:focus-visible {
    outline: 2px solid var(--color-ring);
    outline-offset: 2px;
    border-color: var(--color-primary);
}

.dhc-input-pair {
    display: grid;
    grid-template-columns: 1fr 7.5rem;
    gap: 0.5rem;
}

.dhc-field.is-invalid input,
.dhc-field.is-invalid select {
    border-color: var(--color-destructive);
}

.dhc-error {
    color: var(--color-destructive);
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
}

.dhc-hint {
    margin: 0.3rem 0 0;
    font-size: 0.85rem;
    color: var(--color-muted-foreground);
}

.dhc-alert {
    background: #fef2f2;
    color: #7f1d1d;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    border: 1px solid #fecaca;
    margin-bottom: var(--space-2);
}

.dhc-alert:focus {
    outline: 2px solid var(--color-destructive);
    outline-offset: 2px;
}

.dhc-error-title {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.dhc-alert ul {
    margin: 0;
    padding-left: 1.15rem;
}

.dhc-alert a {
    color: #9a3412;
    font-weight: 700;
}

.dhc-result {
    background: var(--color-result);
    border-color: var(--color-result-border);
    margin-top: var(--space-3);
}

.dhc-result:focus {
    outline: 2px solid var(--color-ring);
    outline-offset: 3px;
}

.dhc-result-hero {
    margin-bottom: var(--space-3);
}

.dhc-result-hero dt {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-muted-foreground);
}

.dhc-result-hero dd {
    margin: 0.2rem 0 0;
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.4rem);
    font-weight: 700;
    color: var(--color-heading);
    line-height: 1.15;
}

.dhc-result-list {
    display: grid;
    gap: var(--space-2);
    margin: 0 0 var(--space-3);
}

.dhc-result-list dt {
    font-size: 0.85rem;
    color: var(--color-muted-foreground);
}

.dhc-result-list dd {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-heading);
}

.dhc-disclaimer {
    font-size: 0.9rem;
    color: var(--color-muted-foreground);
}

.dhc-prose {
    max-width: 42rem;
}

.dhc-prose p {
    margin: 0 0 1rem;
}

.dhc-footer {
    background: var(--color-footer);
    color: #e2e8f0;
    padding: var(--space-4) 0;
    font-size: 0.9rem;
}

.dhc-footer a {
    color: #e2e8f0;
    margin-right: 1rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.dhc-footer a:hover,
.dhc-footer a:focus-visible {
    color: #fff;
}

.dhc-footer a:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.dhc-consent,
.dhc-copy {
    margin: 0.5rem 0 0;
    color: #94a3b8;
}

.dhc-ad {
    min-height: 0;
}

.dhc-ad.is-live {
    min-height: 90px;
    margin: 1rem 0;
}

.dhc-consent-banner {
    display: none;
}

.dhc-ad-box {
    border: 1px dashed var(--color-border);
    padding: 1rem;
    text-align: center;
    color: var(--color-muted-foreground);
    margin: 1rem 0;
    background: #fff;
}

.dhc-slab-svg {
    width: 100%;
    max-width: 22rem;
    height: auto;
}

@media (min-width: 700px) {
    .dhc-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .dhc-split {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-4);
    }

    .dhc-form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-2);
    }

    .dhc-hero-grid {
        grid-template-columns: 1.15fr 0.85fr;
    }

    .dhc-hero-visual {
        display: block;
        justify-self: end;
    }
}

@media (min-width: 1024px) {
    .dhc-card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@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;
    }
}
