/* ------------------------------------------------------------------
   Second Wind — shared design system
   Typography and palette follow the Adviora editorial template:
   Satoshi for everything, Instrument Serif italic for accents,
   warm parchment paper rather than white.
   ------------------------------------------------------------------ */

:root {
  /* paper */
  --paper:      #f4eedf;
  --band:       #ede3cd;
  --card:       #fbf8ef;
  --card-band:  #f4eedf;
  --line:       #e3d7bc;

  /* type colour */
  --ink:        #2d2920;
  --body:       #555350;
  --black:      #201c15;

  /* accents */
  --sienna:     #8e3f22;
  --gold:       #e8a842;
  --on-dark:    #f4eedf;

  /* families */
  --font:       "Satoshi", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-alt:   "Instrument Serif", Georgia, "Times New Roman", serif;

  /* layout */
  --container:  1260px;
  --inner:      760px;
  --gutter:     1.875rem;
  --section:    clamp(4.5rem, 9vw, 12.5rem);

  /* radii — the template is pill-heavy */
  --r-xs:       .625rem;
  --r-sm:       1rem;
  --r-md:       1.25rem;
  --r-pill:     6.25rem;

  --shadow:     0 1px 2px rgba(32,28,21,.05), 0 18px 48px rgba(32,28,21,.07);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:     #201c15;
    --band:      #2a251c;
    --card:      #262117;
    --card-band: #201c15;
    --line:      #3d372c;
    --ink:       #f4eedf;
    --body:      #c6bfae;
    --black:     #14110c;
    --sienna:    #d98455;
    --shadow:    0 1px 2px rgba(0,0,0,.4), 0 18px 48px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--sienna); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

/* ---------- headings ---------- */

h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  margin: 0 0 1rem;
}

h1 { font-size: clamp(2.75rem, 7.4vw, 5.125rem); line-height: 1;    letter-spacing: -.035em; }
h2 { font-size: clamp(2.25rem, 5.6vw, 4.5rem);   line-height: 1.06; letter-spacing: -.03em; }
h3 { font-size: clamp(1.875rem, 4vw, 3.125rem);  line-height: 1.05; letter-spacing: -.025em; }
h4 { font-size: clamp(1.625rem, 3vw, 2rem);      line-height: 1.1;  letter-spacing: -.02em; }
h5 { font-size: 1.5rem;   line-height: 1.2; }
h6 { font-size: 1.25rem;  line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }

/* the template's signature: an italic serif clause inside a sans heading */
em.alt, .alt {
  font-family: var(--font-alt);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.01em;
}

.pre-title {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 1.25rem;
  color: var(--body);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.pre-title::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sienna);
  flex: 0 0 auto;
}

.lede {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.5;
  max-width: 34em;
}

.quiet { color: var(--body); font-size: .9375rem; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- layout ---------- */

.container       { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.inner           { max-width: var(--inner); }
.inner-center    { max-width: var(--inner); margin-inline: auto; }
.section         { padding-block: var(--section); }
.section-sm      { padding-block: clamp(3rem, 6vw, 7rem); }
.band            { background: var(--band); }
.band .card      { background: var(--card-band); }
.center          { text-align: center; }
.inner-center.center .lede { margin-inline: auto; }

/* ---------- navbar ---------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
}
.navbar.is-scrolled { border-bottom-color: var(--line); }
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1875rem;
  letter-spacing: -.02em;
}
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand .alt { color: var(--sienna); }
.nav-menu { display: flex; align-items: center; gap: 1.75rem; }
.nav-link {
  color: var(--body);
  font-size: 1rem;
  text-decoration: none;
  transition: color .3s ease-in-out;
}
.nav-link:hover { color: var(--ink); }
@media (max-width: 860px) { .nav-menu { display: none; } }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  padding: 1rem 2rem;
  border: 1px solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: transform .3s ease-in-out, background-color .3s ease-in-out;
}
.btn:hover { background: var(--black); border-color: var(--black); color: var(--paper); transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--line); color: var(--ink); }
.btn-sm { padding: .75rem 1.5rem; font-size: .9375rem; }

/* the navbar CTA is wider than a phone — the hero carries it from here down */
@media (max-width: 600px) {
  .navbar-inner > .btn { display: none; }
  .btn { padding: .875rem 1.5rem; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--body);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.2;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sienna);
  flex: 0 0 auto;
}
.badge-gold::before { background: var(--gold); }

/* ---------- cards ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1.75rem;
}
.card h6 { margin-bottom: .5rem; }

/* Card and step titles are h3s so the document outline is h1 > h2 > h3,
   but they are sized like an h6 — structure and scale are separate concerns. */
.card h3, .step h3 {
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 .5rem;
}
.card p:last-child { margin-bottom: 0; }

.grid { display: grid; gap: 1.25rem; }
@media (min-width: 700px)  { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 700px)  { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- long-form copy (legal, support) ---------- */

.prose { max-width: var(--inner); }
.prose h2 { font-size: clamp(1.625rem, 2.6vw, 2rem); letter-spacing: -.02em; margin-top: 3rem; }
.prose h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; margin-top: 2rem; }
.prose p, .prose li { font-size: 1.0625rem; line-height: 1.7; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-block: .5rem; }
.prose blockquote {
  margin: 2rem 0;
  padding-left: 1.25rem;
  border-left: 1px solid var(--gold);
  font-family: var(--font-alt);
  font-style: italic;
  font-weight: 400;
  font-size: 1.375rem;
  line-height: 1.35;
  color: var(--ink);
}

.prose .callout {
  margin: 2rem 0 .5rem;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.prose .callout > :last-child { margin-bottom: 0; }
.prose .note { font-size: .9375rem; color: var(--body); }
.prose mark {
  background: var(--gold);
  color: #201c15;
  padding: 1px 6px;
  border-radius: 4px;
}

/* the 404 is the one page that is a centred statement rather than a document.
   Deliberately not called .hero — the homepage already owns that name. */
.page-hero { text-align: center; }
.page-hero .lede { margin-inline: auto; }

/* ---------- footer ---------- */

.footer { background: var(--black); color: rgba(244,238,223,.72); }
.footer-inner {
  display: grid;
  gap: 2.5rem;
  padding-block: clamp(3rem, 6vw, 5rem) 2rem;
}
@media (min-width: 820px) { .footer-inner { grid-template-columns: 2fr 1fr 1fr; } }
.footer-head {
  color: var(--on-dark);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}
.footer .brand { color: var(--on-dark); }
.footer-links { display: grid; gap: .625rem; }
.footer a { color: rgba(244,238,223,.72); text-decoration: none; }
.footer a:hover { color: var(--on-dark); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  justify-content: space-between;
  padding-block: 1.5rem;
  border-top: 1px solid rgba(244,238,223,.16);
  font-size: .875rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}

/* ---------- blog ---------- */

.post-list { display: grid; gap: 1.25rem; margin-top: 3rem; }
@media (min-width: 880px) { .post-list { grid-template-columns: repeat(2, 1fr); } }

.post-card {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: 1.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--body);
  text-decoration: none;
  transition: transform .3s ease-in-out, border-color .3s ease-in-out;
}
.post-card:hover { transform: translateY(-3px); border-color: var(--sienna); color: var(--body); }
.post-card h2 {
  margin: 0;
  font-size: 1.625rem;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.post-card p { margin: 0; }

.post-meta {
  margin: 0;
  color: var(--body);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* a single article: narrower measure, bigger opening */
.article h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1.04; margin-bottom: 1rem; }
.article .lede { max-width: none; margin-bottom: 2.5rem; }
.article h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; margin-top: 3rem; }
.article p, .article li { font-size: 1.0625rem; line-height: 1.7; }
.article-end {
  margin-top: 3.5rem;
  padding: 1.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.article-end h2 { margin-top: 0; font-size: 1.375rem; }
.article-end p:last-child { margin-bottom: 0; }
.article-nav { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .9375rem; }
