/*
 * blog.ciny.io. The tokens, nav, buttons and footer are copied from ciny.io
 * (landing/index.html and landing/legal.css), so the blog reads as the same site.
 * Change them there first, then here.
 */
:root {
  color-scheme: dark;
  --canvas: #131313;
  --surface: #0a0b0c;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f5f5f4;
  --muted: #a1a1a3;
  --dim: #85868a;
  --cta: #ececec;
  --cta-text: #18181a;
  --brand: #fe391e;
  --brand-gradient: linear-gradient(77deg, #bd55e5 0%, #fe391e 44%, #ff8545 100%);
  --brand-soft: linear-gradient(77deg, rgba(189, 85, 229, 0.16) 0%, rgba(254, 57, 30, 0.14) 44%, rgba(255, 133, 69, 0.14) 100%);
  --on-brand: #ffe997;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: var(--gh-font-body, "Satoshi"), -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --heading: var(--gh-font-heading, "Rubik"), -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 32px);
  --frame-pad: 8px;
  --frame-radius: 26px;
  --shot-radius: 18px;
  --glass: linear-gradient(180deg, rgba(40, 40, 43, 0.8), rgba(29, 29, 31, 0.8));
  --glass-blur: blur(16px) saturate(140%);
  --read: 720px;
  --feature: 1040px;
  --wide: 1200px;
}

* { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* A faint brand glow at the top, like the landing's hero, minus the ASCII field. */
body::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 620px; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 70% at 50% 0%, rgba(254, 57, 30, 0.09), rgba(189, 85, 229, 0.05) 45%, transparent 75%);
}
a { color: inherit; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, 0.3); transition: text-decoration-color 0.25s ease, color 0.25s ease; }
a:hover { text-decoration-color: var(--brand); }
img, video { display: block; max-width: 100%; height: auto; }
::selection { background: var(--brand); color: var(--on-brand); }

.wrap { width: 100%; max-width: var(--read); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-feature { max-width: var(--feature); }
.wrap-wide { max-width: var(--wide); }

/* ---------- Nav, same as ciny.io ---------- */
.nav { position: fixed; inset: 14px 0 auto; z-index: 50; display: flex; justify-content: center; padding: 0 var(--gutter); pointer-events: none; }
.nav-inner {
  pointer-events: auto; display: flex; align-items: center; gap: 28px;
  width: 100%; max-width: 780px; padding: 7px 7px 7px 16px;
  background: rgba(17, 18, 20, 0.6);
  backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--line); border-radius: 16px;
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.nav.scrolled .nav-inner { background: rgba(12, 13, 14, 0.86); border-color: var(--line-strong); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4); }
.nav-inner a { text-decoration: none; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 16px; text-decoration: none; letter-spacing: -0.02em; }
.logo-mark { width: 22px; height: 22px; border-radius: 7px; background: var(--brand-gradient); display: grid; place-items: center; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 20px rgba(254, 57, 30, 0.3); }
.logo-mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--on-brand); }
.nav-links { display: flex; gap: 24px; margin-left: auto; }
.nav-links a { color: var(--muted); font-size: 14px; line-height: 1.1; transition: color 0.25s ease; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); }
.nav-cta { display: flex; gap: 8px; }

/* ---------- Buttons, same as ciny.io ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: 12px; border: 0; cursor: pointer;
  font: 500 15px/1 var(--font); white-space: nowrap; text-decoration: none;
  transition: transform 0.35s var(--ease), background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.97); transition-duration: 0.12s; }
.btn-primary { background: var(--cta); color: var(--cta-text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 8px 24px rgba(0, 0, 0, 0.35); }
.btn-primary:hover { background: #fff; box-shadow: inset 0 1px 0 #fff, 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(255, 255, 255, 0.06); }
.btn-ghost { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost:hover { color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26); }
.btn-sm { padding: 9px 14px; font-size: 14px; border-radius: 10px; }
.phone-only { display: none; }
.arr { display: inline-block; transition: transform 0.35s var(--ease); }

/* ---------- Shared bits ---------- */
main { padding: 128px 0 40px; }
h1, h2 { font-family: var(--heading); font-weight: 700; }
h1 { font-size: clamp(36px, 7vw, 60px); line-height: 1.04; letter-spacing: -0.04em; margin: 0 0 16px; text-wrap: balance; }
.lead { color: var(--muted); font-size: clamp(17px, 2vw, 19px); line-height: 1.5; margin: 0; max-width: 620px; text-wrap: pretty; }

.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 12px; color: var(--dim); font-size: 13px; line-height: 1.3; }
.meta .tag {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  color: var(--text); font-weight: 500; text-decoration: none;
  background: var(--brand-soft); box-shadow: inset 0 0 0 1px rgba(254, 57, 30, 0.22);
  transition: box-shadow 0.25s ease;
}
a.tag:hover { box-shadow: inset 0 0 0 1px rgba(254, 57, 30, 0.5); }
.meta .dot { opacity: 0.6; }

.back { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 28px; color: var(--muted); font-size: 14px; text-decoration: none; }
.back:hover { color: var(--text); }
.back:hover .arr { transform: translateX(-3px); }

/* The landing's screenshot frame: glass, a thin edge, the picture inset. */
.frame {
  padding: var(--frame-pad); border-radius: var(--frame-radius);
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 30px 80px rgba(0, 0, 0, 0.45);
}
.frame img { width: 100%; border-radius: var(--shot-radius); background: var(--surface); }

.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line-strong); }
.avatar-lg { width: 72px; height: 72px; margin: 0 0 20px; }

/* ---------- Index, tag and author pages ---------- */
.page-head { margin: 0 0 56px; }
.page-head-sm { margin-bottom: 32px; }
.page-head-sm h1 { font-size: clamp(30px, 5vw, 40px); }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 40px; }
.card-link { display: flex; flex-direction: column; gap: 22px; height: 100%; text-decoration: none; }
.card-frame { overflow: hidden; }
.card-frame img { aspect-ratio: 16 / 10; object-fit: cover; transition: transform 0.9s var(--ease); }
.card-title { margin: 0 0 10px; font-size: clamp(22px, 2.4vw, 26px); line-height: 1.15; letter-spacing: -0.03em; text-wrap: balance; transition: color 0.25s ease; }
.card-excerpt { margin: 0 0 16px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-more { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 500; transition: color 0.25s ease; }
.card-link:hover .card-frame img { transform: scale(1.025); }
.card-link:hover .card-more { color: var(--text); }
.card-link:hover .card-more .arr { transform: translateX(4px); }

/* The first post on page one spans the row, picture on the left. */
.home-template:not(.paged) .cards > .card:first-child { grid-column: 1 / -1; }
.home-template:not(.paged) .cards > .card:first-child .card-link { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; gap: 48px; }
.home-template:not(.paged) .cards > .card:first-child .card-title { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.035em; }
.home-template:not(.paged) .cards > .card-plain:first-child .card-link { grid-template-columns: 1fr; }
.home-template:not(.paged) .cards > .card-plain:first-child .card-body { padding: clamp(28px, 4vw, 48px); }
.home-template:not(.paged) .cards > .card-plain:first-child .card-title, .home-template:not(.paged) .cards > .card-plain:first-child .card-excerpt { max-width: 760px; }

/* Posts without a picture get a quiet card so the grid doesn't look broken. */
.card-plain .card-body { padding: 28px; border-radius: var(--frame-radius); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.3s ease; height: 100%; }
.card-plain .card-link:hover .card-body { box-shadow: inset 0 0 0 1px var(--line-strong); }

.empty { color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 72px 0 0; }
.pager-count { color: var(--dim); font-size: 14px; }
.pager a:hover .arr { transform: translateX(3px); }
.pager a:first-child:hover .arr { transform: translateX(-3px); }

/* ---------- Post ---------- */
.post-head { margin-bottom: 48px; }
.post-head .lead { margin-bottom: 24px; }
.byline { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.byline-author { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; text-decoration: none; }
.byline-author:hover { color: var(--text); }

.post-feature { margin: 0 auto 56px; }
.post-feature figcaption, .gh-content figcaption { margin-top: 12px; color: var(--dim); font-size: 13px; text-align: center; }

/* Ghost's post body. Long reads keep roomier leading than the landing's short copy. */
.gh-content { font-size: 18px; line-height: 1.7; }
.gh-content > * { margin: 0 0 24px; }
.gh-content > :last-child { margin-bottom: 0; }
.gh-content p, .gh-content li { color: #c9c9cb; }
.gh-content h2 { font-size: clamp(26px, 3.4vw, 32px); line-height: 1.15; letter-spacing: -0.03em; margin: 56px 0 18px; scroll-margin-top: 110px; }
.gh-content h3 { font: 500 21px/1.35 var(--font); letter-spacing: -0.015em; margin: 40px 0 12px; scroll-margin-top: 110px; }
.gh-content h4 { font: 500 18px/1.4 var(--font); margin: 32px 0 10px; }
.gh-content strong { color: var(--text); font-weight: 500; }
.gh-content a { color: var(--text); text-decoration: underline; text-decoration-color: rgba(254, 57, 30, 0.55); }
.gh-content a:hover { text-decoration-color: var(--brand); }
.gh-content ul, .gh-content ol { padding-left: 22px; }
.gh-content li { margin-bottom: 8px; }
.gh-content li::marker { color: var(--dim); }
.gh-content hr { height: 1px; border: 0; background: var(--line-strong); margin: 48px 0; }
.gh-content blockquote:not([class]) { margin-left: 0; padding: 2px 0 2px 22px; border-left: 2px solid; border-image: var(--brand-gradient) 1; color: var(--text); font-size: 20px; line-height: 1.55; }
.gh-content blockquote:not([class]) p { color: inherit; }
.gh-content blockquote.kg-blockquote-alt { font-family: var(--heading); font-size: 26px; line-height: 1.3; letter-spacing: -0.02em; text-align: center; color: var(--text); padding: 0 24px; }
.gh-content code { font: 0.86em/1.5 var(--mono); padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); }
.gh-content pre { font: 14px/1.65 var(--mono); padding: 20px 22px; border-radius: 16px; overflow-x: auto; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.gh-content pre code { padding: 0; background: none; box-shadow: none; font-size: inherit; }
.gh-content table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.gh-content th, .gh-content td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.gh-content th { color: var(--text); font-weight: 500; border-bottom-color: var(--line-strong); }

/* Ghost cards. Wide and full images break out of the reading column. */
.gh-content figure { margin: 40px 0; }
.gh-content .kg-image-card img, .gh-content .kg-gallery-image img { border-radius: var(--shot-radius); }
.gh-content .kg-image-card:not(.kg-width-full) img { box-shadow: 0 0 0 1px var(--line); }
.gh-content .kg-width-wide { position: relative; width: min(var(--feature), calc(100vw - 2 * var(--gutter))); left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full { position: relative; width: 100vw; left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full img { border-radius: 0; }
.gh-content .kg-width-full figcaption { padding: 0 var(--gutter); }
.gh-content .kg-embed-card, .gh-content .kg-video-card { border-radius: var(--shot-radius); overflow: hidden; }
.gh-content .kg-callout-card { border-radius: 16px; }
.gh-content .kg-bookmark-card .kg-bookmark-container { border-radius: 16px; border-color: var(--line-strong); color: var(--text); text-decoration: none; transition: border-color 0.25s ease; }
.gh-content .kg-bookmark-card .kg-bookmark-container:hover { border-color: rgba(255, 255, 255, 0.26); }
.gh-content .kg-bookmark-description, .gh-content .kg-bookmark-metadata { color: var(--muted); }
.gh-content .kg-button-card a.kg-btn { border-radius: 12px; font-family: var(--font); font-weight: 500; }

/* The ask at the end of every post: the landing's closing block (.final), in a frame. */
.post-cta { margin: 96px auto 0; }
.cta-card {
  position: relative; isolation: isolate; overflow: hidden; text-align: center;
  padding: clamp(56px, 8vw, 96px) clamp(22px, 5vw, 64px) clamp(44px, 6vw, 64px);
  border-radius: calc(var(--frame-radius) + 6px);
  background: linear-gradient(180deg, rgba(26, 27, 30, 0.9), rgba(17, 18, 20, 0.9));
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 40px 120px -40px rgba(0, 0, 0, 0.8);
}
/* The same glow as behind the landing's last heading. */
.cta-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--brand-gradient); opacity: 0.2;
  -webkit-mask: radial-gradient(55% 60% at 50% 60%, #000, transparent 72%); mask: radial-gradient(55% 60% at 50% 60%, #000, transparent 72%);
}
.cta-card h2 { margin: 0 0 32px; font-size: clamp(34px, 5.6vw, 60px); line-height: 1.02; letter-spacing: -0.05em; text-wrap: balance; }

.composer {
  max-width: 560px; margin: 0 auto; text-align: left; padding: 16px 16px 12px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(48, 48, 52, 0.8), rgba(35, 35, 38, 0.8));
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line-strong); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}
.composer .in { min-height: 54px; font-size: 15px; line-height: 1.3; color: var(--muted); }
.composer .caret { display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -0.15em; background: var(--brand); animation: caret 1.1s steps(1) infinite; }
.composer .row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font: 500 11px/1 var(--mono); color: var(--dim); }
.composer .send { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-gradient); color: var(--on-brand); font-size: 13px; }
@keyframes caret { 50% { opacity: 0; } }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 640px; margin: 16px auto 36px; }
.chip { font: 500 12px/1 var(--mono); color: var(--muted); padding: 8px 11px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }

.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.cta-row.phone-only { display: none; }
.cta-row .btn svg { width: 15px; height: 15px; }
.cta-card .fine { margin: 18px 0 0; font-size: 13px; color: var(--dim); }
.cta-card .fine a { color: var(--muted); text-decoration-color: var(--line-strong); }
.cta-card .fine a:hover { color: var(--text); text-decoration-color: currentColor; }

.more { margin-top: 104px; }
.more-title { margin: 0 0 32px; font-size: 22px; letter-spacing: -0.025em; }

/* ---------- Error ---------- */
.error-page { min-height: 70vh; display: flex; align-items: center; }
.error-code { margin: 0 0 8px; font: 500 14px/1 var(--mono); color: var(--brand); }
.error-page .lead { margin-bottom: 32px; }

/* ---------- Footer, same as ciny.io ---------- */
.site-footer { margin-top: 104px; border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--dim); font-size: 13px; }
.site-footer .wrap { max-width: var(--wide); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; color: var(--muted); transition: color 0.25s ease; }
.site-footer a:hover, .site-footer a[aria-current] { color: var(--text); }
.site-footer nav a { white-space: nowrap; }
.foot-brand { display: inline-flex; align-items: center; gap: 14px; }

/* ---------- Motion: the landing's reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); filter: blur(6px); transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; filter: none; }
.js .reveal.d1 { transition-delay: 0.08s; }
.js .reveal.d2 { transition-delay: 0.16s; }
.js .reveal.d3 { transition-delay: 0.24s; }

@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; gap: 48px; }
  .home-template:not(.paged) .cards > .card:first-child .card-link { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 640px) {
  :root { --gutter: 22px; --frame-pad: 6px; --frame-radius: 20px; --shot-radius: 14px; }
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
  .mac-only { display: none !important; }
  .phone-only { display: revert; }
  main { padding-top: 112px; }
  .gh-content { font-size: 17px; }
  .cta-row { flex-direction: column; align-items: stretch; max-width: 340px; margin-inline: auto; }
  .cta-row.phone-only { display: flex; }
  .chips { margin-bottom: 28px; }
  .pager-count { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .card-frame img, .btn, .arr { transition: none; }
  .composer .caret { animation: none; }
}
