/* ==========================================================================
   douglasdaley.com — design system (from the Figma "douglasdaley.com" file).
   Serif (Source Serif 4) for display + reading; sans (Inter) for the
   furniture (wordmark, nav, dates, metadata, forms, footer). Fonts are
   loaded from Google Fonts in default.hbs. The tokens below are the single
   source of truth and are mirrored onto the MkDocs site.
   ========================================================================== */

:root {
    --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

    --bg: #f9f9f9;          /* page */
    --ink: #1a1c1c;         /* headings, wordmark */
    --body: #5e5e5e;        /* body copy, metadata, excerpts */
    --read: #26282a;        /* long-form reading body (a touch darker for contrast) */
    --hair: #eeeeee;        /* borders, separators, the | and * * * */
    --accent: #000;         /* dividers, link underlines, active nav, button */
    --placeholder: #c7c6c6; /* input placeholder */
    --paper: #fff;          /* input background */

    --measure: 680px;       /* content column (Figma "Main") */
    --gutter: 24px;
}

* { box-sizing: border-box; }

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

body {
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    margin: 0;
    overflow-x: clip; /* contain full-bleed bands; clip preserves sticky header */
}

a { color: inherit; }
img { max-width: 100%; height: auto; }
strong, b { font-weight: 600; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Centred content column, shared by header inner, main, footer inner. */
.wrap {
    width: 100%;
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* --- Header: full-bleed sticky band, blurred; content aligned to column ----- */
.site-head {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(249, 249, 249, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--hair);
}
.site-head__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    max-width: var(--measure);
    margin: 0 auto;
    padding: 12px var(--gutter);
}
.wordmark {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.04em;
    line-height: 1.25;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}
.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    font-family: var(--sans);
    font-size: 16px;
}
.site-nav a {
    color: var(--body);
    font-weight: 600;
    text-decoration: none;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.is-active,
.site-nav a[aria-current="page"] {
    color: var(--ink);
    font-weight: 700;
    border-bottom-color: var(--accent);
}

/* --- Main column ----------------------------------------------------------- */
main.wrap { padding-top: 56px; padding-bottom: 0; }

/* --- Hero (homepage) ------------------------------------------------------- */
.hero { margin: 0 0 64px; }
.hero__title {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(34px, 6.5vw, 48px);
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 0;
}
.hero__sub {
    font-family: var(--serif);
    font-style: italic;
    font-size: 20px;
    line-height: 1.6;
    color: var(--body);
    margin: 8px 0 16px;
}
.hero__rule {
    width: 96px;
    height: 1px;
    border: none;
    background: var(--accent);
    margin: 0;
}

/* --- Essay feed (homepage, tag, author) ------------------------------------ */
.feed { margin: 0; }

.essay { margin: 0; }
.essay__meta {
    font-family: var(--sans);
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--body);
    margin: 0 0 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}
.essay__meta time { font-variant-numeric: tabular-nums; }
.essay__sep { color: var(--hair); }
.essay__cat { color: var(--body); text-decoration: none; }
.essay__cat:hover { color: var(--ink); }

.essay__title {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(26px, 4.5vw, 32px);
    line-height: 1.25;
    margin: 0;
}
.essay__title a { color: var(--ink); text-decoration: none; }
.essay__title a:hover { text-decoration: underline; text-underline-offset: 3px; }

.essay__excerpt {
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.625;
    color: var(--body);
    margin: 8px 0 0;
}
.essay__more { margin: 20px 0 0; }
.essay__more a {
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 1px;
}
.essay__more a:hover { color: var(--body); border-bottom-color: var(--body); }

/* * * * between essays */
.feed__sep {
    font-family: var(--serif);
    color: var(--hair);
    text-align: center;
    letter-spacing: 0.5em;
    margin: 64px 0;
    user-select: none;
}

.pagination {
    font-family: var(--sans);
    font-size: 15px;
    margin-top: 48px;
    display: flex;
    gap: 24px;
}
.pagination a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--accent); }

/* --- Article reading view -------------------------------------------------- */
.post-meta {
    font-family: var(--sans);
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--body);
    margin: 0 0 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}
.post-meta a { color: var(--body); text-decoration: none; }
.post-meta a:hover { color: var(--ink); }
.post-meta .essay__sep { color: var(--hair); }

article > h1 {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(32px, 5.5vw, 44px);
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 0 0 24px;
}
article > img { display: block; margin: 0 0 32px; }

.post-content {
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.7;
    color: var(--read);
}
.post-content > * { margin: 0; }
.post-content > * + * { margin-top: 24px; }
.post-content h2 { font-family: var(--serif); font-weight: 700; font-size: 26px; line-height: 1.25; color: var(--ink); margin-top: 44px; }
.post-content h3 { font-family: var(--serif); font-weight: 600; font-size: 21px; line-height: 1.3; color: var(--ink); margin-top: 34px; }
.post-content blockquote {
    margin-top: 24px; padding-left: 20px;
    border-left: 3px solid var(--hair); color: var(--body); font-style: italic;
}
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content li + li { margin-top: 8px; }
.post-content img { margin: 32px 0; display: block; }
.post-content figcaption { font-family: var(--sans); color: var(--body); font-size: 14px; margin-top: 8px; }
.post-content a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: #bbb; }
.post-content a:hover { text-decoration-color: var(--ink); }
.post-content pre { background: #f0f0ee; padding: 16px 18px; overflow-x: auto; font-size: 14px; line-height: 1.55; border-radius: 2px; }
.post-content code { font-family: ui-monospace, Menlo, Consolas, "Courier New", monospace; font-size: 0.88em; }
.post-content pre code { font-size: inherit; }
.post-content .kg-card,
.post-content .kg-width-wide,
.post-content .kg-width-full { max-width: 100%; }
.post-content .kg-width-wide img, .post-content .kg-width-full img { width: 100%; }

.backlink { font-family: var(--sans); margin-top: 48px; margin-bottom: 80px; font-size: 15px; }
.backlink a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--accent); }

/* --- Subscribe (Ghost members): full-bleed white band, like the footer ----- */
.subscribe {
    margin-top: 64px;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background: var(--paper);
    border-top: 1px solid var(--hair);
}
.subscribe__inner {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 64px var(--gutter);
}
.subscribe__title {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 32px;
    line-height: 1.25;
    color: var(--ink);
    margin: 0 0 8px;
}
.subscribe__sub {
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.6;
    color: var(--body);
    margin: 0 0 24px;
}
.subscribe__form { display: flex; gap: 16px; flex-wrap: wrap; margin: 0; }
.subscribe__input {
    flex: 1 1 auto; min-width: 240px;
    padding: 18px 17px; border: 1px solid var(--accent);
    font-family: var(--sans); font-size: 16px;
    background: var(--paper); color: var(--ink);
    border-radius: 0;
}
.subscribe__input::placeholder { color: var(--placeholder); }
.subscribe__input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.subscribe__btn {
    padding: 18px 33px; border: 1px solid var(--accent);
    background: var(--accent); color: #fff;
    font-family: var(--sans); font-size: 16px; font-weight: 600;
    cursor: pointer; border-radius: 0;
}
.subscribe__btn:hover { background: #222; }
.subscribe__msg { color: #a00; font-size: 13px; flex-basis: 100%; }
.subscribe__ok { display: none; color: #060; font-size: 14px; }
.subscribe__form.success { display: none; }
.subscribe__form.success + .subscribe__ok { display: block; }

/* --- Member auth pages (signin / signup) ----------------------------------- */
.site-head--center .site-head__inner { justify-content: center; }

.auth {
    max-width: 480px;
    margin: 0 auto;
    padding: 96px var(--gutter) 112px;
    text-align: center;
}
.auth__title {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(30px, 5vw, 40px);
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 0 0 12px;
}
.auth__sub {
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.5;
    color: var(--body);
    margin: 0 0 40px;
}
.auth__form { margin: 0; text-align: left; }
.auth__label {
    display: block;
    font-family: var(--sans);
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
    margin: 0 0 8px;
}
.auth__input {
    width: 100%;
    padding: 16px 17px;
    border: 1px solid var(--accent);
    font-family: var(--sans);
    font-size: 16px;
    background: var(--paper);
    color: var(--ink);
    border-radius: 0;
    margin: 0 0 16px;
}
.auth__input::placeholder { color: var(--placeholder); }
.auth__input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.auth__btn {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid var(--accent);
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 0;
}
.auth__btn:hover { background: var(--accent); color: #fff; }
.auth__msg { font-family: var(--sans); color: #a00; font-size: 13px; margin: 12px 0 0; }
.auth__ok {
    display: none;
    font-family: var(--serif);
    font-size: 17px;
    color: var(--ink);
    margin: 20px 0 0;
}
.auth__form.success { display: none; }
.auth__form.success + .auth__ok { display: block; }

.auth__sep {
    font-family: var(--serif);
    color: var(--hair);
    letter-spacing: 0.5em;
    margin: 56px 0;
    user-select: none;
}
.auth__alt { display: flex; flex-direction: column; gap: 14px; }
.auth__alt a {
    font-family: var(--sans);
    font-size: 15px;
    color: var(--body);
    text-decoration: none;
}
.auth__alt a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* --- Membership / signup page ---------------------------------------------- */
.join { padding-top: 8px; }
.join__hero { margin: 0 0 48px; }
.join__title { font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 5vw, 40px); line-height: 1.15; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 14px; }
.join__lede { font-family: var(--serif); font-size: 18px; line-height: 1.6; color: var(--body); margin: 0; max-width: 34rem; }

.join__eyebrow, .tier__eyebrow { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #9c9c9a; margin: 0 0 12px; }

.join__benefit { border: 1px solid var(--hair); padding: 28px; margin: 0 0 40px; background: var(--paper); }
.join__benefit-title { font-family: var(--serif); font-weight: 700; font-size: 24px; color: var(--ink); margin: 0 0 12px; }
.join__benefit-copy { font-family: var(--serif); font-size: 17px; line-height: 1.6; color: var(--body); margin: 0 0 20px; }
.join__list { list-style: none; padding: 0; margin: 0; }
.join__list li { position: relative; padding-left: 26px; font-family: var(--sans); font-size: 14.5px; color: var(--ink); margin: 0 0 10px; }
.join__list li:last-child { margin-bottom: 0; }
.join__list li::before { content: "\2713"; position: absolute; left: 0; top: -1px; color: var(--ink); font-weight: 700; }

.tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 0 0 56px; }
.tier { border: 1px solid var(--hair); padding: 24px 24px 28px; display: flex; flex-direction: column; background: var(--paper); }
.tier--featured { border-style: dashed; border-color: var(--ink); }
.tier__price { font-family: var(--serif); font-weight: 700; font-size: 30px; color: var(--ink); margin: 0 0 12px; }
.tier__per { font-family: var(--sans); font-size: 14px; font-weight: 500; color: #9c9c9a; }
.tier__desc { font-family: var(--serif); font-size: 15.5px; line-height: 1.5; color: var(--body); margin: 0 0 20px; }
.tier__features { list-style: none; padding: 0; margin: 0 0 24px; }
.tier__features li { font-family: var(--sans); font-size: 14px; color: var(--ink); margin: 0 0 10px; font-weight: 500; }
.tier__features li.is-muted { color: #9c9c9a; text-decoration: line-through; font-weight: 400; }
.tier__btn { margin-top: auto; text-align: center; padding: 13px 16px; border: 1px solid var(--accent); font-family: var(--sans); font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink); background: var(--paper); }
.tier__btn:hover { background: var(--accent); color: #fff; }
.tier__btn--solid { background: var(--accent); color: #fff; }
.tier__btn--solid:hover { background: #222; }

.finalize { border-top: 1px solid var(--hair); padding-top: 56px; text-align: center; }
.finalize__title { font-family: var(--serif); font-weight: 700; font-size: 28px; color: var(--ink); margin: 0 0 10px; }
.finalize__sub { font-family: var(--serif); font-size: 17px; line-height: 1.5; color: var(--body); margin: 0 auto 24px; max-width: 30rem; }
.finalize__form { display: flex; flex-direction: column; gap: 16px; max-width: 420px; margin: 0 auto; }
.finalize__input { padding: 16px 17px; border: 1px solid var(--accent); font-family: var(--sans); font-size: 16px; background: var(--paper); color: var(--ink); border-radius: 0; }
.finalize__input::placeholder { color: var(--placeholder); }
.finalize__input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.finalize__btn { padding: 15px 20px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; border-radius: 0; }
.finalize__btn:hover { background: #222; }
.finalize__msg { color: #a00; font-size: 13px; font-family: var(--sans); }
.finalize__ok { display: none; font-family: var(--serif); font-size: 17px; color: var(--ink); margin: 16px 0 0; }
.finalize__form.success { display: none; }
.finalize__form.success + .finalize__ok { display: block; }
.finalize__fine { font-family: var(--sans); font-size: 13px; color: #9c9c9a; margin: 16px 0 0; }
.finalize__fine a { color: var(--body); }

.join__mark { display: flex; align-items: center; justify-content: center; gap: 16px; text-align: center; font-family: var(--sans); font-size: 12px; letter-spacing: 0.25em; text-transform: uppercase; color: #9c9c9a; margin: 64px 0 0; }
.join__mark::before, .join__mark::after { content: ""; height: 1px; width: 48px; background: var(--hair); }

@media (max-width: 600px) {
    .tiers { grid-template-columns: 1fr; }
}

/* --- Flow graph — essays by month, kept as a small cadence datapoint -------- */
.flow { margin: 64px 0 0; overflow-x: auto; }
.flow[aria-hidden="true"] { display: none; }
.flow__cap { font-family: var(--sans); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--body); margin: 0 0 10px; }
.flow__grid { display: flex; gap: 2px; align-items: flex-end; }
.flow__col { display: flex; flex-direction: column-reverse; gap: 2px; }
.flow__cell { width: 10px; height: 10px; background: #e7e7e4; border-radius: 1px; }
.flow__labels { display: flex; gap: 2px; margin-top: 6px; height: 12px; }
.flow__label { width: 10px; font-size: 9px; line-height: 12px; color: var(--body); white-space: nowrap; }
.flow__label--year { color: var(--ink); }

/* --- Footer: full-bleed white band; content aligned to column -------------- */
.site-foot {
    margin-top: 0;
    background: var(--paper);
    border-top: 1px solid var(--hair);
}
.site-foot__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    max-width: var(--measure);
    margin: 0 auto;
    padding: 64px var(--gutter);
}
.site-foot__brand { display: flex; flex-direction: column; gap: 8px; }
.site-foot__name { font-family: var(--sans); font-weight: 600; font-size: 16px; letter-spacing: -0.05em; color: var(--ink); }
.site-foot__copy { font-family: var(--sans); font-size: 14px; letter-spacing: 0.02em; color: var(--body); }
.site-foot__links { display: flex; gap: 24px; font-family: var(--sans); font-size: 14px; letter-spacing: 0.02em; }
.site-foot__links a { color: var(--body); text-decoration: none; }
.site-foot__links a:hover { color: var(--ink); }

/* --- Narrow screens -------------------------------------------------------- */
@media (max-width: 600px) {
    main.wrap { padding-top: 40px; }
    .hero { margin-bottom: 48px; }
    .feed__sep { margin: 48px 0; }
    .site-foot__inner { padding: 40px var(--gutter); }
}
