:root {
    color-scheme: light dark;

    /* Theme mapping from RepeatableTodos */
    --page-bg: rgb(234 234 234);
    --header-accent: rgb(251 207 86);
    --surface-bg: rgb(243 241 234);
    --surface-muted: rgb(246 246 244);
    --text-primary: rgb(56 56 61);
    --text-secondary: rgb(105 107 115);
    --text-tertiary: rgb(148 150 158);
    --border-soft: rgba(0, 0, 0, 0.08);
    --divider: rgba(255, 255, 255, 0.18);
    --shadow-color: rgba(0, 0, 0, 0.08);
    --highlight-soft: rgba(251, 207, 86, 0.32);
    --button-text: rgb(56 56 61);

    /* Spacing / radius from theme */
    --radius-card: 28px;
    --radius-sheet: 28px;
    --radius-input: 24px;

    --space-xs: 8px;
    --space-sm: 10px;
    --space-md: 16px;
    --space-lg: 20px;
    --space-xl: 28px;
    --space-2xl: 36px;

    --page-horizontal-margin: 14px;
    --page-vertical-padding: 20px;

    /* Typography mapped from theme */
    --font-screen-title: 22px;
    --font-card-title: 17px;
    --font-body: 17px;
    --font-meta: 14px;
    --font-preview: 13px;

    --container-width: 820px;
    --container-narrow-width: 720px;
    --card-shadow: 0 8px 18px var(--shadow-color);
}

@media (prefers-color-scheme: dark) {
    :root {
        --page-bg: rgb(43 51 61);
        --header-accent: rgb(227 194 79);
        --surface-bg: rgba(20, 23, 28, 0.92);
        --surface-muted: rgba(33, 38, 46, 1);
        --text-primary: rgb(237 240 242);
        --text-secondary: rgb(189 194 201);
        --text-tertiary: rgb(140 145 156);
        --border-soft: rgba(255, 255, 255, 0.10);
        --divider: rgba(255, 255, 255, 0.10);
        --shadow-color: rgba(0, 0, 0, 0.28);
        --highlight-soft: rgba(227, 194, 79, 0.22);
        --button-text: rgb(34 38 44);
    }
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family:
            Inter,
            ui-sans-serif,
            system-ui,
            -apple-system,
            BlinkMacSystemFont,
            "Segoe UI",
            sans-serif;
    background: var(--page-bg);
    color: var(--text-primary);
    font-size: var(--font-body);
    line-height: 1.55;
}

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

input,
select,
textarea,
button {
    font: inherit;
}

.page-shell {
    width: min(calc(100% - (var(--page-horizontal-margin) * 2)), var(--container-width));
    margin: 0 auto;
    padding: var(--page-vertical-padding) 0 calc(var(--page-vertical-padding) * 2);
}

.page-shell--narrow {
    width: min(calc(100% - (var(--page-horizontal-margin) * 2)), var(--container-narrow-width));
    min-height: 100vh;
    display: grid;
    align-items: center;
}

.card {
    background: var(--surface-bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    overflow: clip;
}

.card + .card {
    margin-top: var(--space-lg);
}

.hero-card,
.section-card,
.form-card,
.thanks-card {
    padding: 0;
}

.card-header,
.section-top {
    background: var(--header-accent);
    color: var(--text-primary);
    padding: 18px 20px 16px;
    border-bottom: 1px solid var(--divider);
}

.hero-copy,
.stack-text,
.tag-list,
.price-list,
.details-block,
.intake-form,
.thanks-actions {
    padding: 18px 20px 20px;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: var(--font-meta);
    color: var(--text-secondary);
}

h1,
h2,
h3,
legend {
    margin: 0;
    font-weight: 650;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(1.9rem, 1.4rem + 1.5vw, 2.4rem);
    line-height: 1.12;
}

h2 {
    font-size: 1.125rem;
    line-height: 1.2;
}

h3 {
    font-size: 1rem;
    line-height: 1.3;
}

.lead {
    margin: 10px 0 0;
    color: var(--text-secondary);
}

p {
    margin: 0;
}

p + p {
    margin-top: 12px;
}

.hero-copy p,
.stack-text p,
.section-note,
.form-footnote {
    max-width: 66ch;
}

.tag-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}

.tag-list li {
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--surface-muted);
    border: 1px solid var(--border-soft);
    color: var(--text-primary);
    line-height: 1.3;
}

.price-list {
    margin: 0;
}

.price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
}

.price-row:first-child {
    padding-top: 0;
}

.price-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.price-row dt {
    color: var(--text-primary);
}

.price-row dd {
    margin: 0;
    font-weight: 650;
    color: var(--text-primary);
}

.details-block {
    padding-top: 16px;
}

details {
    background: var(--surface-muted);
    border: 1px solid var(--border-soft);
    border-radius: 24px;
    overflow: hidden;
}

summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 18px;
    font-weight: 600;
    position: relative;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: "+";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

details[open] summary::after {
    content: "−";
}

.details-content {
    padding: 0 18px 18px;
    border-top: 1px solid var(--border-soft);
}

.credentials-group + .credentials-group {
    margin-top: 18px;
}

.credentials-group ul {
    margin: 10px 0 0;
    padding-left: 20px;
}

.credentials-group li + li {
    margin-top: 8px;
}

.intake-form {
    display: grid;
    gap: 18px;
}

.form-section {
    margin: 0;
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: 24px;
    background: var(--surface-muted);
    min-width: 0;
}

.form-section legend {
    padding: 0 8px;
    font-size: var(--font-meta);
    color: var(--text-secondary);
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field-grid + .field-grid,
.field + .field,
.field-grid + .field,
.field + .checkbox-field,
.checkbox-field + .checkbox-field {
    margin-top: 14px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    color: var(--text-primary);
    font-size: 0.98rem;
}

input[type="text"],
input[type="email"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-input);
    background: var(--surface-bg);
    color: var(--text-primary);
    padding: 14px 16px;
    outline: none;
    transition:
            border-color 0.18s ease,
            box-shadow 0.18s ease,
            background-color 0.18s ease;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

select {
    appearance: none;
    background-image:
            linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
            linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position:
            calc(100% - 22px) calc(50% - 3px),
            calc(100% - 16px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 44px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--header-accent);
    box-shadow: 0 0 0 4px var(--highlight-soft);
}

.checkbox-field {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 12px;
    align-items: start;
}

.checkbox-field input[type="checkbox"] {
    margin: 3px 0 0;
    accent-color: var(--header-accent);
}

.hidden-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.button-primary,
.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 20px;
    border-radius: 24px;
    border: 1px solid transparent;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    transition:
            transform 0.12s ease,
            opacity 0.18s ease,
            background-color 0.18s ease,
            border-color 0.18s ease;
}

.button-primary {
    background: var(--header-accent);
    color: var(--button-text);
}

.button-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-soft);
}

.button-primary:hover,
.button-secondary:hover {
    transform: translateY(-1px);
}

.button-primary:active,
.button-secondary:active {
    transform: translateY(0);
}

.section-note,
.form-footnote {
    font-size: var(--font-meta);
    color: var(--text-secondary);
}

.thanks-card {
    max-width: 100%;
}

.thanks-actions {
    padding-top: 0;
}

a {
    color: inherit;
}

@media (max-width: 720px) {
    .page-shell,
    .page-shell--narrow {
        width: min(calc(100% - 20px), 100%);
    }

    .card-header,
    .section-top,
    .hero-copy,
    .stack-text,
    .tag-list,
    .price-list,
    .details-block,
    .intake-form,
    .thanks-actions {
        padding-left: 16px;
        padding-right: 16px;
    }

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

    .price-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 16px;
    }

    .card-header,
    .section-top {
        padding-top: 16px;
        padding-bottom: 14px;
    }

    .form-section {
        padding: 14px;
    }

    .button-primary,
    .button-secondary {
        width: 100%;
    }
}
