/* nutritioncognition.app — one stylesheet for every page.
 *
 * The colours are the web app's tokens (nc-fe/src/styles.css and ng-shared's theme): warm
 * sandstone in light mode, the navy "away-kit" in dark mode, and the brand orange. Text that
 * has to be read uses an orange that passes WCAG AA on its background (links: #9A3412 on
 * sandstone, #FB923C on navy; buttons: white on #C2410C); #EA580C is for marks and rules.
 *
 * No web fonts: the system sans for text, and the system serif (New York on Apple devices)
 * for headings, standing in for the app's Fraunces without a request to a font host.
 */

:root {
  color-scheme: light dark;

  --bg: #EFE9DB;            /* background-primary */
  --surface: #FAF5E9;       /* background-secondary */
  --surface-2: #E3DAC3;     /* background-tertiary */
  --text: #1B1812;          /* text-primary */
  --text-strong: #100D08;   /* text-primary-strong */
  --text-2: #3A3328;        /* text-secondary */
  --text-3: #5E5546;        /* text-tertiary */
  --border: #E1D9C4;        /* border-primary */
  --border-2: #BEAF8C;      /* border-secondary */
  --brand: #EA580C;         /* primary */
  --link: #9A3412;          /* orange-800: 6:1 on the sandstone */
  --link-hover: #7C2D12;
  --button: #C2410C;        /* primary-hover: white text at 5:1 */
  --button-hover: #9A3412;
  --button-text: #FFFFFF;
  --notice-bg: #FCEBD9;
  --code-bg: #E9E1CD;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 0.5rem;
  --measure: 42rem;
  --wide: 64rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1633;
    --surface: #142555;
    --surface-2: #1E3475;
    --text: #E6ECF8;
    --text-strong: #F3F6FC;
    --text-2: #C0CCE5;
    --text-3: #8B9DC2;
    --border: #2B437F;
    --border-2: #3B5299;
    --brand: #EA580C;
    --link: #FB923C;
    --link-hover: #FDBA74;
    --button: #C2410C;
    --button-hover: #9A3412;
    --button-text: #FFFFFF;
    --notice-bg: #2A2A4A;
    --code-bg: #0F1D45;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: var(--link-hover); }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Header ── */

.site-header { border-bottom: 1px solid var(--border); }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text-strong);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--text-strong); }
.brand img { width: 2rem; height: 2rem; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}
.site-nav a { color: var(--text-2); text-decoration: none; }
.site-nav a:hover { color: var(--link); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--text-strong); font-weight: 600; }

/* ── Main ── */

main { flex: 1; }

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--text-strong);
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); margin: 0 0 1rem; font-weight: 600; }
h2 { font-size: clamp(1.375rem, 1.15rem + 1vw, 1.75rem); margin: 2.5rem 0 0.75rem; font-weight: 600; }
h3 { font-size: 1.1875rem; margin: 1.75rem 0 0.5rem; font-weight: 600; }

p, ul, ol { margin: 0 0 1rem; }

.lead {
  font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  color: var(--text-2);
  max-width: 38rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--text-3);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Landing ── */

.hero { padding: 2.5rem 0 2.5rem; }

.hero-grid {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

/* On a phone the icon sits above the heading, app-icon size; beside it on wider screens. */
.hero-mark {
  order: -1;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1.125rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.625rem;
}

@media (min-width: 48rem) {
  .hero { padding: 5rem 0 3.5rem; }
  .hero-grid { grid-template-columns: 1fr auto; gap: 3rem; }
  .hero-mark { order: 0; width: 11rem; height: 11rem; border-radius: 2.25rem; padding: 1.5rem; }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
}

.button-primary { background: var(--button); color: var(--button-text); }
.button-primary:hover { background: var(--button-hover); color: var(--button-text); }

.button-secondary {
  background: var(--surface);
  color: var(--text-strong);
  border-color: var(--border-2);
}
.button-secondary:hover { color: var(--text-strong); border-color: var(--text-3); }

.features {
  display: grid;
  gap: 1rem;
  padding: 0;
  margin: 0 0 3.5rem;
  list-style: none;
}

@media (min-width: 40rem) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60rem) { .features { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 0.25rem;
}

.card h2, .card h3 {
  font-size: 1.125rem;
  margin: 0 0 0.375rem;
}

.card p { color: var(--text-2); font-size: 1rem; }

.card-accent {
  display: block;
  width: 2rem;
  height: 3px;
  margin-bottom: 0.875rem;
  background: var(--brand);
  border-radius: 2px;
}

/* ── Reading pages (help, privacy, terms) ── */

.page {
  max-width: var(--measure);
  padding-top: 2.5rem;
  padding-bottom: 3.5rem;
}

@media (min-width: 48rem) { .page { padding-top: 3.5rem; } }

.page > h1 { font-size: clamp(1.875rem, 1.4rem + 2vw, 2.625rem); }

.page li { margin-bottom: 0.375rem; }
.page li > ul, .page li > ol { margin-top: 0.375rem; }

.meta { color: var(--text-3); font-size: 0.9375rem; }

.page .card { margin: 1.5rem 0 2rem; }

.notice {
  margin: 1.5rem 0;
  padding: 0.875rem 1rem;
  background: var(--notice-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
}
.notice p:last-child { margin-bottom: 0; }

/* Text the owner hasn't written yet. Search the source for "OWNER:" to find each one. */
.placeholder {
  padding: 0.75rem 1rem;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  color: var(--text-3);
  font-style: italic;
}

.button.placeholder {
  padding: 0.625rem 1.25rem;
  background: transparent;
  font-style: normal;
  font-weight: 500;
  cursor: default;
}

.toc {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.25rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.toc h2 { margin: 0 0 0.5rem; font-size: 1rem; font-family: var(--sans); }
.toc ol { padding-left: 1.25rem; }

.steps { padding-left: 1.5rem; }
.steps li { padding-left: 0.25rem; margin-bottom: 0.5rem; }

code, kbd {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--code-bg);
  border-radius: 0.25rem;
  padding: 0.1em 0.35em;
}

.address {
  display: block;
  margin: 0.75rem 0 1.25rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 1rem;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}

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

.prompts {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.prompts li {
  margin: 0;
  padding: 0.625rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.two-col { display: grid; gap: 0 2rem; }
@media (min-width: 40rem) { .two-col { grid-template-columns: 1fr 1fr; } }

/* ── Footer ── */

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 0.9375rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer a { color: var(--text-2); }
.site-footer p { margin: 0; }

@media print {
  .site-header nav, .site-footer ul, .skip-link { display: none; }
  body { background: #fff; color: #000; }
}
