/* ==========================================================================
   see-your-business: Ghost theme for blog.seeyourbusiness.online
   Signal design system, same as the main site (en-project-portfolio, docs/design-system.md): light grey
   ground, near-black ink, one electric blue accent, Funnel Display / Funnel Sans / Geist Mono.
   ========================================================================== */

/* ---------- Tokens ----------
   Copied from the main site's src/styles/tokens.css (there inside Tailwind's @theme; here plain custom
   properties). Change them there first, then copy. */
:root {
    color-scheme: light;
    --color-bg: #ecece8;
    --color-fg: #0e0e10;
    --color-muted: #5e5e64;
    --color-card: #f7f7f4;
    --color-line: rgb(14 14 16 / 0.12);
    --color-accent: #3d2bff;
    --color-accent-fg: #ffffff;
    --color-inverse: #0e0e10;
    --color-inverse-fg: #efefeb;
    --color-inverse-muted: #8e8e95;
    --color-accent-inverse: #9a91ff;
    --color-danger: #d93a2b;

    --text-display: clamp(46px, 8.4vw, 128px);
    --text-h2: clamp(36px, 5.6vw, 76px);
    --text-h3: clamp(26px, 3.2vw, 44px);
    --text-lead: clamp(16px, 1.4vw, 19px);
    --tracking-display: -0.045em;

    --radius-card: 18px;
    --radius-panel: 28px;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-press: 160ms;
    --duration-hover: 300ms;
    --duration-enter: 1000ms;

    --font-display: var(--gh-font-heading, "Funnel Display", sans-serif);
    --font-body: var(--gh-font-body, "Funnel Sans", sans-serif);
    --font-mono: "Geist Mono", ui-monospace, monospace;

    /* theme-only layout values */
    --gutter: clamp(16px, 4vw, 40px);
    --measure: 680px;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --color-bg: #0d0d10;
    --color-fg: #ededea;
    --color-muted: #9a9aa2;
    --color-card: #16161a;
    --color-line: rgb(255 255 255 / 0.1);
    --color-accent: #8478ff;
    --color-accent-fg: #0d0d10;
    --color-inverse: #18181d;
    --color-inverse-fg: #ededea;
    --color-inverse-muted: #9a9aa2;
    --color-accent-inverse: #a49cff;
    --color-danger: #ff6b5b;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        color-scheme: dark;
        --color-bg: #0d0d10;
        --color-fg: #ededea;
        --color-muted: #9a9aa2;
        --color-card: #16161a;
        --color-line: rgb(255 255 255 / 0.1);
        --color-accent: #8478ff;
        --color-accent-fg: #0d0d10;
        --color-inverse: #18181d;
        --color-inverse-fg: #ededea;
        --color-inverse-muted: #9a9aa2;
        --color-accent-inverse: #a49cff;
        --color-danger: #ff6b5b;
    }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
    background: var(--color-bg);
    color: var(--color-fg);
    font-family: var(--font-body);
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}
body { margin: 0; min-height: 100vh; background: var(--color-bg); overflow-x: clip; }
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ol, ul, figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: var(--tracking-display); text-wrap: balance; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--color-accent); color: var(--color-accent-fg); }

/* Ghost's Portal and search popups are transparent iframes with light pages inside; on a dark page Chrome
   paints an opaque backdrop behind any iframe whose color-scheme is not "light". */
iframe { color-scheme: light; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--color-fg); color: var(--color-bg); }
.skip:focus { top: 12px; }

.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.site-main { display: block; min-height: 60vh; }
.muted { color: var(--color-muted); }
.lead { font-size: var(--text-lead); color: var(--color-muted); max-width: 46ch; }
.meta { font: 500 12px/1.5 var(--font-mono); color: var(--color-muted); font-variant-numeric: tabular-nums; }
.meta a { color: var(--color-fg); text-decoration: underline; text-decoration-color: var(--color-line); text-underline-offset: 3px; }
@media (hover: hover) { .meta a:hover { color: var(--color-accent); } }

/* ---------- Buttons (site .btn) ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 44px; padding: 12px 22px;
    border-radius: 999px; border: 1px solid transparent;
    font: 600 15px/1.2 var(--font-body);
    white-space: nowrap; cursor: pointer;
    transition: transform var(--duration-press) var(--ease-out), background-color var(--duration-hover), border-color var(--duration-hover), color var(--duration-hover);
}
.btn:active { transform: scale(0.97); }
.btn-accent { background: var(--color-accent); color: var(--color-accent-fg); }
.btn-ghost { background: transparent; border-color: var(--color-line); color: var(--color-fg); }
.btn-arrow {
    display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: -10px;
    border-radius: 50%; background: var(--color-accent-fg); color: var(--color-accent); font-size: 14px;
    transition: transform var(--duration-hover) var(--ease-out);
}
@media (hover: hover) {
    .btn-ghost:hover { border-color: var(--color-fg); }
    .btn:hover .btn-arrow { transform: rotate(-45deg); }
}
.icon-btn {
    position: relative; flex: none; display: inline-grid; place-items: center;
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--color-line);
    color: var(--color-fg); cursor: pointer;
    transition: border-color var(--duration-hover) ease, transform var(--duration-press) var(--ease-out);
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (hover: hover) { .icon-btn:hover { border-color: var(--color-fg); } }
.text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--color-fg); text-decoration: underline; text-decoration-color: var(--color-line); text-underline-offset: 4px; }
@media (hover: hover) { .text-link:hover { text-decoration-color: currentColor; } }

/* theme toggle: moon in light mode, sun in dark mode; the icons swap with a turn (site Nav) */
.theme-btn svg { position: absolute; inset: 0; margin: auto; transition: opacity 400ms var(--ease-out), transform 600ms var(--ease-spring); }
.theme-btn .i-moon { fill: currentColor; stroke: none; }
.theme-btn .i-sun { opacity: 0; transform: rotate(-90deg) scale(0.5); }
:root[data-theme="dark"] .theme-btn .i-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
:root[data-theme="dark"] .theme-btn .i-sun { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .theme-btn .i-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
    :root:not([data-theme]) .theme-btn .i-sun { opacity: 1; transform: none; }
}

/* ---------- Nav: floating pill with Liquid Glass (the main site's Nav.astro) ----------
   The glass is its own layer (.nav-glass): never put opacity, filter, mask or clip-path on an ancestor of it,
   or the backdrop goes blank. Chromium adds SVG refraction (.is-refractive, main.js); Safari and Firefox keep
   the frosted surface. Unlike the site, the glass shows from the top of the page. */
@property --glass-angle { syntax: "<angle>"; inherits: true; initial-value: 135deg; }
.nav { position: fixed; inset: 0 0 auto; z-index: 50; padding: 14px clamp(12px, 3vw, 28px); pointer-events: none; }
.nav-in { position: relative; pointer-events: auto; max-width: 1240px; margin: 0 auto; border-radius: 999px; transition: max-width 600ms var(--ease-out); }
.nav.is-scrolled .nav-in, .nav.is-open .nav-in { max-width: 940px; }
.nav-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 20px; }
.glass-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.nav-glass, .nav-panel {
    background-color: rgb(255 255 255 / 0.24);
    backdrop-filter: blur(14px) saturate(1.8) brightness(1.08);
    -webkit-backdrop-filter: blur(14px) saturate(1.8) brightness(1.08);
    box-shadow:
        inset 1.5px 1.5px 1px -1px rgb(255 255 255 / 0.9),
        inset -1.5px -1.5px 1px -1px rgb(255 255 255 / 0.55),
        inset 0 0 10px rgb(255 255 255 / 0.22),
        inset 0 -10px 18px -14px rgb(255 255 255 / 0.35),
        0 10px 28px -12px rgb(14 14 16 / 0.22),
        0 1px 3px rgb(14 14 16 / 0.08);
    transition: background-color 400ms ease, box-shadow 400ms ease;
}
.nav-glass {
    position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    animation: glass-in 500ms var(--ease-out) both;
}
@keyframes glass-in { from { opacity: 0; transform: scale(0.98); } }
.nav-glass.is-refractive { backdrop-filter: blur(5px) url(#nav-liquid-glass) saturate(1.8) brightness(1.08); }
/* specular rim: a bright edge whose highlight follows the pointer around the glass */
.nav-glass::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
    background: conic-gradient(from var(--glass-angle), rgb(255 255 255 / 1), rgb(255 255 255 / 0.18) 16%, rgb(255 255 255 / 0) 30%, rgb(255 255 255 / 0.55) 50%, rgb(255 255 255 / 0) 70%, rgb(255 255 255 / 0.18) 84%, rgb(255 255 255 / 1));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    transition: --glass-angle 300ms var(--ease-out);
}
/* vibrancy: a soft light halo keeps the labels legible over busy art seen through the clear glass */
.nav :is(.logo, .nav-links a) { text-shadow: 0 0 2px rgb(255 255 255 / 0.9), 0 0 12px rgb(255 255 255 / 0.85); }

/* dark theme: the dark-tone glass of the site */
:root[data-theme="dark"] .nav-glass { background-color: rgb(255 255 255 / 0.06); box-shadow: inset 1.5px 1.5px 1px -1px rgb(255 255 255 / 0.75), inset -1.5px -1.5px 1px -1px rgb(255 255 255 / 0.4), inset 0 0 12px rgb(255 255 255 / 0.08), 0 10px 28px -12px rgb(0 0 0 / 0.5); }
:root[data-theme="dark"] .nav-glass.is-refractive { backdrop-filter: blur(3px) url(#nav-liquid-glass) saturate(1.6) brightness(0.92); }
:root[data-theme="dark"] .nav :is(.logo, .nav-links a) { text-shadow: 0 1px 8px rgb(0 0 0 / 0.35); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .nav-glass { background-color: rgb(255 255 255 / 0.06); box-shadow: inset 1.5px 1.5px 1px -1px rgb(255 255 255 / 0.75), inset -1.5px -1.5px 1px -1px rgb(255 255 255 / 0.4), inset 0 0 12px rgb(255 255 255 / 0.08), 0 10px 28px -12px rgb(0 0 0 / 0.5); }
    :root:not([data-theme]) .nav-glass.is-refractive { backdrop-filter: blur(3px) url(#nav-liquid-glass) saturate(1.6) brightness(0.92); }
    :root:not([data-theme]) .nav :is(.logo, .nav-links a) { text-shadow: 0 1px 8px rgb(0 0 0 / 0.35); }
}
@media (prefers-reduced-transparency: reduce) {
    .nav-glass, .nav-glass.is-refractive, .nav-panel { backdrop-filter: none; -webkit-backdrop-filter: none; background-color: var(--color-card); }
}


.logo { display: inline-flex; align-items: baseline; gap: 8px; margin-right: auto; font: 600 20px var(--font-display); letter-spacing: -0.05em; white-space: nowrap; text-transform: lowercase; }
.logo em, .ft-mark em { font-style: normal; color: var(--color-accent); }
.logo-tag { font: 500 11px/1 var(--font-mono); letter-spacing: 0; text-transform: uppercase; padding: 5px 8px; border: 1px solid var(--color-line); border-radius: 999px; color: var(--color-muted); }
.nav-links { display: flex; gap: 2px; margin-right: 6px; font-size: 14px; font-weight: 500; }
.nav-links a { padding: 8px 14px; border-radius: 999px; transition: background-color 200ms ease; }
.nav-links a[aria-current="page"] { background: color-mix(in srgb, var(--color-fg) 9%, transparent); }
@media (hover: hover) { .nav-links a:hover { background: color-mix(in srgb, var(--color-fg) 6%, transparent); } }
.nav-cta { min-height: 40px; padding: 10px 18px; font-size: 14px; }

.menu-btn { display: none; position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--color-line); cursor: pointer; }
.menu-btn span { position: absolute; left: 12px; right: 12px; height: 1.6px; border-radius: 2px; background: currentColor; transition: transform var(--duration-hover) var(--ease-out); }
.menu-btn span:first-child { top: 15px; }
.menu-btn span:last-child { bottom: 15px; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.7px) rotate(-45deg); }
.nav-panel {
    pointer-events: auto; max-width: 940px; margin: 8px auto 0; padding: 12px; border-radius: var(--radius-panel);
    display: grid; gap: 12px;
}
/* the menu sits over page text: nearly opaque so the links stay legible */
.nav-panel { background-color: color-mix(in srgb, var(--color-card) 94%, transparent); }
.nav-panel nav { display: grid; }
.nav-panel nav a { padding: 12px; border-bottom: 1px solid var(--color-line); font: 500 22px/1.2 var(--font-display); letter-spacing: -0.03em; }
.nav-panel nav a:last-child { border-bottom: 0; }

@media (max-width: 900px) {
    .nav-links, .nav-cta { display: none; }
    .menu-btn { display: inline-block; }
}
@media (min-width: 901px) { .nav-panel { display: none !important; } }
@media (max-width: 420px) { .logo-tag { display: none; } }

/* ---------- Hero (the main site's Hero.astro) ---------- */
.hero { position: relative; min-height: min(920px, 100svh); display: grid; align-items: end; padding-top: 120px; overflow: hidden; }
.hero-art {
    position: absolute; inset: 0 0 0 36%; z-index: 0;
    /* fades out near the top so the art never sits behind the header text */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent 70px, #000 190px);
    mask-image: linear-gradient(to bottom, transparent 0, transparent 70px, #000 190px);
}
.hero-art canvas { width: 100%; height: 100%; display: block; }
.hero-in { position: relative; z-index: 1; width: 100%; padding-bottom: clamp(36px, 6vw, 72px); }
.hero-title { font-size: var(--text-display); line-height: 0.92; max-width: 14ch; }
.em { color: var(--color-accent); }
.hero-row { display: flex; flex-wrap: wrap; gap: 28px 48px; align-items: flex-end; justify-content: space-between; margin-top: 34px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* words rise in from a mask (main.js splits the title); the intro follows */
.split-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split-word > span { display: inline-block; }

/* scroll-driven exit: the art sinks and fades, the text drifts up (CSS timelines, off the main thread) */
@supports (animation-timeline: view()) {
    .hero-art { animation: hero-art-out linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
    .hero-title, .hero-row > div:first-child { animation: hero-in-out linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
    .scroll-cue { animation: scroll-cue-out linear both; animation-timeline: scroll(root); animation-range: 0px 240px; }
}
@keyframes hero-in-out { to { transform: translateY(-12%); opacity: 0.15; } }
@keyframes hero-art-out { to { transform: translateY(18%) scale(0.92); opacity: 0.25; } }
@keyframes scroll-cue-out { to { opacity: 0; } }

/* scroll cue: a light runs down the line three times, then rests */
.scroll-cue {
    position: absolute; left: 50%; bottom: 18px; z-index: 1; translate: -50% 0;
    display: grid; justify-items: center; gap: 8px;
    font: 500 10px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-muted);
}
.scroll-cue-line { position: relative; width: 1px; height: 40px; overflow: hidden; background: var(--color-line); }
.scroll-cue-line i { position: absolute; inset: 0; background: var(--color-fg); transform: translateY(-100%); animation: scroll-cue-run 1800ms var(--ease-in-out) 1600ms 3; }
@keyframes scroll-cue-run { to { transform: translateY(100%); } }

@media (max-width: 900px) {
    .hero { align-items: start; min-height: 0; padding-bottom: 46vw; }
    .scroll-cue { display: none; }
    .hero-art { inset: auto 0 0 0; height: 62vw; }
}

/* ---------- Lists ---------- */
.home-posts { padding-block: 40px 24px; }
.section-title { font-size: var(--text-h3); line-height: 1.02; margin-bottom: 28px; }
.page-head { padding-block: clamp(130px, 16vw, 180px) 32px; display: grid; gap: 14px; }
.page-title { font-size: var(--text-h2); line-height: 0.98; }
.author-head { grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.author-head > div { display: grid; gap: 12px; }
.av { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--color-card); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding-block: 8px 24px; }
.card {
    position: relative; display: flex; flex-direction: column;
    background: var(--color-card); border: 1px solid var(--color-line); border-radius: var(--radius-card);
    overflow: hidden;
    transition: transform var(--duration-hover) var(--ease-out), border-color var(--duration-hover);
}
.card-img img, .cover-type { width: 100%; aspect-ratio: 1600 / 840; object-fit: cover; }
.card-body { display: grid; gap: 10px; padding: 20px 24px 24px; }
.card-title { font-size: 22px; line-height: 1.12; letter-spacing: -0.03em; }
/* the title link covers the whole card */
.card-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-ex { color: var(--color-muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-arrow {
    position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 34px; height: 34px;
    border-radius: 50%; background: var(--color-accent); color: var(--color-accent-fg); font-size: 15px;
    opacity: 0; transform: scale(0.6) rotate(-45deg);
    transition: opacity var(--duration-hover) var(--ease-out), transform var(--duration-hover) var(--ease-spring);
}
@media (hover: hover) {
    .card:hover { transform: translateY(-6px); border-color: var(--color-fg); }
    .card:hover .card-arrow { opacity: 1; transform: none; }
}
.card:focus-within { border-color: var(--color-fg); }

/* posts without a cover: the tag name on a plain panel, never a generated image */
.cover-type {
    display: flex; align-items: flex-end; padding: 20px 24px;
    background: color-mix(in srgb, var(--color-accent) 8%, var(--color-card));
    border-bottom: 1px solid var(--color-line);
    font: 500 26px/1 var(--font-display); letter-spacing: -0.04em; color: var(--color-accent);
}

/* the featured post, or the first card when there is none, spans the row as image + text */
.feat, main:not(:has(.home-featured)) .home-latest .grid > .card:first-child { grid-column: 1 / -1; }
@media (min-width: 901px) {
    /* The cover is never cropped (pipeline covers carry text): the picture keeps its 1600x840 shape and sets the
       card height; the text column is sized to fit beside it. If the text still runs taller, the picture is
       centered whole (contain) instead of being cut. */
    .feat, main:not(:has(.home-featured)) .home-latest .grid > .card:first-child { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
    :is(.feat, main:not(:has(.home-featured)) .home-latest .grid > .card:first-child) .card-body { padding: 28px 36px; gap: 12px; align-content: center; }
    :is(.feat, main:not(:has(.home-featured)) .home-latest .grid > .card:first-child) .card-title { font-size: clamp(24px, 2.3vw, 32px); line-height: 1.06; }
    :is(.feat, main:not(:has(.home-featured)) .home-latest .grid > .card:first-child) .card-ex { -webkit-line-clamp: 3; font-size: 16px; }
    :is(.feat, main:not(:has(.home-featured)) .home-latest .grid > .card:first-child) .card-img { border-right: 1px solid var(--color-line); display: grid; align-items: center; }
    :is(.feat, main:not(:has(.home-featured)) .home-latest .grid > .card:first-child) .card-img img { height: 100%; object-fit: contain; }
    /* no cover: the tag panel fills the column */
    :is(.feat, main:not(:has(.home-featured)) .home-latest .grid > .card:first-child) .card-img:has(.cover-type) { position: relative; min-height: 320px; }
    :is(.feat, main:not(:has(.home-featured)) .home-latest .grid > .card:first-child) .cover-type { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; border-bottom: 0; font-size: 44px; padding: 32px; }
}

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 24px 40px; font-size: 15px; }
.pager a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; }
@media (hover: hover) { .pager a:hover { color: var(--color-accent); } }

@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
    .grid { grid-template-columns: minmax(0, 1fr); }
    .author-head { grid-template-columns: 1fr; }
}

/* ---------- Book a call panel (site bookSection) ---------- */
.book { padding-block: clamp(48px, 7vw, 96px); }
.book-in {
    display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px 56px; align-items: end;
    padding: clamp(32px, 6vw, 72px); border-radius: var(--radius-panel);
    background: var(--color-inverse); color: var(--color-inverse-fg);
}
.book-title { font-size: var(--text-h2); line-height: 0.98; }
.book-title em { font-style: normal; color: var(--color-accent-inverse); }
.book-side { display: grid; gap: 24px; justify-items: start; }
.book-text { color: var(--color-inverse-muted); font-size: var(--text-lead); max-width: 40ch; }
/* on the dark panel the accent button uses the inverse accent, as on the site */
:root:not([data-theme="dark"]) .book .btn-accent { background: var(--color-accent-inverse); color: var(--color-inverse); }
:root:not([data-theme="dark"]) .book .btn-arrow { background: var(--color-inverse); color: var(--color-accent-inverse); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .book .btn-accent { background: var(--color-accent); color: var(--color-accent-fg); }
    :root:not([data-theme]) .book .btn-arrow { background: var(--color-accent-fg); color: var(--color-accent); }
}
@media (max-width: 900px) { .book-in { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Post ---------- */
.post-article { padding-bottom: 24px; }
.post-head { max-width: calc(860px + 2 * var(--gutter)); margin-inline: auto; padding: clamp(130px, 16vw, 180px) var(--gutter) 0; display: grid; gap: 18px; }
.post-title { font-size: clamp(36px, 5vw, 64px); line-height: 1; }
.post-lead { font-size: var(--text-lead); color: var(--color-muted); max-width: 60ch; }
.post-cover { max-width: calc(1040px + 2 * var(--gutter)); margin: 40px auto 0; padding-inline: var(--gutter); }
.post-cover img { width: 100%; aspect-ratio: 1600 / 840; object-fit: cover; border-radius: var(--radius-card); border: 1px solid var(--color-line); }
.post-cover figcaption { margin-top: 10px; text-align: center; font-size: 13px; color: var(--color-muted); }

.gh-content {
    max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 40px auto 0; padding-inline: var(--gutter);
    font-size: 18px; line-height: 1.7;
}
.gh-content > * + * { margin-top: 1.15em; }
.gh-content :is(h2, h3, h4) { margin-top: 2em; scroll-margin-top: 100px; line-height: 1.1; }
.gh-content h2 { font-size: clamp(28px, 3vw, 36px); }
.gh-content h3 { font-size: 24px; letter-spacing: -0.03em; }
.gh-content h4 { font: 600 18px var(--font-body); letter-spacing: 0; }
.gh-content strong { font-weight: 600; }
.gh-content a { text-decoration: underline; text-decoration-color: var(--color-accent); text-decoration-thickness: 1px; text-underline-offset: 4px; }
@media (hover: hover) { .gh-content a:hover { color: var(--color-accent); } }
.gh-content :is(ul, ol) { padding-left: 1.25em; }
.gh-content li::marker { color: var(--color-muted); }
.gh-content li + li { margin-top: 0.35em; }
.gh-content blockquote { padding-left: 1em; border-left: 2px solid var(--color-accent); font: 500 22px/1.35 var(--font-display); letter-spacing: -0.02em; }
.gh-content hr { border: 0; border-top: 1px solid var(--color-line); margin-block: 2.5em; }
.gh-content code { padding: 0.1em 0.35em; border-radius: 6px; background: var(--color-card); border: 1px solid var(--color-line); font: 0.85em var(--font-mono); }
.gh-content pre { overflow-x: auto; padding: 18px 20px; border-radius: 12px; background: var(--color-inverse); color: var(--color-inverse-fg); font: 14px/1.65 var(--font-mono); }
.gh-content pre code { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; }
.gh-content table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; font-variant-numeric: tabular-nums; }
.gh-content :is(th, td) { padding: 10px 14px; border-bottom: 1px solid var(--color-line); text-align: left; }
.gh-content th { font: 500 12px var(--font-mono); color: var(--color-muted); }
.gh-content :is(img, video) { border-radius: 12px; }

/* table of contents: built by main.js from the h2 headings when the post has none */
.toc { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 40px auto 0; padding-inline: var(--gutter); }
.gh-content .toc { max-width: none; margin: 2em 0; padding-inline: 0; }
.gh-content .toc li { margin: 0; }
.toc-in { border: 1px solid var(--color-line); border-radius: var(--radius-card); background: var(--color-card); padding: 20px 24px; }
.toc-title, .gh-content .toc .toc-title { margin: 0 0 10px; font: 500 12px/1.4 var(--font-mono); color: var(--color-muted); }
.toc ol, .gh-content .toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; display: grid; gap: 6px; }
.toc li { counter-increment: toc; display: grid; grid-template-columns: 2.4em 1fr; align-items: baseline; }
.toc li::before { content: counter(toc, decimal-leading-zero); font: 500 12px var(--font-mono); color: var(--color-accent); }
.toc a, .gh-content .toc a { text-decoration: none; line-height: 1.4; font-size: 16px; }
@media (hover: hover) { .toc a:hover { color: var(--color-accent); } }

/* Koenig editor cards */
.kg-width-wide { width: min(1040px, 94vw); max-width: none; margin-inline: calc(50% - min(520px, 47vw)); }
.kg-width-full { width: 100vw; max-width: none; margin-inline: calc(50% - 50vw); }
.kg-width-full img { border-radius: 0; }
.kg-image-card img, .kg-gallery-image img { width: 100%; }
.kg-card figcaption { margin-top: 0.6em; text-align: center; font-size: 13px; line-height: 1.4; color: var(--color-muted); }
.kg-gallery-container { display: flex; flex-direction: column; gap: 0.75em; }
.kg-gallery-row { display: flex; gap: 0.75em; }
.kg-gallery-image { flex: 1 1 0; }
.kg-gallery-image img { height: 100%; object-fit: cover; }
.kg-bookmark-card { width: 100%; }
.kg-bookmark-container { display: flex; min-height: 140px; border: 1px solid var(--color-line); border-radius: var(--radius-card); overflow: hidden; text-decoration: none !important; }
.kg-bookmark-content { flex: 1; min-width: 0; padding: 18px 20px; display: grid; gap: 6px; align-content: start; }
.kg-bookmark-title { font-weight: 600; line-height: 1.3; }
.kg-bookmark-description { font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kg-bookmark-metadata { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.kg-bookmark-icon { width: 18px; height: 18px; border-radius: 4px; }
.kg-bookmark-thumbnail { flex: 0 0 32%; position: relative; }
.kg-bookmark-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
/* Ghost's cards.min.css forces a white bookmark card with #222 text; these selectors outrank it */
.gh-content .kg-bookmark-card a.kg-bookmark-container,
.gh-content .kg-bookmark-card a.kg-bookmark-container:hover { background: var(--color-card); color: var(--color-fg); border-color: var(--color-line); }
.gh-content .kg-bookmark-card a.kg-bookmark-container:hover { border-color: var(--color-fg); }
.gh-content .kg-bookmark-description, .gh-content .kg-bookmark-metadata { opacity: 1; color: var(--color-muted); }
.kg-callout-card { display: flex; gap: 12px; padding: 18px 20px; border-radius: var(--radius-card); background: var(--color-card); border: 1px solid var(--color-line); }
.kg-callout-emoji { flex: none; }
.kg-toggle-card { padding: 16px 20px; border: 1px solid var(--color-line); border-radius: var(--radius-card); }
.kg-toggle-heading { display: flex; justify-content: space-between; gap: 12px; cursor: pointer; }
.kg-toggle-heading-text { font-size: 18px; margin: 0; }
.kg-toggle-content { margin-top: 0.75em; }
.kg-toggle-card[data-kg-toggle-state="close"] .kg-toggle-content { display: none; }
.kg-toggle-card-icon { cursor: pointer; }
.kg-button-card { display: flex; justify-content: center; }
.kg-btn, .gh-content .kg-button-card .kg-btn, .gh-content .kg-button-card .kg-btn-accent {
    display: inline-flex; align-items: center; min-height: 44px; padding: 12px 22px; border-radius: 999px;
    background: var(--color-accent); color: var(--color-accent-fg) !important; text-decoration: none !important; font: 600 15px var(--font-body);
}
.kg-embed-card { display: flex; flex-direction: column; align-items: center; }
.kg-embed-card iframe { max-width: 100%; }
.kg-video-card video { width: 100%; }
.kg-audio-card, .kg-file-card-container, .kg-product-card { border: 1px solid var(--color-line); border-radius: var(--radius-card); padding: 16px 20px; }
.kg-file-card-container { display: flex; justify-content: space-between; gap: 12px; text-decoration: none !important; }
.kg-header-card { padding: 32px 24px; border-radius: var(--radius-panel); background: var(--color-inverse); color: var(--color-inverse-fg); text-align: center; }
.kg-header-card-header { font-family: var(--font-display); font-weight: 500; line-height: 1.05; margin: 0; }

/* ---------- End of post ---------- */
.band {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px 28px; align-items: center;
    max-width: var(--measure); margin: 56px max(var(--gutter), calc((100% - var(--measure)) / 2)) 0;
    padding: 24px; border: 1px solid var(--color-line); border-radius: var(--radius-card); background: var(--color-card);
}
.band > div { display: grid; gap: 4px; }
.band-title { font-size: 24px; line-height: 1.1; letter-spacing: -0.03em; }
.post-next {
    display: grid; gap: 8px; max-width: calc(var(--measure) + 2 * var(--gutter));
    margin: 48px auto 0; padding: 28px var(--gutter) 0; border-top: 1px solid var(--color-line);
}
.next-title { font: 500 clamp(24px, 3vw, 32px)/1.1 var(--font-display); letter-spacing: -0.03em; }
@media (hover: hover) { .post-next:hover .next-title { color: var(--color-accent); } }
@media (max-width: 640px) { .band { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Subscribe form (site input: card background, 12px radius, accent focus ring) ---------- */
.subscribe-form { display: grid; gap: 8px; }
.subscribe-row { display: flex; align-items: center; gap: 8px; }
.subscribe-field { flex: 1 1 0; min-width: 0; }
.subscribe-row input {
    width: 100%; min-height: 44px; padding: 0 16px;
    border-radius: 12px; border: 1px solid var(--color-line);
    background: var(--color-card); color: var(--color-fg); font: 400 15px var(--font-body);
    transition: border-color var(--duration-hover), box-shadow var(--duration-hover);
}
.subscribe-row input::placeholder { color: var(--color-muted); }
.subscribe-row input:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent) 22%, transparent); }
.sbtn .busy, .subscribe-msg { display: none; }
.subscribe-form.loading .sbtn .idle { display: none; }
.subscribe-form.loading .sbtn .busy { display: inline; }
.subscribe-form.success .msg-ok, .subscribe-form.error .msg-err { display: block; }
.subscribe-msg { font-size: 14px; color: var(--color-muted); }
.subscribe-form.error .msg-err { color: var(--color-danger); }
@media (max-width: 420px) {
    .subscribe-row { flex-wrap: wrap; }
    .subscribe-field, .sbtn { flex: 1 1 100%; }
}

/* ---------- Footer (site Footer) ---------- */
.ft { padding-block: 80px 32px; overflow: hidden; }
.ft-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; font-size: 14px; color: var(--color-muted); }
.ft-cols div { display: grid; align-content: start; gap: 8px; }
.ft-cols h2 { font: 600 14px var(--font-body); letter-spacing: 0; color: var(--color-fg); margin-bottom: 4px; }
.ft-cols a { width: fit-content; padding-block: 2px; transition: color 200ms; }
@media (hover: hover) { .ft-cols a:hover, .ft-legal a:hover { color: var(--color-fg); } }
.ft-mark {
    /* fallback size; main.js fits it to the container width */
    font: 500 16vw / 0.82 var(--font-display); letter-spacing: -0.06em;
    margin-top: 72px; padding-top: 0.12em; white-space: nowrap; text-align: center; text-transform: lowercase;
}
.ft-legal {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
    margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--color-line);
    font-size: 13px; color: var(--color-muted);
}
.ft-legal-links { display: flex; flex-wrap: wrap; gap: 18px; }
.ft-legal a { padding-block: 4px; }
@media (max-width: 900px) { .ft-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.error-page { padding-bottom: 96px; }

/* ==========================================================================
   Motion (site docs/motion.md: transform, opacity, filter and clip-path only, motion tokens)
   ========================================================================== */

/* page transitions between blog pages (cross-document view transitions; other browsers just navigate) */
@view-transition { navigation: auto; }
.card-title a, .post-title span { display: block; }
::view-transition-group(*) { animation-duration: 0.45s; animation-timing-function: var(--ease-out); }
::view-transition-old(root) { animation: vt-out 0.2s ease both; }
::view-transition-new(root) { animation: vt-in 0.35s var(--ease-out) 0.05s both; }
::view-transition-old(*.cover), ::view-transition-new(*.cover) { animation: none; height: 100%; object-fit: cover; }
::view-transition-old(*.cover):only-child { animation: vt-out 0.2s ease both; }
::view-transition-new(*.cover):only-child { animation: vt-in 0.35s var(--ease-out) 0.05s both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
/* theme switch: the new colours grow in a circle from the toggle (main.js); nothing else moves */
html.theme-fade::view-transition-old(root), html.theme-fade::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.theme-fade * { view-transition-name: none !important; }

/* reading progress on posts: a scroll-driven animation, no JS */
.read-progress { display: none; }
@supports (animation-timeline: scroll()) {
    .read-progress {
        display: block; position: fixed; inset: 0 0 auto 0; z-index: 70; height: 3px;
        background: var(--color-accent); transform-origin: 0 50%;
        animation: read-grow linear both; animation-timeline: scroll(root block);
    }
    @keyframes read-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* entrance: main.js marks only what starts below the fold */
.will-reveal { opacity: 0; transform: translateY(24px); }
.will-reveal.is-in {
    opacity: 1; transform: none;
    transition: opacity var(--duration-enter) var(--ease-out) var(--d, 0s), transform var(--duration-enter) var(--ease-out) var(--d, 0s);
}

.arr { display: inline-block; transition: transform 350ms var(--ease-out); }
a:is(:hover, :focus-visible) .arr { transform: translate(2px, -2px); }
a:is(:hover, :focus-visible) .arr-back { transform: translateX(-3px); }
a:is(:hover, :focus-visible) .arr-fwd, .post-next:is(:hover, :focus-visible) .arr { transform: translateX(3px); }

/* ---------- In-text calls to action (main.js places them) ---------- */
.gh-content .post-cta {
    display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap;
    margin-block: 2.2em; padding: 22px 24px; border-radius: var(--radius-card);
    background: var(--color-card); border: 1px solid var(--color-line);
    box-shadow: inset 3px 0 0 var(--color-accent);
}
.gh-content .post-cta + * { margin-top: 0; }
.post-cta-text { display: grid; gap: 4px; flex: 1 1 280px; }
.gh-content .post-cta-title { font: 500 22px/1.15 var(--font-display); letter-spacing: -0.03em; }
.gh-content .post-cta-sub { font-size: 15px; line-height: 1.5; color: var(--color-muted); }
.gh-content .post-cta .btn { text-decoration: none; color: var(--color-accent-fg); }
.gh-content .post-cta > * + * { margin-top: 0; }

/* ---------- Booking funnel (copy of the site's src/components/funnel/funnel.css) ---------- */
.funnel-box { position: relative; overflow: hidden; background: var(--color-bg); border-radius: var(--radius-card); padding: clamp(20px, 2.6vw, 30px); color: var(--color-fg); }
.funnel-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.funnel-meta { font: 500 12px/1.4 var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-muted); }
.funnel-top { display: flex; justify-content: space-between; margin-bottom: 14px; padding-right: 52px; }
.funnel-progress { height: 3px; background: var(--color-line); border-radius: 3px; overflow: hidden; margin-bottom: 22px; }
.funnel-progress i { display: block; height: 100%; background: var(--color-accent); transform-origin: left; transition: transform 500ms var(--ease-out); }
.funnel-title { font: 600 22px/1.2 var(--font-body); letter-spacing: -0.02em; margin-bottom: 6px; outline: none; }
.funnel-hint { color: var(--color-muted); font-size: 15px; margin-bottom: 18px; }
.funnel-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.funnel-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    min-height: 44px; border: 1px solid var(--color-line); background: var(--color-card); color: var(--color-fg);
    border-radius: 999px; padding: 10px 16px; font-size: 15px; cursor: pointer;
    transition: background-color 200ms, border-color 200ms, color 200ms, transform var(--duration-press) var(--ease-out);
}
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"] { background: var(--color-fg); color: var(--color-bg); border-color: var(--color-fg); }
@media (hover: hover) { .chip:hover { border-color: var(--color-fg); } }
.funnel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span, .field-label { font-size: 13px; font-weight: 500; color: var(--color-muted); padding: 0; }
.field-label { margin-bottom: 8px; }
.field input, .field select {
    font: inherit; font-size: 16px; color: var(--color-fg); background: var(--color-card);
    border: 1px solid var(--color-line); border-radius: 12px; padding: 12px 14px; min-height: 48px; width: 100%;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 22%, transparent); }
.funnel-error { color: var(--color-danger); font-size: 14px; min-height: 20px; margin-top: 12px; }
.funnel-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.funnel-nav .btn { margin-left: auto; }
.funnel-nav .btn[disabled] { opacity: 0.7; cursor: progress; }
.funnel-back { color: var(--color-muted); cursor: pointer; font-size: 14px; padding: 10px 0; min-height: 44px; }
.funnel-done { text-align: center; padding-block: 16px; }
.funnel-check { width: 64px; height: 64px; border-radius: 50%; background: var(--color-accent); color: var(--color-accent-fg); display: grid; place-items: center; margin: 0 auto 16px; font-size: 28px; }
@media (max-width: 560px) { .funnel-grid { grid-template-columns: minmax(0, 1fr); } }

/* modal: open 300ms, close 200ms; display and overlay are discrete so the exit plays before the top layer drops it */
.funnel-dialog {
    border: 0; padding: 0; background: transparent; color: var(--color-fg);
    width: min(560px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); margin: auto; overflow: visible;
    opacity: 0; transform: translateY(16px) scale(0.96);
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), overlay 200ms allow-discrete, display 200ms allow-discrete;
}
.funnel-dialog[open] { opacity: 1; transform: none; transition-duration: 300ms; }
@starting-style { .funnel-dialog[open] { opacity: 0; transform: translateY(16px) scale(0.96); } }
.funnel-dialog::backdrop { background: rgb(14 14 16 / 0); transition: background-color 200ms var(--ease-out), overlay 200ms allow-discrete, display 200ms allow-discrete; }
.funnel-dialog[open]::backdrop { background: rgb(14 14 16 / 0.45); transition-duration: 300ms; }
@starting-style { .funnel-dialog[open]::backdrop { background: rgb(14 14 16 / 0); } }
.funnel-dialog-panel {
    position: relative; background: var(--color-bg); border: 1px solid var(--color-line); border-radius: var(--radius-panel); padding: 12px;
    box-shadow: 0 40px 80px -30px rgb(14 14 16 / 0.5); max-height: calc(100dvh - 24px); overflow-y: auto;
}
.funnel-close {
    position: absolute; top: 18px; right: 18px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--color-line); background: var(--color-card); font-size: 22px; line-height: 1; cursor: pointer;
    transition: transform 300ms var(--ease-out);
}
@media (hover: hover) { .funnel-close:hover { transform: rotate(90deg); } }

/* ---------- Smooth scroll (Lenis, as on the main site; rules from lenis/dist/lenis.css) ---------- */
html.lenis, html.lenis body { height: auto; }
/* Lenis moves the page itself: CSS smooth scrolling would fight it */
html.lenis { scroll-behavior: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
/* only while it is scrolling, so Ghost's Portal and search popups stay clickable at rest */
.lenis.lenis-smooth iframe { pointer-events: none; }

/* ---------- Scrollbar (desktop mouse only), same as blog.diegomirhan.com ----------
   The native bar is hidden and this one takes over: a thin accent thumb that stays quiet when idle, lights up
   while scrolling (always the same size), grows on hover, can be dragged or clicked. Colors from the accent. */
html.has-scrollbar { scrollbar-width: none; }
html.has-scrollbar::-webkit-scrollbar { display: none; }
#scrollbar { display: none; }
.has-scrollbar #scrollbar {
    position: fixed; top: 8px; right: 4px; bottom: 8px; z-index: 80;
    display: block; width: 10px; border-radius: 999px; cursor: pointer;
    transition: opacity 0.6s var(--ease-out), width 0.35s var(--ease-out), background-color 0.35s;
}
#scrollbar.is-empty { opacity: 0; pointer-events: none; }
#scrollbar:hover, #scrollbar.is-dragging { width: 14px; background: color-mix(in oklch, var(--color-fg) 6%, transparent); }
.scrollbar__thumb {
    touch-action: none;
    position: absolute; top: 0; right: 2px; width: 4px; border-radius: 999px;
    background: linear-gradient(180deg, color-mix(in oklch, var(--color-accent) 45%, white), var(--color-accent) 60%);
    opacity: 0.45;
    will-change: transform;
    transition: width 0.35s var(--ease-out), opacity 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out), right 0.35s var(--ease-out);
}
/* the thumb is 4px wide: a transparent wider area around it so it is easy to grab */
.scrollbar__thumb::before { content: ""; position: absolute; inset: 0 -6px 0 -6px; }
#scrollbar.is-active .scrollbar__thumb {
    opacity: 1;
    box-shadow: 0 0 12px color-mix(in oklch, var(--color-accent) 70%, transparent), 0 0 2px color-mix(in oklch, var(--color-accent) 45%, white);
}
#scrollbar:hover .scrollbar__thumb, #scrollbar.is-dragging .scrollbar__thumb {
    width: 8px; right: 3px; opacity: 1; cursor: grab;
    box-shadow: 0 0 16px color-mix(in oklch, var(--color-accent) 80%, transparent), 0 0 3px color-mix(in oklch, var(--color-accent) 45%, white);
}
#scrollbar.is-dragging .scrollbar__thumb { cursor: grabbing; }
