/* ttyblog — typewriter / vintage cream paper */

:root {
    --cream: #f4ede0;
    --cream-deep: #ece3d1;
    --rule: #e3d8bf;
    --ink: #1a1714;
    --ink-soft: #2a2520;
    --dim: #7a6f5c;
    --ribbon: #b03a2e;
    --ribbon-dim: #8a2e24;
    --mono: 'Courier Prime', 'JetBrains Mono', ui-monospace, Menlo, monospace;
    --sans: 'Satoshi', ui-sans-serif, system-ui, sans-serif;
}

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

html, body { background: var(--cream); }

body {
    font-family: var(--mono);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.7;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
    position: relative;
    min-height: 100vh;
    /* ruled notebook lines */
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 27px,
        var(--rule) 27px,
        var(--rule) 28px
    );
    background-attachment: fixed;
}

/* paper grain noise */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.1;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.09  0 0 0 0 0.08  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.page {
    position: relative;
    z-index: 2;
    max-width: 860px;
    margin: 0 auto;
    padding: 0 32px;
}

/* nav */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0 20px;
    border-bottom: 1px solid var(--ink);
    margin-bottom: 56px;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.04em;
}
.nav-logo .dot { color: var(--ribbon); }
.nav-right { display: flex; align-items: center; gap: 24px; }
.nav-link {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 4px;
    font-size: 13px;
}
.nav-link:hover { color: var(--ribbon); }
.nav-cta {
    color: var(--cream);
    background: var(--ink);
    padding: 7px 14px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    border: 1px solid var(--ink);
}
.nav-cta:hover { background: var(--ribbon); border-color: var(--ribbon); }

/* hero */
.hero-kicker {
    color: var(--ribbon);
    font-size: 12px;
    letter-spacing: 0.1em;
    font-weight: 500;
    margin-bottom: 28px;
    text-transform: lowercase;
}
.hero-title {
    font-family: var(--mono);
    font-weight: 700;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.25;
    letter-spacing: -0.005em;
    color: var(--ink);
    max-width: 18ch;
    margin-bottom: 28px;
    /* ink spread */
    text-shadow:
        0 0 0.4px rgba(26, 23, 20, 0.8),
        0.3px 0 0.6px rgba(26, 23, 20, 0.4);
}
.hero-title .ink-heavy {
    text-shadow:
        0 0 0.5px rgba(26, 23, 20, 1),
        0.5px 0.1px 0.8px rgba(26, 23, 20, 0.55),
        -0.2px 0 0.4px rgba(176, 58, 46, 0.25);
}
.hero-sub {
    font-size: 15px;
    line-height: 1.85;
    color: var(--ink-soft);
    max-width: 58ch;
    margin-bottom: 36px;
}
.hero-sub a, .prose a, .note a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.hero-sub a:hover, .prose a:hover, .note a:hover { color: var(--ribbon); }

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 64px; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 11px 18px;
    text-decoration: none;
    border: 1px solid var(--ink);
    transition: background 0.12s, color 0.12s;
}
.btn-primary { background: var(--ink); color: var(--cream); }
.btn-primary:hover { background: var(--ribbon); border-color: var(--ribbon); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); }

/* typed page block (hero demo + build output) */
.typed-page {
    background: var(--cream);
    border: 1px solid var(--ink);
    padding: 32px 36px;
    margin-bottom: 20px;
    font-family: var(--mono);
    font-size: 13.5px;
    line-height: 28px; /* aligns with ruled lines */
    color: var(--ink);
    white-space: pre;
    overflow-x: auto;
    position: relative;
    box-shadow: 2px 3px 0 rgba(26, 23, 20, 0.08);
}
.typed-page .rule { color: var(--ink); }
.typed-page .stamp { color: var(--ribbon); }
.typed-page .dim { color: var(--dim); }
.typed-page .ok { color: var(--ribbon); }
.typed-page .sig { color: var(--dim); }
.typed-page .pageno { color: var(--ribbon); }

/* section heads */
.section {
    padding: 64px 0;
    border-top: 1px solid var(--ink);
}
.section:first-of-type { border-top: none; }
.section-label {
    color: var(--ribbon);
    font-size: 11px;
    letter-spacing: 0.12em;
    margin-bottom: 10px;
}
.section-title {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 24px;
    margin-bottom: 28px;
    letter-spacing: -0.005em;
}

/* features */
.features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border: 1px solid var(--ink);
    background: var(--cream);
}
.feature {
    padding: 26px 28px;
    border-right: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
}
.feature:nth-child(2n) { border-right: none; }
.feature:nth-last-child(-n+2) { border-bottom: none; }
.feature-num {
    color: var(--ribbon);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 0.05em;
}
.feature h3 {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: var(--ink);
}
.feature p {
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--ink-soft);
}
.feature code {
    font-family: var(--mono);
    background: var(--cream-deep);
    padding: 1px 5px;
    font-size: 12.5px;
    border: 1px solid var(--rule);
}

/* prose essay */
.prose {
    max-width: 62ch;
}
.prose p {
    font-size: 15px;
    line-height: 28px;
    margin-bottom: 28px;
    color: var(--ink-soft);
}
.prose p .emph {
    color: var(--ink);
    font-weight: 500;
}
.prose .pull {
    border-left: 2px solid var(--ribbon);
    padding-left: 16px;
    color: var(--ink);
    font-weight: 500;
    margin: 28px 0;
}

/* install */
.install-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.index-card {
    background: var(--cream);
    border: 1px solid var(--ink);
    padding: 22px 22px 20px;
    position: relative;
    box-shadow: 2px 2px 0 rgba(26, 23, 20, 0.08);
    /* index-card top red line */
}
.index-card::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 44px;
    height: 1px;
    background: var(--ribbon);
    opacity: 0.5;
}
.index-card h3 {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 24px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 10px;
}
.index-card .soon {
    font-size: 10px;
    font-weight: 500;
    background: var(--ribbon);
    color: var(--cream);
    padding: 2px 6px;
    letter-spacing: 0.1em;
    text-transform: lowercase;
}
.index-card pre {
    background: var(--cream-deep);
    border: 1px solid var(--rule);
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 12.5px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.index-card .note {
    font-size: 12px;
    line-height: 1.65;
    color: var(--dim);
}

/* footer */
.footer {
    margin-top: 40px;
    border-top: 1px solid var(--ink);
    padding: 24px 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    color: var(--dim);
}
.footer a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    margin-left: 18px;
}
.footer a:hover { color: var(--ribbon); }
.footer .errata { color: var(--ribbon); font-style: italic; }

@media (max-width: 720px) {
    .page { padding: 0 20px; }
    .features { grid-template-columns: 1fr; }
    .feature { border-right: none !important; border-bottom: 1px solid var(--ink); }
    .feature:last-child { border-bottom: none; }
    .install-grid { grid-template-columns: 1fr; }
    .footer { flex-direction: column; gap: 10px; align-items: flex-start; }
    .footer a { margin-left: 0; margin-right: 14px; }
    .typed-page { padding: 22px 18px; font-size: 12px; }
}
