:root {
    --paper: #ffffff;
    --ink: #12161b;
    --slate: #5a6472;
    --edge: #e2e6ea;
    --signal: #1f6f5c;
    --warn: #b23a2e;
    --measure: 66ch;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.6 system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

h1, h2, h3 {
    font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

h1 { font-size: 2.25rem; margin: 0 0 .5rem; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.125rem; margin: 0 0 .35rem; }

a { color: var(--signal); }
a:hover { color: var(--ink); }

:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 2px;
}

.masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem clamp(1rem, 5vw, 4rem);
    border-bottom: 1px solid var(--edge);
}

.wordmark {
    font-family: Georgia, serif;
    font-size: 1.25rem;
    color: var(--ink);
    text-decoration: none;
}

.wordmark span { color: var(--signal); }

.masthead nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.masthead nav a { text-decoration: none; color: var(--slate); }
.masthead nav a:hover { color: var(--ink); }

.signout { margin: 0; }

.signout button {
    border: 0;
    background: none;
    color: var(--slate);
    font: inherit;
    cursor: pointer;
    padding: 0;
}

.cta-small {
    border: 1px solid var(--edge);
    border-radius: 4px;
    padding: .35rem .75rem;
}

main { padding: 0 clamp(1rem, 5vw, 4rem) 4rem; }

.hero {
    padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 5vw, 4rem) 3rem;
    max-width: 60ch;
}

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

.lead {
    font-size: 1.125rem;
    color: var(--slate);
    max-width: var(--measure);
}

.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.cta {
    display: inline-block;
    background: var(--signal);
    color: #fff;
    text-decoration: none;
    padding: .7rem 1.2rem;
    border-radius: 4px;
}

.cta:hover { background: var(--ink); color: #fff; }

.cta.ghost {
    background: none;
    color: var(--ink);
    border: 1px solid var(--edge);
}

.page { max-width: 72rem; margin: 0 auto; }
.page.narrow { max-width: var(--measure); }
.page p { max-width: var(--measure); }

.cards {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1px;
    background: var(--edge);
    border: 1px solid var(--edge);
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.cards li { background: var(--paper); padding: 1.5rem; }
.cards h3 a { text-decoration: none; }

.meta { color: var(--slate); font-size: .875rem; }
.price { font-variant-numeric: tabular-nums; }

.icon {
    display: block;
    width: 1.75rem;
    height: 1.75rem;
    margin-bottom: .5rem;
    color: var(--signal);
}

.trust-strip {
    list-style: none;
    margin: 0 0 1rem;
    padding: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    border-top: 1px solid var(--edge);
    border-bottom: 1px solid var(--edge);
    color: var(--slate);
    font-size: .875rem;
}

.trust-strip li { display: flex; align-items: center; gap: .5rem; }
.trust-strip .icon { width: 1.1rem; height: 1.1rem; margin-bottom: 0; flex-shrink: 0; }

.value-props {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.value-props h3 { color: var(--signal); }
.value-props p { color: var(--slate); margin: 0; }

.steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.steps li { display: flex; gap: 1rem; align-items: baseline; }

.step-num {
    font-family: Georgia, serif;
    font-size: 1.75rem;
    color: var(--signal);
    line-height: 1;
}

.steps p { margin: 0; color: var(--slate); }

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

.faq details:first-child { border-top: 1px solid var(--edge); }

.faq summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

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

.faq summary::after {
    content: "+";
    color: var(--signal);
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.faq details[open] summary::after { content: "\2212"; }

.faq details p { margin: .75rem 0 0; color: var(--slate); }

.cta-band {
    text-align: center;
    max-width: none;
    /* Cancel out main's own horizontal padding so the background reaches the viewport edge. */
    margin: 3rem calc(-1 * clamp(1rem, 5vw, 4rem)) 0;
    padding: 3rem clamp(1rem, 5vw, 4rem);
    background: var(--edge);
}

.cta-band .lead { margin: 0 auto 1.5rem; }
.cta-band .hero-actions { justify-content: center; margin-top: 0; }

.lessons { padding-left: 1.25rem; }
.lessons li { margin-bottom: .6rem; }
.lesson-title { display: block; }

.spec { display: grid; grid-template-columns: 12rem 1fr; gap: .5rem 1rem; border-top: 1px solid var(--edge); padding-top: 1rem; }
.spec dt { color: var(--slate); }
.spec dd { margin: 0; }

.notice {
    background: #fdf6f0;
    border-left: 3px solid var(--warn);
    padding: .75rem 1rem;
    margin: 0 0 1.5rem;
    max-width: var(--measure);
}

/* Course player */
.player {
    display: grid;
    grid-template-columns: 16rem 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

@media (max-width: 40rem) {
    .player { grid-template-columns: 1fr; }
}

.lesson-list ol { list-style: none; padding: 0; margin: 0; }
.lesson-list li { padding: .5rem 0; border-bottom: 1px solid var(--edge); }
.lesson-list a { text-decoration: none; }
.lesson-list a.current { color: var(--ink); font-weight: 600; }
.progress-item.locked span { color: var(--slate); }
.progress-item.done a { color: var(--signal); }

.lesson-content { white-space: pre-wrap; max-width: var(--measure); }
.lesson-nav { display: flex; gap: .75rem; margin-top: 2rem; }

/* Bot delivery */
.key-box {
    font-family: ui-monospace, Consolas, "SFMono-Regular", monospace;
    background: var(--edge);
    padding: .75rem 1rem;
    border-radius: 4px;
    word-break: break-all;
}

.badge {
    display: inline-block;
    padding: .25rem .6rem;
    border-radius: 999px;
    font-size: .8125rem;
    color: #fff;
    background: var(--slate);
}

.badge.active { background: var(--signal); }
.badge.past-due { background: #b8842e; }
.badge.canceled { background: var(--warn); }

/* Admin */
.admin-nav { display: flex; gap: 1.25rem; margin-bottom: 1.5rem; }
.table-scroll { overflow-x: auto; }

.admin-table { border-collapse: collapse; width: 100%; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--edge); padding: .6rem .75rem; text-align: left; }
.admin-table th { background: var(--edge); }
.admin-table td a { margin-right: .75rem; }

.field { margin-bottom: 1rem; max-width: var(--measure); }
.field label { display: block; margin-bottom: .25rem; color: var(--slate); }
.field input:not([type="checkbox"]), .field select, .field textarea {
    width: 100%;
    padding: .5rem .6rem;
    border: 1px solid var(--edge);
    border-radius: 4px;
    font: inherit;
}
.field.checkbox label { display: flex; align-items: center; gap: .5rem; }
.field-error { color: var(--warn); font-size: .875rem; }

.cta.danger { background: var(--warn); }
.cta.danger:hover { background: var(--ink); }
button.cta { border: 0; cursor: pointer; font: inherit; }
button.cta[disabled] { background: var(--edge); color: var(--slate); cursor: not-allowed; }

footer {
    border-top: 1px solid var(--edge);
    padding: 2rem clamp(1rem, 5vw, 4rem);
    color: var(--slate);
    font-size: .875rem;
}

footer .risk { max-width: var(--measure); border-left: 3px solid var(--warn); padding-left: .75rem; }
footer .legal { display: flex; gap: 1.25rem; flex-wrap: wrap; }

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