/* Larder — "Pantry Sheen" for the web.
 *
 * The larder itself: a cool dark room, labels in brass. Dark is the PRIMARY
 * appearance; light is cream with identical structure. Tokens mirror
 * Packages/LarderDesignKit/Sources/LarderDesignKit/Theme.swift — if that file
 * changes, change this one too.
 *
 * Every path here is relative. GitHub Pages serves project sites under
 * /<repo>/, so a leading slash would 404. */

/* ---- Fonts: self-hosted, Latin subset. No external requests anywhere on
   this site, which is the only honest way to ship a privacy policy. ---- */
@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: #f1ebdd;
  --surface-raised: #f8f2e4;
  --text: #1d2a21;
  --text-secondary: rgba(29, 42, 33, 0.62);
  --text-quiet: rgba(29, 42, 33, 0.45);
  --brass: #96793e;
  --hairline: rgba(150, 121, 62, 0.32);
  --hairline-strong: rgba(150, 121, 62, 0.52);
  --brass-wash: rgba(150, 121, 62, 0.12);

  --radius-card: 12px;
  --radius-small: 8px;
  --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: #16211a;
    --surface-raised: #1b2820;
    --text: #ece5d3;
    --text-secondary: rgba(236, 229, 211, 0.62);
    --text-quiet: rgba(236, 229, 211, 0.45);
    --brass: #b79862;
    --hairline: rgba(183, 152, 98, 0.22);
    --hairline-strong: rgba(183, 152, 98, 0.4);
    --brass-wash: rgba(183, 152, 98, 0.1);
  }
}

/* ---- 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.65;
  /* Unhurried by default — Pantry Sheen is calm, not dense. */
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

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

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

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

:focus-visible {
  outline: 2px solid var(--brass);
  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 rather than referencing the SVG: the brand asset hardcodes
   cream and can't reach this page's @font-face when loaded as an external
   image, so it would neither adapt to light mode nor use the real face. */
.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: 25px;
  letter-spacing: 0.34em;
  /* The tracking adds a trailing gap; pull it back so the rule reads centred. */
  text-indent: 0.34em;
  color: var(--text);
}

.wordmark__rule {
  display: block;
  width: 36px;
  height: 1px;
  margin: 7px auto 0;
  background: var(--brass);
  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(--brass);
}

.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 — the mono small-caps signature ---- */
.meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-quiet);
  margin: 0 0 10px;
}

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

/* ---- Typography ---- */
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  line-height: 1.08;
  margin: 12px 0 18px;
}

h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.05rem);
  line-height: 1.2;
  margin: 52px 0 14px;
  padding-top: 26px;
  border-top: 1px solid var(--hairline);
}

h3 {
  font-weight: 600;
  font-size: 1.3rem;
  /* Display faces need their own line-height — inheriting the body's 1.65
     leaves a two-line card heading looking like two unrelated lines. */
  line-height: 1.22;
  margin: 32px 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;
}

.lede {
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.8vw, 1.5rem);
  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;
}

/* ---- The single brass action ----
   One per page. Everything else is outline or text; that discipline is the
   signature of this design and the fastest way to break it is a second one. */
.button-brass {
  display: inline-block;
  background: var(--brass);
  color: var(--surface);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid var(--brass);
}

.button-brass:hover {
  filter: brightness(1.08);
  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: 999px;
  border: 1px solid var(--hairline-strong);
}

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

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

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

.hero__icon {
  width: 96px;
  height: 96px;
  border-radius: 21px;
  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;
}

/* ---- FAQ ---- */
details {
  border-bottom: 1px solid var(--hairline);
  padding: 4px 0;
}

details summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 34px 18px 0;
  position: relative;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.28rem;
  line-height: 1.35;
  color: var(--text);
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 17px;
  color: var(--brass);
}

details[open] summary::after {
  content: "–";
}

details .answer {
  padding: 0 0 14px;
}

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

/* ---- Definition-style rows (privacy "what/where") ---- */
.rows {
  border-top: 1px solid var(--hairline);
  margin: 18px 0 26px;
}

.row {
  display: grid;
  grid-template-columns: minmax(140px, 30%) 1fr;
  gap: 8px 24px;
  padding: 15px 0;
  border-bottom: 1px solid var(--hairline);
}

.row dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--brass);
  padding-top: 3px;
}

.row dd {
  margin: 0;
  max-width: var(--measure);
}

@media (max-width: 560px) {
  .row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ---- Callout ---- */
.callout {
  border-left: 2px solid var(--brass);
  background: var(--brass-wash);
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
  padding: 16px 20px;
  margin: 0 0 22px;
}

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

/* ---- Print: people save privacy policies as PDFs ---- */
@media print {
  :root {
    --surface: #fff;
    --surface-raised: #fff;
    --text: #000;
    --text-secondary: #333;
    --text-quiet: #555;
    --brass: #6b5628;
    --hairline: #ccc;
  }

  body {
    font-size: 11.5pt;
  }

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

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

  /* Print the destination of real links, since a PDF can't be clicked back. */
  main a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-family: var(--mono);
    font-size: 9pt;
    color: #555;
  }

  h2 {
    break-after: avoid;
  }

  details {
    break-inside: avoid;
  }

  details .answer {
    display: block !important;
  }
}
