/* Trinder website. Colours and type match lib/design.dart. Mobile first: wider layouts are in the media queries at the end. */
@font-face {
  font-family: "Trinder Serif";
  src: url("source-serif-4-display.otf") format("opentype");
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f9f9f6;
  --ink: #20251d;
  --muted: #62665d;
  --accent: #cf744f;
  --green: #527455;
  --sage: #e8ede1;
  --card: #ffffff;
  --line: rgba(32, 37, 29, 0.1);
  --serif: "Trinder Serif", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --width: 1080px;
  --text: 680px;
  --gutter: clamp(16px, 5vw, 32px);
  --section: clamp(56px, 10vw, 104px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: calc(var(--width) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--card); padding: 8px 12px; z-index: 1; }

/* Header and footer */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none; font: 24px/1 var(--serif); letter-spacing: -0.02em; }
/* The mark is drawn as the app icon: artwork on a white rounded tile. */
.brand svg { width: 36px; height: 36px; flex: none; background: var(--card); border-radius: 10px; box-shadow: 0 0 0 1px var(--line), 0 1px 3px rgba(32, 37, 29, 0.08); }
.top nav { display: flex; gap: 4px; font-size: 15px; }
.top nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--ink); text-decoration: none; }
.top nav a:last-child { margin-right: -8px; }
.top nav a:hover, .top nav a[aria-current] { color: var(--green); text-decoration: underline; }

.foot { border-top: 1px solid var(--line); margin-top: var(--section); padding: 28px 0 calc(40px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 14px; }
.foot .wrap { display: flex; flex-direction: column; gap: 14px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 20px; }
.foot nav a { display: inline-block; padding: 6px 0; color: var(--muted); }

/* Type */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(38px, 9vw, 68px); line-height: 1.06; letter-spacing: -0.03em; margin: 0 0 18px; }
h2 { font-size: clamp(28px, 6vw, 40px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 12px; }
h3 { font-size: clamp(22px, 5vw, 24px); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 8px; }
p { text-wrap: pretty; }
.lead { font-size: clamp(17px, 4.2vw, 20px); line-height: 1.55; color: var(--muted); max-width: 34em; margin: 0 0 26px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }

/* Home */
.hero { display: grid; gap: 8px; padding-top: clamp(16px, 4vw, 48px); }
/* illustration.png has a transparent background, so it sits directly on the page. */
.hero img { width: min(42vw, 170px); justify-self: center; margin-top: 24px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.pill { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: 15px; }
.actions a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

.features { display: grid; gap: 14px; margin-top: var(--section); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
.card p { margin: 0; color: var(--muted); }
.card .tag { display: inline-block; margin-bottom: 14px; padding: 5px 11px; border-radius: 999px; background: rgba(82, 116, 85, 0.09); color: var(--green); font-size: 13px; font-weight: 600; }

.lenses { margin-top: var(--section); display: grid; gap: 20px; }
.lenses p { margin: 0; color: var(--muted); }
.lenses dl { margin: 0; display: grid; gap: 12px; }
.lenses dl div { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; }
.lenses dt { font-weight: 600; }
.lenses dd { margin: 4px 0 0; color: var(--muted); }

.practice { margin-top: var(--section); background: var(--sage); border-radius: 24px; padding: clamp(24px, 6vw, 48px); }
.practice p { margin: 0; max-width: 40em; }

/* Text pages */
.doc { max-width: var(--text); margin: 0 auto; padding-top: clamp(12px, 3vw, 32px); }
.doc h1 { font-size: clamp(36px, 8vw, 56px); }
.doc h2 { font-size: clamp(24px, 5.5vw, 30px); margin: 44px 0 10px; }
.doc p, .doc li { color: #3b4036; }
.doc ul, .doc ol { padding-left: 20px; }
.doc li { margin: 6px 0; }
.doc .updated { color: var(--muted); font-size: 15px; margin-top: -6px; }

/* Provider table: stacked rows on phones, a normal table on wider screens. */
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0; }
.doc thead { display: none; }
.doc tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
.doc tr:first-child { border-top: 1px solid var(--line); }
.doc td { display: block; padding: 1px 0; }
.doc td:first-child { font-weight: 600; }
.doc td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; color: var(--muted); }

.callout { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; margin: 22px 0; }
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }
.callout .email { font-size: clamp(18px, 5vw, 21px); font-weight: 600; }

details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary { cursor: pointer; list-style: none; padding: 16px 36px 16px 0; font-weight: 600; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-52%); font-size: 24px; line-height: 1; font-weight: 400; color: var(--muted); }
details[open] summary::after { content: "−"; }
details > p { margin-top: 0; }
details > :last-child { margin-bottom: 18px; }

/* Tablets and up */
@media (min-width: 640px) {
  body { font-size: 17px; }
  .brand { font-size: 26px; }
  .top { padding-top: 20px; padding-bottom: 20px; }
  .top nav { gap: 12px; }
  .card { padding: 26px; }
  .callout { padding: 24px 26px; }
  .foot .wrap { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; }

  .doc thead { display: table-header-group; }
  .doc tr { display: table-row; padding: 0; border: 0; }
  .doc tr:first-child { border-top: 0; }
  .doc th, .doc td { display: table-cell; text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); }
  .doc th { font-weight: 600; }
  .doc td:first-child { font-weight: 400; }
  .doc td[data-label]:not(:first-child)::before { content: none; }
}

/* Laptops and up: two-column hero and perspectives, three feature cards. */
@media (min-width: 880px) {
  .hero { grid-template-columns: 1.2fr 0.8fr; align-items: center; gap: 56px; }
  .hero img { width: 100%; max-width: 300px; margin-top: 0; }
  .features { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .card { padding: 28px; }
  .lenses { grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: start; }
}
