/* ==========================================================================
   Gruion Blog — 2026
   The blog carries the same design system as gruion.com: amber #FFB020 on ink
   #1C1A16, Sora/Inter, one accent. Tokens are copied from
   gruion_website/aws_s3/css/gruion.css rather than imported — the two sites
   deploy separately, so a shared file would be a cross-origin dependency on
   every page load.

   This sheet is STANDALONE. config.toml no longer loads the casper3 theme's
   bootstrap/styles bundle (240 KB of markup-coupled CSS we were fighting),
   and every template that produced bootstrap markup is overridden in layouts/.
   ========================================================================== */

:root {
  --ink:         #1C1A16;
  --ink-2:       #2A2721;

  --brand:       #FFB020;
  --brand-light: #FFC94A;
  --brand-dark:  #8A5A00;   /* amber-family TEXT on light: 5.9:1. Amber itself
                               is 1.83:1 and can never be text. */
  --brand-wash:  #FFF4E0;

  --paper: #FFFFFF;
  --mist:  #FAF8F4;
  --line:  #EAE3D8;
  --body:  #5A5750;
  --muted: #8C877D;

  --grad-brand: linear-gradient(135deg, var(--brand-light) 0%, var(--brand) 100%);
  --grad-ink:   linear-gradient(160deg, #302C24 0%, var(--ink) 72%);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  --sh-sm: 0 2px 8px rgba(28,26,22,.06);
  --sh-md: 0 10px 30px -12px rgba(28,26,22,.16);
  --sh-lg: 0 30px 60px -28px rgba(28,26,22,.30);
  --sh-brand: 0 16px 34px -14px rgba(255,176,32,.55);

  --font-display: 'Sora', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --nav-h: 76px;
  --maxw: 1180px;
  --readw: 720px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--body);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1.2em; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--brand);
    text-decoration-thickness: 2px; text-underline-offset: 3px; transition: color .18s ease; }
a:hover { color: var(--brand-dark); }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  padding: 13px 24px; border-radius: var(--r-pill);
  border: 1.5px solid transparent; cursor: pointer;
  text-decoration: none; transition: transform .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-2px); }
/* Ink on amber = 9.5:1. White on amber would be 1.8:1, so the label is always ink. */
.btn-primary { background: var(--grad-brand); color: var(--ink); box-shadow: var(--sh-brand); }
.btn-primary:hover { color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--ink); }
.btn-sm { padding: 9px 18px; font-size: 14px; }

/* ==========================================================================
   Navigation — mirrors gruion.com so the two sites read as one property
   ========================================================================== */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { height: 100%; display: flex; align-items: center; gap: 20px; }
.nav-logo { flex: none; text-decoration: none; }
.nav-logo img { height: 34px; width: auto; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.nav-links a {
  font-family: var(--font-display); font-size: 15px; font-weight: 500;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.nav-links a:not(.btn):hover { color: var(--brand-dark); }
.nav-toggle {
  display: none; margin-left: auto;
  width: 44px; height: 44px; padding: 10px;
  background: none; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; margin: 4px 0; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: var(--sh-md); padding: 8px 24px 20px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav-links a.btn { margin-top: 14px; justify-content: center; border-bottom: none; }
}

/* ==========================================================================
   Blog index hero
   ========================================================================== */
.blog-hero {
  background: var(--mist);
  border-bottom: 1px solid var(--line);
  padding: 72px 0 64px;
  position: relative; overflow: hidden;
}
.blog-hero::after {
  /* the same faint grid the marketing site uses behind its hero */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
                    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px; opacity: .45;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%);
}
.blog-hero .wrap { position: relative; z-index: 1; max-width: 860px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand-dark); background: var(--brand-wash);
  padding: 8px 16px; border-radius: var(--r-pill); margin-bottom: 22px;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.blog-hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.4rem); font-weight: 700; margin-bottom: .35em; }
/* Amber can't be text, so emphasis is a highlight behind ink. */
.blog-hero h1 .accent {
  color: var(--ink);
  background-image: linear-gradient(transparent 58%, var(--brand-light) 58%, var(--brand) 96%, transparent 96%);
  padding: 0 .08em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.blog-hero p { font-size: 1.15rem; color: var(--body); max-width: 620px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ==========================================================================
   Post feed
   ========================================================================== */
.feed { padding: 64px 0 88px; }
.feed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 1000px) { .feed-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 660px)  { .feed-grid { grid-template-columns: 1fr; } }

.card {
  display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); border-color: var(--brand); color: inherit; }
.card-media { aspect-ratio: 1200 / 630; background: var(--mist); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
/* No usable cover → a branded category card. Drawn in CSS so it costs nothing
   and can never 404, and so a post without artwork still looks deliberate.
   Four variants keep a grid of them from reading as a rendering fault. */
.card-media.is-placeholder {
  background: var(--grad-ink);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 26px 28px; gap: 8px; position: relative; overflow: hidden;
}
.card-media.is-placeholder::before {
  content: ""; position: absolute; width: 230px; height: 230px; border-radius: 50%;
  background: var(--brand); opacity: .16; filter: blur(14px);
}
.is-placeholder.v0::before { right: -70px; top: -70px; }
.is-placeholder.v1::before { left: -80px; bottom: -90px; opacity: .12; }
.is-placeholder.v2::before { right: -90px; bottom: -60px; }
.is-placeholder.v3::before { left: 40%; top: -120px; opacity: .1; }
.is-placeholder .ph-cat {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700;
  line-height: 1.2; color: #F4F0E9; letter-spacing: -.02em; position: relative;
}
.is-placeholder .ph-mark {
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--brand); position: relative;
}
.is-lead .is-placeholder { padding: 48px 52px; }
.is-lead .is-placeholder .ph-cat { font-size: 2.6rem; }

.card-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.card-cat {
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--brand-dark); margin-bottom: 10px;
}
.card h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: .5em; }
.card p { font-size: 15px; color: var(--body); margin-bottom: 1em; }
.card-date { margin-top: auto; font-size: 13px; color: var(--muted); }

/* The first card on the index runs full width. */
.feed-grid .card.is-lead { grid-column: 1 / -1; flex-direction: row; }
/* Keep the cover's own 1200x630 ratio: stretching it to the body height
   cropped the headline off both sides. */
.feed-grid .card.is-lead .card-media { flex: 1 1 58%; align-self: center; }
.feed-grid .card.is-lead .card-body { flex: 1 1 42%; justify-content: center; padding: 40px; }
.feed-grid .card.is-lead h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; }
.feed-grid .card.is-lead p { font-size: 16px; }
@media (max-width: 800px) {
  .feed-grid .card.is-lead { flex-direction: column; }
  .feed-grid .card.is-lead .card-media { aspect-ratio: 1200 / 630; }
  .feed-grid .card.is-lead .card-body { padding: 24px; }
}

/* ==========================================================================
   Single post
   ========================================================================== */
.post-hero { background: var(--mist); border-bottom: 1px solid var(--line); padding: 56px 0 0; }
.post-hero .wrap { max-width: 860px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tags a {
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand-dark); background: var(--brand-wash);
  padding: 6px 14px; border-radius: var(--r-pill); text-decoration: none;
}
.tags a:hover { background: var(--brand); color: var(--ink); }
.post-hero h1 { font-size: clamp(2rem, 4.6vw, 3rem); font-weight: 700; }
.post-meta { font-size: 14px; color: var(--muted); margin: 0 0 32px; }
.post-meta b { color: var(--ink); font-weight: 600; }
.post-cover { border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-lg); transform: translateY(24px); }
.post-cover img { width: 100%; }

.post-body { padding: 72px 0 40px; }
.post-body .wrap { max-width: var(--readw); }
.post-lede {
  font-size: 1.3rem; line-height: 1.5; color: var(--ink);
  font-family: var(--font-display); font-weight: 400;
  border-left: 4px solid var(--brand); padding-left: 22px; margin: 0 0 40px;
}
.post-content { font-size: 1.08rem; line-height: 1.75; color: var(--body); }
.post-content h2 {
  font-size: 1.6rem; font-weight: 700; margin: 2.4em 0 .6em;
  padding-bottom: .35em; border-bottom: 2px solid var(--brand);
}
.post-content h3 { font-size: 1.25rem; font-weight: 600; margin: 2em 0 .5em; }
.post-content ul, .post-content ol { padding-left: 1.3em; margin: 0 0 1.4em; }
.post-content li { margin-bottom: .6em; }
.post-content blockquote {
  margin: 2em 0; padding: 20px 26px;
  background: var(--brand-wash); border-left: 4px solid var(--brand);
  border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--ink);
}
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content img { border-radius: var(--r-md); margin: 2em 0; box-shadow: var(--sh-md); }
.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em;
  background: var(--mist); border: 1px solid var(--line); border-radius: 6px; padding: .15em .4em;
}
.post-content pre {
  background: var(--ink); color: #E8E3D9; border-radius: var(--r-md);
  padding: 20px 24px; overflow-x: auto; font-size: .92rem; line-height: 1.6;
}
.post-content pre code { background: none; border: 0; padding: 0; color: inherit; }
.post-content table { width: 100%; border-collapse: collapse; margin: 2em 0; font-size: .95rem; }
.post-content th, .post-content td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.post-content th { font-family: var(--font-display); color: var(--ink); background: var(--mist); }

/* Carousel attachment. A PDF cannot render as an <img>, so it is offered as a
   download card rather than silently sitting unreferenced in the bundle. */
.carousel-card {
  display: flex; align-items: center; gap: 18px;
  margin: 3rem 0 0; padding: 20px 24px;
  background: var(--mist); border: 1px solid var(--line); border-radius: var(--r-lg);
  text-decoration: none;
}
.carousel-card:hover { border-color: var(--brand); box-shadow: var(--sh-md); }
.carousel-card .ico {
  flex: none; width: 46px; height: 46px; border-radius: var(--r-sm);
  background: var(--grad-brand); display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 12px; color: var(--ink);
}
.carousel-card .txt { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: 15px; }
.carousel-card .txt small { display: block; font-family: var(--font-body); font-weight: 400; color: var(--muted); font-size: 13px; }

/* ---------- end-of-post CTA ---------- */
.post-cta { margin: 64px 0 0; padding: 40px; border-radius: var(--r-lg); background: var(--grad-ink); color: #C9C3B8; text-align: center; }
.post-cta h3 { color: var(--paper); font-size: 1.5rem; margin-bottom: .5em; }
.post-cta p { margin-bottom: 1.6em; }

/* ---------- read next ---------- */
.read-next { background: var(--mist); border-top: 1px solid var(--line); padding: 64px 0 80px; margin-top: 72px; }
.read-next h2 { font-size: 1.4rem; margin-bottom: 28px; }
.read-next .feed-grid { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 660px) { .read-next .feed-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--ink); color: #A9A398; padding: 56px 0 32px; font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.site-footer h4 { color: var(--paper); font-size: 15px; margin-bottom: 14px; }
.site-footer a { color: #A9A398; text-decoration: none; }
.site-footer a:hover { color: var(--brand); }
.footer-col { max-width: 320px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); margin-top: 40px; padding-top: 22px;
  font-size: 13px; color: #7E796F; text-align: center;
}
