/* Monitor Glucose — monitorglucose.ca */
:root {
  --night: #0f1b2d;
  --night-2: #172740;
  --night-ink: #e8eef5;
  --night-muted: #9fb0c4;
  --day: #eef3f7;
  --paper: #ffffff;
  --ink: #16212e;
  --muted: #526273;
  --rule: #d5dee7;
  --sky: #5bc0eb;
  --sky-deep: #1f7fae;
  --green: #3dbe7a;
  --yellow: #f2c94c;
  --red: #ff4d5a;
  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, monospace;
  --measure: 38rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--day);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--sky-deep); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(70rem, 100% - 2rem); margin-inline: auto; }

/* ---------- top bar ---------- */
.bar { background: var(--night); color: var(--night-ink); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; white-space: nowrap; color: inherit; text-decoration: none; font-weight: 700; font-size: 1.125rem; }
.brand img { width: 2rem; height: 2rem; border-radius: 0.5rem; }
.bar nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.bar nav a { color: var(--night-muted); text-decoration: none; }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--night-ink); }

/* ---------- hero: the night view ---------- */
.hero { background: var(--night); color: var(--night-ink); padding-block: 3.5rem 5rem; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 1.25rem; font-weight: 800; max-width: 14ch; }
.hero p { color: var(--night-muted); font-size: 1.1875rem; max-width: 32rem; margin: 0 0 2rem; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn { display: inline-block; padding: 0.8rem 1.3rem; border-radius: 0.6rem; font-weight: 700; text-decoration: none; border: 2px solid transparent; }
.btn-primary { background: var(--sky); color: var(--night); }
.btn-primary:hover { background: #7fd0f1; }
.btn-ghost { color: var(--night-ink); border-color: #34496a; }
.btn-ghost:hover { border-color: var(--night-muted); }

/* The night view, drawn the way the app shows it in a dark bedroom. */
.nightview {
  background: #060c16;
  border-radius: 1.75rem;
  padding: 2.25rem 2rem 1.75rem;
  border: 1px solid #22344f;
  box-shadow: 0 30px 80px -30px #000;
  display: grid;
  gap: 0.25rem;
  justify-items: center;
  text-align: center;
}
.nightview .clock { font-family: var(--mono); color: #6f819a; font-size: 1.1rem; letter-spacing: 0.04em; }
.nightview .reading { display: flex; align-items: center; gap: 0.6rem; color: var(--green); }
.nightview .value { font-family: var(--font); font-variant-numeric: tabular-nums; font-weight: 800; font-size: clamp(5.5rem, 13vw, 9rem); line-height: 1; letter-spacing: -0.04em; }
.nightview .arrow { width: clamp(2.6rem, 6vw, 4rem); height: auto; }
.nightview .unit { color: #6f819a; font-size: 0.95rem; }
.nightview .age { margin-top: 0.75rem; display: flex; gap: 1.25rem; color: #8ea1b8; font-size: 1rem; }
.nightview .age span::before { content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--sky); margin-right: 0.45rem; vertical-align: 0.08em; }
.zones { display: flex; gap: 0.35rem; margin-top: 1.4rem; width: 100%; max-width: 18rem; }
.zones i { flex: 1; height: 0.4rem; border-radius: 1rem; background: var(--yellow); opacity: 0.35; }
.zones i:nth-child(1), .zones i:nth-child(5) { background: var(--red); }
.zones i:nth-child(3) { background: var(--green); opacity: 1; }

/* ---------- day sections ---------- */
main section { padding-block: 4rem; }
main section + section { border-top: 1px solid var(--rule); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; margin: 0 0 1rem; font-weight: 800; letter-spacing: -0.005em; }
h3 { font-size: 1.15rem; margin: 0 0 0.35rem; }
.lede { color: var(--muted); max-width: var(--measure); margin: 0 0 2.5rem; font-size: 1.125rem; }
.prose { max-width: var(--measure); }
.prose p, .prose li { color: var(--ink); }
.prose h2 { margin-top: 2.5rem; font-size: 1.45rem; }
.prose h2:first-child { margin-top: 0; }

/* Features: the zone colour marks what kind of help each one gives. */
.features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem 3rem; }
.features li { padding-left: 1.25rem; border-left: 4px solid var(--sky); }
.features li.g { border-color: var(--green); }
.features li.y { border-color: var(--yellow); }
.features li.r { border-color: var(--red); }
.features p { margin: 0; color: var(--muted); }

.needs { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.needs ul { margin: 0; padding-left: 1.2rem; }
.needs li { margin-bottom: 0.6rem; }

.stores { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }
.store { background: var(--paper); border: 1px solid var(--rule); border-radius: 0.8rem; padding: 1rem 1.25rem; min-width: 14rem; }
.store strong { display: block; font-size: 1.05rem; }
.store span { color: var(--muted); font-size: 0.95rem; }

.plus { background: var(--paper); border-radius: 1.25rem; padding: 2rem; border: 1px solid var(--rule); max-width: 46rem; }
.plus p:last-child { margin-bottom: 0; }

/* Medical notice: stated plainly, never hidden in small print. */
.plus + .notice { margin-top: 2rem; }
.notice { background: #fff8e1; border-left: 5px solid var(--yellow); padding: 1.1rem 1.25rem; border-radius: 0 0.6rem 0.6rem 0; max-width: 46rem; }
.notice p { margin: 0; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--rule); padding-block: 1rem; max-width: 46rem; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.08rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--sky-deep); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details > *:not(summary) { margin: 0.75rem 0 0; color: var(--ink); }
.faq dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1rem; }
.faq dt { font-weight: 700; color: var(--red); }
.faq dd { margin: 0; }

.contact { background: var(--night); color: var(--night-ink); border-radius: 1.25rem; padding: 2rem; max-width: 46rem; }
.contact p { color: var(--night-muted); margin: 0 0 1rem; }
.contact a.mail { color: var(--sky); font-size: 1.3rem; font-weight: 700; word-break: break-all; }

/* Page title band for inner pages */
.pagehead { background: var(--night); color: var(--night-ink); padding-block: 2.5rem 3rem; }
.pagehead h1 { margin: 0 0 0.5rem; font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.1; }
.pagehead p { margin: 0; color: var(--night-muted); }

/* ---------- footer ---------- */
footer { background: var(--night); color: var(--night-muted); padding-block: 2.5rem; font-size: 0.95rem; }
footer .wrap { display: grid; gap: 1rem; }
footer nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
footer a { color: var(--night-ink); }
footer p { margin: 0; max-width: 46rem; }

@media (max-width: 800px) {
  .hero { padding-block: 2rem 3.5rem; }
  .hero .wrap, .needs, .features { grid-template-columns: 1fr; }
  .hero .wrap { gap: 2.5rem; }
  .nightview { padding: 1.75rem 1.25rem 1.5rem; }
  main section { padding-block: 3rem; }
  .bar nav { gap: 0.9rem; font-size: 0.95rem; }
  .needs { gap: 0.5rem; }
  .needs .lede { margin-bottom: 1rem; }
}
@media (max-width: 560px) {
  .bar nav a[href="./"] { display: none; }
}
@media (max-width: 340px) {
  .brand span { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .nightview .reading { animation: settle 1.2s ease-out both; }
  @keyframes settle { from { opacity: 0; transform: translateY(6px); } }
}
