:root {
  --paper: #e8edee;
  --sheet: #f5f8f8;
  --ink: #13232c;
  --slate: #0e1f28;
  --muted: #4a5e68;
  --rule: #b5c3c9;
  --mark: #c01a5d;
  --mark-on-dark: #ff7fb0;
  --teal: #1fa391;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --text: "Source Serif 4", Georgia, serif;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --measure: 38rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.6;
}

a { color: inherit; }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 3px; }
.hero :focus-visible, .foot :focus-visible { outline-color: var(--mark-on-dark); }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 10;
  background: var(--sheet); color: var(--ink); padding: .6rem 1rem;
  font-family: var(--display);
}
.skip:focus { left: 0; }

h1, h2, h3, .wordmark, .role, .nav, figcaption, table, .seg, .cloud-note, .legend, .status, dt {
  font-family: var(--display);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: max(100svh, 36rem);
  background: var(--slate);
  color: #eef3f4;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr) calc(21rem + var(--gutter));
  overflow: hidden;
}

#cloud {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  cursor: grab;
  touch-action: pan-y;
}
#cloud.dragging { cursor: grabbing; }

.nav {
  grid-column: 1 / -1;
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .5rem 2rem;
  padding: 1.25rem var(--gutter);
  font-size: .95rem;
  pointer-events: none;
}
.nav a { pointer-events: auto; text-decoration: none; }
.nav a:hover { text-decoration: underline; text-underline-offset: .25em; }
.nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; list-style: none; margin: 0; padding: 0; }

.wordmark {
  font-stretch: 125%;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .01em;
}

.hero-text {
  grid-row: 3; grid-column: 1;
  position: relative; z-index: 2;
  padding: 0 var(--gutter) clamp(1.5rem, 4vw, 3rem);
  max-width: 54rem;
  pointer-events: none;
}
.hero-text h1 {
  margin: 0 0 1rem;
  font-stretch: 112%;
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.hero-text p {
  margin: 0;
  max-width: 34rem;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: #c4d3d8;
}

.cloud-panel {
  grid-row: 3; grid-column: 2;
  position: relative; z-index: 2;
  align-self: end;
  padding: 0 var(--gutter) clamp(1.5rem, 4vw, 3rem) 0;
}
.seg { display: flex; border: 1px solid #47606c; border-radius: 3px; overflow: hidden; }
.seg button {
  flex: 1;
  font: inherit; font-size: .85rem;
  padding: .5rem .4rem;
  color: #c4d3d8; background: rgba(14, 31, 40, .7);
  border: 0; border-left: 1px solid #47606c;
  cursor: pointer;
}
.seg button:first-child { border-left: 0; }
.seg button:hover { color: #fff; }
.seg button[aria-pressed="true"] { background: #eef3f4; color: var(--slate); font-weight: 600; }
.cloud-note { margin: .75rem 0 0; font-size: .8rem; line-height: 1.45; color: #9fb3ba; font-variant-numeric: tabular-nums; }

@media (max-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto auto; }
  .hero-text { grid-row: 3; padding-bottom: 1.25rem; }
  .cloud-panel { grid-row: 4; grid-column: 1; width: auto; max-width: 26rem; padding-left: var(--gutter); }
  .nav ul { gap: .25rem 1.1rem; font-size: .9rem; }
}

/* ---------- How they fit ---------- */

.fit { padding: clamp(3rem, 7vw, 6rem) var(--gutter) 0; }
.fit h2 {
  margin: 0 0 2rem;
  font-size: 1.05rem; font-weight: 600; font-stretch: 112%;
  color: var(--muted);
}
.fit-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 2px solid var(--ink);
}
.fit-list li { padding: 1.25rem 1.5rem 0 0; }
.fit-list li + li { border-left: 1px solid var(--rule); padding-left: 1.5rem; }
.fit-list a {
  font-family: var(--display); font-stretch: 112%; font-weight: 600; font-size: 1.3rem;
  text-decoration-color: var(--mark); text-decoration-thickness: 2px; text-underline-offset: .22em;
}
.fit-list a:hover { color: var(--mark); }
.fit-list p { margin: .6rem 0 0; font-size: 1rem; line-height: 1.5; color: var(--muted); }

@media (max-width: 75rem) {
  .fit-list { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.5rem; }
  .fit-list li:nth-child(odd) { border-left: 0; padding-left: 0; }
  .fit-list li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 34rem) {
  .fit-list { grid-template-columns: minmax(0, 1fr); }
  .fit-list li + li { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); }
}

/* ---------- Work sections ---------- */

.work {
  padding: clamp(4rem, 9vw, 8rem) var(--gutter) 0;
  scroll-margin-top: 1rem;
}
.work:last-of-type { padding-bottom: clamp(4rem, 9vw, 8rem); }

.work-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
  border-top: 2px solid var(--ink);
  padding-top: 1.25rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}
.role {
  grid-column: 1 / -1;
  margin: 0 0 1.5rem;
  font-size: .95rem; font-weight: 600;
  color: var(--mark);
}
.work-head h2 {
  margin: 0;
  font-stretch: 125%;
  font-weight: 700;
  font-size: clamp(2.1rem, 4.4vw, 4rem);
  line-height: 1;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.lede {
  margin: 0;
  font-size: clamp(1.2rem, 1.7vw, 1.5rem);
  line-height: 1.4;
  max-width: 36rem;
}

.work-body {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
}
/* Alternate which side the figure sits on, so the page does not read as a stack of one template. */
#analysis .work-body, #inspector .work-body { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
#analysis .work-body > figure, #inspector .work-body > figure { order: -1; }

/* The inspector's figure is a screenshot, so it takes the wide column. */
@media (min-width: 60.01rem) {
  #inspector .work-body { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.1em; }
.prose h3 {
  margin: 2.2em 0 .6em;
  font-size: 1.15rem; font-weight: 600; font-stretch: 112%;
}
.caution {
  margin-top: 1.6em !important;
  padding: .9rem 1.1rem;
  border-left: 4px solid var(--mark);
  background: var(--sheet);
  font-size: 1rem;
}

@media (max-width: 60rem) {
  .work-head, .work-body,
  #analysis .work-body, #inspector .work-body { grid-template-columns: minmax(0, 1fr); }
  .work-head h2 { margin-bottom: 1.25rem; }
  #analysis .work-body > figure, #inspector .work-body > figure { order: 0; }
}

/* ---------- Figures ---------- */

figure { margin: 0; }
figcaption {
  font-size: .9rem; font-weight: 600;
  color: var(--muted);
  margin-bottom: .9rem;
}

.features { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 2rem; }
.features dt { font-weight: 600; font-size: 1rem; }
.features dd { margin: .2rem 0 0; font-size: 1rem; line-height: 1.5; color: var(--muted); }
@media (max-width: 34rem) { .features { grid-template-columns: minmax(0, 1fr); } }

.table-scroll { overflow-x: auto; background: var(--sheet); border: 1px solid var(--rule); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: .8rem 1rem; border-top: 1px solid var(--rule); }
thead th { border-top: 0; font-weight: 600; background: var(--ink); color: #eef3f4; }
tbody th { font-weight: 600; white-space: nowrap; }
#pointloom td:first-child { color: var(--muted); width: 38%; }
#analysis tbody th { white-space: normal; width: 32%; }
.table-fig.wide { margin-top: clamp(2.5rem, 5vw, 4rem); }
.table-fig.wide table { min-width: 34rem; }

.status, .legend {
  list-style: none; margin: 1rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  font-size: .9rem;
}
.status li, .legend li { display: flex; align-items: center; gap: .5rem; }
.dot { width: .7rem; height: .7rem; border-radius: 50%; }
.dot.good { background: #2f9e5b; }
.dot.check { background: #e0a11b; }
.dot.bad { background: #cf3b3b; }
.dot.none { background: transparent; border: 2px solid var(--muted); }
.sw { width: .9rem; height: .9rem; background: var(--c); }

.coverage-fig svg { display: block; width: 100%; height: auto; background: var(--sheet); border: 1px solid var(--rule); }
.coverage-fig { position: sticky; top: 1.5rem; }

.phone-fig svg { display: block; width: min(100%, 17rem); height: auto; }

@media (max-width: 60rem) { .coverage-fig { position: static; } }

/* ---------- Screenshots ---------- */

.shots {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.shots img, .shot img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); background: var(--slate); }
.shots a, .shot a { display: block; }
.shots figcaption, .shot figcaption { margin: .7rem 0 0; font-weight: 400; max-width: 34rem; }

/* ---------- Footer ---------- */

.foot {
  background: var(--slate); color: #c4d3d8;
  padding: 3rem var(--gutter);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1rem clamp(1.5rem, 4vw, 4rem);
}
.foot p { margin: 0; max-width: 36rem; font-size: 1rem; }
.foot .wordmark { color: #eef3f4; }
.foot-body p + p { margin-top: 1rem; }
.foot a { color: #eef3f4; text-underline-offset: 0.2em; }
.foot a:hover { color: var(--mark-on-dark); }
@media (max-width: 60rem) { .foot { grid-template-columns: minmax(0, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
