/* Tend blog: shared styles for the article template + articles index.
   Quiet & Editorial: warm paper + ink, 1px hairlines, flat, color only where
   it carries meaning. Space Grotesk display + Hanken Grotesk UI. */
:root {
  --canvas: #F2F0EA;
  --surface: #FAF9F5;
  --chip: #F6F4EE;
  --line: #E4DFD3;
  --heat0: #EDE9DF;
  --ink: #1A1814;
  --body: #3A362E;
  --muted: #6E695F;
  --faint: #A8A299;
  --paper-inv: #F2EFE9;
  --inv-muted: #9A958B;
  --indigo: #4655C0;
  --sky: #2C7EC4;
  --emerald: #1F8A5E;
  --teal: #10807F;
  --coral: #E2553A;
  --display: 'Space Grotesk', system-ui, sans-serif;
  --sans: 'Hanken Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* category accents (the only color on the page) */
.cat-indigo { color: var(--indigo); }
.cat-sky { color: var(--sky); }
.cat-emerald { color: var(--emerald); }
.cat-teal { color: var(--teal); }
.cat-coral { color: var(--coral); }

/* ---------- Nav ---------- */
.site-nav { border-bottom: 1px solid var(--line); background: var(--canvas); }
.site-nav .wrap {
  max-width: 1120px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.site-nav .brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.site-nav .brand img { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); }
.site-nav .brand span { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -0.2px; color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-link { color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.nav-link:hover { color: var(--muted); }
.nav-cta {
  background: var(--ink); color: var(--paper-inv); font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 9px; text-decoration: none;
}
a:focus-visible, .nav-cta:focus-visible, .appstore:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ---------- Article ---------- */
.article { max-width: 680px; margin: 0 auto; padding: 28px 24px 0; }
.eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--faint);
}
.article-title {
  margin: 12px 0 0; font-family: var(--display); font-weight: 700;
  font-size: clamp(28px, 6vw, 40px); line-height: 1.15; letter-spacing: -0.6px;
  color: var(--ink); text-wrap: pretty;
}
.dek {
  margin: 12px 0 0; font-size: clamp(16px, 3.4vw, 19px); line-height: 1.55; color: var(--muted);
}
.byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 16px; font-size: 12.5px; color: var(--faint);
}
.byline .author { font-weight: 600; color: var(--muted); }

/* ---------- Body ---------- */
.article-body { margin-top: 24px; font-size: 16.5px; line-height: 1.65; color: var(--body); }
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin: 16px 0 0; }
.article-body h2 {
  margin: 32px 0 0; font-family: var(--display); font-weight: 700;
  font-size: clamp(21px, 4.2vw, 25px); line-height: 1.25; letter-spacing: -0.3px; color: var(--ink);
}
.article-body h2 + p { margin-top: 12px; }
.article-body h3 {
  margin: 26px 0 0; font-family: var(--display); font-weight: 600;
  font-size: clamp(18px, 3.6vw, 20px); line-height: 1.3; letter-spacing: -0.2px; color: var(--ink);
}
.article-body strong { font-weight: 600; color: var(--ink); }
.article-body a {
  color: var(--ink); text-decoration: underline;
  text-decoration-color: var(--faint); text-underline-offset: 2px;
}
.article-body a:hover { text-decoration-color: var(--ink); }
.article-body ul, .article-body ol { margin: 16px 0 0; padding-left: 22px; }
.article-body li { margin: 8px 0 0; }
.article-body li::marker { color: var(--faint); }
.article-body blockquote {
  margin: 28px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 22px 8px;
}
.article-body blockquote p {
  margin: 0; font-family: var(--display); font-weight: 600; font-size: 19.5px;
  line-height: 1.45; color: var(--ink); text-align: center; text-wrap: pretty;
}
.article-body hr { border: none; border-top: 1px solid var(--line); margin: 32px 0 0; }
.article-body table { margin: 20px 0 0; border-collapse: collapse; width: 100%; font-size: 14.5px; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.article-body th { background: var(--surface); font-family: var(--display); font-weight: 600; font-size: 13.5px; }

/* ---------- Download banners ---------- */
.appstore {
  display: inline-flex; align-items: center; gap: 8px; background: #000;
  border: 1px solid #A6A6A6; border-radius: 7px; text-decoration: none;
  transition: transform .15s ease;
}
.appstore:hover { transform: translateY(-1px); }
.appstore svg { flex: 0 0 auto; }
.appstore > span { text-align: left; }
.appstore .t1, .appstore .t2 { display: block; }
.appstore .t1 { color: #fff; line-height: 1; }
.appstore .t2 { color: #fff; font-weight: 600; line-height: 1.15; letter-spacing: -0.2px; }

.banner-mid {
  margin: 28px 0 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px; display: flex; align-items: center; gap: 14px;
}
.banner-mid > img { width: 44px; height: 44px; border-radius: 11px; border: 1px solid var(--line); flex: 0 0 auto; }
.banner-mid .txt { flex: 1 1 0; }
.banner-mid .h { font-family: var(--display); font-size: 14.5px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.banner-mid .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.banner-mid .appstore { padding: 0 12px; height: 40px; }
.banner-mid .appstore .t1 { font-size: 8px; }
.banner-mid .appstore .t2 { font-size: 15px; }

.banner-end {
  max-width: 680px; margin: 36px auto 0; background: var(--ink); border-radius: 16px;
  padding: 30px 24px; text-align: center;
}
.banner-end > img { width: 56px; height: 56px; border-radius: 14px; margin: 0 auto; }
.banner-end .h {
  margin-top: 14px; font-family: var(--display); font-weight: 700;
  font-size: clamp(22px, 4.6vw, 28px); line-height: 1.2; letter-spacing: -0.4px;
  color: var(--paper-inv); text-wrap: pretty;
}
.banner-end .s { margin-top: 6px; font-size: 13.5px; color: var(--inv-muted); }
.banner-end .appstore { margin-top: 18px; padding: 0 18px; height: 52px; border-radius: 9px; border-color: #615C54; }
.banner-end .appstore .t1 { font-size: 11px; }
.banner-end .appstore .t2 { font-size: 21px; }

/* margin between column edge and the dark card on small screens */
@media (max-width: 727px) { .banner-end { margin-left: 20px; margin-right: 20px; } }

/* attribution / corrections note (article tail) */
.article-tail { max-width: 680px; margin: 24px auto 0; padding: 0 24px; }
.article-tail p { margin: 14px 0 0; font-size: 13px; line-height: 1.6; color: var(--faint); text-align: center; }
.article-tail a { color: var(--muted); }
.article-tail strong { color: var(--muted); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 36px; padding: 22px 24px 36px; border-top: 1px solid var(--line); }
.site-footer .wrap { max-width: 1120px; margin: 0 auto; }
.site-footer .links {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px;
  font-size: 12px; font-weight: 500; color: var(--muted);
}
.site-footer .links a { color: var(--muted); text-decoration: none; }
.site-footer .links a:hover { color: var(--ink); text-decoration: underline; }
.site-footer .sep { color: var(--faint); }
.site-footer .copy { margin-top: 10px; text-align: center; font-size: 11px; color: var(--faint); }

/* ---------- Articles index ---------- */
.index-main { max-width: 980px; margin: 0 auto; padding: 0 24px; }
.index-head { padding: 28px 0 0; }
.index-head h1 {
  margin: 10px 0 0; font-family: var(--display); font-weight: 700;
  font-size: clamp(27px, 6vw, 38px); line-height: 1.12; letter-spacing: -0.7px; color: var(--ink);
}
.index-head p { margin: 10px 0 0; max-width: 520px; font-size: 15px; line-height: 1.55; color: var(--muted); }

.index-grid { margin-top: 22px; }

.featured-card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px 20px 20px; text-decoration: none;
  transition: border-color .15s ease;
}
.featured-card:hover { border-color: var(--faint); }
.meta-row { display: flex; align-items: center; gap: 8px; }
.meta-row .eyebrow { font-size: 10.5px; }
.meta-row .meta { font-size: 11px; color: var(--faint); }
.featured-card h2 {
  margin: 8px 0 0; font-family: var(--display); font-size: 20px; font-weight: 700;
  line-height: 1.2; letter-spacing: -0.3px; color: var(--ink); text-wrap: pretty;
}
.featured-card .card-dek { margin: 7px 0 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.featured-card .read-more { margin-top: 12px; font-size: 13.5px; font-weight: 700; color: var(--ink); }

.post-list { margin-top: 10px; display: flex; flex-direction: column; }
.post-row {
  padding: 18px 4px; border-bottom: 1px solid var(--line);
  display: flex; gap: 14px; align-items: center; text-decoration: none;
}
.post-row:last-child { border-bottom: none; }
.post-row .txt { flex: 1 1 0; }
.post-row .meta-row { display: flex; }
.post-row .row-title {
  display: block; margin-top: 6px; font-family: var(--display); font-size: 16.5px;
  font-weight: 600; line-height: 1.3; letter-spacing: -0.2px; color: var(--ink);
}
.post-row:hover .row-title { color: var(--muted); }
.tile {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px;
  background: var(--chip); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.tile-num { font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--teal); }
.tile-ring {
  width: 20px; height: 20px; border-radius: 10px;
  background: conic-gradient(var(--indigo) 0deg 240deg, var(--heat0) 240deg 360deg);
  display: flex; align-items: center; justify-content: center;
}
.tile-ring::after { content: ""; width: 12px; height: 12px; border-radius: 6px; background: var(--chip); }

.banner-index {
  max-width: 980px; margin: 20px auto 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 18px;
  display: flex; align-items: center; gap: 14px;
}
.banner-index .txt { flex: 1 1 0; }
.banner-index .h { font-family: var(--display); font-size: 14.5px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.banner-index .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.banner-index .appstore { padding: 0 12px; height: 40px; }
.banner-index .appstore .t1 { font-size: 8px; }
.banner-index .appstore .t2 { font-size: 15px; }
@media (max-width: 1027px) { .banner-index { margin-left: 24px; margin-right: 24px; } }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  .site-nav .wrap { padding: 18px 24px; }
  .site-nav .brand img { width: 32px; height: 32px; border-radius: 8px; }
  .site-nav .brand span { font-size: 19px; }
  .nav-cta { font-size: 13.5px; padding: 9px 16px; }

  .article { padding-top: 48px; }
  .article-title { margin-top: 14px; letter-spacing: -1.1px; }
  .dek { margin-top: 14px; }
  .byline { margin-top: 18px; font-size: 13px; }
  .article-body { margin-top: 32px; font-size: 17.5px; line-height: 1.7; }
  .article-body p { margin-top: 18px; }
  .article-body h2 { margin-top: 40px; letter-spacing: -0.4px; }
  .article-body h2 + p { margin-top: 14px; }
  .article-body blockquote { margin-top: 36px; padding: 28px 40px; }
  .article-body blockquote p { font-size: 23px; }
  .banner-mid { margin-top: 36px; padding: 20px 24px; gap: 18px; }
  .banner-mid > img { width: 48px; height: 48px; border-radius: 12px; }
  .banner-mid .h { font-size: 16px; }
  .banner-mid .s { font-size: 13.5px; }
  .banner-mid .appstore { padding: 0 14px; height: 44px; border-radius: 8px; }
  .banner-mid .appstore .t1 { font-size: 9px; }
  .banner-mid .appstore .t2 { font-size: 17px; }
  .banner-end { margin-top: 48px; padding: 40px; }
  .banner-end > img { width: 64px; height: 64px; border-radius: 15px; }
  .banner-end .s { font-size: 14.5px; }

  .index-head { padding-top: 48px; }
  .index-head p { font-size: 16.5px; }
  .index-grid { margin-top: 28px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: start; }
  .featured-card { padding: 22px 26px 26px; }
  .featured-card h2 { font-size: 26px; line-height: 1.15; letter-spacing: -0.5px; margin-top: 10px; }
  .featured-card .card-dek { font-size: 15px; margin-top: 8px; }
  .featured-card .read-more { margin-top: 14px; font-size: 14px; }
  .meta-row .meta { font-size: 11.5px; }
  .post-list { margin-top: 0; gap: 20px; }
  .post-row {
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    padding: 22px 24px; transition: border-color .15s ease;
  }
  .post-row:last-child { border-bottom: 1px solid var(--line); }
  .post-row:hover { border-color: var(--faint); }
  .post-row .row-title { font-size: 18.5px; line-height: 1.25; margin-top: 8px; }
  .post-row .tile { display: none; }
  .banner-index { margin-top: 20px; padding: 20px 24px; }
}
