/* foldlab — warm lab notebook, paper + ink */

:root {
    --paper: #f5f0e4;
    --paper-2: #ede6d5;
    --paper-3: #e3dcc9;
    --ink: #1a1612;
    --ink-soft: #2b261e;
    --pencil: #6b5e4e;
    --pencil-2: #8b7e6a;
    --teal: #0d6b64;
    --teal-deep: #0a4f4a;
    --forest: #2d5f4a;
    --rust: #a13d3d;
    --rust-soft: #c46262;
    --rule: #c9bfa7;
    --rule-soft: #d8cfb8;
    --panel: #efe8d6;
    --panel-rule: #c9bfa7;
}

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

html, body {
    background: var(--paper);
    color: var(--ink);
    font-family: 'General Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    /* subtle paper texture */
    background-image:
        radial-gradient(circle at 20% 30%, rgba(139, 126, 106, 0.035) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(139, 126, 106, 0.04) 0%, transparent 45%),
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 2px,
            rgba(107, 94, 78, 0.012) 2px,
            rgba(107, 94, 78, 0.012) 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 3px,
            rgba(107, 94, 78, 0.01) 3px,
            rgba(107, 94, 78, 0.01) 4px
        );
    background-color: var(--paper);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

code, pre, .mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ─── nav ─── */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 0 24px;
    border-bottom: 1px solid var(--rule);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Fraunces', serif;
    font-weight: 500;
    font-size: 17px;
    letter-spacing: 0.01em;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 22px;
}

.nav-link {
    color: var(--pencil);
    font-size: 14px;
    transition: color 0.15s;
}
.nav-link:hover { color: var(--teal); }

.nav-cta {
    background: var(--teal);
    color: #fbf8f0;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--teal-deep);
    transition: background 0.15s;
}
.nav-cta:hover { background: var(--teal-deep); }

/* ─── hero ─── */
.hero {
    padding: 80px 0 70px;
    border-bottom: 1px solid var(--rule);
}

.hero-inner {
    max-width: 860px;
}

.hero-kicker, .section-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    letter-spacing: 0.1em;
    text-transform: lowercase;
    color: var(--pencil);
    margin-bottom: 22px;
}

.hero-title {
    font-family: 'Fraunces', serif;
    font-weight: 400;
    font-size: clamp(38px, 6vw, 64px);
    line-height: 1.08;
    letter-spacing: -0.015em;
    color: var(--ink);
    margin-bottom: 28px;
}

.accent {
    color: var(--teal);
    font-style: italic;
    font-weight: 400;
    position: relative;
    white-space: nowrap;
}
.accent::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--rust);
    opacity: 0.7;
}

.hero-sub {
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink-soft);
    max-width: 680px;
    margin-bottom: 32px;
}

.hero-cta-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 52px;
}

.btn {
    display: inline-block;
    padding: 11px 22px;
    font-size: 14.5px;
    font-weight: 500;
    font-family: 'General Sans', sans-serif;
    border: 1px solid transparent;
    transition: all 0.15s;
    cursor: pointer;
    letter-spacing: 0.005em;
}

.btn-primary {
    background: var(--teal);
    color: #fbf8f0;
    border-color: var(--teal-deep);
}
.btn-primary:hover { background: var(--teal-deep); }

.btn-ghost {
    background: transparent;
    color: var(--teal);
    border-color: var(--teal);
}
.btn-ghost:hover {
    background: var(--teal);
    color: #fbf8f0;
}

/* ─── panel (pre block container) ─── */
.panel {
    background: var(--panel);
    border-top: 1px solid var(--panel-rule);
    border-bottom: 1px solid var(--panel-rule);
    padding: 28px 32px;
    margin: 8px 0;
    position: relative;
}

.panel::before, .panel::after {
    content: '';
    position: absolute;
    left: 32px;
    right: 32px;
    height: 1px;
    background: var(--rust);
    opacity: 0.25;
}
.panel::before { top: -1px; border-top: 1px solid var(--rust); opacity: 0; }
.panel::after { display: none; }

pre.demo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.75;
    color: var(--ink);
    overflow-x: auto;
    white-space: pre;
}

.c-cmd { color: var(--rust); font-weight: 500; }
.c-accent { color: var(--teal); }
.c-dim { color: var(--pencil); }
.c-ink { color: var(--ink); }
.c-rust { color: var(--rust); }

.panel-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--pencil-2);
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px dashed var(--rule-soft);
    font-style: italic;
}

/* ─── section common ─── */
section {
    padding: 80px 0;
    border-bottom: 1px solid var(--rule);
}

.section-title {
    font-family: 'Fraunces', serif;
    font-weight: 400;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 44px;
    max-width: 820px;
}

/* ─── demo section ─── */
.demo-section .panel {
    margin-top: 28px;
}

/* ─── features ─── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid var(--rule);
    border-left: 1px solid var(--rule);
}

.feature {
    padding: 32px 28px 34px;
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    background: var(--paper);
    position: relative;
    transition: background 0.18s;
}

.feature:hover {
    background: var(--paper-2);
}

.feature-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--rust);
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}

.feature h3 {
    font-family: 'Fraunces', serif;
    font-weight: 500;
    font-size: 20px;
    line-height: 1.25;
    color: var(--ink);
    margin-bottom: 10px;
    display: inline-block;
    border-bottom: 1px solid transparent;
    transition: border-color 0.18s;
}

.feature:hover h3 {
    border-bottom-color: var(--rust);
}

.feature p {
    font-size: 14.5px;
    line-height: 1.62;
    color: var(--pencil);
}

.feature code {
    font-size: 12.5px;
    background: var(--panel);
    padding: 1px 5px;
    color: var(--ink-soft);
    border: 1px solid var(--rule-soft);
}

/* ─── essay ─── */
.essay {
    padding: 100px 0;
}

.essay-rule {
    width: 80px;
    height: 1px;
    background: var(--rust);
    opacity: 0.6;
}

.essay-body {
    max-width: 680px;
    margin: 0 auto;
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: 19px;
    line-height: 1.72;
    color: var(--ink-soft);
    letter-spacing: 0.003em;
}

.essay-body p {
    margin-bottom: 22px;
    text-indent: 1.8em;
}

.essay-body p:first-child { text-indent: 0; }

.essay-body p:first-child::first-letter {
    font-weight: 500;
    font-size: 1.05em;
    color: var(--ink);
}

.essay-body em {
    font-style: italic;
    color: var(--teal);
}

/* ─── install ─── */
.install-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.install-card {
    background: var(--paper);
    border: 1px solid var(--rule);
    padding: 24px 22px 22px;
    display: flex;
    flex-direction: column;
}

.install-card h3 {
    font-family: 'Fraunces', serif;
    font-weight: 500;
    font-size: 17px;
    color: var(--ink);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--rule);
}

.install-card pre {
    background: var(--panel);
    border-top: 1px solid var(--panel-rule);
    border-bottom: 1px solid var(--panel-rule);
    padding: 12px 14px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--teal-deep);
    overflow-x: auto;
    margin-bottom: 14px;
    white-space: pre;
}

.install-card .note {
    font-size: 13px;
    color: var(--pencil);
    line-height: 1.55;
    font-style: italic;
    margin-top: auto;
}

/* ─── footer ─── */
.footer {
    padding: 40px 0 48px;
    border-bottom: none;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--pencil);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--pencil);
    transition: color 0.15s;
}
.footer-links a:hover {
    color: var(--teal);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--rust);
}

/* ─── responsive ─── */
@media (max-width: 860px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .install-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .page { padding: 0 20px; }
    section { padding: 56px 0; }
    .hero { padding: 56px 0 48px; }
    .feature-grid { grid-template-columns: 1fr; }
    .panel { padding: 20px 18px; }
    pre.demo { font-size: 11.5px; }
    .essay-body { font-size: 17px; }
    .essay-body p { text-indent: 1.3em; }
    .footer-inner { flex-direction: column; gap: 14px; text-align: center; }
}
