/* keepy.fyi. The extension's own palette: an ink call screen above, the
   cool paper of the kept file below. Atkinson Hyperlegible, a family made
   for reading at a glance, the way captions are read. */

@font-face {
  font-family: "Hyperlegible Next";
  src: url("/fonts/hyperlegible-next.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Hyperlegible Mono";
  src: url("/fonts/hyperlegible-mono.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --ink: #102434;
  --ink-2: #1a3347;
  --ink-line: #2c4a60;
  --on-ink: #eef4f7;
  --on-ink-mute: #9db4c3;
  --blotter: #e3ecf1;
  --sheet: #f7fafb;
  --text: #14283a;
  --mute: #4f6677;
  --line: #c3d0da;
  --sea: #1c7c74;
  --sea-strong: #14615a;
  --sea-bright: #38b9ac;
  --hit: #fbe7a8;
  --live: #cc4b2a;

  --font: "Hyperlegible Next", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --mono: "Hyperlegible Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --wordmark: Palatino, "Palatino Linotype", "Book Antiqua", "Iowan Old Style", Georgia, serif;

  /* A 1.25 scale from 17px body. */
  --step--1: 0.85rem;
  --step-0: 1.0625rem;
  --step-1: 1.33rem;
  --step-2: 1.66rem;
  --step-3: clamp(1.9rem, 1.4rem + 1.8vw, 2.6rem);
  --step-hero: clamp(2.9rem, 1.6rem + 5.4vw, 5.6rem);

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1160px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blotter: #14212b;
    --sheet: #1b2a36;
    --text: #e3edf2;
    --mute: #93a8b6;
    --line: #2d4050;
    --sea: #4fbfb3;
    --sea-strong: #6fd3c8;
    --hit: #5b4c16;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --blotter: #14212b;
  --sheet: #1b2a36;
  --text: #e3edf2;
  --mute: #93a8b6;
  --line: #2d4050;
  --sea: #4fbfb3;
  --sea-strong: #6fd3c8;
  --hit: #5b4c16;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--blotter);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

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

a { color: var(--sea); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--sea-strong); text-decoration-thickness: 2px; }

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

h1, h2, h3 { margin: 0; line-height: 1.12; font-weight: 750; letter-spacing: -0.012em; text-wrap: balance; }

p { margin: 0; }

code, kbd {
  font-family: var(--mono);
  font-size: 0.86em;
}

code {
  padding: 0.08em 0.36em;
  border-radius: 4px;
  background: var(--hit);
  color: var(--text);
}

kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0.05em 0.42em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--sheet);
  text-align: center;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--sheet);
  color: var(--text);
}
.skip:focus { top: 12px; }

/* ── The call ─────────────────────────────────────────────────────── */

.call {
  background: var(--ink);
  color: var(--on-ink);
  padding-bottom: clamp(56px, 8vw, 104px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--on-ink);
  text-decoration: none;
  font-family: var(--wordmark);
  font-size: 1.5rem;
  letter-spacing: 0.01em;
}
.wordmark:hover { color: var(--on-ink); }

.nav ul {
  display: flex;
  gap: clamp(14px, 2.4vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--step--1);
}

.nav ul a { color: var(--on-ink-mute); text-decoration: none; }
.nav ul a:hover { color: var(--on-ink); text-decoration: underline; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding-top: clamp(24px, 5vw, 72px);
}

.hero h1 {
  font-size: var(--step-hero);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 9ch;
}

.lead {
  margin-top: 28px;
  max-width: 30ch;
  font-size: var(--step-1);
  line-height: 1.42;
}

.plain {
  margin-top: 14px;
  max-width: 36ch;
  color: var(--on-ink-mute);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--sea-bright);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
a.button:hover { background: #5fd0c4; color: var(--ink); }

.button.is-soon {
  background: transparent;
  color: var(--on-ink);
  border: 1.5px dashed var(--sea-bright);
  cursor: default;
}

.call .text-link { color: var(--on-ink); }
.call .text-link:hover { color: var(--sea-bright); }

.fine {
  margin-top: 18px;
  font-size: var(--step--1);
  color: var(--on-ink-mute);
}

/* ── The demo: captions become file lines ─────────────────────────── */

.demo {
  position: relative;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.stage {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  background: #0a1a26;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--ink-line);
}

.stage-bar {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 0.78rem;
  color: var(--on-ink-mute);
  z-index: 2;
}

.clock { font-variant-numeric: tabular-nums; }

.tiles {
  position: absolute;
  inset: 36px 12px 76px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
}

.tile {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--ink-2);
  box-shadow: inset 0 0 0 0 var(--sea-bright);
  transition: box-shadow 220ms ease;
}

.tile.is-speaking { box-shadow: inset 0 0 0 3px var(--sea-bright); }

.face {
  display: grid;
  place-items: center;
  width: clamp(38px, 5.4vw, 64px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--face);
  color: #fff;
  font-size: clamp(0.72rem, 1vw, 0.95rem);
  font-weight: 700;
}

.tile .name {
  position: absolute;
  left: 10px;
  bottom: 8px;
  font-size: 0.72rem;
  color: var(--on-ink-mute);
}

.caption {
  position: absolute;
  left: 50%;
  bottom: 86px;
  z-index: 3;
  width: min(86%, 520px);
  transform: translateX(-50%);
  padding: 10px 14px 12px;
  border-radius: 8px;
  background: rgba(4, 12, 18, 0.86);
  color: #fff;
  font-size: clamp(0.92rem, 1.25vw, 1.1rem);
  line-height: 1.35;
  min-height: 3.6em;
}

.caption-who {
  display: block;
  margin-bottom: 2px;
  font-size: 0.74em;
  font-weight: 700;
  color: var(--sea-bright);
}

.caption.is-empty { visibility: hidden; }

.callbar {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: center;
  padding: 10px 10px 28px;
}

.ended {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: rgba(8, 20, 30, 0.92);
  font-size: var(--step-1);
  font-weight: 700;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 0s linear 300ms;
}

.demo.is-ended .ended { opacity: 1; visibility: visible; transition-delay: 0s; }

.stage button {
  min-height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.leave { background: var(--live); color: #fff; }
.leave:hover { background: #b23e20; }
.leave[disabled] { opacity: 0.4; cursor: default; }

.rejoin { background: var(--sea-bright); color: var(--ink); }
.rejoin:hover { background: #5fd0c4; }

.sheet {
  position: relative;
  z-index: 5;
  margin: -18px 18px 0 clamp(18px, 6%, 56px);
  border-radius: 10px;
  background: #f7fafb;
  color: #14283a;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
  transition: transform 420ms cubic-bezier(.2, .8, .2, 1);
}

.demo.is-ended .sheet { transform: translateY(-10px); }

.sheet-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #d5e0e7;
  font-size: 0.76rem;
}

.filename { font-family: var(--mono); color: #4f6677; overflow-wrap: anywhere; }

.state { font-weight: 700; color: #14615a; }

.state.is-live { color: #a33a1f; }
.state.is-live::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--live);
  vertical-align: 0.05em;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: 0.25; } }

.sheet-body {
  height: clamp(220px, 26vw, 280px);
  overflow: hidden;
  padding: 12px 16px 16px;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.6;
  mask-image: linear-gradient(to bottom, transparent 0, #000 22px);
}

.yaml { margin: 0 0 10px; color: #5b7182; font: inherit; white-space: pre-wrap; }

.turns p { margin: 0 0 8px; padding: 1px 4px; margin-inline: -4px; border-radius: 3px; }
.turns .t { color: #5b7182; }

.turns p.is-new { animation: land 1.6s ease-out; }

@keyframes land {
  0% { background: #fbe7a8; transform: translateY(6px); opacity: 0; }
  18% { background: #fbe7a8; transform: none; opacity: 1; }
  100% { background: transparent; }
}

/* ── The kept file ────────────────────────────────────────────────── */

main { padding-bottom: 24px; }

.band { padding-top: clamp(72px, 10vw, 128px); }

.band h2 { font-size: var(--step-3); max-width: 22ch; }

.intro p { margin-top: 18px; max-width: 62ch; color: var(--mute); }
.intro p + p { margin-top: 12px; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 48px);
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li { counter-increment: step; }

.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 14px;
  font-size: 3.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--sea);
}

.steps h3 { font-size: var(--step-1); }
.steps p { margin-top: 10px; color: var(--mute); max-width: 34ch; }

.anatomy {
  margin-top: 40px;
  border-radius: 12px;
  background: var(--sheet);
  box-shadow: 0 0 0 1px var(--line);
  padding: clamp(16px, 3vw, 32px) 0;
}

.anatomy .row {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 32px;
  align-items: start;
  padding: 0 clamp(16px, 3vw, 32px);
}

.anatomy .row + .row { margin-top: 14px; }

.code {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.note {
  position: relative;
  padding: 3px 0 3px 16px;
  border-left: 3px solid var(--hit);
  font-size: 0.94rem;
  line-height: 1.45;
  color: var(--mute);
}

.ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
  margin-top: 40px;
}

.ledger h3 { font-size: var(--step-1); }

.ledger ul { margin: 14px 0 0; padding: 0; list-style: none; }

.ledger li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  max-width: 46ch;
}

.perms {
  width: 100%;
  margin-top: 48px;
  border-collapse: collapse;
  font-size: 0.96rem;
}

.perms caption {
  margin-bottom: 10px;
  text-align: left;
  font-size: var(--step-1);
  font-weight: 750;
}

.perms th,
.perms td {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.perms th { width: 34%; padding-right: 24px; font-weight: 700; }
.perms td { color: var(--mute); }

.more { margin-top: 20px; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

#notes .split { margin-top: 40px; align-items: start; }

.uses { margin: 0; }
.uses > div { padding: 16px 0; border-top: 1px solid var(--line); }
.uses > div:last-child { border-bottom: 1px solid var(--line); }
.uses dt { font-weight: 750; font-size: var(--step-1); line-height: 1.25; }
.uses dd { margin: 6px 0 0; color: var(--mute); max-width: 52ch; }

.aside { margin-top: 24px; max-width: 62ch; font-size: 0.94rem; color: var(--mute); }

.tree {
  margin: 0;
  padding: 22px 24px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--on-ink-mute);
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.9;
  white-space: pre;
  overflow-x: auto;
}

.tree .dir { color: var(--sea-bright); font-weight: 700; }

.details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px clamp(24px, 4vw, 48px);
  margin: 40px 0 0;
}

.details dt { font-size: var(--step-1); font-weight: 750; line-height: 1.2; }
.details dd { margin: 10px 0 0; color: var(--mute); max-width: 36ch; }

.faq { margin-top: 32px; max-width: 760px; }

.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  cursor: pointer;
  font-size: var(--step-1);
  font-weight: 700;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  flex: none;
  font-weight: 400;
  color: var(--sea);
  transition: transform 200ms ease;
}

.faq details[open] summary::after { transform: rotate(45deg); }

.faq details p { padding: 0 0 20px; max-width: 64ch; color: var(--mute); }

.get {
  margin-top: clamp(80px, 11vw, 140px);
  padding-block: clamp(48px, 7vw, 88px);
  border-radius: 18px;
  background: var(--ink);
  color: var(--on-ink);
  text-align: center;
  max-width: calc(var(--max) + 2 * var(--gutter));
}

.get h2 { font-size: var(--step-3); }
.get p { margin: 14px auto 28px; color: var(--on-ink-mute); }

.foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 24px;
  padding-block: 48px 56px;
  font-size: var(--step--1);
  color: var(--mute);
}

.foot .sign { font-family: var(--wordmark); font-size: 1.05rem; color: var(--text); }
.foot ul { display: flex; gap: 20px; margin: 0; padding: 0; list-style: none; }
.foot .marks { grid-column: 1 / -1; max-width: 70ch; }

/* ── Privacy page ─────────────────────────────────────────────────── */

.call-short { padding-bottom: clamp(40px, 6vw, 72px); }

.page-head { padding-top: clamp(24px, 4vw, 56px); }
.page-head h1 { font-size: var(--step-hero); font-weight: 800; line-height: 1; letter-spacing: -0.035em; }
.page-head .plain { margin-top: 16px; }

.policy { padding-top: clamp(40px, 6vw, 72px); }
.policy > * { max-width: 66ch; }
.policy-lead { font-size: var(--step-1); line-height: 1.45; }
.policy h2 { margin-top: 48px; font-size: var(--step-2); }
.policy p,
.policy ul { margin-top: 14px; color: var(--mute); }
.policy ul { padding-left: 1.2em; }
.policy li + li { margin-top: 8px; }
.policy strong { color: var(--text); }

/* ── Narrow screens ───────────────────────────────────────────────── */

@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .nav { flex-wrap: wrap; row-gap: 8px; }
  .nav ul { flex-wrap: wrap; }
  .steps,
  .ledger,
  .details { grid-template-columns: minmax(0, 1fr); }
  .anatomy .row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .anatomy .row + .row { margin-top: 22px; }
  .stage { aspect-ratio: 4 / 3; }
  .sheet { margin: -14px 6px 0 14px; }
  .perms th,
  .perms td { display: block; width: auto; padding: 0; border: 0; }
  .perms tr { display: block; padding: 12px 0; border-top: 1px solid var(--line); }
  .perms td { margin-top: 4px; }
  .foot { grid-template-columns: minmax(0, 1fr); }
}

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