/* ==========================================================================
   Simple Titbit — Design System & Styles
   Palette derived from the Simple Titbit logo: forest green, slate blue, gold.
   Mobile-first, accessible, low-bandwidth friendly.
   ========================================================================== */

:root {
  /* Brand */
  --green:        #2E6B4F;
  --green-600:    #245840;
  --green-050:    #E8F1EC;
  --blue:         #37588A;
  --blue-600:     #2C4770;
  --blue-050:     #E9EEF6;
  --gold:         #E0A82E;
  --gold-600:     #C08F1E;
  --gold-050:     #FBF3DF;

  /* Neutrals */
  --ink:          #1A1F2B;
  --ink-soft:     #39414F;
  --muted:        #5B6472;
  --line:         #E6E9EF;
  --line-soft:    #F0F2F6;
  --bg:           #FFFFFF;
  --bg-alt:       #F7F8FA;
  --bg-deep:      #12241C; /* deep green for footer */

  /* Semantic */
  --brand:        var(--green);
  --brand-strong: var(--green-600);
  --accent:       var(--gold);
  --accent-strong:var(--gold-600);

  /* Type */
  --font-head: "Sora", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Scale */
  --step--1: clamp(0.83rem, 0.79rem + 0.2vw, 0.92rem);
  --step-0:  clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem);
  --step-2:  clamp(1.45rem, 1.28rem + 0.85vw, 1.85rem);
  --step-3:  clamp(1.75rem, 1.45rem + 1.5vw, 2.5rem);
  --step-4:  clamp(2.1rem, 1.6rem + 2.5vw, 3.4rem);

  /* Layout */
  --maxw: 1120px;
  --maxw-prose: 720px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20,30,25,.05), 0 2px 8px rgba(20,30,25,.05);
  --shadow-md: 0 6px 24px rgba(20,30,25,.08);
  --shadow-lg: 0 18px 48px rgba(20,30,25,.14);
  --gap: clamp(1rem, 0.6rem + 2vw, 2rem);
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
strong { color: var(--ink); font-weight: 600; }
ul, ol { padding-left: 1.25rem; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ---------- Utilities ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 0.5rem + 3vw, 2rem); }
.prose { max-width: var(--maxw-prose); }
.section { padding-block: clamp(2.75rem, 2rem + 4vw, 5rem); }
.bg-alt { background: var(--bg-alt); }
.eyebrow { display: inline-block; font-family: var(--font-head); font-weight: 600; font-size: var(--step--1); letter-spacing: .08em; text-transform: uppercase; color: var(--green); }
.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.lead { font-size: var(--step-1); color: var(--muted); }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: .7rem 1rem; z-index: 1000; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 600; font-size: var(--step-0);
  padding: .8rem 1.4rem; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease); text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--gold); color: #2a2205; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--gold-600); box-shadow: var(--shadow-md); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-600); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn-lg { padding: 1rem 1.8rem; font-size: var(--step-1); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.9); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-head); font-weight: 700; color: var(--ink); font-size: 1.15rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; }
.nav-links { display: flex; align-items: center; gap: .35rem; list-style: none; padding: 0; margin: 0; }
.nav-links a { color: var(--ink-soft); font-family: var(--font-head); font-weight: 500; font-size: .98rem; padding: .5rem .8rem; border-radius: 8px; }
.nav-links a:hover { color: var(--green); background: var(--green-050); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--green); }
.nav-cta { margin-left: .4rem; }
.nav-toggle { display: none; background: none; border: 1.5px solid var(--line); border-radius: 10px; width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch;
    background: #fff; border-bottom: 1px solid var(--line); padding: .75rem clamp(1rem,3vw,2rem) 1.25rem; gap: .15rem;
    box-shadow: var(--shadow-md); transform: translateY(-140%); transition: transform .28s var(--ease); max-height: calc(100vh - 68px); overflow: auto;
  }
  .nav[data-open="true"] .nav-links { transform: translateY(0); }
  .nav-links a { padding: .85rem .6rem; font-size: 1.05rem; border-bottom: 1px solid var(--line-soft); }
  .nav-cta { margin: .6rem 0 0; }
  .nav-cta .btn { width: 100%; justify-content: center; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at 80% -10%, var(--green-050), transparent 60%), radial-gradient(900px 500px at -10% 10%, var(--blue-050), transparent 55%); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 1rem + 3vw, 3.5rem); align-items: center; padding-block: clamp(2.5rem, 1.5rem + 5vw, 5rem); }
.hero h1 { margin-bottom: 1rem; }
.hero .lead { max-width: 32ch; margin-bottom: 1.75rem; color: var(--ink-soft); }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; }
.hero-proof { margin-top: 1.5rem; display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: var(--step--1); }
.hero-visual { position: relative; }
.hero-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 1.5rem; }
.hero-card .kicker { color: var(--green); font-weight: 600; font-family: var(--font-head); font-size: var(--step--1); text-transform: uppercase; letter-spacing: .08em; }
.hero-card h3 { font-size: var(--step-1); margin: .5rem 0 .75rem; }
.pillars { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.pillars li { display: flex; gap: .7rem; align-items: flex-start; font-size: .98rem; }
.pillars .dot { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-family: var(--font-head); font-weight: 700; font-size: .85rem; }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; } .hero-visual { order: -1; } }

/* ---------- Post cards ---------- */
.grid-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), border-color .2s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #dfe3ea; }
.card a { text-decoration: none; color: inherit; }
.card-media { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--green), var(--blue)); position: relative; display: grid; place-items: center; }
.card-media .tag { position: absolute; top: .8rem; left: .8rem; background: rgba(255,255,255,.92); color: var(--green-600); font-family: var(--font-head); font-weight: 600; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; padding: .3rem .6rem; border-radius: 999px; }
.card-media .glyph { font-family: var(--font-head); font-weight: 800; color: rgba(255,255,255,.9); font-size: 2rem; }
.card-body { padding: 1.15rem 1.25rem 1.35rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.card-meta { font-size: var(--step--1); color: var(--muted); display: flex; gap: .6rem; align-items: center; }
.card-title { font-family: var(--font-head); font-size: 1.18rem; font-weight: 700; color: var(--ink); line-height: 1.25; }
.card:hover .card-title { color: var(--green-600); }
.card-excerpt { font-size: .96rem; color: var(--muted); }
.card-more { margin-top: auto; font-family: var(--font-head); font-weight: 600; font-size: .92rem; color: var(--green); display: inline-flex; align-items: center; gap: .35rem; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.section-head h2 { font-size: var(--step-3); }
.section-head p { color: var(--muted); max-width: 46ch; }

/* ---------- Newsletter CTA ---------- */
.newsletter { background: linear-gradient(135deg, var(--green), var(--blue)); color: #fff; border-radius: 22px; padding: clamp(1.75rem, 1.2rem + 3vw, 3rem); text-align: center; position: relative; overflow: hidden; }
.newsletter::after { content: ""; position: absolute; inset: auto -60px -80px auto; width: 260px; height: 260px; background: radial-gradient(circle, rgba(224,168,46,.35), transparent 65%); }
.newsletter h2 { color: #fff; }
.newsletter p { color: rgba(255,255,255,.9); max-width: 46ch; margin: .75rem auto 1.5rem; }
.newsletter .btn-primary { box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.newsletter small { display: block; margin-top: .9rem; color: rgba(255,255,255,.75); font-size: var(--step--1); }

/* ---------- Social hub ---------- */
.socials { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; }
.social-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-soft); font-family: var(--font-head); font-weight: 500; font-size: .92rem; transition: all .18s var(--ease); }
.social-chip:hover { text-decoration: none; border-color: var(--green); color: var(--green); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.social-chip svg { width: 18px; height: 18px; }

/* ---------- Article ---------- */
.article-header { padding-block: clamp(1.75rem, 1rem + 3vw, 3rem) 0; }
.breadcrumb { font-size: var(--step--1); color: var(--muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--muted); }
.article-title { font-size: var(--step-4); margin: .4rem 0 .9rem; max-width: 18ch; }
.article-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; color: var(--muted); font-size: var(--step--1); }
.article-meta .pill { background: var(--green-050); color: var(--green-600); padding: .25rem .7rem; border-radius: 999px; font-family: var(--font-head); font-weight: 600; }
.article-hero { margin: 1.5rem 0 0; aspect-ratio: 21 / 9; border-radius: 18px; background: linear-gradient(135deg, var(--green), var(--blue)); display: grid; place-items: center; color: rgba(255,255,255,.9); font-family: var(--font-head); font-weight: 800; font-size: clamp(1.5rem,4vw,2.5rem); }

.article-body { font-size: var(--step-0); color: var(--ink-soft); }
.article-body > * + * { margin-top: 1.15rem; }
.article-body h2 { font-size: var(--step-2); margin-top: 2.4rem; }
.article-body h3 { font-size: var(--step-1); margin-top: 1.8rem; }
.article-body p { line-height: 1.75; }
.article-body ul, .article-body ol { padding-left: 1.4rem; }
.article-body li + li { margin-top: .4rem; }
.article-body a { color: var(--blue-600); text-decoration: underline; text-underline-offset: 2px; }
.article-body blockquote { border-left: 4px solid var(--gold); background: var(--gold-050); padding: 1rem 1.25rem; border-radius: 0 10px 10px 0; font-size: var(--step-1); color: var(--ink); }
.article-body blockquote p { margin: 0; }
.callout { border: 1px solid var(--green-050); background: var(--green-050); border-radius: 14px; padding: 1.25rem 1.4rem; }
.callout .callout-title { font-family: var(--font-head); font-weight: 700; color: var(--green-600); margin-bottom: .4rem; display: flex; align-items: center; gap: .5rem; }
.key-takeaways { border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem 1.4rem; background: var(--bg-alt); }
.key-takeaways h2 { margin-top: 0; font-size: var(--step-1); }
.article-body figure { margin: 1.5rem 0; }
.faq h2 { margin-top: 2.6rem; }
.faq details { border: 1px solid var(--line); border-radius: 12px; padding: .25rem 1.1rem; margin-top: .75rem; background: #fff; }
.faq summary { cursor: pointer; font-family: var(--font-head); font-weight: 600; color: var(--ink); padding: .85rem 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--green); font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq details[open] summary { border-bottom: 1px solid var(--line-soft); }
.faq details p { padding: .85rem 0; margin: 0; color: var(--muted); }

.article-footer { border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-list a { font-size: var(--step--1); background: var(--bg-alt); border: 1px solid var(--line); padding: .3rem .7rem; border-radius: 999px; color: var(--muted); }
.share { display: flex; gap: .5rem; }
.share a { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: var(--ink-soft); }
.share a:hover { border-color: var(--green); color: var(--green); }
.share svg { width: 17px; height: 17px; }

.author-box { display: flex; gap: 1rem; align-items: center; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 16px; padding: 1.25rem; margin-top: 2rem; }
.author-box .avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg,var(--green),var(--blue)); color:#fff; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; }
.author-box strong { display: block; font-family: var(--font-head); }
.author-box p { font-size: .95rem; color: var(--muted); margin: .2rem 0 0; }

/* ---------- Blog index controls ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.75rem; }
.filter-btn { font-family: var(--font-head); font-weight: 500; font-size: .9rem; padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); cursor: pointer; transition: all .15s var(--ease); }
.filter-btn:hover { border-color: var(--green); color: var(--green); }
.filter-btn[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.empty { text-align: center; color: var(--muted); padding: 2rem; }

/* ---------- Products ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: var(--gap); }
.product { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; background: #fff; }
.product .badge { font-family: var(--font-head); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gold-600); background: var(--gold-050); padding: .25rem .6rem; border-radius: 999px; }
.product h3 { font-size: var(--step-1); margin: .8rem 0 .4rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-deep); color: rgba(255,255,255,.72); padding-block: clamp(2.5rem,2rem+2vw,3.5rem) 1.5rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1rem; }
.site-footer a { color: rgba(255,255,255,.72); }
.site-footer a:hover { color: #fff; }
.footer-brand { display: inline-flex; align-items: center; gap: .6rem; color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.footer-brand img { width: 36px; height: 36px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; font-size: .95rem; }
.footer-social { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.footer-social a { width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; display: grid; place-items: center; }
.footer-social a:hover { background: rgba(255,255,255,.1); }
.footer-social svg { width: 16px; height: 16px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2rem; padding-top: 1.25rem; font-size: var(--step--1); display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand-col { grid-column: 1 / -1; } }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.pagelead { max-width: 46ch; }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
