/* critz.dev — app pages. Each page sets --app (its identity colour), --on-app (text on it),
   and --app-2 (secondary text on it). Everything else is the shared package. */

.field-app { background: var(--app); color: var(--on-app); --muted: var(--app-2); --fg: var(--on-app); --line: var(--on-app); }
.strip .pill-app {
  display: inline-flex;
  align-items: center;
  flex: none;
  white-space: nowrap;
  padding: 4px 10px;
  background: var(--app);
  color: var(--on-app);
  font-size: 0.72rem;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.35;
}
.strip .crumb { color: var(--on-ink-2); font-weight: 600; font-stretch: 105%; }
.strip .crumb a { color: var(--paper); }
.strip .crumb a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; text-decoration-color: var(--app); }

.field-app .action.is-quiet:hover { background: var(--ink); color: var(--app); }
.action.is-ink { background: var(--ink); color: var(--app); }
.action.is-ink:hover { background: var(--paper); color: var(--ink); }
.action.is-app { background: var(--app); color: var(--on-app); }
.action.is-app:hover { background: var(--ink); color: var(--paper); }

/* ---------- Hero ---------- */
.app-hero { padding: 48px 24px 64px; padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 48px) clamp(40px, 6vw, 80px); }
.app-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
.app-id { display: flex; align-items: flex-end; gap: 18px; container-type: inline-size; }
.app-icon {
  width: clamp(72px, 9vw, 108px);
  aspect-ratio: 1;
  flex: none;
  background: var(--ink);
  outline: 3px solid var(--ink);
  object-fit: cover;
}
.app-hero .app-id .lower-third { min-width: 0; }
/* The name never breaks: it is sized from the room beside the icon (9 expanded caps ≈ 8.9em). */
.app-hero .lower-third .lt-name { font-size: clamp(1.9rem, calc((100cqw - 140px) / 8.9), 4.2rem); background: var(--ink); color: var(--app); white-space: nowrap; }
.app-hero .lower-third .lt-role { background: var(--paper); color: var(--ink); max-width: 46ch; }
.app-hero .lead { margin-top: 26px; max-width: 54ch; font-size: clamp(1.05rem, 1.6vw, 1.2rem); font-weight: 500; line-height: 1.45; text-wrap: pretty; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.cta-note { margin-top: 14px; font-size: 0.9rem; font-weight: 500; color: var(--app-2); max-width: 54ch; }
.cta-note a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
@media (max-width: 900px) {
  .app-hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .app-id { flex-direction: column; align-items: flex-start; gap: 14px; }
  .app-hero .lower-third .lt-name { font-size: clamp(1.7rem, calc((100cqw - 32px) / 8.9), 2.8rem); }
}

/* ---------- Demo frame: the app shown doing its job, labelled as an example ---------- */
.demo {
  --chamfer: 16px;
  position: relative;
  min-width: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 22px;
  display: grid;
  gap: 14px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, var(--chamfer) 100%, 0 calc(100% - var(--chamfer)));
}
.demo .tag {
  position: absolute;
  top: 0;
  left: 0;
  padding: 5px 9px;
  background: var(--butter);
  color: var(--ink);
}
.demo .tag.right { left: auto; right: 0; background: var(--app); color: var(--on-app); }
.demo-title { margin-top: 18px; font-weight: 900; font-stretch: 118%; text-transform: uppercase; font-size: 1.05rem; letter-spacing: 0.02em; }
.demo-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid rgba(246, 241, 231, 0.22);
}
.demo-row:first-of-type { border-top: 0; }
.demo-row .n { min-width: 2ch; font-weight: 900; font-stretch: 118%; font-size: 1.35rem; color: var(--app); font-variant-numeric: tabular-nums; }
.demo-row .t { font-weight: 800; font-size: 1.05rem; }
.demo-row .s { color: var(--on-ink-2); font-size: 0.85rem; font-weight: 500; }
.demo-row .chip { height: 28px; padding: 0 10px; border-color: var(--paper); color: var(--paper); font-size: 0.66rem; display: inline-flex; align-items: center; }
.demo-big { font-weight: 900; font-stretch: 125%; font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: 0.95; color: var(--app); letter-spacing: -0.01em; }
.demo-plate { padding: 14px 16px; background: var(--paper); color: var(--ink); display: grid; gap: 4px; }
.demo-plate b { font-weight: 900; font-stretch: 112%; font-size: 1.1rem; }
.demo-plate.app { background: var(--app); color: var(--on-app); }
.demo-line { font-size: 0.85rem; font-weight: 600; color: var(--on-ink-2); font-variant-numeric: tabular-nums; }

/* ---------- Points: what it does, three plain statements ---------- */
.section { padding: 64px 24px; padding: clamp(40px, 7vw, 96px) clamp(16px, 4vw, 48px); }
.section .lower-third { margin-bottom: clamp(24px, 4vw, 40px); }
.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  border-top: var(--rule) solid var(--line);
}
.point { padding: 24px 28px 30px 0; border-bottom: var(--rule) solid var(--line); }
.point h3 { font-weight: 900; font-stretch: 118%; text-transform: uppercase; font-size: 1.15rem; line-height: 1.1; letter-spacing: 0.01em; }
.point p { margin-top: 12px; color: var(--muted); font-size: 1rem; line-height: 1.5; text-wrap: pretty; max-width: 40ch; }
.field-paper .point p { color: var(--on-paper); }
.field-ink .point p { color: var(--on-ink-2); }

/* ---------- Get it ---------- */
.get-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 800px) { .get-grid { grid-template-columns: 1fr; } }
.steps { list-style: none; }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 16px 0; border-top: var(--rule) solid var(--line); }
.steps li > .n {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--app);
  font-weight: 900;
  font-stretch: 118%;
  font-size: 1.2rem;
}
.field-ink .steps li > .n { background: var(--app); color: var(--on-app); }
.steps li p { align-self: center; font-weight: 500; }
.steps li p b { font-weight: 800; }

.choices { display: grid; gap: 0; border-top: var(--rule) solid var(--line); }
.choice {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 16px;
  align-items: start;
  width: 100%;
  padding: 16px 0;
  border-bottom: var(--rule) solid var(--line);
  text-align: left;
  transition: background-color 0.2s;
}
.choice:hover { background: rgba(20, 20, 20, 0.05); }
.choice .dot { width: 22px; height: 22px; border: var(--rule) solid var(--ink); display: grid; place-items: center; margin-top: 2px; }
.choice[aria-checked='true'] .dot::after { content: ''; width: 10px; height: 10px; background: var(--ink); }
.choice .cn { font-weight: 900; font-stretch: 112%; font-size: 1.1rem; }
.choice .cc { font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.choice .cd { margin-top: 6px; font-size: 0.9rem; line-height: 1.45; color: var(--muted); max-width: 52ch; }
.choice .chip { pointer-events: none; }
.dl-block { --chamfer: 16px; display: grid; gap: 12px; padding: 20px; background: var(--ink); color: var(--paper); clip-path: polygon(0 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer), 100% 100%, 0 100%); }
.dl-block .label { color: var(--on-ink-2); }
.dl-block .file { font-size: 0.85rem; font-weight: 500; color: var(--on-ink-2); }
.dl-block .note { font-size: 0.9rem; line-height: 1.45; }
.dl-block .note b { color: var(--app); }
.dl-block .action { justify-self: start; }
.cta-stack { display: grid; gap: 12px; justify-items: start; }
.cta-stack .sub { font-size: 0.85rem; font-weight: 600; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq { border-top: var(--rule) solid var(--line); max-width: 76ch; }
.faq details { border-bottom: var(--rule) solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr 18px;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  font-weight: 800;
  font-size: 1.08rem;
  line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '';
  width: 11px;
  height: 11px;
  border-right: var(--rule) solid currentColor;
  border-bottom: var(--rule) solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  transition: transform 0.25s var(--ease-out);
  justify-self: end;
}
.faq details[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.faq summary:hover { color: var(--action-text, inherit); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; text-decoration-color: var(--app); }
.faq .a { padding: 0 34px 20px 0; line-height: 1.55; color: var(--muted); max-width: 66ch; }
.faq .a a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; text-decoration-color: var(--app); color: inherit; }
.faq .a code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.8em; word-break: break-all; background: rgba(20, 20, 20, 0.08); padding: 1px 4px; }
.field-ink .faq .a code { background: rgba(246, 241, 231, 0.12); }

/* ---------- Prose page (privacy) ---------- */
.doc { max-width: 68ch; }
.doc h2 { margin-top: 2.2em; font-weight: 900; font-stretch: 118%; text-transform: uppercase; font-size: 1.15rem; letter-spacing: 0.01em; }
.doc h2 + p { margin-top: 0.6em; }
.doc p { margin-top: 0.9em; line-height: 1.6; }
.doc a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; text-decoration-color: var(--app); }
.doc .when { color: var(--muted); font-weight: 600; font-size: 0.9rem; }

/* ---------- App footer ---------- */
.foot .back { color: var(--paper); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.foot .back svg { width: 18px; height: 18px; }
