/*
 * Gliplog site styles. The tokens mirror the app's src/styles/tokens.css (warm paper, sea-teal
 * primary, terracotta accent, warm ink) so the site and the app read as one product. Dark mode
 * follows the device; the site ships no script, so there is no toggle.
 */
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/hanken-grotesk-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/hanken-grotesk-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/hanken-grotesk-latin-700-normal.woff2') format('woff2');
}

:root {
  color-scheme: light dark;
  --gl-font: 'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gl-radius-md: 14px;
  --gl-radius-lg: 20px;
  --gl-radius-xl: 28px;
  --gl-radius-pill: 999px;
  --gl-gutter: 16px;
  --gl-max: 1120px;

  --gl-bg: #fbf8f3;
  --gl-surface: #fffdf9;
  --gl-surface-2: #f4ede2;
  --gl-text-1: #1d1a14;
  --gl-text-2: #5f5544;
  --gl-text-3: #7a6c54;
  --gl-brand: #2d6567;
  --gl-brand-strong: #234f51;
  --gl-on-brand: #fbf8f3;
  --gl-brand-soft: rgba(45, 101, 103, 0.12);
  --gl-accent: #9a4f33;
  --gl-divider: #e8ddcc;
  --gl-shadow: 0 1px 1px rgba(45, 38, 26, 0.04), 0 8px 24px rgba(45, 38, 26, 0.07);
  --gl-backdrop-1: rgba(116, 179, 174, 0.22);
  --gl-backdrop-2: rgba(220, 141, 107, 0.16);
  --gl-focus: #dc8d6b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --gl-bg: #15120e;
    --gl-surface: #221e18;
    --gl-surface-2: #2c2820;
    --gl-text-1: #f4ede2;
    --gl-text-2: #d6c7af;
    --gl-text-3: #b3a286;
    --gl-brand: #74c3bd;
    --gl-brand-strong: #a3e0db;
    --gl-on-brand: #15120e;
    --gl-brand-soft: rgba(116, 195, 189, 0.18);
    --gl-accent: #ebb59b;
    --gl-divider: #3a342a;
    --gl-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --gl-backdrop-1: rgba(58, 169, 166, 0.14);
    --gl-backdrop-2: rgba(189, 89, 47, 0.12);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--gl-font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--gl-text-1);
  background:
    radial-gradient(60rem 36rem at 0% 0%, var(--gl-backdrop-1), transparent 70%),
    radial-gradient(50rem 30rem at 100% 0%, var(--gl-backdrop-2), transparent 70%), var(--gl-bg);
  background-repeat: no-repeat;
}

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

a {
  color: var(--gl-brand);
  text-underline-offset: 0.18em;
}

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--gl-focus);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  font-weight: 700;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

p {
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: var(--gl-max);
  margin: 0 auto;
  padding: 0 var(--gl-gutter);
}

@media (min-width: 720px) {
  :root {
    --gl-gutter: 32px;
  }
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--gl-surface);
  padding: 8px 12px;
}

/* Header */
.site-header {
  padding: 16px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--gl-text-1);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  box-shadow: var(--gl-shadow);
}

.brand__accent {
  color: var(--gl-brand);
}

.site-nav {
  display: flex;
  gap: 20px;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--gl-text-2);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--gl-text-1);
}

@media (max-width: 559px) {
  .site-nav .optional {
    display: none;
  }
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--gl-radius-pill);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}

.button--primary {
  background: var(--gl-brand);
  color: var(--gl-on-brand);
}

.button--primary:hover {
  background: var(--gl-brand-strong);
}

.button--quiet {
  border-color: var(--gl-divider);
  color: var(--gl-text-1);
  background: var(--gl-surface);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Stacked buttons on a phone share one width instead of wrapping at two. */
@media (max-width: 559px) {
  .actions .button {
    flex: 1 1 100%;
  }
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gl-accent);
}

.lead {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  color: var(--gl-text-2);
  max-width: 38ch;
}

.muted {
  color: var(--gl-text-2);
}

.small {
  font-size: 0.9rem;
}

/* The container owns the spacing between its children, so a child's own margin reset can't
   collapse it. */
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack--loose {
  gap: 28px;
}

/* Hero */
.hero {
  padding: 32px 0 56px;
}

.hero .wrap {
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.phones {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.phone {
  width: min(46%, 260px);
  border-radius: var(--gl-radius-xl);
  overflow: hidden;
  box-shadow: var(--gl-shadow);
  border: 1px solid var(--gl-divider);
  background: var(--gl-surface);
}

.phone:nth-child(2) {
  transform: translateY(32px);
}

/* Plain text with a tick, not pills: a pill reads as a button you can tap. */
.badges {
  display: grid;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 0.95rem;
  color: var(--gl-text-2);
}

.badges li {
  padding-left: 22px;
  position: relative;
}

.badges li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--gl-brand);
  border-bottom: 2px solid var(--gl-brand);
  transform: rotate(-45deg);
}

/* Sections */
.section {
  padding: 56px 0;
}

.section--band {
  background: var(--gl-surface-2);
}

.section-head {
  max-width: 60ch;
  margin-bottom: 32px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.card {
  background: var(--gl-surface);
  border: 1px solid var(--gl-divider);
  border-radius: var(--gl-radius-lg);
  padding: 24px;
  box-shadow: var(--gl-shadow);
}

.card h3 {
  margin-bottom: 8px;
}

.split {
  display: grid;
  gap: 32px;
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
}

.split .phone {
  width: min(100%, 300px);
  margin: 0 auto;
}

.checks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.checks li {
  padding-left: 32px;
  position: relative;
}

.checks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 18px;
  height: 10px;
  border-left: 3px solid var(--gl-brand);
  border-bottom: 3px solid var(--gl-brand);
  transform: rotate(-45deg);
}

.meds {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}

.meds dl {
  margin: 0;
}

.meds dt {
  font-weight: 600;
}

.meds dd {
  margin: 0;
  color: var(--gl-text-2);
  font-size: 0.95rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--gl-divider);
  vertical-align: top;
}

.table-scroll {
  overflow-x: auto;
}

/* A wide comparison scrolls sideways on a phone rather than wrapping a word a line. */
.table-scroll .table--wide {
  min-width: 760px;
}

details {
  border-bottom: 1px solid var(--gl-divider);
  padding: 16px 0;
}

summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 32px;
}

details p {
  margin-top: 8px;
  color: var(--gl-text-2);
}

/* Long-form pages (privacy) */
.prose {
  max-width: 68ch;
  padding: 24px 0 64px;
}

.prose h2 {
  font-size: 1.4rem;
  margin-top: 36px;
}

.prose p,
.prose ul {
  margin-top: 12px;
}

/* Footer */
.site-footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--gl-divider);
  font-size: 0.9rem;
  color: var(--gl-text-2);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-weight: 600;
}

@media (prefers-reduced-motion: no-preference) {
  .button {
    transition: background-color 160ms ease;
  }
}

/* Inline style attributes are blocked by the CSP, so spacing tweaks are classes. */
.spaced {
  margin-top: 20px;
}

/* Dosing page */
.hero--page {
  padding-bottom: 40px;
}

/* A page heading is one column, not the home page's text-and-phones grid. */
.hero.hero--page .wrap {
  display: flex;
  align-items: flex-start;
}

.lead--wide {
  max-width: 60ch;
}

.site-nav a[aria-current='page'] {
  color: var(--gl-text-1);
}

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-weight: 600;
  font-size: 0.95rem;
}

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dosing-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

.dosing-grid--three {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

/* An anchor target lands below the top edge rather than flush against it. */
.card[id] {
  scroll-margin-top: 16px;
}

/*
 * A dose staircase: one column per dose, the bar's height a share of the chart's highest dose.
 * Heights are classes because the CSP blocks style attributes. Kind is never colour alone: the
 * starting dose is hatched and an optional step is outlined and dashed.
 */
.ladder {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  column-gap: 6px;
}

/* Each column shares the ladder's two rows, so bars sit on one baseline however the labels
   under them wrap. */
.rung {
  grid-row: span 2;
  display: grid;
  grid-template-rows: subgrid;
  text-align: center;
}

.rung__top {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 180px;
}

.rung__dose {
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-bottom: 4px;
}

.rung__bar {
  display: block;
  min-height: 6px;
  max-height: 150px;
  border-radius: 8px 8px 2px 2px;
  background: color-mix(in srgb, var(--gl-brand) 45%, transparent);
}

.rung__when {
  margin-top: 6px;
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--gl-text-2);
}

/* Fill says whether the label lists a dose for ongoing use; a dashed ring says it is reached
   only if the prescriber steps up; hatching marks the starting dose. */
.swatch--step {
  background: color-mix(in srgb, var(--gl-brand) 45%, transparent);
}

.rung--keep .rung__bar,
.swatch--keep {
  background: var(--gl-brand);
}

.rung--start .rung__bar,
.swatch--start {
  background: repeating-linear-gradient(
    135deg,
    var(--gl-brand) 0 3px,
    var(--gl-brand-soft) 3px 7px
  );
}

.rung--option .rung__bar,
.swatch--option {
  outline: 2px dashed var(--gl-brand);
  outline-offset: 2px;
}

.swatch--option {
  background: transparent;
  outline-offset: -1px;
}

/* Bar heights in 5% steps of 150px, the tallest bar: the CSP blocks style attributes. */
.h-5 {
  height: 7.5px;
}

.h-10 {
  height: 15px;
}

.h-15 {
  height: 22.5px;
}

.h-20 {
  height: 30px;
}

.h-25 {
  height: 37.5px;
}

.h-30 {
  height: 45px;
}

.h-35 {
  height: 52.5px;
}

.h-40 {
  height: 60px;
}

.h-45 {
  height: 67.5px;
}

.h-50 {
  height: 75px;
}

.h-55 {
  height: 82.5px;
}

.h-60 {
  height: 90px;
}

.h-65 {
  height: 97.5px;
}

.h-70 {
  height: 105px;
}

.h-75 {
  height: 112.5px;
}

.h-80 {
  height: 120px;
}

.h-85 {
  height: 127.5px;
}

.h-90 {
  height: 135px;
}

.h-95 {
  height: 142.5px;
}

.h-100 {
  height: 150px;
}

.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.9rem;
  color: var(--gl-text-2);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  display: inline-block;
  width: 18px;
  height: 12px;
  border-radius: 3px;
}

.dose-notes {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  color: var(--gl-text-2);
  font-size: 0.95rem;
}

.split--top {
  align-items: start;
}

.sources {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

th[scope='row'] {
  font-weight: 600;
}

/* A card with its action beside the text on wide screens, below it on a phone. */
.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}

.callout .stack {
  flex: 1 1 320px;
  gap: 8px;
}

.h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.crumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 0.9rem;
  color: var(--gl-text-2);
}

.crumbs li + li::before {
  content: '›';
  margin-right: 8px;
  color: var(--gl-text-3);
}

.crumbs a {
  color: var(--gl-text-2);
}

.quick {
  max-width: 68ch;
  border-left: 4px solid var(--gl-brand);
  gap: 8px;
}

.related {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-weight: 600;
}
