/* ecgrecorder.digitalpurr.com: one stylesheet, no third-party resources, no JavaScript. */

:root {
  color-scheme: light dark;
  --bg: #faf8f5;
  --surface: #ffffff;
  --fg: #1d1b19;
  --muted: #69635c;
  --line: #e6e0d8;
  --accent: #b3202e;
  --on-accent: #ffffff;
  --accent-soft: rgba(179, 32, 46, 0.08);
  --grid-minor: rgba(179, 32, 46, 0.09);
  --grid-major: rgba(179, 32, 46, 0.2);
  --radius: 14px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131211;
    --surface: #1b1a18;
    --fg: #ece8e2;
    --muted: #a49d94;
    --line: #2d2a27;
    --accent: #ff7a86;
    --on-accent: #131211;
    --accent-soft: rgba(255, 122, 134, 0.1);
    --grid-minor: rgba(255, 122, 134, 0.06);
    --grid-major: rgba(255, 122, 134, 0.14);
  }
}

*, *::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: 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 44rem; margin: 0 auto; padding: 0 1.25rem; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; }
h2 { font-size: 1.35rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 0.6rem; }
p, ul, ol { margin: 0 0 1rem; }

.muted { color: var(--muted); }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 3rem 0 1rem;
}

.lead { font-size: 1.25rem; line-height: 1.5; margin: 0 0 0.4rem; }
.lead + .lead { color: var(--muted); }

/* Error page */

.home { padding-top: clamp(3rem, 14vh, 9rem); }

/* Footer */

.foot {
  border-top: 1px solid var(--line);
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}
.foot p { margin: 0 0 0.35rem; }
.foot a { color: inherit; }

/* App page */

.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
  font-size: 0.92rem;
}
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--fg); }
.topnav .lang a + a { margin-left: 0.9rem; }

.paper {
  background-color: var(--surface);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 8px 8px, 8px 8px;
  background-position: -1px -1px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero { padding-top: 2.25rem; }
.hero-head { display: flex; gap: 1.1rem; align-items: center; }
.hero img { width: 4.5rem; height: 4.5rem; border-radius: 1rem; flex: none; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }
.hero h1 { font-size: clamp(1.65rem, 5vw, 2.3rem); margin: 0; }
.hero .sub { margin: 0.3rem 0 0; color: var(--muted); }

.trace { display: block; width: 100%; height: 64px; margin-top: 1.25rem; color: var(--accent); }
.trace path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.lang-section + .lang-section { border-top: 1px solid var(--line); margin-top: 3rem; }
.lang-section .lead { margin-bottom: 1.25rem; }

.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 0.8rem 1rem;
  border-radius: 0 10px 10px 0;
}

.notice {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}
.notice strong { display: block; margin-bottom: 0.25rem; }

/* Link to the recording viewer (/viewer/) */
.cta {
  display: inline-block;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}
.cta:hover { text-decoration: underline; text-decoration-thickness: 1px; }

ul.ticks { padding-left: 1.2rem; }
ul.ticks li { margin: 0.2rem 0; }
ul.ticks li::marker { color: var(--accent); }

/* Screenshots (assets/shots/): wider than the text column on large screens, the column's width on a phone. */
.shots, .screens, .wide-shot {
  --shots-width: min(62rem, 100vw - 2.5rem);
  width: var(--shots-width);
  margin-left: calc((100% - var(--shots-width)) / 2);
  margin-right: 0;
}

/* Phone screens in one row; a narrow window scrolls it sideways. */
.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(10.5rem, 1fr);
  gap: 1rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  list-style: none;
  padding: 0 0 0.75rem;
  margin-top: 2rem;
  margin-bottom: 0;
}
.shots > li { scroll-snap-align: start; }
.shots-note { font-size: 0.875rem; margin-bottom: 1.5rem; }

/* Viewer screens: the first one full width, then two side by side. */
.screens {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 1rem;
  align-items: start;
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}
.screens > li:first-child { grid-column: 1 / -1; }

.wide-shot { margin-top: 1.5rem; margin-bottom: 1.5rem; }

.shots figure, .screens figure { margin: 0; }
.shots a, .screens a, .wide-shot a { display: block; }
.shots img, .screens img, .wide-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--surface);
}
.shots img { border-radius: 1.1rem; }
.shots figcaption, .screens figcaption, .wide-shot figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
}

@media (max-width: 40rem) {
  .screens { grid-template-columns: 1fr; }
}

@media print {
  .topnav, .trace, .shots, .shots-note { display: none; }
  .paper { background: none; }
}
