/* Hindsight — the Latent/Larder "Pantry Sheen" site design, in Hindsight's
 * own colours.
 *
 * Structure, type and spacing follow latent.css (Latent-Suite/latent/docs) so
 * the sites read as one family. The palette comes from hindsight.ico: paper
 * #fbfaf5, ink #252525, one amber accent #f3b956. Light is the icon's own
 * appearance; dark swaps paper and ink with identical structure.
 *
 * The rules Latent's site follows apply here as well:
 * - One amber-filled action per page; everything else is outline or text.
 * - Cormorant Garamond for the wordmark, a page's own <h1> and the lede only.
 *   h2/h3 use the system body face at weight.
 * - Text meets WCAG AA (4.5:1). Amber is too light to read as text on paper,
 *   so light mode uses a darker amber (#9a6813, 4.6:1) for text and keeps
 *   #f3b956 for fills and rules.
 *
 * Every path here is relative. GitHub Pages serves project sites under
 * /<repo>/, so a leading slash would 404. */

/* ---- Fonts: self-hosted, Latin subset (the same files Latent and Larder
   ship). No external requests anywhere on this site. ---- */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("./fonts/cormorant-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("./fonts/cormorant-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("./fonts/plexmono-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---- Palette ----
   Light first on bare :root so a viewer with no preference still gets a
   complete palette, then dark overrides only what changes. */
:root {
  --surface: #fbfaf5;
  --surface-raised: #ffffff;
  --text: #252525;
  --text-secondary: rgba(37, 37, 37, 0.78);
  --text-quiet: rgba(37, 37, 37, 0.7);
  --accent: #9a6813;
  --accent-fill: #f3b956;
  --on-accent: #252525;
  --accent-wash: rgba(243, 185, 86, 0.16);
  --hairline: rgba(37, 37, 37, 0.14);
  --hairline-strong: rgba(37, 37, 37, 0.32);

  --radius-card: 8px;
  --radius-small: 6px;
  --radius-pill: 999px;
  --measure: 68ch;

  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #1a1a19;
    --surface-raised: #252525;
    --text: #fbfaf5;
    --text-secondary: rgba(251, 250, 245, 0.72);
    --text-quiet: rgba(251, 250, 245, 0.6);
    --accent: #f3b956;
    --on-accent: #1a1a19;
    --accent-wash: rgba(243, 185, 86, 0.1);
    --hairline: rgba(243, 185, 86, 0.2);
    --hairline-strong: rgba(243, 185, 86, 0.42);
  }
}

/* ---- Reset-ish ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface-raised);
  color: var(--text);
  padding: 12px 18px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-small);
  z-index: 10;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

/* ---- Layout ---- */
.shell {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
}

main {
  padding: 8px 0 72px;
}

/* ---- Wordmark ----
   Built in CSS, as on Latent's site. The amber rule echoes the icon's
   amber stroke. */
.wordmark {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.wordmark__text {
  display: block;
  font-family: var(--display);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--text);
}

.wordmark__rule {
  display: block;
  width: 36px;
  height: 2px;
  margin: 8px auto 0;
  background: var(--accent-fill);
  border: 0;
}

/* ---- Site header / footer ---- */
.site-header {
  border-bottom: 1px solid var(--hairline);
  padding: 28px 0 22px;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: center;
  justify-content: space-between;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.site-nav a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 28px 0 44px;
  color: var(--text-quiet);
  font-size: 14px;
}

.site-footer p {
  margin: 0 0 6px;
}

/* ---- Meta label: mono small caps, as on Latent's site. Also used for the
   per-OS labels above install commands. ---- */
.meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-quiet);
  margin: 0 0 10px;
}

.meta--accent {
  color: var(--accent);
}

/* ---- Typography ----
   h1 is the page's one Cormorant Garamond heading. h2/h3 use the system body
   face, with a hairline marking each section break. */
h1 {
  font-family: var(--display);
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0;
  text-wrap: balance;
  font-size: clamp(2.3rem, 6vw, 3.2rem);
  line-height: 1.1;
  margin: 12px 0 18px;
}

h2 {
  font-family: var(--body);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  text-wrap: balance;
  font-size: clamp(1.4rem, 3.2vw, 1.7rem);
  line-height: 1.25;
  margin: 52px 0 14px;
  padding-top: 26px;
  border-top: 1px solid var(--hairline);
}

h3 {
  font-family: var(--body);
  font-weight: 600;
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 28px 0 8px;
}

p,
li {
  max-width: var(--measure);
}

p {
  margin: 0 0 18px;
}

ul,
ol {
  padding-left: 22px;
  margin: 0 0 18px;
}

li {
  margin-bottom: 9px;
}

strong {
  font-weight: 600;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--accent);
  word-break: break-word;
}

.lede {
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.6vw, 1.4rem);
  line-height: 1.45;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* ---- Cards ---- */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 22px 24px;
  margin: 0 0 16px;
}

.card > :last-child {
  margin-bottom: 0;
}

.card h3 {
  margin-top: 0;
}

.card h3 a {
  color: var(--text);
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--accent);
}

/* ---- The single accent action ----
   One filled button per page, at most; everything else is outline or text. */
.button-accent {
  display: inline-block;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent-fill);
}

.button-accent:hover {
  filter: brightness(1.06);
  text-decoration: none;
}

.button-outline {
  display: inline-block;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 13px 25px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline-strong);
}

.button-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0 8px;
}

/* ---- Landing hero ---- */
.hero {
  padding: 48px 0 28px;
}

.hero__icon {
  width: 88px;
  height: 88px;
  border-radius: 19px;
  border: 1px solid var(--hairline);
  margin-bottom: 6px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 12px 0 8px;
}

.feature-grid .card {
  margin: 0;
}

.feature-grid p {
  color: var(--text-secondary);
  font-size: 15.5px;
  margin: 0;
}

/* ---- Code blocks ---- */
pre {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-small);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 18px;
}

pre code {
  display: block;
  color: var(--text);
  background: none;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre;
}

/* ---- "Next page" link at the foot of each page ---- */
.next {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}

/* ---- Print ---- */
@media print {
  :root {
    --surface: #fff;
    --surface-raised: #fff;
    --text: #000;
    --text-secondary: #333;
    --text-quiet: #555;
    --accent: #5e4c27;
    --hairline: #ccc;
  }

  body {
    font-size: 11.5pt;
  }

  .site-nav,
  .skip-link,
  .actions,
  .next {
    display: none;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  main a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-family: var(--mono);
    font-size: 9pt;
    color: #555;
  }

  h2 {
    break-after: avoid;
  }
}
