/* Source Pocket site styles. Mobile first; no external fonts. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f4f5f7;
  --fg: #16181d;
  --muted: #4b5262;
  --accent: #1f4fd1;
  --on-accent: #ffffff;
  --rule: #dfe2e8;
  --control-border: #8a909c;
  --focus: #1f4fd1;
  --pass: #11753a;
  --fail: #b3261e;
  --running: #8a5300;
  --queued: #5b6170;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: 16px;
  --measure: 68ch;
  --radius: 10px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1014;
  --surface: #181b22;
  --fg: #e9ebf0;
  --muted: #a9b0bd;
  --accent: #8db4ff;
  --on-accent: #0e1014;
  --rule: #2a2f3a;
  --control-border: #5a6170;
  --focus: #8db4ff;
  --pass: #5fd38d;
  --fail: #ff8f85;
  --running: #f5c04a;
  --queued: #9aa1ad;
}

/* The logo's ink strokes and dot follow the text color in dark mode. */
:root[data-theme="dark"] .mark-ink-stroke {
  stroke: var(--fg);
}

:root[data-theme="dark"] .mark-ink-fill {
  fill: var(--fg);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1014;
    --surface: #181b22;
    --fg: #e9ebf0;
    --muted: #a9b0bd;
    --accent: #8db4ff;
    --on-accent: #0e1014;
    --rule: #2a2f3a;
    --control-border: #5a6170;
    --focus: #8db4ff;
    --pass: #5fd38d;
    --fail: #ff8f85;
    --running: #f5c04a;
    --queued: #9aa1ad;
  }

  :root:not([data-theme="light"]) .mark-ink-stroke {
    stroke: var(--fg);
  }

  :root:not([data-theme="light"]) .mark-ink-fill {
    fill: var(--fg);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem);
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2rem);
  margin-top: 2.5rem;
}

h3 {
  font-size: 1.2rem;
  margin-top: 1.75rem;
}

p,
ul,
ol,
table {
  margin: 0 0 1rem;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
}

.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;
}

/* Skip link: hidden until focused. */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  border-radius: 0 0 var(--radius) var(--radius);
}

.skip-link:focus {
  top: 0;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose {
  max-width: var(--measure);
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  color: var(--fg);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.brand .mark {
  width: 32px;
  height: 32px;
  flex: none;
}

.site-nav {
  order: 3;
  flex-basis: 100%;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.6rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
}

.site-nav li:first-child a {
  padding-inline-start: 0;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--fg);
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.theme-toggle {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.75rem;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle[aria-pressed="true"] .icon-sun {
  display: inline;
}

.theme-toggle[aria-pressed="true"] .icon-moon {
  display: none;
}

@media (min-width: 52rem) {
  .site-nav {
    order: 0;
    flex-basis: auto;
    margin-inline-start: 1rem;
  }
}

/* Sections */
main {
  display: block;
  padding-bottom: 4rem;
}

.hero {
  padding-block: 3rem 2rem;
}

.lede {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 40rem;
}

.notice {
  border-left: 4px solid var(--accent);
  background: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  max-width: var(--measure);
}

.notice strong {
  display: block;
}

.eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.section {
  padding-block: 2rem;
  border-top: 1px solid var(--rule);
}

.section:first-of-type {
  border-top: 0;
}

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card h3 {
  margin-top: 0;
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

.card-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

@media (min-width: 50rem) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Home page hero: copy on the left, a drawn phone on the right from 800px up. */
.hero-split {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero-split h1 {
  margin-bottom: 1rem;
}

.hero-note {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

@media (min-width: 50rem) {
  .hero-split {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3rem;
  }
}

/* A static drawing of the app's pipeline screen. Status always has a word next to its dot. */
.phone {
  justify-self: center;
  width: min(300px, 100%);
  margin: 0;
}

.phone-screen {
  display: flex;
  flex-direction: column;
  min-height: 560px;
  padding: 3rem 1rem 1.25rem;
  border: 10px solid var(--fg);
  border-radius: 44px;
  background: var(--surface);
}

.phone-kicker {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.phone-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.phone-steps {
  margin: 0;
  padding: 0.75rem;
  list-style: none;
  background: var(--bg);
  border-radius: 12px;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.step + .step {
  margin-top: 0.6rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.step-pass .dot {
  background: var(--pass);
}

.step-fail .dot {
  background: var(--fail);
}

.step-state {
  font-weight: 600;
}

.step-pass .step-state {
  color: var(--pass);
}

.step-fail .step-state {
  color: var(--fail);
}

.step-fail .step-name {
  font-weight: 700;
}

.step-time {
  margin-inline-start: auto;
  color: var(--muted);
}

.phone-log {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #16181d;
  color: #e9ebf0;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.phone-log code {
  font-size: inherit;
}

.log-error {
  color: #ff8f85;
}

.phone-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1.25rem;
}

.phone-action {
  flex: 1 1 0;
  padding: 0.7rem 0;
  border: 1.5px solid var(--fg);
  border-radius: 10px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.phone-action-primary {
  background: var(--fg);
  color: var(--bg);
}

.phone figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Push relay band on the home page. */
.band {
  display: grid;
  gap: 1.5rem;
  margin-block: 1rem;
  padding: 2rem 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
}

.band h2 {
  margin-top: 0;
}

.band-intro p:last-child {
  margin-bottom: 0;
}

.band-options {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.band-options li {
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--bg);
}

.band-options strong {
  display: block;
  margin-bottom: 0.25rem;
}

.band-options span {
  color: var(--muted);
  font-size: 0.95rem;
}

@media (min-width: 50rem) {
  .band {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    align-items: start;
    padding: 2.5rem 2rem;
  }
}

/* Tables */
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
}

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

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}

th {
  font-weight: 600;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2rem 3rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .site-nav a {
    transition: color 120ms ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .card-icon {
    forced-color-adjust: auto;
  }

  .phone,
  .phone-action {
    border-color: CanvasText;
  }
}
