/*
 * coffeehop.com (CHG-20261120-006). Palettes are the apps' (Android CoffeeHopApp.kt AppPalette:
 * Espresso, Latte, Light, Dark); theme.js sets html[data-theme] before the first paint.
 * Links use the text color with an accent underline, so every theme meets WCAG AA contrast
 * (the Latte and Light accents are under 4.5:1 as text on their backgrounds).
 */
@font-face {
  font-family: "Nunito";
  src: url("/fonts/Nunito-VariableFont_wght.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

/* Espresso: the apps' default */
:root,
html[data-theme="espresso"] {
  --bg: #1f1410;
  --surface: #2b1d14;
  --tertiary: #3a2618;
  --accent: #bf783b;
  --text: #f5e6d3;
  --text-2: #e8d5c0;
  color-scheme: dark;
}
html[data-theme="latte"] {
  --bg: #ede0d4;
  --surface: #f5ebe0;
  --tertiary: #e6ccb2;
  --accent: #bf783b;
  --text: #3e2723;
  --text-2: #5d4037;
  color-scheme: light;
}
html[data-theme="light"] {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --tertiary: #e0e0e6;
  --accent: #007aff;
  --text: #000000;
  --text-2: #3c3c43;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #1c1c1e;
  --surface: #000000;
  --tertiary: #2c2c2e;
  --accent: #0a84ff;
  --text: #ffffff;
  --text-2: #ebebf5;
  color-scheme: dark;
}
/* system: Light/Dark by the device setting; system-coffee: Latte/Espresso (as in the apps) */
@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    --bg: #f2f2f7; --surface: #ffffff; --tertiary: #e0e0e6; --accent: #007aff; --text: #000000; --text-2: #3c3c43;
    color-scheme: light;
  }
  html[data-theme="system-coffee"] {
    --bg: #ede0d4; --surface: #f5ebe0; --tertiary: #e6ccb2; --accent: #bf783b; --text: #3e2723; --text-2: #5d4037;
    color-scheme: light;
  }
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bg: #1c1c1e; --surface: #000000; --tertiary: #2c2c2e; --accent: #0a84ff; --text: #ffffff; --text-2: #ebebf5;
    color-scheme: dark;
  }
  html[data-theme="system-coffee"] {
    --bg: #1f1410; --surface: #2b1d14; --tertiary: #3a2618; --accent: #bf783b; --text: #f5e6d3; --text-2: #e8d5c0;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
}
a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 3px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* The site's own frame; ?nav=false hides it (in-app viewing) */
html[data-nav="false"] .site-chrome { display: none !important; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--surface);
  padding: 8px 14px;
  border-radius: 10px;
  z-index: 10;
}
.skip-link:focus { top: 12px; }

.site-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.brand {
  display: inline-flex;
  flex: none;
  padding: 2px;
  border-radius: 10px;
  text-decoration: none;
}
.brand img { display: block; width: 36px; height: auto; }
/* A tease of the web app to come (CHG-20261120-008); theme.js picks one at random */
.tease {
  margin: 0;
  font-weight: 800;
  font-size: 20px;
  line-height: 1.25;
}

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

.draft-banner {
  max-width: 760px;
  margin: 8px auto 0;
  padding: 12px 16px;
  background: var(--tertiary);
  color: var(--text);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  font-size: 16px;
}
html[data-nav="false"] .draft-banner { margin: 12px 16px 0; }

main { padding: 8px 16px 48px; }

/* Legal pages */
.legal { max-width: 760px; margin: 0 auto; }
.legal h1 { font-size: 32px; line-height: 1.2; margin: 24px 0 6px; font-weight: 800; }
.legal h2 { font-size: 22px; line-height: 1.3; margin: 32px 0 8px; font-weight: 800; scroll-margin-top: 16px; }
.legal h3 { font-size: 18px; line-height: 1.35; margin: 22px 0 6px; font-weight: 700; scroll-margin-top: 16px; }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 22px; }
.legal li { margin: 4px 0; }
.doc-meta { color: var(--text-2); font-size: 15px; margin: 0 0 20px; }

/* Home (CHG-20261120-008): one screen at any size. Hopper fills everything between the header and
   the footer (whose links are the policies), edge to edge, like the apps' launch loader. */
body.page-home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
body.page-home main {
  flex: 1;
  display: flex;
  padding: 0;
}
.home { flex: 1; display: flex; }

/* Hopper: the apps' launch loader (Android CoffeeHopApp.kt NativeLoadingOverlay, HopperLoaderHops.kt).
   hopper.js sizes him as on a phone fitted into the stage. Still until it plays, and with reduced motion. */
.hopper-stage {
  position: relative;
  flex: 1;
  min-height: 300px;
  overflow: hidden;
}
.hopper {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(240px, 60vw, 40vh);
  height: auto;
  transform: translate(-50%, -50%) scaleX(-1); /* the app's default facing (nav order not reversed) */
}
.hopper-stage.playing .hopper {
  left: 0;
  top: 0;
  opacity: 0;
  will-change: transform, opacity;
}

.site-footer {
  padding: 20px 16px 28px;
  border-top: 1px solid var(--tertiary);
  font-size: 15px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a[aria-current="page"] { font-weight: 800; }
.copyright { color: var(--text-2); margin: 0; }

.notfound { max-width: 760px; margin: 0 auto; }

/* Staging only: delete without the app (B6, CHG-20261123-002) */
.delete-flow { margin: 20px 0 28px; padding: 16px; border-radius: 14px; background: var(--surface); display: grid; gap: 10px; }
.delete-flow h2 { margin: 0; font-size: 20px; }
.delete-flow [data-step] { display: grid; gap: 8px; }
.delete-flow [hidden] { display: none; }
.delete-flow label, .delete-flow p { font-size: 16px; color: var(--text); margin: 0; }
.delete-flow .delete-flow-note { color: var(--text-2); font-size: 15px; }
.delete-flow input { font: inherit; font-size: 17px; padding: 12px; border-radius: 10px; border: 1px solid var(--tertiary); background: var(--bg); color: var(--text); max-width: 100%; }
.delete-flow button { font: inherit; font-size: 16px; font-weight: 600; padding: 12px 16px; border: 2px solid var(--accent); border-radius: 12px; background: var(--tertiary); color: var(--text); cursor: pointer; justify-self: start; }
.delete-flow button[disabled] { opacity: .5; cursor: default; }
.delete-flow code { font-size: 15px; word-break: break-all; }

/* coffeehop.app invite site (CHG-20261130-004): the invitation card sits above Hopper's stage,
   which fills the rest of the screen as on coffeehop.com. Appended to site.css at build time. */
body.page-links main { flex-direction: column; }
.invite-home { flex-direction: column; min-width: 0; }
.invite-card {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: calc(100% - 32px);
  max-width: 560px;
  min-width: 0;
  margin: 8px auto 0;
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--tertiary);
}
.invite-card h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.2; font-weight: 800; }
.invite-lead { margin: 0 0 12px; }
.invite-steps-title { margin: 16px 0 4px; font-size: 18px; font-weight: 800; }
.invite-steps { margin: 0 0 16px; padding-left: 22px; }
.invite-steps li { margin: 6px 0; }
.invite-copy {
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  min-height: 48px;
  padding: 10px 20px;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: #1f1410;
  cursor: pointer;
}
.invite-copy:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.invite-copy[hidden] { display: none; }
.invite-status { min-height: 1.6em; margin: 8px 0 0; font-weight: 700; }
.invite-note { margin: 12px 0 0; color: var(--text-2); font-size: 15px; }
body.page-links .hopper-stage { min-height: 260px; }
