/* El Clásico del Té — ink on paper, not cloth, not a startup landing. */

:root {
    --paper: #f2ead6;
    --paper-deep: #e7dcc3;
    --ink: #2a2118;
    --ink-soft: #5a4d40;
    --tea: #7c3f28;
    --seal: #9c3b2a;
    --celadon: #5d6a57;
    --rule: #c4b394;
    --rule-strong: #8a7354;
}

html {
    scroll-behavior: smooth;
}

body.site-body {
    background-color: var(--paper);
    color: var(--ink);
    /* Fine paper speckles — not a weave, not linen. */
    background-image:
        radial-gradient(ellipse 80% 50% at 12% -10%, rgba(124, 63, 40, 0.05), transparent 55%),
        radial-gradient(ellipse 70% 40% at 92% 110%, rgba(93, 106, 87, 0.06), transparent 50%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.13  0 0 0 0 0.09  0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.site-brand img {
    filter: sepia(0.5) saturate(0.55) hue-rotate(-8deg) brightness(0.88);
}

.font-display {
    font-family: "EB Garamond", "Noto Serif", "Times New Roman", serif;
}

.font-zh {
    font-family: "Zhi Mang Xing", "Liu Jian Mao Cao", serif;
    font-weight: 400;
}

.font-cha {
    font-family: "Liu Jian Mao Cao", "Zhi Mang Xing", serif;
    font-weight: 400;
}

.kicker {
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--tea);
}

.section-title {
    font-weight: 600;
    letter-spacing: 0.02em;
    text-align: center;
}

.section-title::after {
    content: "";
    display: block;
    width: 3.5rem;
    height: 1px;
    margin: 0.85rem auto 0;
    background: var(--rule-strong);
}

.rule-top {
    border-top: 1px solid var(--rule);
    box-shadow: 0 -1px 0 var(--paper), 0 -2px 0 var(--rule);
}

.rule-bottom {
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 1px 0 var(--paper), 0 2px 0 var(--rule);
}

.plate {
    background: rgba(255, 251, 242, 0.55);
    border: 1px solid var(--rule);
    box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--rule);
    padding: 1.75rem;
}

.btn-ink,
.btn-ghost {
    display: inline-block;
    padding: 0.7rem 1.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-ink {
    background: var(--ink);
    color: var(--paper);
    border: 1px solid var(--ink);
}

.btn-ink:hover {
    background: var(--tea);
    border-color: var(--tea);
    color: var(--paper);
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--ink);
}

.btn-ghost:hover {
    background: var(--ink);
    color: var(--paper);
}

.site-header {
    padding-top: 1.25rem;
    padding-bottom: 1rem;
}

.site-nav a {
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: var(--ink-soft);
}

.site-nav a:hover,
.site-nav a.is-active {
    color: var(--ink);
}

.site-brand {
    letter-spacing: 0.04em;
}

.watermark {
    position: absolute;
    left: 6%;
    top: 5.5rem;
    font-size: clamp(8rem, 22vw, 16rem);
    line-height: 0.85;
    color: var(--tea);
    opacity: 0.16;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.book-plate {
    border: 1px solid var(--rule-strong);
    box-shadow: 8px 10px 0 rgba(42, 33, 24, 0.08);
    background: var(--paper-deep);
}

.book-plate img {
    display: block;
    width: 100%;
    height: auto;
}

.milestone-mark {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--ink);
    background: var(--paper);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.milestone-mark.is-current {
    background: var(--ink);
    color: var(--paper);
}

.milestone-mark.is-done {
    border-color: var(--celadon);
    color: var(--celadon);
}

.portrait {
    width: 8rem;
    height: 8rem;
    object-fit: cover;
    border: 1px solid var(--rule-strong);
    background: var(--paper-deep);
}

.quote {
    border-left: 2px solid var(--tea);
    padding-left: 1rem;
    font-style: italic;
    color: var(--ink-soft);
}

.field input,
.field textarea,
.field select {
    width: 100%;
    background: rgba(255, 251, 242, 0.7);
    border: 1px solid var(--rule-strong);
    border-radius: 0;
    color: var(--ink);
    padding: 0.65rem 0.8rem;
    box-shadow: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--tea);
    box-shadow: 0 0 0 1px var(--tea);
}

.flash {
    border: 1px solid var(--rule-strong);
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 251, 242, 0.7);
}

.flash-error { border-color: var(--seal); color: var(--seal); }
.flash-success { border-color: var(--celadon); color: var(--celadon); }
.flash-warning { border-color: var(--rule-strong); }

.colophon {
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.68rem;
    color: var(--ink-soft);
}

#mobileNav[hidden] {
    display: none;
}

/* Status page — a little more organic than the letterpress plates. */
.status-timeline {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0.25rem 0 0.5rem;
}

.status-timeline::before {
    content: "";
    position: absolute;
    left: 0.35rem;
    top: 1.6rem;
    bottom: 1.6rem;
    width: 42px;
    background-repeat: no-repeat;
    background-size: 42px 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='900' viewBox='0 0 42 900' preserveAspectRatio='none'%3E%3Cpath d='M21 0 C 6 90 36 170 18 260 S 4 420 24 510 S 38 650 16 740 S 8 840 21 900' fill='none' stroke='%238a7354' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
    opacity: 0.62;
    pointer-events: none;
}

.status-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1.35rem;
    margin-bottom: 1.65rem;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-mark {
    position: relative;
    z-index: 1;
    flex: 0 0 2.35rem;
    width: 2.35rem;
    height: 2.35rem;
    margin-top: 0.85rem;
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    background: var(--paper);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
}

.status-mark.is-done {
    border-color: var(--celadon);
    color: var(--paper);
    background: var(--celadon);
}

.status-mark.is-current {
    background: var(--tea);
    border-color: var(--tea);
    color: var(--paper);
    box-shadow: 0 0 0 7px rgba(124, 63, 40, 0.14);
}

.status-chip {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 0.28rem 0.7rem 0.22rem;
    border-radius: 999px;
    line-height: 1.2;
}

.status-item.is-current .status-chip {
    background: rgba(124, 63, 40, 0.14);
    color: var(--tea);
}

.status-item.is-done .status-chip {
    background: rgba(93, 106, 87, 0.16);
    color: var(--celadon);
}

.status-card {
    position: relative;
    flex: 1;
    max-width: 36rem;
    background:
        radial-gradient(ellipse 80% 60% at 8% 8%, rgba(124, 63, 40, 0.07), transparent 56%),
        radial-gradient(ellipse 55% 50% at 92% 88%, rgba(93, 106, 87, 0.06), transparent 60%),
        rgba(255, 251, 242, 0.82);
    border: 1px solid rgba(138, 115, 84, 0.4);
    border-radius: 2.8rem 4.4rem 2.2rem 3.6rem;
    padding: 1.55rem 1.85rem 1.4rem;
    box-shadow: 0 14px 32px rgba(42, 33, 24, 0.05);
}

.status-card::after {
    content: "";
    position: absolute;
    right: -0.7rem;
    top: -0.85rem;
    width: 4.8rem;
    height: 2.6rem;
    background: rgba(124, 63, 40, 0.05);
    border-radius: 70% 40% 60% 50%;
    pointer-events: none;
}

.status-item:nth-child(even) .status-card {
    border-radius: 4.2rem 2.1rem 3.8rem 2.4rem;
    max-width: 33.5rem;
}

.status-item:nth-child(even) .status-card::after {
    right: auto;
    left: -0.55rem;
    top: auto;
    bottom: -0.7rem;
    width: 5.4rem;
    height: 3rem;
    background: rgba(93, 106, 87, 0.06);
}

.status-item:nth-child(3n) .status-card {
    border-radius: 2.2rem 3.9rem 3.1rem 4.6rem;
}

.status-item.is-current .status-card {
    background:
        radial-gradient(ellipse 90% 75% at 86% 12%, rgba(124, 63, 40, 0.16), transparent 54%),
        #f8efe0;
    border-color: rgba(124, 63, 40, 0.48);
}

.status-item.is-current .status-card::after {
    background: rgba(124, 63, 40, 0.12);
}

.status-item.is-current .kicker {
    color: var(--tea);
}

.status-item.is-done .status-card {
    background:
        radial-gradient(ellipse 80% 65% at 10% 12%, rgba(93, 106, 87, 0.14), transparent 58%),
        #eef1e4;
    border-color: rgba(93, 106, 87, 0.38);
}

.status-item.is-done .status-card::after {
    background: rgba(93, 106, 87, 0.12);
}

.status-item.is-done .kicker,
.status-item.is-done .status-meta {
    color: #4f5c4a;
}

.status-item.is-done h3 {
    color: #3d4a38;
}

.status-card-empty {
    padding: 2rem 1.75rem;
}

.status-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.92rem;
    font-style: italic;
    color: var(--ink-soft);
}

.status-cta {
    background:
        radial-gradient(ellipse 85% 75% at 50% 35%, rgba(255, 251, 242, 0.96), rgba(231, 220, 195, 0.55) 72%);
    border: 1px solid rgba(138, 115, 84, 0.38);
    border-radius: 3rem 2.2rem 2.8rem 2.4rem;
    padding: 2rem 1.75rem 1.85rem;
}

@media (min-width: 640px) {
    .status-item:nth-child(even) {
        transform: translateX(0.45rem);
    }

    .status-item:nth-child(odd) {
        transform: translateX(-0.15rem);
    }

    .status-cta {
        padding: 2.15rem 2.4rem 2rem;
    }
}

.chapters-dialog {
    background: rgba(42, 33, 24, 0.48);
}

.chapters-sheet {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 46rem;
    max-height: 85vh;
    overflow: hidden;
    background:
        radial-gradient(ellipse 70% 50% at 8% 0%, rgba(124, 63, 40, 0.08), transparent 55%),
        radial-gradient(ellipse 55% 45% at 96% 100%, rgba(93, 106, 87, 0.08), transparent 50%),
        #f8f2e4;
    border: 1px solid rgba(138, 115, 84, 0.42);
    border-radius: 2.4rem 3.6rem 2.1rem 3.2rem;
    box-shadow: 0 22px 48px rgba(42, 33, 24, 0.16);
}

.chapters-head,
.chapters-foot {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    padding: 1.25rem 1.5rem 1.1rem;
}

.chapters-head {
    background: radial-gradient(ellipse 80% 90% at 20% 0%, rgba(124, 63, 40, 0.06), transparent 60%);
}

.chapters-foot {
    justify-content: flex-end;
    align-items: center;
    padding-top: 0.85rem;
    padding-bottom: 1.15rem;
}

.chapters-close {
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(138, 115, 84, 0.45);
    border-radius: 50%;
    background: rgba(255, 251, 242, 0.7);
    color: var(--ink-soft);
    font-size: 1.25rem;
    line-height: 1;
}

.chapters-close:hover {
    color: var(--ink);
    border-color: var(--ink);
}

.chapters-list {
    overflow-y: auto;
    padding: 0.15rem 1.35rem 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.chapter-slip {
    display: flex;
    align-items: flex-start;
    gap: 0.95rem;
    padding: 0.95rem 1.15rem 0.9rem;
    border: 1px solid transparent;
}

.chapter-slip:nth-child(3n+1) {
    background:
        radial-gradient(ellipse 80% 70% at 90% 10%, rgba(124, 63, 40, 0.1), transparent 55%),
        #f8efe0;
    border-color: rgba(124, 63, 40, 0.28);
    border-radius: 1.8rem 2.8rem 1.5rem 2.4rem;
}

.chapter-slip:nth-child(3n+2) {
    background:
        radial-gradient(ellipse 75% 65% at 8% 15%, rgba(93, 106, 87, 0.12), transparent 56%),
        #eef1e4;
    border-color: rgba(93, 106, 87, 0.3);
    border-radius: 2.6rem 1.5rem 2.5rem 1.7rem;
}

.chapter-slip:nth-child(3n) {
    background:
        radial-gradient(ellipse 70% 60% at 88% 85%, rgba(138, 115, 84, 0.14), transparent 55%),
        #f4ecda;
    border-color: rgba(138, 115, 84, 0.38);
    border-radius: 1.6rem 2.4rem 2.1rem 2.9rem;
}

.chapter-mark {
    flex: 0 0 2.1rem;
    width: 2.1rem;
    height: 2.1rem;
    margin-top: 0.15rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--paper);
}

.chapter-slip:nth-child(3n+1) .chapter-mark {
    background: var(--tea);
}

.chapter-slip:nth-child(3n+2) .chapter-mark {
    background: var(--celadon);
}

.chapter-slip:nth-child(3n) .chapter-mark {
    background: var(--rule-strong);
}

.chapter-body p {
    color: var(--ink-soft);
}

.chapter-slip:nth-child(3n+1) .font-zh {
    color: var(--tea);
}

.chapter-slip:nth-child(3n+2) .font-zh {
    color: var(--celadon);
}

.chapter-slip:nth-child(3n) .font-zh {
    color: #6f5b40;
}
