/* gridd.us — colours, type and spacing follow the Gridd Health app
   (GriddHealth/DesignSystem/Tokens/GriddColor.swift, design-handoff/design-system.md):
   colour as stroke not fill, outlined tinted surfaces, hairline cards, calm spacing,
   Cormorant Garamond headings, Lora body. */

@font-face { font-family: "Cormorant Garamond"; src: url("/assets/fonts/CormorantGaramond-Regular.f3d77fa2f1.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/assets/fonts/CormorantGaramond-Medium.93c2d9b38e.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/assets/fonts/CormorantGaramond-SemiBold.7ca5b4e30c.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/assets/fonts/CormorantGaramond-Italic.065e930ec4.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Lora"; src: url("/assets/fonts/Lora-Regular.a43dbf2476.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("/assets/fonts/Lora-Medium.112db8f73f.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("/assets/fonts/Lora-SemiBold.f53c930a93.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("/assets/fonts/Lora-Italic.2a7f3646fe.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  color-scheme: light dark;
  --bg: #F3F2F2;
  --card: #F8F4F4;
  --text: #201F1D;
  --muted: #605D5D;
  --accent: #4E9A80;   /* strokes and marks only, never paragraph text */
  --ink: #1A3348;      /* accent-coloured text */
  --tint: #EAF6F0;
  --tint2: #D3F2E5;
  --line: rgba(32, 31, 29, .15);
  --shadow-base: 45, 43, 43;

  --font-heading: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Lora", "Iowan Old Style", Georgia, serif;

  --radius-md: 4px;
  --radius-lg: 7px;
  --wrap: 1120px;
  --measure: 36rem;
  --gutter: clamp(20px, 5vw, 40px);
  --section: clamp(72px, 11vw, 136px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131D27;
    --card: #1B2733;
    --text: #F3F0EE;
    --muted: #BAB6B6;
    --accent: #8FD3B8;
    --ink: #D3F2E5;
    --tint: rgba(143, 211, 184, .10);
    --tint2: rgba(143, 211, 184, .22);
    --line: rgba(243, 240, 238, .16);
    --shadow-base: 0, 0, 0;
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }
p + p { margin-top: 1em; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--tint2); color: var(--text); }
strong { font-weight: 600; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  padding: 10px 14px; background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius-md);
}
.skip:focus { top: 12px; }

/* Kicker / section label: Lora 12, uppercase, letter-spaced, muted */
.kicker {
  font-family: var(--font-body);
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
}

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-height: 44px; }
.brand__mark { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.brand__word {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.375rem;
  letter-spacing: .005em;
  line-height: 1;
}
.site-nav { display: flex; gap: clamp(14px, 3vw, 28px); }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap;
  font-size: .9375rem; color: var(--muted); text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .45em; }

@media (max-width: 380px) {
  .brand { gap: 8px; }
  .brand__mark { width: 28px; height: 28px; border-radius: 7px; }
  .brand__word { font-size: 1.25rem; }
  .site-nav { gap: 14px; }
  .site-nav a { font-size: .875rem; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: var(--section); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-block: 28px 36px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0 22px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-size: .875rem; }
.footer-nav a:hover { color: var(--ink); text-decoration: underline; }
.footer-legal { color: var(--muted); font-size: .875rem; }

/* Hero */
.hero { padding-block: clamp(56px, 10vw, 128px) clamp(48px, 7vw, 96px); }
.display {
  font-weight: 400;
  font-size: clamp(2.75rem, 1.6rem + 5.4vw, 5.5rem);
  line-height: 1.0;
  letter-spacing: -.015em;
}
.lead {
  font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem);
  line-height: 1.6;
  max-width: var(--measure);
  margin-top: clamp(22px, 3vw, 32px);
}
.muted { color: var(--muted); }

/* Section scaffolding */
.section { padding-top: var(--section); }
.section__head { max-width: var(--measure); margin-bottom: clamp(32px, 5vw, 56px); }
.h2 { font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem); }
.h3 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem); font-weight: 500; line-height: 1.12; }
.section__head p { margin-top: 16px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* Home: three principles */
.principles { display: grid; gap: 0; border-top: 1px solid var(--line); }
.principle { padding: 28px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; align-content: start; }
.principle h3 { font-size: 1.75rem; }
.principle p { color: var(--muted); max-width: 30rem; }
@media (min-width: 760px) {
  .principles { grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
  .principle { padding: 32px 28px 36px; border-bottom: 0; }
  .principle + .principle { border-left: 1px solid var(--line); }
  .principle:first-child { padding-left: 0; }
}

/* App feature card (home) */
.app-card {
  display: grid;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  border: 1.5px solid var(--accent);
  background: var(--tint);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 64px);
  overflow: hidden;
}
.app-card__icon { width: 72px; height: 72px; border-radius: 16px; box-shadow: 0 0 0 1px var(--line); margin-bottom: 24px; }
.app-card h2 { margin-bottom: 18px; }
.app-card p { max-width: 32rem; }
.app-card .phone { justify-self: center; }
@media (min-width: 860px) {
  .app-card { grid-template-columns: 1.15fr .85fr; }
}

/* Buttons: outlined, tinted (never solid accent) */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px;
  border: 1.5px solid var(--accent); border-radius: var(--radius-lg);
  background: var(--tint); color: var(--ink);
  font-family: var(--font-heading); font-weight: 600; font-size: 1.1875rem;
  text-decoration: none;
}
.button:hover { background: var(--tint2); }
.button--plain { background: transparent; }
.actions { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 32px; }
.textlink { font-size: 1rem; min-height: 44px; display: inline-flex; align-items: center; }

/* Coming soon */
.soon {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-heading); font-size: 1.375rem; font-weight: 500; line-height: 1.2; color: var(--ink);
}
.soon::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--accent); }
.facts { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 14px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .9375rem; }
.facts li:not(:last-child)::after { content: "·"; margin-left: 10px; color: var(--muted); }
.appstore { display: inline-block; }

/* iPhone frame (real screenshot or placeholder) */
.phone {
  --w: clamp(220px, 62vw, 300px);
  width: var(--w);
  margin: 0;
  padding: calc(var(--w) * .02);
  border-radius: calc(var(--w) * .16);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 24px 60px -24px rgba(var(--shadow-base), .28), 0 2px 6px rgba(var(--shadow-base), .06);
  flex: none;
}
.phone--small { --w: clamp(200px, 56vw, 260px); }
.phone picture { display: contents; }
/* Dark mode: a light silver frame so the phone's edge stands out from the navy page */
@media (prefers-color-scheme: dark) {
  .phone {
    background: linear-gradient(150deg, #E4E7EB 0%, #B9BFC6 45%, #D5D9DE 70%, #A7AEB6 100%);
    border-color: rgba(255, 255, 255, .35);
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3);
  }
  .phone--placeholder .phone__screen { border-color: rgba(0, 0, 0, .25); }
}
.phone__screen {
  display: block;
  width: 100%;
  aspect-ratio: 1206 / 2622;
  border-radius: calc(var(--w) * .14);
  overflow: hidden;
}
.phone--placeholder .phone__screen {
  position: relative;
  border: 1px solid var(--line);
  background: var(--bg);
}
.phone__island {
  position: absolute; top: 3.2%; left: 50%; transform: translateX(-50%);
  width: 31%; height: 3.4%; border-radius: 999px; background: var(--text); opacity: .9;
}
.phone__label {
  position: absolute; left: 10%; right: 10%; top: 14%;
  font-family: var(--font-heading); font-size: calc(var(--w) * .1); font-weight: 500; line-height: 1.05; color: var(--text);
}
.phone__label::after {
  content: "";
  display: block;
  margin-top: calc(var(--w) * .09);
  height: calc(var(--w) * .5);
  border-top: 1px solid var(--line);
  background:
    linear-gradient(var(--line), var(--line)) 0 calc(var(--w) * .1) / 70% 1px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 calc(var(--w) * .2) / 85% 1px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 calc(var(--w) * .3) / 55% 1px no-repeat;
}

/* Product hero (home) */
.product-hero { display: grid; gap: clamp(40px, 6vw, 72px); align-items: center; }
.product-hero__icon { width: 88px; height: 88px; border-radius: 20px; box-shadow: 0 0 0 1px var(--line); margin-bottom: 28px; }
.product-hero .phone { justify-self: center; }
@media (min-width: 860px) {
  .product-hero { grid-template-columns: 1.2fr .8fr; }
}

/* Swipeable screen row (home, phones and narrow windows only) */
.gallery { display: none; }
@media (max-width: 859px) {
  .gallery { display: block; margin-bottom: 24px; }
  .product-hero > .phone, .feature > .phone { display: none; }
}
.gallery__track {
  list-style: none; margin: 0;
  display: flex; gap: 18px;
  padding: 8px max(var(--gutter), env(safe-area-inset-right)) 36px max(var(--gutter), env(safe-area-inset-left));
  scroll-padding-inline: max(var(--gutter), env(safe-area-inset-left));
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track:focus-visible { outline-offset: -2px; }
.gallery__item { flex: none; scroll-snap-align: start; }
.gallery .phone { --w: min(56vw, 230px); }
.gallery__caption {
  margin-top: 16px; text-align: center;
  font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}

/* Feature rows */
.features { display: grid; gap: clamp(72px, 10vw, 128px); }
.feature { display: grid; gap: clamp(32px, 5vw, 56px); align-items: center; }
.feature .phone { justify-self: center; }
.feature__text { max-width: 30rem; }
.feature__text .h3 { margin-bottom: 16px; }
.feature__list { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.feature__list li { padding-left: 22px; position: relative; color: var(--muted); }
.feature__list li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 9px; height: 1.5px; background: var(--accent); }
@media (min-width: 860px) {
  .feature { grid-template-columns: 1fr 1fr; }
  .feature--flip .feature__text { order: 2; }
  .feature__text { justify-self: center; }
}

/* Privacy panel */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: clamp(24px, 5vw, 56px);
}
.panel--highlight { border: 1.5px solid var(--accent); background: var(--tint); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.checklist li { padding: 16px 0 16px 34px; border-top: 1px solid var(--line); position: relative; }
.checklist li:first-child { border-top: 0; }
.checklist li::before {
  content: ""; position: absolute; left: 2px; top: 1.35em;
  width: 12px; height: 7px; border-left: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent);
  transform: rotate(-45deg);
}
@media (min-width: 860px) {
  .checklist { grid-template-columns: 1fr 1fr; column-gap: 48px; }
  .checklist li:nth-child(2) { border-top: 0; }
}

/* Spec list */
.specs { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--line); }
.specs div { display: grid; gap: 4px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.specs dt { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.specs dd { margin: 0; }
@media (min-width: 640px) {
  .specs div { grid-template-columns: 12rem 1fr; gap: 24px; align-items: baseline; }
}

.note {
  border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px 16px; color: var(--muted); font-size: .9375rem; max-width: var(--measure);
}

/* Long-form documents (privacy, support) */
.doc { max-width: 42rem; }
.doc-head { padding-block: clamp(48px, 8vw, 96px) clamp(28px, 4vw, 48px); }
.doc-head h1 { font-size: clamp(2.5rem, 1.8rem + 3vw, 4rem); }
.doc-head .lead { margin-top: 20px; }
.doc-meta { color: var(--muted); font-size: .9375rem; margin-top: 18px; }
article.doc h2 { font-size: clamp(1.625rem, 1.4rem + 1vw, 2.125rem); margin: 56px 0 14px; padding-top: 28px; border-top: 1px solid var(--line); }
article.doc h2:first-child { margin-top: 0; }
.doc h3 { font-size: 1.375rem; font-weight: 600; margin: 28px 0 8px; }
.doc ul { padding-left: 1.2em; margin: 1em 0 0; }
.doc li + li { margin-top: .5em; }
.doc li::marker { color: var(--accent); }
.doc p + ul, .doc ul + p { margin-top: 1em; }
.toc { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.toc a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 20px; text-decoration: none; font-size: .9375rem;
}
.toc a:hover { border-color: var(--accent); background: var(--tint); }
mark.placeholder { background: var(--tint2); color: var(--ink); padding: 0 4px; border-radius: 3px; }

/* FAQ (details/summary, no JavaScript) */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 14px 0;
  font-family: var(--font-heading); font-size: 1.375rem; font-weight: 500; line-height: 1.2;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 6px;
  border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent);
  transform: rotate(45deg) translateY(-3px); transition: transform .2s ease-out;
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq .answer { padding: 0 0 24px; max-width: 40rem; }
.faq .answer p + p, .faq .answer p + ul { margin-top: .8em; }
.faq .answer ul { margin: .8em 0 0; padding-left: 1.2em; }
.faq .answer li::marker { color: var(--accent); }

.contact {
  display: grid; gap: 16px; align-items: center;
  border: 1.5px solid var(--accent); background: var(--tint); border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 36px);
}
.contact h2 { font-size: clamp(1.75rem, 1.5rem + 1vw, 2.25rem); margin-bottom: 8px; }
.contact a.email { font-family: var(--font-heading); font-size: clamp(1.5rem, 1.3rem + 1vw, 2rem); font-weight: 500; overflow-wrap: anywhere; }
@media (min-width: 760px) { .contact { grid-template-columns: 1fr auto; } }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.copy {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: transparent;
  color: var(--ink); font-family: var(--font-body); font-size: .9375rem; cursor: pointer;
}
.copy:hover, .copy.is-done { border-color: var(--accent); background: var(--tint2); }
.copy[hidden] { display: none; }
.copy__icon { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.copy__buffer { position: fixed; top: 0; left: -9999px; opacity: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.disclaimer { border-left: 2px solid var(--accent); padding: 4px 0 4px 18px; max-width: var(--measure); }

/* Headings directly above an FAQ list or panel need room before its top line */
section.doc > .h2 { margin-bottom: 24px; }

/* 404 */
.notfound { padding-block: clamp(80px, 14vw, 180px) 0; }

/* Phones: tighter vertical rhythm, smaller phone frames, less nested padding */
@media (max-width: 639px) {
  :root { --section: 64px; }
  .hero { padding-block: 40px 44px; }
  .lead { margin-top: 20px; }
  .kicker { margin-bottom: 14px; }
  .section__head { margin-bottom: 28px; }

  .principle { padding: 22px 0; gap: 6px; }
  .principle h3 { font-size: 1.625rem; }

  .phone { --w: min(52vw, 210px); }
  .phone--small { --w: min(48vw, 190px); }

  .app-card { padding: 26px 22px 30px; gap: 32px; }
  .app-card__icon { width: 60px; height: 60px; border-radius: 14px; margin-bottom: 18px; }
  .app-card h2 { margin-bottom: 12px; }
  .actions { margin-top: 24px; }

  .product-hero { gap: 40px; }
  .product-hero__icon { width: 68px; height: 68px; border-radius: 15px; margin-bottom: 22px; }
  .features { gap: 64px; }
  .feature { gap: 28px; }
  .feature__text .h3 { margin-bottom: 12px; }

  .panel { padding: 26px 20px; }
  .checklist li { padding: 14px 0 14px 30px; }

  .doc-head { padding-block: 40px 28px; }
  article.doc h2 { margin: 40px 0 12px; padding-top: 24px; }
  .faq summary { font-size: 1.3125rem; min-height: 60px; }
  .contact { padding: 22px 20px; }

  .notfound { padding-top: 64px; }
  .site-footer__inner { padding-block: 20px 28px; }
}

/* iPhone in landscape: keep content clear of the notch / Dynamic Island */
@supports (padding: max(0px)) {
  .wrap {
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .skip { display: none; }
  body { background: #fff; color: #000; }
}
