/* ---------------------------------------------------------------------
   blog.hush.science — derived from the main hush.science stylesheet but
   trimmed for long-form reading: no hero animations, no big feature
   grids. Same color tokens and type stack so the two sites feel like
   one brand.
   --------------------------------------------------------------------- */

:root {
    --paper: #faf6ee;
    --paper-soft: #f4ebd9;
    --ink: #181614;
    --ink-soft: #4d473f;
    --ink-mute: #7a7268;
    --rule: #e7dcc4;
    --sage: #6b8068;
    --sage-soft: #c5d2bd;
    --peach: #ee8161;
    --peach-soft: #f8c6b3;
    --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    --read: 680px;
    --gutter: clamp(20px, 5vw, 44px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

/* ------------------------------------------------------------------
   Header — same pattern as the main site, slightly compressed.
   ------------------------------------------------------------------ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px var(--gutter);
    background: color-mix(in oklab, var(--paper) 80%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--rule);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--serif);
    font-size: 26px;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.brand img { display: block; }
.brand .blog-tag {
    font-family: var(--sans);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--sage);
    margin-left: 6px;
    border: 1px solid var(--sage-soft);
    border-radius: 999px;
    padding: 3px 8px;
    line-height: 1;
    background: color-mix(in oklab, var(--sage-soft) 25%, transparent);
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 14px;
    color: var(--ink-soft);
    font-weight: 500;
}
/* Keep individual nav links on a single line — even on narrow iPhones,
   "Get Hush" or "All posts"-style labels should never wrap. The header
   is a sticky single-row layout; if it overflows we'd rather the gap
   tighten than the labels stack. */
.site-header nav a { white-space: nowrap; }
@media (max-width: 420px) {
    .site-header nav { gap: 14px; }
    .brand { font-size: 22px; }
    .brand .blog-tag { display: none; }   /* mobile: brand stays compact */
}

.site-header .cta {
    background: var(--ink);
    color: var(--paper);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color .2s ease, transform .2s ease;
}
.site-header .cta:hover {
    background: var(--peach);
    transform: translateY(-1px);
}

/* ------------------------------------------------------------------
   Index page
   ------------------------------------------------------------------ */
.index-hero {
    max-width: var(--read);
    margin: 0 auto;
    padding: clamp(40px, 8vw, 80px) var(--gutter) clamp(24px, 4vw, 48px);
}
.index-hero h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(40px, 6vw, 64px);
    line-height: 1.0;
    letter-spacing: -0.02em;
    margin: 0 0 18px;
}
.index-hero p {
    color: var(--ink-soft);
    font-size: 18px;
    margin: 0;
    max-width: 540px;
}

.posts {
    max-width: var(--read);
    margin: 0 auto;
    padding: 0 var(--gutter) 80px;
    list-style: none;
}
.posts > li {
    border-top: 1px solid var(--rule);
    padding: 28px 0 24px;
}
.posts a.post-link {
    display: block;
    transition: transform .2s ease;
}
.posts a.post-link:hover { transform: translateX(2px); }
.posts time {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--sage);
    font-weight: 500;
}
.posts h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(26px, 3vw, 34px);
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin: 8px 0 10px;
    color: var(--ink);
}
.posts p.summary {
    color: var(--ink-soft);
    font-size: 16px;
    margin: 0;
}
.posts .meta {
    margin-top: 12px;
    font-size: 13px;
    color: var(--ink-mute);
}

/* ------------------------------------------------------------------
   Article
   ------------------------------------------------------------------ */
.article {
    max-width: var(--read);
    margin: 0 auto;
    padding: clamp(40px, 8vw, 80px) var(--gutter) 60px;
}

.article-eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--sage);
    font-weight: 500;
    margin: 0 0 20px;
}

.article h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(38px, 5.5vw, 60px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 20px;
    color: var(--ink);
}
.article h1 em {
    font-style: italic;
    background: linear-gradient(120deg, var(--peach) 0%, var(--sage) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.article .lede {
    font-size: 20px;
    line-height: 1.55;
    color: var(--ink-soft);
    margin: 0 0 12px;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
}

.article .byline {
    font-size: 13px;
    color: var(--ink-mute);
    margin: 0 0 36px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--rule);
}
.article .byline time { font-variant-numeric: tabular-nums; }

.article h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(26px, 3vw, 32px);
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 48px 0 14px;
    color: var(--ink);
}
.article h2 .num {
    color: var(--peach);
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    margin-right: 0.25em;
}

.article h3 {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 16px;
    margin: 28px 0 6px;
    color: var(--ink);
}

.article p {
    margin: 0 0 18px;
    color: var(--ink-soft);
}

.article ul, .article ol {
    margin: 0 0 22px;
    padding-left: 22px;
    color: var(--ink-soft);
}
.article li { margin-bottom: 6px; }

.article strong { color: var(--ink); font-weight: 600; }
.article em { font-style: italic; }

.article a {
    color: var(--peach);
    border-bottom: 1px solid color-mix(in oklab, var(--peach) 40%, transparent);
    transition: border-color .15s ease;
}
.article a:hover { border-bottom-color: var(--peach); }

.article code {
    font-family: var(--mono);
    font-size: 14.5px;
    background: var(--paper-soft);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--ink);
}

.article pre {
    background: var(--paper-soft);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 16px 18px;
    overflow-x: auto;
    margin: 0 0 22px;
}
.article pre code {
    background: none;
    padding: 0;
    font-size: 14px;
    line-height: 1.55;
}

.article blockquote {
    margin: 24px 0;
    padding: 16px 22px;
    border-left: 3px solid var(--sage-soft);
    background: color-mix(in oklab, var(--sage-soft) 14%, transparent);
    color: var(--ink-soft);
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.5;
    border-radius: 0 6px 6px 0;
}

.article figure {
    margin: 30px 0;
}
.article figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--rule);
    background: var(--paper-soft);
}
.article figcaption {
    font-size: 13px;
    color: var(--ink-mute);
    margin-top: 10px;
    text-align: center;
    font-style: italic;
}

/* Setting card — used to highlight a concrete System Settings path. */
.setting-path {
    display: block;
    background: var(--paper-soft);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px 0 18px;
    font-family: var(--mono);
    font-size: 14px;
    color: var(--ink);
}
.setting-path .arrow {
    color: var(--sage);
    margin: 0 6px;
    font-weight: bold;
}

/* "What it costs" tradeoff badge inside a section. */
.tradeoff {
    display: inline-block;
    background: color-mix(in oklab, var(--peach-soft) 50%, transparent);
    color: var(--ink-soft);
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
    margin-bottom: 10px;
}

/* The Hush soft-pitch box. */
.cta-card {
    margin: 56px 0 0;
    padding: 24px 26px;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: color-mix(in oklab, var(--paper-soft) 60%, transparent);
}
.cta-card h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 24px;
    margin: 0 0 8px;
    color: var(--ink);
}
.cta-card p { margin: 0 0 14px; color: var(--ink-soft); }
.cta-card .btn {
    display: inline-block;
    background: var(--ink);
    color: var(--paper);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    transition: background-color .2s ease, transform .2s ease;
}
.cta-card .btn:hover {
    background: var(--peach);
    transform: translateY(-1px);
}

/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */
.site-footer {
    border-top: 1px solid var(--rule);
    padding: 32px var(--gutter) 60px;
    background: color-mix(in oklab, var(--paper-soft) 65%, var(--paper));
}
.footer-inner {
    max-width: var(--read);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.site-footer nav {
    display: flex;
    gap: 22px;
    font-size: 14px;
    color: var(--ink-soft);
}
.fineprint {
    max-width: var(--read);
    margin: 24px auto 0;
    font-size: 13px;
    color: var(--ink-mute);
    text-align: center;
    font-style: italic;
}


/* ====================================================================
   Tier-1 dynamism — same vocabulary as hush.science so the two sites
   feel like one brand. Effects are opt-in via class (.hush-mark-dot,
   .hero-title .word, .magnetic) or a single fixed element (.scroll-
   progress) and all collapse cleanly under prefers-reduced-motion.
   ==================================================================== */

/* 1) Breathing logo dot — same 4.6 s cadence as the homepage. */
.hush-mark .hush-mark-dot {
    transform-box: fill-box;
    transform-origin: center;
    animation: hush-breath 4.6s ease-in-out infinite;
}
@keyframes hush-breath {
    0%, 100% { transform: scale(1);    opacity: 1;    }
    50%      { transform: scale(1.06); opacity: 0.86; }
}

/* 2) Word stagger on hero / article H1 — 70 ms per word, 200 ms head-
   start. The trailing <em> on the article H1 keeps its peach→sage
   gradient because the gradient is applied on .article h1 em, which
   sits inside the .word span we wrap around it. */
.hero-title .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.4em);
    animation: hero-word-rise 0.85s cubic-bezier(.2,.8,.2,1) forwards;
    animation-delay: calc(var(--i, 0) * 70ms + 200ms);
    will-change: transform, opacity;
}
@keyframes hero-word-rise {
    to { opacity: 1; transform: none; }
}

/* 3) Scroll-progress strip — extra useful on the long article. */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--peach);
    transform: scaleX(0);
    transform-origin: left center;
    z-index: 100;
    pointer-events: none;
    will-change: transform;
}
@supports (animation-timeline: scroll()) {
    .scroll-progress {
        animation: scroll-progress-fill linear;
        animation-timeline: scroll(root);
    }
    @keyframes scroll-progress-fill {
        to { transform: scaleX(1); }
    }
}

/* 4) Magnetic CTA — only the big in-article download card. The header
   .cta is sticky and small; magnetism on a sticky button reads as a
   bug while the user scrolls past it, so it stays calm. */
.cta-card .btn.magnetic {
    --mx: 0px;
    --my: 0px;
    --mlift: 0px;
    transform: translate(var(--mx), calc(var(--my) + var(--mlift)));
    transition: transform .35s cubic-bezier(.2,.8,.2,1),
                background-color .25s ease,
                background .25s ease;
}
.cta-card .btn.magnetic:hover {
    --mlift: -1px;
    transition: transform .12s linear,
                background .25s ease;
    /* Override the base `.cta-card .btn:hover { transform: translateY(-1px) }`
       so it doesn't fight our combined translate. */
    transform: translate(var(--mx), calc(var(--my) - 1px));
}

/* 5) Post-card lift — the index list currently slides 2 px right on
   hover; promote that to a small vertical lift so it matches the
   "card lifts off the page" feel of the main site. */
.posts a.post-link:hover {
    transform: translateY(-3px);
}

/* Reduced-motion: every effect snaps to its rest state. The progress
   strip stays at scaleX(0) instead of animating with scroll. */
@media (prefers-reduced-motion: reduce) {
    .hush-mark .hush-mark-dot { animation: none; }
    .hero-title .word { opacity: 1; transform: none; animation: none; }
    .scroll-progress { animation: none; transform: scaleX(0); }
    .cta-card .btn.magnetic,
    .cta-card .btn.magnetic:hover { transform: none; }
    .posts a.post-link, .posts a.post-link:hover { transform: none; }
}
