/*
 * Styles for the three public pages the Google OAuth consent screen links to —
 * home.html, privacy.html, terms.html — served by `bins/api/src/site.rs`.
 *
 * Plain hand-written CSS, no build step, no external requests: the fonts are
 * subsets of the ones in `packages/kiosk_ui/fonts/` (Latin, variable `wght`
 * axis kept), so the pages read the same with the app's JS or Dart bundles
 * absent. Tokens are copied, not imported, from
 * `packages/kiosk_ui/lib/src/tokens/colors.dart` (`KioskColors.light` /
 * `.dark`); change them there first. The app flips to dark by clock (7 pm to
 * 7 am); a web page has no clock rule worth copying, so it follows the
 * visitor's `prefers-color-scheme`.
 */

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/fonts/CormorantGaramond.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Lora';
  src: url('/fonts/Lora.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f3f2f2;
  --surface: #eae9e9;
  --text: #201f1d;
  --muted: #605d5d;
  --divider: rgba(32, 31, 29, 0.16);
  --accent: #b68235;
  --accent-text: #7d5411;
  --accent-tint: #fff3e4;
  --display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --body: 'Lora', Georgia, 'Times New Roman', serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1917;
    --surface: #262320;
    --text: #efe8dc;
    --muted: #bab6b6;
    --divider: rgba(239, 232, 220, 0.2);
    --accent: #e1ad66;
    --accent-text: #facb8d;
    --accent-tint: #3a270d;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}

/* Header ------------------------------------------------------------- */

header.site {
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--divider);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: block;
  /* The mark's field is the dark ground itself; a hairline keeps its edge on dark pages. */
  outline: 1px solid var(--divider);
  outline-offset: -1px;
}

.brand span {
  font-family: var(--display);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Type --------------------------------------------------------------- */

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
}

h1 {
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  letter-spacing: 0.005em;
  margin: 40px 0 12px;
}

h2 {
  font-size: 1.8rem;
  margin: 48px 0 10px;
  padding-top: 22px;
  border-top: 1px solid var(--divider);
}

h3 {
  font-size: 1.3rem;
  margin: 26px 0 4px;
}

p,
li {
  color: var(--muted);
}

strong {
  color: var(--text);
  font-weight: 600;
}

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

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

ul {
  padding-left: 1.25rem;
}

li {
  margin: 6px 0;
}

code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.82em;
  color: var(--text);
  overflow-wrap: anywhere;
}

.lede {
  font-size: 1.25rem;
  color: var(--muted);
  margin: 0 0 24px;
  max-width: 34em;
}

.stamp {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 28px;
}

/* Blocks ------------------------------------------------------------- */

/* Hairline outline, gold rule down the leading edge: color as stroke, not fill. */
.note {
  border: 1px solid var(--divider);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 4px 20px;
  margin: 22px 0;
}

.button {
  display: inline-block;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 10px 20px;
}

.button:hover {
  background: var(--accent-tint);
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 8px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0;
  margin: 22px 0 8px;
  border-top: 1px solid var(--divider);
  border-left: 1px solid var(--divider);
}

.grid > div {
  border-right: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  padding: 4px 18px 16px;
}

.grid h3 {
  margin-top: 16px;
}

.grid p {
  margin: 0;
  font-size: 0.95rem;
}

.table-scroll {
  overflow-x: auto;
  margin: 18px 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 30rem;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--divider);
  color: var(--muted);
}

th {
  color: var(--text);
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
}

/* Footer ------------------------------------------------------------- */

footer.site {
  border-top: 1px solid var(--divider);
  margin-top: 56px;
  padding: 22px 0 48px;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
}

footer.site a {
  color: var(--muted);
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  h2 {
    font-size: 1.6rem;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
  p,
  li,
  td {
    color: #000;
  }
}
