/* Hearth showcase site. Self-hosted fonts (Fraunces for display, Inter for body),
   colours borrowed from the e-paper frame's ink palette. No build step. */

@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('fonts/fraunces-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
    font-family: 'Fraunces';
    font-style: italic;
    font-display: swap;
    font-weight: 100 900;
    src: url('fonts/fraunces-latin-wght-italic.woff2') format('woff2-variations');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
    color-scheme: light;
    --bg: #f6f1e8;
    --paper: #fffdf8;
    --surface: #efe8db;
    --border: #ddd3c2;
    --text-1: #1f1b16;
    --text-2: #5a5146;
    --text-3: #7c7265;
    --indigo: #5e5b91;
    --brick: #d9555b;
    --butter: #fffeb6;
    --amber: #f8b771;
    --green: #5a8d6c;
    --accent: var(--indigo);
    --frame-wood: #3b2f25;
    --frame-wood-hi: #5a4636;
    --shadow: 0 30px 60px -20px rgb(40 28 16 / 0.35), 0 10px 20px -10px rgb(40 28 16 / 0.25);
    --display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --measure: 64ch;
    --gutter: clamp(16px, 4vw, 48px);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        color-scheme: dark;
        --bg: #171411;
        --paper: #211d19;
        --surface: #2a241f;
        --border: #3b342d;
        --text-1: #f3ede3;
        --text-2: #c7bcad;
        --text-3: #9d9284;
        --indigo: #a9a6e0;
        --brick: #f3878b;
        --accent: #b9b6ec;
        --frame-wood: #0d0b09;
        --frame-wood-hi: #2b231c;
        --shadow: 0 30px 60px -20px rgb(0 0 0 / 0.7), 0 10px 20px -10px rgb(0 0 0 / 0.5);
    }
}
:root[data-theme='dark'] {
    color-scheme: dark;
    --bg: #171411;
    --paper: #211d19;
    --surface: #2a241f;
    --border: #3b342d;
    --text-1: #f3ede3;
    --text-2: #c7bcad;
    --text-3: #9d9284;
    --indigo: #a9a6e0;
    --brick: #f3878b;
    --accent: #b9b6ec;
    --frame-wood: #0d0b09;
    --frame-wood-hi: #2b231c;
    --shadow: 0 30px 60px -20px rgb(0 0 0 / 0.7), 0 10px 20px -10px rgb(0 0 0 / 0.5);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text-1);
    font-family: var(--body);
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

a {
    color: var(--accent);
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
}
a:hover {
    text-decoration-thickness: 2px;
}
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

h1,
h2,
h3 {
    font-family: var(--display);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin: 0;
    text-wrap: balance;
}
h2 {
    font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
}
h3 {
    font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
}
p {
    margin: 0;
    text-wrap: pretty;
}
code {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: var(--surface);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

.wrap {
    width: 100%;
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* Small-caps label, like the frame's section headers */
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--indigo);
}
.kicker::before {
    content: '';
    width: 0.6em;
    height: 0.6em;
    background: currentColor;
}

.lede {
    font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
    color: var(--text-2);
    max-width: var(--measure);
}

/* ---------- Header ---------- */
.site-header {
    border-bottom: 1px solid var(--border);
}
.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 64px;
}
.wordmark {
    font-weight: 700;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    font-size: 0.95rem;
    color: var(--text-1);
    text-decoration: none;
}
.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.site-nav a {
    color: var(--text-2);
    text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current='page'] {
    color: var(--text-1);
}
@media (max-width: 560px) {
    .site-nav .nav-optional {
        display: none;
    }
}

/* ---------- Edition line (mirrors the frame's masthead) ---------- */
.edition {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em 0.9em;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--indigo);
}
.edition span {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
}
.edition span::before {
    content: '';
    width: 0.5em;
    height: 0.5em;
    background: currentColor;
}
.edition {
    gap: 0.4em 1.4em;
}

/* ---------- Hero ---------- */
.hero {
    padding-block: clamp(3rem, 6vw, 6rem) clamp(3rem, 7vw, 7rem);
}
.hero .wrap {
    display: grid;
    gap: clamp(2.5rem, 5vw, 4rem);
    align-items: center;
}
@media (min-width: 960px) {
    .hero .wrap {
        grid-template-columns: 0.9fr 1.1fr;
    }
}
.hero h1 {
    font-size: clamp(2.6rem, 1.8rem + 3.2vw, 4.25rem);
    font-weight: 600;
    margin-block: 1.1rem 1.4rem;
}
.hero h1 em {
    font-style: italic;
    font-weight: 500;
    color: var(--indigo);
}
.hero .lede {
    margin-bottom: 2rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.8em 1.3em;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--text-1);
    background: var(--text-1);
    color: var(--bg);
    transition: transform 0.15s ease;
}
.button:hover {
    transform: translateY(-1px);
}
.button.secondary {
    background: transparent;
    color: var(--text-1);
}
.button svg {
    width: 1.1em;
    height: 1.1em;
}

/* A picture frame: wood moulding, white mat, the panel inside. */
.frame {
    position: relative;
    padding: clamp(10px, 2.2vw, 22px);
    background: linear-gradient(145deg, var(--frame-wood-hi), var(--frame-wood) 45%, var(--frame-wood-hi));
    border-radius: 4px;
    box-shadow: var(--shadow);
}
.frame .mat {
    padding: clamp(14px, 3.4vw, 40px);
    background: #fbfaf6;
    box-shadow: inset 0 2px 8px rgb(0 0 0 / 0.18);
}
.frame img {
    width: 100%;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06);
}
.frame.portrait {
    max-width: 440px;
}
.hero-frame {
    margin: 0;
}
.hero-frame figcaption {
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-3);
    text-align: center;
}

/* ---------- Sections ---------- */
section {
    padding-block: clamp(4rem, 8vw, 7rem);
}
section + section {
    border-top: 1px solid var(--border);
}
.section-head {
    display: grid;
    gap: 1rem;
    margin-bottom: clamp(2rem, 4vw, 3.5rem);
    max-width: 760px;
}

/* Three principles */
.principles {
    display: grid;
    gap: clamp(1.5rem, 3vw, 2.5rem);
}
@media (min-width: 760px) {
    .principles {
        grid-template-columns: repeat(3, 1fr);
    }
}
.principle {
    border-top: 3px solid var(--text-1);
    padding-top: 1.25rem;
}
.principle .num {
    font-family: var(--display);
    font-size: 3rem;
    line-height: 1;
    font-weight: 600;
    color: var(--brick);
    margin-bottom: 0.75rem;
}
.principle h3 {
    margin-bottom: 0.6rem;
}
.principle p {
    color: var(--text-2);
}

/* Two modes */
.modes {
    display: grid;
    gap: clamp(2.5rem, 5vw, 3rem);
}
@media (min-width: 860px) {
    .modes {
        grid-template-columns: 1fr 1fr;
    }
}
.mode figure {
    margin: 0 0 1.5rem;
}
.mode h3 {
    margin-bottom: 0.6rem;
}
.mode p {
    color: var(--text-2);
}
.mode .tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.25em 0.7em;
    margin-bottom: 0.8rem;
    background: var(--butter);
    color: #3a3410;
}
.mode .tag.alt {
    background: var(--brick);
    color: #fff;
}

/* Frame theme gallery */
.themes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: clamp(1rem, 2.5vw, 1.75rem);
}
.theme-card {
    margin: 0;
}
.theme-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}
.theme-card img {
    border: 1px solid var(--border);
    border-radius: 3px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.theme-card a:hover img {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.theme-card figcaption {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.theme-card strong {
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 600;
}
.theme-card span {
    font-size: 0.8rem;
    color: var(--text-3);
    text-align: right;
}
.note {
    margin-top: 2rem;
    font-size: 0.95rem;
    color: var(--text-2);
    max-width: var(--measure);
}

/* Paired feature rows: image + text */
.feature-row {
    display: grid;
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
}
.feature-row + .feature-row {
    margin-top: clamp(3.5rem, 7vw, 6rem);
}
@media (min-width: 900px) {
    .feature-row {
        grid-template-columns: 1.3fr 1fr;
    }
    .feature-row.flip > :first-child {
        order: 2;
    }
    .feature-row.flip {
        grid-template-columns: 1fr 1.3fr;
    }
}
.feature-row h3 {
    font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);
    margin-bottom: 1rem;
}
.feature-row p + p {
    margin-top: 1rem;
}
.feature-row p {
    color: var(--text-2);
}

/* Browser-window chrome around dashboard screenshots */
.window {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--paper);
    box-shadow: var(--shadow);
}
.window .bar {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.window .bar i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
}

/* Pure-CSS tabs to flip between dashboard themes */
.tabs input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.tab-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.tab-labels label {
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4em 0.95em;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-2);
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
}
.tab-labels label i {
    width: 0.8em;
    height: 0.8em;
    border-radius: 50%;
    border: 1px solid rgb(0 0 0 / 0.15);
}
.tab-panel {
    display: none;
}
#dash-linen:checked ~ .tab-labels label[for='dash-linen'],
#dash-stone:checked ~ .tab-labels label[for='dash-stone'],
#dash-forest:checked ~ .tab-labels label[for='dash-forest'] {
    background: var(--text-1);
    color: var(--bg);
    border-color: var(--text-1);
}
#dash-linen:checked ~ .tab-panels .p-linen,
#dash-stone:checked ~ .tab-panels .p-stone,
#dash-forest:checked ~ .tab-panels .p-forest {
    display: block;
}
#dash-linen:focus-visible ~ .tab-labels label[for='dash-linen'],
#dash-stone:focus-visible ~ .tab-labels label[for='dash-stone'],
#dash-forest:focus-visible ~ .tab-labels label[for='dash-forest'] {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.phone {
    max-width: 300px;
    margin-inline: auto;
    padding: 10px;
    border-radius: 36px;
    background: #111;
    box-shadow: var(--shadow);
}
.phone img {
    border-radius: 27px;
}

/* Widget list */
.widgets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 0;
    border-top: 1px solid var(--border);
}
.widget {
    padding: 1.25rem 1rem 1.25rem 0;
    border-bottom: 1px solid var(--border);
}
.widget h3 {
    font-family: var(--body);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.widget p {
    font-size: 0.92rem;
    color: var(--text-2);
}
.badge {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.15em 0.55em;
    border-radius: 3px;
    background: var(--surface);
    color: var(--text-2);
}
.badge.frame-badge {
    background: var(--indigo);
    color: #fff;
}
:root[data-theme='dark'] .badge.frame-badge {
    color: #171411;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .badge.frame-badge {
        color: #171411;
    }
}

/* Architecture diagram */
.diagram {
    display: grid;
    gap: 1rem;
    align-items: stretch;
}
@media (min-width: 900px) {
    .diagram {
        grid-template-columns: 1fr auto 1.6fr auto 1fr;
    }
}
.node {
    border: 1px solid var(--border);
    background: var(--paper);
    border-radius: 8px;
    padding: 1.25rem;
}
.node h3 {
    font-family: var(--body);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.node p {
    font-size: 0.9rem;
    color: var(--text-2);
}
.node ul {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.node li {
    font-size: 0.75rem;
    padding: 0.2em 0.6em;
    border-radius: 3px;
    background: var(--surface);
    color: var(--text-2);
}
.node.host {
    border: 2px solid var(--text-1);
}
.arrow {
    display: grid;
    place-items: center;
    color: var(--text-3);
    font-size: 0.75rem;
    text-align: center;
    gap: 0.25rem;
    padding: 0.25rem;
}
.arrow svg {
    width: 28px;
    height: 28px;
}
@media (max-width: 899px) {
    .arrow svg {
        transform: rotate(90deg);
    }
}

/* Stat strip */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    gap: 1.5rem;
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
}
.stat strong {
    display: block;
    font-family: var(--display);
    font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);
    font-weight: 600;
    line-height: 1.1;
}
.stat span {
    font-size: 0.9rem;
    color: var(--text-2);
}

/* Closing call to action */
.cta {
    text-align: center;
}
.cta .wrap {
    display: grid;
    justify-items: center;
    gap: 1.25rem;
}
.cta .lede {
    margin-inline: auto;
}

/* ---------- Build page ---------- */
.page-head {
    padding-block: clamp(3rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem);
}
.page-head h1 {
    font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.25rem);
    margin-block: 1rem 1.25rem;
}
.prose {
    max-width: var(--measure);
}
.prose p + p,
.prose p + ul,
.prose ul + p {
    margin-top: 1rem;
}
.prose p,
.prose li {
    color: var(--text-2);
}
.prose ul {
    padding-left: 1.2em;
    margin: 0;
}
.prose li + li {
    margin-top: 0.4rem;
}
.prose strong {
    color: var(--text-1);
}

.parts {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.part {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.4rem;
    background: var(--paper);
}
.part .role {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brick);
}
.part h3 {
    margin-block: 0.4rem 0.6rem;
}
.part p {
    font-size: 0.95rem;
    color: var(--text-2);
}

.steps {
    counter-reset: step;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 2rem;
    max-width: 820px;
}
.steps > li {
    counter-increment: step;
    display: grid;
    grid-template-columns: 3rem 1fr;
    gap: 0 1rem;
}
.steps > li::before {
    content: counter(step);
    font-family: var(--display);
    font-size: 2.25rem;
    font-weight: 600;
    line-height: 1;
    color: var(--brick);
    grid-row: span 3;
}
.steps h3 {
    margin-bottom: 0.5rem;
}
.steps p {
    color: var(--text-2);
}
pre {
    margin: 0.85rem 0 0;
    padding: 1rem 1.1rem;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.55;
}
pre code {
    background: none;
    padding: 0;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
th,
td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
tr:last-child td {
    border-bottom: 0;
}
th {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
    font-weight: 600;
    background: var(--surface);
}
td {
    color: var(--text-2);
}
td:first-child {
    color: var(--text-1);
    font-weight: 500;
}

.buttons-map {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}
.buttons-map div {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.92rem;
    color: var(--text-2);
}
.buttons-map b {
    flex: none;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--text-1);
    color: var(--bg);
    font-size: 0.85rem;
}

.two-col {
    display: grid;
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
}
@media (min-width: 900px) {
    .two-col {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding-block: 2.5rem;
    font-size: 0.85rem;
    color: var(--text-3);
}
.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
}
.site-footer a {
    color: var(--text-2);
}
