/* Thanks, Brain — paper-world pages.
   Identity per the product brief: warm off-white paper, ink, system serif,
   generous whitespace, minimal chrome, full dark-mode counterpart. */

:root {
    --paper: #f5f2eb;
    --card: #ffffff;
    --tb-ink: #3b372e;
    --tb-muted: #948f83;
    --rule: rgba(59, 55, 46, 0.14);
    --tb-serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #211e19;
        --card: #2a2620;
        --tb-ink: #e8e3d8;
        --tb-muted: #948f83;
        --rule: rgba(232, 227, 216, 0.16);
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.tb {
    font-family: var(--tb-serif);
    background: var(--paper);
    color: var(--tb-ink);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.tb-wrap {
    max-width: 660px;
    margin: 0 auto;
    padding: 0 1.4rem;
}

.tb a { color: var(--tb-ink); text-underline-offset: 3px; }
.tb a:hover { color: var(--tb-muted); }

/* Hero */
.tb-hero { padding: 4.5rem 0 3.5rem; text-align: center; }

.tb-app-icon {
    width: 120px;
    height: 120px;
    border-radius: 27px; /* iOS-style squircle-ish corner */
    margin: 0 auto 1.6rem;
    box-shadow: 0 6px 24px rgba(59, 55, 46, 0.18);
}

/* iPhone-style bezel around full screenshots */
.tb-frame {
    display: block;
    padding: 9px;
    background: #26221d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 34px;
    box-shadow: 0 12px 38px rgba(38, 34, 29, 0.28);
}

.tb-frame img {
    width: 100%;
    height: auto;
    border-radius: 25px;
    display: block;
}

.tb-hero-shot {
    max-width: 300px;
    margin: 2.8rem auto 0;
}

.tb-wordmark {
    display: block;
    width: min(340px, 82%);
    height: auto;
    margin: 0 auto 1.3rem;
}

.tb-kicker {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--tb-muted);
    margin-bottom: 1rem;
}

.tb-hero h1 {
    font-size: clamp(2.2rem, 6vw, 3.2rem);
    font-weight: 600;
    line-height: 1.15;
    margin-bottom: 1.4rem;
}

.tb-lead {
    font-size: 1.15rem;
    color: var(--tb-ink);
    max-width: 36em;
    margin: 0 auto;
}

.tb-store {
    margin-top: 2.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
}

.tb-badge-wrap { display: inline-block; }

.tb-badge-wrap img { height: 52px; display: block; }

.tb-badge-wrap:hover { opacity: 0.85; }

.tb-coming { font-size: 0.85rem; font-style: italic; color: var(--tb-muted); }

/* Sections */
.tb-section { padding: 2.6rem 0; border-top: 1px solid var(--rule); }

.tb-section h2 { font-size: 1.6rem; font-weight: 600; margin-bottom: 1rem; }

.tb-section-lead { color: var(--tb-muted); margin-bottom: 1.6rem; }

.tb-section p + p { margin-top: 1rem; }

/* Ritual list */
.tb-ritual {
    list-style: none;
    counter-reset: ritual;
    display: grid;
    gap: 0.9rem;
    margin: 1.4rem 0;
}

.tb-ritual li {
    counter-increment: ritual;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 1rem 1.2rem 1rem 3rem;
    position: relative;
    box-shadow: 0 1px 3px rgba(59, 55, 46, 0.06);
}

.tb-ritual li::before {
    content: counter(ritual);
    position: absolute;
    left: 1.1rem;
    top: 1rem;
    font-style: italic;
    color: var(--tb-muted);
}

.tb-ritual li span { font-weight: 600; }

.tb-aside { font-style: italic; color: var(--tb-muted); margin-top: 1.4rem; }

/* Methods */
.tb-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.tb-method {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 1.2rem 1.3rem;
    box-shadow: 0 1px 3px rgba(59, 55, 46, 0.06);
}

.tb-method h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.4rem; }

.tb-method p { font-size: 0.95rem; color: var(--tb-ink); }

/* Gallery */
.tb-gallery {
    display: flex;
    gap: 1.1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.4rem 0.2rem 1rem;
    -webkit-overflow-scrolling: touch;
}

.tb-gallery figure {
    flex: 0 0 auto;
    width: 230px;
    scroll-snap-align: start;
    margin: 0;
}

.tb-gallery .tb-frame {
    padding: 7px;
    border-radius: 28px;
}

.tb-gallery .tb-frame img { border-radius: 21px; }

.tb-gallery figcaption {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--tb-muted);
    text-align: center;
    margin-top: 0.6rem;
}

/* Quote */
.tb-quote {
    font-style: italic;
    font-size: 1.15rem;
    border-left: 2px solid var(--tb-muted);
    padding-left: 1.2rem;
    margin: 1.4rem 0;
    color: var(--tb-ink);
}

/* Closing */
.tb-closing { text-align: center; }

.tb-signoff {
    font-style: italic;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Legal / support pages */
.tb-legal { padding: 3.5rem 0 2rem; }

.tb-legal-mark { display: block; margin-bottom: 2.4rem; }

.tb-legal-mark img { width: 190px; height: auto; display: block; }

.tb-legal h1 { font-size: 2.1rem; font-weight: 600; margin-bottom: 0.4rem; }

.tb-legal-meta { color: var(--tb-muted); font-style: italic; margin-bottom: 2rem; }

.tb-legal h2 { font-size: 1.35rem; font-weight: 600; margin: 2rem 0 0.6rem; }

.tb-legal h3 { font-size: 1.05rem; font-weight: 600; margin: 1.6rem 0 0.4rem; }

.tb-legal p + p { margin-top: 0.8rem; }

.tb-legal ul { margin: 0.8rem 0 0.8rem 1.4rem; }

/* Footer */
.tb-footer {
    border-top: 1px solid var(--rule);
    margin-top: 3rem;
    padding: 2rem 0 2.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--tb-muted);
}

.tb-footer nav { margin-top: 0.6rem; }

.tb-footer a { color: var(--tb-muted); }

.tb-footer a:hover { color: var(--tb-ink); }

@media (max-width: 560px) {
    .tb-methods { grid-template-columns: 1fr; }
}
