/* The blog's pages: /blog/ and /blog/<slug>/. Written by web/blog's publish into their own
   bucket, and linked rather than inlined so a site deploy restyles every article without
   republishing one.

   The look is the home page's, not styles.css's: Inter, the stone and amber scales, the hero's
   sky, white rounded panels, the amber closing band and the dark footer. Values are copied from
   index.html's inline <style>, which is the authority; when one changes there, change it here.
   Light only, like the home page, which has no dark scheme either.

   The article body's markup is fixed by the Markdown subset: h2, h3, p, ul, ol, blockquote,
   figure > img, strong, em, a. */
:root {
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-300: #fcd34d;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-800: #92400e;
  --stone-50: #fafaf9;
  --stone-200: #e7e5e4;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-900: #1c1917;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--stone-700);
  background: var(--stone-50);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  /* The footer sits on the bottom edge of a short page instead of above a strip of ground. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

/* ─── TOP BAR ─── the home page's fixed download bar, moved to the top: same glass, same icon
   corner, same amber control. */
.blog-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stone-200);
}
.blog-bar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.blog-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--stone-900);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}
.blog-brand img { width: 32px; height: 32px; border-radius: 8px; }
.blog-bar nav { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.blog-bar nav a { color: var(--stone-600); font-size: 0.9rem; font-weight: 500; text-decoration: none; }
.blog-bar nav a:hover, .blog-bar nav a[aria-current] { color: var(--stone-900); }
.blog-bar .get-app-btn {
  background: var(--amber-100);
  color: var(--amber-800);
  border: 1px solid var(--amber-200);
  padding: 6px 16px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}
.blog-bar .get-app-btn:hover { color: var(--amber-800); background: var(--amber-200); border-color: var(--amber-300); }

/* ─── SKY BAND ─── the hero's gradient, cut short: sky into dawn, ending on the page ground so
   the band has no hard bottom edge. */
.blog-sky {
  background: linear-gradient(180deg, #87ceeb 0%, #b4e0fa 40%, #fde68a 82%, var(--stone-50) 100%);
  padding: 4.5rem 1rem 5.5rem;
  text-align: center;
}
.blog-sky-inner { max-width: 760px; margin: 0 auto; }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--amber-700);
  margin: 0 0 0.75rem;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--amber-800); }
.blog-sky h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.25; /* every heading on the page sets alike: the article's h2 and the CTA's */
  letter-spacing: -0.02em;
  color: var(--stone-900);
  margin: 0 0 1rem;
}
.blog-sky .lede {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.55;
  color: var(--stone-700);
  max-width: 600px;
  margin: 0 auto;
}

/* ─── INDEX ─── each article as one of the home page's white panels. */
.post-list {
  list-style: none;
  max-width: 1080px;
  margin: -3rem auto 0;
  padding: 0 1rem 5rem;
  display: grid;
  /* Fixed-width tracks, centred: one or two articles sit in the middle rather than leaving
     the left column of an otherwise empty grid. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 320px));
  justify-content: center;
  gap: 1.5rem;
}
.post-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--stone-200);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.09), 0 1px 4px rgba(0, 0, 0, 0.04); }
/* Anchored to the top: a portrait hero (an app screenshot) keeps its top edge, the status bar
   and the scene, rather than being cut through its middle. A landscape hero barely moves. */
.post-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; }
.post-card-body { padding: 1.25rem 1.5rem 1.5rem; }
.post-card .eyebrow { font-size: 0.75rem; margin-bottom: 0.5rem; color: var(--amber-700); }
.post-card h2 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; color: var(--stone-900); margin: 0 0 0.5rem; }
/* The whole card is the link's hit area, while the link itself stays the title. */
.post-card h2 a { color: inherit; text-decoration: none; }
.post-card h2 a::after { content: ""; position: absolute; inset: 0; border-radius: 24px; }
.post-card h2 a:focus-visible { outline: none; }
.post-card:has(a:focus-visible) { outline: 2px solid var(--amber-600); outline-offset: 3px; }
.post-card p { margin: 0; font-size: 0.95rem; line-height: 1.6; color: var(--stone-600); }
/* ─── PAGER ─── the bar's amber control for Newer and Older, the page numbers between. */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: -2.5rem auto 0;
  padding: 0 1rem 5rem;
}
.pager-btn {
  background: var(--amber-100);
  color: var(--amber-800);
  border: 1px solid var(--amber-200);
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}
a.pager-btn:hover { background: var(--amber-200); border-color: var(--amber-300); }
.pager-btn[aria-disabled] { opacity: 0.4; }
.pager-nums { display: flex; gap: 0.25rem; }
.pager-num {
  min-width: 2.25rem;
  padding: 7px 0;
  border-radius: 10px;
  text-align: center;
  color: var(--stone-600);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}
.pager-num:hover { color: var(--stone-900); background: var(--stone-200); }
.pager-num[aria-current] { color: #fff; background: var(--stone-900); }

.blog-empty { text-align: center; color: var(--stone-500); padding: 0 1rem 5rem; margin: 0; }

/* ─── ARTICLE ─── */
.post { padding-bottom: 4rem; }
.post .hero {
  max-width: 880px;
  margin: -3.5rem auto 3rem;
  padding: 0 1rem;
}
.post .hero img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
  border: 1px solid var(--stone-200);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
}
.post-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1rem;
  font-size: 1.2rem;
  line-height: 1.75;
}
.post-body > :first-child { margin-top: 0; }
.post-body h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--stone-900);
  margin: 3rem 0 0.75rem;
}
.post-body h3 { font-size: 1.2rem; font-weight: 700; color: var(--stone-900); margin: 2rem 0 0.5rem; }
.post-body p, .post-body ul, .post-body ol { margin: 0 0 1.25rem; }
.post-body ul, .post-body ol { padding-left: 1.4rem; }
.post-body li { margin: 0.4rem 0; }
.post-body li::marker { color: var(--amber-600); }
.post-body strong { color: var(--stone-900); font-weight: 700; }
.post-body a {
  color: var(--amber-700);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  transition: color 0.2s;
}
.post-body a:hover { color: var(--amber-800); }
.post-body blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--amber-50);
  border-left: 4px solid var(--amber-300);
  border-radius: 0 16px 16px 0;
  color: var(--stone-700);
}
.post-body blockquote p { margin: 0.5rem 0; }
.post-body figure { margin: 2.25rem 0; text-align: center; }
/* A tall image (an app screenshot) would otherwise run several screens at column width. */
.post-body figure img {
  display: inline-block;
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
}
.back-link { max-width: 680px; margin: 3rem auto 0; padding: 0 1rem; font-size: 0.95rem; }
.back-link a { color: var(--amber-700); font-weight: 600; text-decoration: none; }
.back-link a:hover { color: var(--amber-800); }

/* ─── CLOSING BAND ─── the home page's .section--cta. A text link, not a second App Store
   badge: one badge per layout, and "Available on the App Store" is Apple's approved wording. */
.blog-cta {
  background: linear-gradient(180deg, var(--amber-50), var(--amber-100));
  text-align: center;
  padding: 4.5rem 1.5rem;
}
.blog-cta-inner { max-width: 560px; margin: 0 auto; }
.blog-cta h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25; /* the article's h2, so the page's headings set alike */
  color: var(--stone-900);
  margin: 0 0 0.75rem;
}
.blog-cta p { font-size: 1.05rem; line-height: 1.6; color: var(--stone-600); margin: 0; }
.blog-cta a {
  color: var(--amber-700);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}
.blog-cta a:hover { color: var(--amber-800); }

/* ─── FOOTER ─── the home page's, without the room it reserves for its fixed bar. */
.blog-footer {
  background: var(--stone-900);
  color: var(--stone-400);
  padding: 2.5rem 2rem;
  text-align: center;
}
.blog-footer .footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  margin-bottom: 1.25rem;
}
.blog-footer a { color: var(--stone-400); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.blog-footer a:hover { color: #fff; }
.blog-footer .copy { font-size: 0.8rem; color: var(--stone-500); }

a:focus-visible { outline: 2px solid var(--amber-600); outline-offset: 2px; border-radius: 4px; }

/* A phone gets a lot more room, not less. Tuned by eye against the live article at 390pt over
   three rounds (24px, then 32px gutters were both still too tight): 40px gutters, and roughly
   double the desktop's space between paragraphs, headings, list items and figures. The body
   is 18px, which in that column is about 33 characters a line. */
@media (max-width: 560px) {
  /* 24px, not the content's 40px: at 375pt the bar's three items do not fit inside wider
     gutters without wrapping the name. */
  .blog-bar-inner { padding: 10px 1.5rem; }
  .blog-bar nav { gap: 0.9rem; }
  .blog-sky { padding: 4.5rem 2.5rem 5rem; }
  .blog-sky .eyebrow { margin-bottom: 1rem; }
  .blog-sky h1 { margin-bottom: 1.75rem; line-height: 1.3; }
  .blog-sky .lede { font-size: 1.2rem; line-height: 1.6; }
  .post .hero { margin-top: -3rem; margin-bottom: 4.5rem; padding: 0 2.5rem; }
  .post-list { margin-top: -2.5rem; padding-left: 2.5rem; padding-right: 2.5rem; gap: 2.5rem; }
  .post .hero img, .post-card { border-radius: 18px; }
  .post-body { font-size: 1.125rem; line-height: 1.95; padding: 0 2.5rem; }
  .post-body p, .post-body ul, .post-body ol { margin-bottom: 2.25rem; }
  .post-body h2 { margin: 4rem 0 2rem; line-height: 1.3; }
  .post-body h3 { margin: 3.75rem 0 2rem; }
  .post-body li { margin: 1.5rem 0; }
  .post-body blockquote { margin: 3.75rem 0; padding: 1.5rem 1.5rem; }
  .post-body figure { margin: 4.5rem 0; }
  .back-link { padding: 0 2.5rem; margin-top: 5rem; }
  .blog-cta h2 { margin-bottom: 1.75rem; line-height: 1.3; }
  .post { padding-bottom: 5rem; }
}

/* The narrowest phones (320pt, or a larger one at zoomed display): the bar's three items need
   tighter spacing to stay on one line. Measured at 320, 375 and 390: with these rules the
   button ends 16px or more inside the edge at each. */
@media (max-width: 360px) {
  .blog-bar-inner { padding: 10px 1rem; gap: 0.5rem; }
  .blog-bar nav { gap: 0.6rem; }
  .blog-bar .get-app-btn { padding: 6px 11px; }
  /* 40px gutters would leave a 240px column at 320pt; 28px keeps about 30 characters. */
  .blog-sky, .post-list, .back-link, .post .hero, .post-body { padding-left: 1.75rem; padding-right: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .post-card, .post-card:hover { transition: none; transform: none; }
}
