@layer uikitten.components;
/* ============================================================================
   heras.infinity-sdg.com — global stylesheet (plain CSS, no Tailwind)

   The palette is the book's: `docs/fund-me/book.typ` sets ink #143B43 and
   accent #BB7545, and this page is the book's landing page, so the two should
   not disagree. Tokens live here; component styles stay scoped in each
   .astro file, matching infinity-sdg.com's stylesheet convention.
   ========================================================================= */

:root {
  /* Ink — the book's deep teal, plus two steps for headings and body copy */
  --ink: #143b43;
  --ink-2: #1c4d56;
  --text: #202828;
  --text-2: #4d5c5c;
  --text-3: #6f7f7f;

  /* Accent — the book's burnt orange */
  --accent: #bb7545;
  --accent-2: #a46034;

  /* Paper — a reading-edition background, not white */
  --paper: #fbf8f4;
  --paper-2: #f1f5f4; /* the book's code-block fill */
  --card: #ffffff;

  --rule: #e0dcd4;
  --rule-strong: #c9c3b8;

  --font-sans: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Libertinus Serif", Constantia, Georgia, "Times New Roman", serif;
  --font-mono: "Cascadia Mono", Consolas, ui-monospace, SFMono-Regular, Menlo, monospace;

  --maxw: 68rem;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 59, 67, 0.06), 0 8px 24px rgba(20, 59, 67, 0.06);
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,
picture,
svg,
canvas {
  display: block;
  max-width: 100%;
}
a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--accent-2);
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
::selection {
  background: var(--accent);
  color: var(--paper);
}

/* Visible keyboard focus everywhere — the default ring disappears on
   coloured surfaces, and this page has several. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---- Shared helpers ---- */

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section {
  padding-block: 4.5rem;
  border-top: 1px solid var(--rule);
}

/* Small caps label above a section heading. Mirrors the book's PART rule. */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-2);
}

.section h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.25rem);
  margin-block: 0.6rem 0.75rem;
}

.lede {
  font-size: 1.125rem;
  color: var(--text-2);
  max-width: 46rem;
}

.rule-accent {
  width: 4.5rem;
  height: 3px;
  background: var(--accent);
  border: 0;
  margin-block: 1.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--ink-2);
  color: var(--paper);
}
.btn-ghost {
  border-color: var(--rule-strong);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-2);
}

/* Card grid used by several sections */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  margin-top: 2rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.4rem;
}
.card p {
  color: var(--text-2);
  font-size: 0.9375rem;
}

/* The book's #note[] box, as a web element. Used for the coverage caveats —
   the one thing on this page that must not read like marketing. */
.note {
  background: var(--paper-2);
  border-left: 3px solid var(--ink);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  color: var(--text-2);
  font-size: 0.9375rem;
}
.note strong {
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---- Prose column, used by the interior pages ---------------------------- */
.prose {
  max-width: 44rem;
}
.prose h1 {
  font-size: clamp(2rem, 4.6vw, 2.85rem);
}
.prose h2 {
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  margin-top: 2.75rem;
  margin-bottom: 0.6rem;
}
.prose h3 {
  font-size: 1.0625rem;
  margin-top: 1.75rem;
  margin-bottom: 0.35rem;
}
.prose p {
  margin-bottom: 1rem;
  color: var(--text-2);
}
.prose p.lede {
  color: var(--text);
}
.prose ul,
.prose ol {
  margin: 0 0 1.25rem 1.25rem;
  color: var(--text-2);
}
.prose li {
  margin-bottom: 0.4rem;
}
.prose li::marker {
  color: var(--accent);
}
.prose .note {
  margin-block: 1.75rem;
}
.prose pre {
  background: var(--paper-2);
  border-left: 2px solid var(--ink);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.6;
}
.page-head {
  padding-block: 4rem 1rem;
}


  .shell {
    width: 100%;
    max-width: calc(var(--maxw) + 13.5rem);
    margin-inline: auto;
  }
  .skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--ink);
    color: var(--paper);
    padding: 0.6rem 1rem;
    z-index: 10;
    border-radius: 0 0 var(--radius) 0;
  }
  .skip:focus {
    left: 0;
    color: var(--paper);
  }


  header {
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    position: sticky;
    top: 0;
    z-index: 5;
  }
  .bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding-block: 0.9rem;
  }
  .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
  }
  .mark {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 3px;
    background: var(--ink);
    border-left: 4px solid var(--accent);
  }
  header nav,
  header .bar-end {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.9375rem;
  }
  header nav a {
    text-decoration: none;
    color: var(--text-2);
  }
  header nav a:hover,
  header nav a[aria-current='page'] {
    color: var(--ink);
  }
  header nav a[aria-current='page'] {
    box-shadow: inset 0 -2px 0 var(--accent);
  }
  .cta {
    color: var(--paper);
  }

  /* ── The side-nav layouts ──────────────────────────────────────────────────
     The row itself is uikitten's: <uk-layout kind="row"> is CSS, not script
     (uikitten/src/components/layout/layout.css), so this works on a site that
     ships no JavaScript, and the column's width is its own data-size /
     --uk-size mechanism rather than a number invented here.

     TWO of the kit's rules have to be relaxed, and it is worth saying which
     and why rather than leaving an !important for someone to find. uk-layout
     is built for an application shell that OWNS the viewport: it sets
     overflow: hidden and its children fill it. A document page scrolls the
     window instead, and inside an overflow:hidden ancestor a sticky column
     sticks to that ancestor -- which does not scroll -- so the nav would
     scroll away with the article. Hence overflow: visible and a height that
     is the content's, not the viewport's. */
  .shell {
    overflow: visible;
    align-items: flex-start;
  }
  .shell > main {
    min-width: 0;
  }
  nav.side {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 2rem 1.25rem;
    font-size: 0.9375rem;
    position: sticky;
    /* Clear of the sticky header, which is 3.4rem tall at this font size. */
    top: 4.2rem;
  }
  nav.side a {
    text-decoration: none;
    color: var(--text-2);
    padding-left: 0.6rem;
    border-left: 2px solid var(--rule);
    line-height: 1.3;
  }
  nav.side a:hover {
    color: var(--ink);
    border-left-color: var(--rule-strong);
  }
  nav.side a[aria-current='page'] {
    color: var(--ink);
    font-weight: 600;
    border-left-color: var(--accent);
  }

  /* The session chip. Sized so that swapping "Sign in" for a name and a Log
     out button does not move the rest of the header around more than it must;
     the two states are deliberately close in weight. */
  .session {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
  }
  .session-who {
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .session-who:hover {
    text-decoration: underline;
    text-decoration-color: var(--accent);
  }
  /* A button and a link that read as the same control, because they are the
     same control in two states. */
  .session-link {
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-2);
    background: none;
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    text-decoration: none;
    cursor: pointer;
  }
  .session-link:hover {
    color: var(--ink);
    border-color: var(--accent);
  }
  .session-link[disabled] {
    opacity: 0.6;
    cursor: progress;
  }
  @media (max-width: 46rem) {
    .bar {
      flex-wrap: wrap;
    }
    header nav,
    header .bar-end {
      gap: 1rem;
      font-size: 0.875rem;
    }
    .cta {
      display: none; /* the page's own contact section is two scrolls away */
    }
    /* The name goes; the control stays. Who you are is recoverable from the
       CMS, but losing the way out of a session is not. */
    .session-who {
      display: none;
    }
    /* A 13.5rem column beside the text does not fit a phone, so the row
       becomes a column and the navigation goes back above the content --
       first, whichever side it is on when there is room for a side. */
    .shell {
      flex-direction: column;
    }
    .shell > nav.side {
      flex: 0 0 auto;
      width: 100%;
      position: static;
      order: -1;
      flex-direction: row;
      flex-wrap: wrap;
      gap: 0.75rem 1rem;
      padding: 1rem 1.25rem;
      border-bottom: 1px solid var(--rule);
    }
  }


  footer {
    border-top: 1px solid var(--rule);
    background: var(--paper-2);
    padding-block: 3rem 2.5rem;
    margin-top: 1rem;
  }
  .inner {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
  }
  /* Was .name, scoped per file by Astro. Now that every page's CSS is plain
     CSS in one <style>, it would also hit /documents' own .name; renamed
     rather than reintroducing a scoping mechanism to carry two selectors. */
  .brand-name {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ink);
  }
  .fine {
    font-size: 0.875rem;
    color: var(--text-3);
    max-width: 34rem;
  }
  footer nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9375rem;
  }
  footer nav a {
    text-decoration: none;
    color: var(--text-2);
  }
  footer nav a:hover {
    color: var(--accent-2);
  }
  /* Present, findable, and not competing with the links a reader wants. */
  footer nav a.quiet {
    color: var(--text-3);
    margin-top: 0.3rem;
  }
  footer nav a.quiet:hover {
    color: var(--accent-2);
  }
  .legal p {
    max-width: 58rem; /* a disclaimer, not a column of body copy */
  }
  .legal {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
  }

