/* HyperImplement blog. Shared by every page in /blog. No build step. */

:root {
  --bg:           #FFFFFF;
  --bg-surface:   #F6F5F3;
  --bg-elevated:  #EDECE9;
  --text:         #0D0D0D;
  --text-sec:     #525252;
  --text-muted:   #959595;
  --accent:       #F95B3D;
  --accent-dark:  #D94828;
  --accent-deep:  #B83820;
  --border:       rgba(0,0,0,0.09);
  --border-acc:   rgba(249,91,61,0.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
a, button, input, select, textarea, label {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; }
h1, h2, h3, .display { font-family: 'Unbounded', sans-serif; letter-spacing: -0.03em; line-height: 1.1; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.skip {
  position: absolute; left: 12px; top: 12px; z-index: 200;
  background: #fff; color: var(--text); padding: 8px 12px;
  border-radius: 5px; transform: translateY(-150%);
}
.skip:focus { transform: none; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ─── NAV (matches the main site) ─── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 18px 48px;
  padding-top: max(18px, env(safe-area-inset-top));
  padding-left: max(48px, env(safe-area-inset-left));
  padding-right: max(48px, env(safe-area-inset-right));
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.3s, box-shadow 0.3s, padding 0.3s;
  background: rgba(255,255,255,0);
}
.nav.scrolled {
  background: rgba(255,255,255,0.96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  padding: 12px 48px;
  padding-left: max(48px, env(safe-area-inset-left));
  padding-right: max(48px, env(safe-area-inset-right));
  box-shadow: 0 1px 0 var(--border), 0 4px 24px rgba(0,0,0,0.06);
}
.nav-logo img { height: 34px; width: auto; max-width: 220px; object-fit: contain; display: block; }
.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a {
  font-size: 13px; font-weight: 500; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-sec);
  text-decoration: none; transition: color 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--accent); }
.nav-cta {
  background: var(--text) !important;
  color: white !important;
  padding: 10px 22px; border-radius: 5px;
  font-family: 'Unbounded', sans-serif;
  font-size: 11px !important; font-weight: 700 !important;
  letter-spacing: 0.05em;
  transition: background 0.2s, transform 0.15s !important;
}
.nav-cta:hover { background: var(--accent) !important; transform: translateY(-1px); color: white !important; }

.nav-hamburger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 44px; height: 44px;
  background: transparent; border: none; cursor: pointer;
  padding: 8px; border-radius: 6px;
}
.nav-hamburger:hover { background: var(--bg-surface); }
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile-menu {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  padding-top: max(72px, calc(56px + env(safe-area-inset-top)));
  background: rgba(255,255,255,0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  z-index: 99;
  flex-direction: column;
  transform: translateY(-8px); opacity: 0;
  visibility: hidden; pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s, visibility 0.2s;
}
.nav-mobile-menu.open {
  transform: translateY(0); opacity: 1;
  visibility: visible; pointer-events: auto;
}
.nav-mobile-link {
  display: block; padding: 16px 24px;
  font-size: 15px; font-weight: 500;
  color: var(--text-sec); text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.nav-mobile-link:hover, .nav-mobile-link[aria-current="page"] { color: var(--accent); background: var(--bg-surface); }
.nav-mobile-cta {
  margin: 16px 24px 20px;
  background: var(--text); color: white !important;
  border-radius: 6px; border-bottom: none;
  font-family: 'Unbounded', sans-serif;
  font-size: 12px !important; font-weight: 700;
  letter-spacing: 0.05em; text-align: center;
}
.nav-mobile-cta:hover { background: var(--accent) !important; color: white !important; }

/* ─── BUTTONS ─── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent); color: white;
  font-family: 'Unbounded', sans-serif; font-size: 12px;
  font-weight: 700; letter-spacing: 0.05em;
  padding: 16px 32px; border-radius: 5px;
  text-decoration: none; border: none; cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(249,91,61,0.3);
  min-height: 48px;
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(249,91,61,0.4); color: white; }
.btn-primary:active { transform: translateY(0); }
.text-link {
  color: var(--accent-deep); font-weight: 600; text-underline-offset: 3px;
}
.text-link:hover { color: var(--accent); }

.label {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}

.page { padding-top: 108px; }

/* ─── BLOG INDEX ─── */
.blog-hero, .article-hero { padding: 28px 48px 8px; }
.blog-hero-inner, .wrap { max-width: 1100px; margin: 0 auto; }
.blog-hero h1, .article-hero h1 {
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 900;
  max-width: 16ch;
  margin-bottom: 16px;
}
.lede {
  font-size: 18px; line-height: 1.7; color: var(--text-sec);
  max-width: 62ch; font-weight: 400;
}
.card-list { padding: 28px 48px 72px; }
.card-list-inner { max-width: 1100px; margin: 0 auto; display: grid; gap: 22px; }
.post-card {
  background: #fff; border: 1px solid var(--border); border-radius: 18px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34,1.4,0.64,1), box-shadow 0.3s, border-color 0.3s;
}
.post-card:hover { transform: translateY(-4px); border-color: var(--border-acc); box-shadow: 0 14px 32px rgba(249,91,61,0.1); }
.post-card-link { display: grid; grid-template-columns: 280px 1fr; text-decoration: none; color: inherit; min-height: 100%; }
.post-card img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 16/9; background: #0D0D0D; }
.post-card-body { padding: 28px 28px 24px; }
.post-card h2 { font-size: clamp(22px, 2vw, 28px); font-weight: 700; margin: 0 0 10px; letter-spacing: -0.03em; line-height: 1.2; }
.post-card .excerpt { color: var(--text-sec); font-size: 16px; line-height: 1.65; margin-bottom: 16px; }
.more { font-family: 'Unbounded', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--accent-deep); }

.index-cta, .end-cta {
  margin: 8px 48px 80px; max-width: 1100px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 36px 32px;
}
.blog-hero-inner + .index-cta, .center-cta { margin-left: auto; margin-right: auto; }
.index-cta h2, .end-cta h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 900; margin-bottom: 12px; max-width: 18ch; }
.index-cta p, .end-cta p { color: var(--text-sec); max-width: 58ch; margin-bottom: 18px; font-size: 16px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 16px 22px; align-items: center; }
.end-cta { margin: 36px 0 0; max-width: none; }

/* ─── ARTICLE ─── */
.crumbs {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--text-sec);
  margin-bottom: 18px;
}
.crumbs a { color: var(--text-sec); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current="page"] { color: var(--text); }
.article-hero h1 { max-width: 18ch; }
.byline { display: flex; gap: 14px; align-items: center; margin-top: 22px; }
.byline img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--bg-elevated); }
.byline-name { font-weight: 600; color: var(--text); text-decoration: none; }
.byline-name:hover { color: var(--accent); }
.byline-meta { display: block; color: var(--text-sec); font-size: 14px; line-height: 1.45; }

.layout {
  max-width: 1100px; margin: 0 auto;
  padding: 28px 48px 80px;
  display: grid; grid-template-columns: minmax(0, 230px) minmax(0, 1fr); gap: 48px; align-items: start;
}
.toc {
  position: sticky; top: 96px;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--bg-surface); padding: 16px 16px 14px;
}
.toc summary { cursor: pointer; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc .label { margin-bottom: 0; }
.toc ol { margin: 12px 0 0; padding: 0; list-style: none; }
.toc li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 8px;
}
/* Chip mark from the existing apple-touch icon. Zoom past its transparent padding
   so the circular chip itself is ~15px, without stretching the square asset. */
.toc li::before {
  content: "";
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  background: url("../apple-touch-icon.png") center / 119% no-repeat;
}
.toc a { color: var(--text-sec); font-size: 14px; line-height: 1.4; text-decoration: none; min-width: 0; }
.toc a:hover { color: var(--accent-deep); }

.post { max-width: 68ch; min-width: 0; }
.post > * + * { margin-top: 1.05em; }
.post h2 {
  font-size: clamp(24px, 2.4vw, 32px); font-weight: 700;
  margin-top: 1.6em; line-height: 1.2; scroll-margin-top: 96px;
}
.post h3 { font-size: 20px; font-weight: 700; margin-top: 1.3em; scroll-margin-top: 96px; }
.post p, .post li { font-size: 18px; line-height: 1.75; color: var(--text); }
.post .lede-in { font-size: 19px; }
.post a { color: var(--accent-deep); text-underline-offset: 3px; }
.post a:hover { color: var(--accent); }
/* .post a (one class + one element) beats .btn-primary, so a callout
   button inside an article was drawn in the rust link color on the
   orange fill. These states win on hover, :active, and :visited too. */
.post a.btn-primary,
.post a.btn-primary:hover,
.post a.btn-primary:focus,
.post a.btn-primary:focus-visible,
.post a.btn-primary:active,
.post a.btn-primary:visited {
  color: #fff;
  -webkit-text-fill-color: #fff;
  opacity: 1;
}
.post ul, .post ol { padding-left: 1.25em; }
.post li + li { margin-top: 0.45em; }
.post strong { font-weight: 600; }

.prompt {
  background: #141414; color: #F4F4F5;
  border-radius: 12px; padding: 16px 18px;
  max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13.5px; line-height: 1.65; margin: 16px 0;
}
.post code { font-family: 'IBM Plex Mono', monospace; font-size: 0.92em; word-break: break-word; }
.prompt code { font-family: inherit; }

.table-wrap { overflow-x: auto; max-width: 100%; margin: 18px 0; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; }
caption {
  text-align: left; font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); padding: 14px 16px 0;
}
th, td { text-align: left; vertical-align: top; padding: 12px 16px; font-size: 15px; line-height: 1.5; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
th { font-family: 'Unbounded', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: -0.02em; background: var(--bg-surface); }
td:first-child { font-weight: 600; width: 46%; }

.diagram {
  margin: 22px 0; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: 14px; padding: 16px;
  min-width: 0; max-width: 100%;
}
.steps-2 { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.step-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 14px 16px;
}
.step-card .label {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin: 0;
}
.step-card p { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: var(--text-sec); }
.step-arrow { align-self: center; color: var(--accent); font-size: 22px; line-height: 1; }
.diagram figcaption { color: var(--text-sec); font-size: 14px; margin-top: 12px; }

.yt {
  position: relative; margin: 22px 0; border-radius: 12px; overflow: hidden;
  background: #0D0D0D; aspect-ratio: 16/9;
}
.yt iframe { width: 100%; height: 100%; border: 0; display: block; }
.yt-btn { display: block; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; position: relative; background: #0D0D0D; }
.yt-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-play {
  position: absolute; left: 50%; top: 50%; width: 68px; height: 48px;
  transform: translate(-50%, -50%); background: var(--accent); border-radius: 12px;
}
.yt-play::before {
  content: ''; position: absolute; left: 28px; top: 16px;
  border-style: solid; border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent #fff;
}

/* ─── FOOTER (matches the main site) ─── */
footer {
  background: var(--text);
  padding: 56px 48px 32px;
  padding-bottom: max(32px, calc(24px + env(safe-area-inset-bottom)));
}
.footer-top {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 56px; padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.footer-logo-pill {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.95);
  border-radius: 7px;
  padding: 8px;
  margin-bottom: 16px;
}
.footer-logo-pill img {
  display: block;
  width: auto;
  height: 26px;
  max-width: none;
  flex: 0 0 auto;
  object-fit: contain;
}
@media (max-width: 768px) {
  .footer-logo-pill img { height: 32px; }
}
.footer-desc { font-size: 13px; color: rgba(255,255,255,0.38); line-height: 1.7; }
.footer-col .footer-h {
  font-family: 'Unbounded', sans-serif; font-size: 10px;
  font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.3); margin-bottom: 18px;
}
.footer-col a {
  display: block; font-size: 13px; color: rgba(255,255,255,0.45);
  text-decoration: none; margin-bottom: 11px; transition: color 0.2s;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 28px; font-size: 12px; color: rgba(255,255,255,0.2);
}
.footer-bottom a { color: var(--accent); text-decoration: none; }

@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 36px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .toc { position: static; }
  .post-card-link { grid-template-columns: 220px 1fr; }
}
@media (max-width: 768px) {
  .nav { padding: 14px 20px; padding-top: max(14px, env(safe-area-inset-top)); }
  .nav.scrolled { padding: 10px 20px; padding-top: max(10px, env(safe-area-inset-top)); }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-mobile-menu { display: flex; }
  .page { padding-top: 84px; }
  .blog-hero, .article-hero, .card-list, .layout { padding-left: 20px; padding-right: 20px; }
  .index-cta { margin-left: 20px; margin-right: 20px; }
  .blog-hero h1, .article-hero h1 { font-size: clamp(30px, 8.4vw, 40px); }
  .post-card-link { grid-template-columns: 1fr; }
  .post-card img { aspect-ratio: 16/9; max-height: 200px; }
  .post p, .post li { font-size: 17px; }
  .steps-2 { grid-template-columns: 1fr; }
  .step-arrow { transform: rotate(90deg); justify-self: center; }
  .cta-row .btn-primary { width: 100%; }
  footer { padding: 48px 20px 28px; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}
@media (hover: none) {
  .post-card:hover { transform: none; box-shadow: none; border-color: var(--border); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .post-card, .btn-primary, .nav { transition: none; }
}
