/* Inkslip launch site. Palette and type from docs/site/BRIEF.md. */

:root {
  --paper: #f6f1e7;
  --surface: #fffcf6;
  --sunken: #eee6d8;
  --ink: #1f1a17;
  --ink-muted: #5c534b;
  --line: #ddd2c1;
  --line-strong: #a89a87;
  --accent: #7a1f2b; /* oxblood, the one accent */
  --accent-hover: #63151f;
  --accent-ink: #fffaf3;
  --accent-soft: #f3e1df;
  --flag: #7c5300;
  --flag-soft: #fbefd3;
  --success: #2c6a3a;
  --success-soft: #e2f0e2;
  --flash-line: #c9b48f; /* decorative line art only, never text */
  --stencil: #4b3a8c; /* the drawn signature only */
  --shadow-tint: 31 26 23; /* rgb of --ink, for layered shadows */
  /* The offline card's swatch shows both app palettes in either scheme. */
  --swatch-light-paper: #f6f1e7;
  --swatch-light-ink: #1f1a17;
  --swatch-dark-paper: #171311;
  --swatch-dark-ink: #f1e9dc;

  --display: Gloock, "Iowan Old Style", Palatino, Georgia, serif;
  --body: "Public Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow:
    0 1px 2px rgb(var(--shadow-tint) / 0.06),
    0 8px 24px -8px rgb(var(--shadow-tint) / 0.18);
  --shadow-lift:
    0 2px 4px rgb(var(--shadow-tint) / 0.08),
    0 16px 36px -10px rgb(var(--shadow-tint) / 0.26);
  --shadow-deep:
    0 2px 6px rgb(var(--shadow-tint) / 0.1),
    0 24px 60px -16px rgb(var(--shadow-tint) / 0.38);
  --pad: clamp(4rem, 10vw, 8rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171311;
    --surface: #211b18;
    --sunken: #120f0d;
    --ink: #f1e9dc;
    --ink-muted: #b8ab9b;
    --line: #3a312b;
    --line-strong: #6e6157;
    --accent: #e48a91;
    --accent-hover: #f0a3a8;
    --accent-ink: #1d0e10;
    --accent-soft: #3a1d20;
    --flag: #f0c463;
    --flag-soft: #3a2c10;
    --success: #8fd19e;
    --success-soft: #173020;
    --flash-line: #5a4a35;
    --stencil: #a99bf0;
    --shadow-tint: 0 0 0;
  }
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  overflow-x: clip;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
fieldset {
  margin: 0;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
}

h3 {
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.3;
}

a {
  color: inherit;
}

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

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 1.5rem;
}

.section {
  position: relative;
  padding-block: var(--pad);
}

.mono {
  font-family: var(--mono);
}

.small {
  font-size: 0.875rem;
}

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

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

.eyebrow,
.note {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 650;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.note {
  font-family: var(--mono);
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

.note::before {
  content: "— ";
  color: var(--line-strong);
}

.lede {
  font-size: 1.25rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.body-lg {
  font-size: 1.1875rem;
  margin-top: 1.5rem;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.skip:focus {
  top: 1rem;
}

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.flash-art {
  fill: none;
  stroke: var(--flash-line);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 48rem) {
  .grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  .grid > .note {
    grid-column: 1 / 3;
    padding-top: 0.9rem;
  }
  .grid > .content {
    grid-column: 3 / 13;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font: 650 1.0625rem/1.2 var(--body);
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 200ms var(--ease),
    transform 120ms var(--ease),
    box-shadow 200ms var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  background-color: var(--sunken);
}

.btn-compact {
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  font-size: 1rem;
}

/* ---------- Top bar ---------- */

.sentinel {
  position: absolute;
  top: 0;
  height: 1px;
  width: 1px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}

.topbar.scrolled {
  border-bottom-color: var(--line);
}

.topbar-in {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  text-decoration: none;
  margin-right: auto;
}

.logo {
  width: 32px;
  height: 32px;
  flex: none;
}

.logo-slip,
.logo-fold {
  stroke: var(--ink);
  stroke-width: 1.75;
  stroke-linejoin: round;
}

.logo-slip {
  fill: var(--surface);
}

.logo-fold {
  fill: var(--sunken);
}

.logo-drop {
  fill: var(--accent);
}

.logo-sig {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.topnav {
  display: none;
}

@media (min-width: 48rem) {
  .topnav {
    display: flex;
    gap: 0.25rem;
    margin-right: 0.75rem;
  }
  .topnav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 0.85rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--ink-muted);
    font-weight: 500;
    transition: background-color 200ms var(--ease);
  }
  .topnav a:hover {
    background-color: var(--sunken);
    color: var(--ink);
  }
}

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

.hero {
  padding-block: clamp(2.5rem, 7vw, 6rem) clamp(3rem, 8vw, 6rem);
  overflow: clip;
  view-timeline: --hero block;
}

.hero-grid {
  display: grid;
  gap: 3rem;
}

.hero-copy h1 {
  margin-bottom: 1.5rem;
}

.hero-copy .lede {
  max-width: 34ch;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 2rem 0 1.25rem;
}

@media (min-width: 30rem) {
  .actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.hero-art {
  position: relative;
  /* The whole rotated 3:4 tablet and its shadow fit the stage. */
  height: calc(min(78vw, 26rem) * 4 / 3 + 3.5rem);
  margin-inline: -1.5rem;
  overflow: clip;
}

.plane {
  position: absolute;
}

.plane-back {
  inset: -10% -10%;
  opacity: 0.5;
}

.plane-back .drift,
.flash {
  display: block;
  width: 100%;
  height: 100%;
}

.plane-tablet {
  width: 78vw;
  max-width: 26rem;
  left: 50%;
  top: 14px;
  margin-left: calc(min(78vw, 26rem) / -2 - 5vw);
}

.plane-sheet {
  width: 44vw;
  max-width: 13rem;
  right: 5vw;
  top: 96px;
}

.drift-tablet {
  transform: rotate(-4deg);
}

.drift-sheet {
  transform: rotate(6deg);
}

.tilt {
  container-type: inline-size;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

.tablet {
  aspect-ratio: 3 / 4;
  border-radius: 28px;
  padding: 12px;
  background: var(--ink);
  box-shadow: var(--shadow-deep);
}

.tablet-screen {
  height: 100%;
  border-radius: 17px;
  background: var(--paper);
  padding: 7cqi 7cqi;
  overflow: hidden;
  font-size: 4.1cqi;
  line-height: 1.35;
  color: var(--ink);
}

.mock-head {
  display: flex;
  align-items: center;
  gap: 2.5cqi;
  font-weight: 650;
  padding-bottom: 4cqi;
  margin-bottom: 5cqi;
  border-bottom: 1px solid var(--line);
}

.mock-drop {
  width: 6cqi;
  height: 6cqi;
  fill: var(--accent);
}

.mock-section {
  font-family: var(--display);
  font-size: 7cqi;
  margin-bottom: 4cqi;
}

.mock-num {
  color: var(--accent);
}

.mock-q {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3cqi;
  padding: 4cqi;
  margin-bottom: 3.5cqi;
}

.mock-q .pills {
  margin-top: 2.5cqi;
}

.mock-q .pill {
  min-height: 0;
  min-width: 0;
  padding: 1.2cqi 4.5cqi;
  font-size: 3.8cqi;
}

.mock-flag {
  margin-top: 3cqi;
  padding: 2.5cqi 3cqi;
  background: var(--flag-soft);
  border-left: 6px solid var(--flag);
  border-radius: 1.5cqi;
  font-size: 3.6cqi;
}

.mock-sign {
  border: 1.5px dashed var(--line-strong);
  border-radius: 3cqi;
  height: 22cqi;
  display: grid;
  place-items: center;
}

.mock-sign svg {
  width: 70%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sheet {
  aspect-ratio: 1 / 1.414;
  background:
    linear-gradient(315deg, var(--sunken) 0, var(--surface) 12%, var(--surface) 100%);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9cqi 8cqi;
  box-shadow: var(--shadow-lift);
  font-size: 5.3cqi;
  line-height: 1.4;
  overflow: hidden;
}

.sheet-title {
  font-family: var(--display);
  font-size: 10cqi;
  line-height: 1.1;
}

.sheet-sub {
  color: var(--ink-muted);
  margin-bottom: 4cqi;
  padding-bottom: 3cqi;
  border-bottom: 1px solid var(--line);
}

.sheet-line {
  padding-block: 2cqi;
  border-bottom: 1px solid var(--line);
}

.timeline {
  display: flex;
  gap: 1.5cqi;
  margin-top: 6cqi;
  height: 3cqi;
}

.timeline span {
  border-radius: 9px;
  background: var(--accent);
  flex: 1;
}

.timeline span:nth-child(2) {
  background: var(--flag);
  flex: 3;
}

.timeline span:nth-child(3) {
  background: var(--success);
  flex: 6;
}

.sheet-tl {
  display: flex;
  justify-content: space-between;
  font-size: 4.2cqi;
  color: var(--ink-muted);
  margin-top: 1.5cqi;
}

@media (min-width: 48rem) {
  .hero-art {
    height: 34rem;
  }
  .plane-tablet {
    width: 24rem;
    max-width: none;
    left: 8%;
    margin-left: 0;
    top: 1.5rem;
  }
  .plane-sheet {
    width: 12rem;
    max-width: none;
    left: 2%;
    right: auto;
    top: 20rem;
  }
}

@media (min-width: 64rem) {
  .hero-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 1.5rem;
    align-items: center;
  }
  .hero-copy {
    grid-column: 1 / 7;
  }
  .hero-art {
    grid-column: 7 / 13;
    height: 40rem;
    margin-inline: 0 calc(-1 * max(1.5rem, (100vw - 72rem) / 2 + 1.5rem));
  }
  .plane-tablet {
    width: 26rem;
    left: 10%;
    top: 2rem;
  }
  .plane-sheet {
    width: 13rem;
    left: 0;
    top: 20rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .plane {
    animation: settle 600ms var(--ease) both;
  }
  .plane-tablet {
    animation-delay: 80ms;
  }
  .plane-sheet {
    animation-delay: 160ms;
  }

  @supports (animation-timeline: view()) {
    .drift {
      animation-timeline: --hero;
      animation-range: exit 0% exit 100%;
      animation-fill-mode: both;
      animation-timing-function: linear;
    }
    .drift-back {
      animation-name: drift-back;
    }
    .drift-tablet {
      animation-name: drift-tablet;
    }
    .drift-sheet {
      animation-name: drift-sheet;
    }
  }

  .tilt {
    transition: transform 120ms linear;
  }
}

@keyframes settle {
  from {
    opacity: 0;
    translate: 0 12px;
  }
}

@keyframes drift-back {
  to {
    transform: translateY(-20px);
  }
}

@keyframes drift-tablet {
  from {
    transform: rotate(-4deg);
  }
  to {
    transform: translateY(-40px) rotate(-2deg);
  }
}

@keyframes drift-sheet {
  from {
    transform: rotate(6deg);
  }
  to {
    transform: translateY(-70px) rotate(3deg);
  }
}

/* ---------- Problem ---------- */

.problem {
  overflow: clip;
}

.narrow {
  max-width: 43rem;
}

.clipboard {
  display: none;
}

.problem .wrap {
  position: relative;
  z-index: 1;
}

/* Only where the gutter beside the text column can hold it. */
@media (min-width: 64rem) {
  .clipboard {
    display: block;
    position: absolute;
    right: max(2%, calc((100vw - 72rem) / 2 - 6rem));
    top: 50%;
    /* No wider than the gutter beside the 43rem text column. */
    width: min(20rem, calc((100vw - 43rem) / 2 - 3rem));
    translate: 0 -50%;
    rotate: 5deg;
    fill: none;
    stroke: var(--line);
    stroke-width: 2;
    stroke-linecap: round;
  }
}

/* ---------- How it works ---------- */

.how-grid {
  margin-top: 3rem;
}

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.step h3 {
  margin-bottom: 0.6rem;
}

.num {
  color: var(--accent);
  font-weight: 400;
}

.frag {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}

.slip-name {
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 1.2;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.25rem;
}

.slip-date {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin-top: 0.4rem;
}

.slip-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-bottom: 0.4rem;
}

.dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  transition:
    transform 200ms var(--ease),
    opacity 200ms var(--ease);
  transition-delay: calc(var(--i, 0) * 30ms);
}

.dot.flagged {
  background: var(--flag);
}

.flag-tag {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  font-weight: 650;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--flag-soft);
  color: var(--flag);
}

.id-row {
  display: inline-block;
  font-weight: 650;
  padding: 0.4rem 0.9rem;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  rotate: -1.5deg;
}

.sig {
  position: relative;
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sig-draw {
  stroke: var(--stencil);
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.sig-ink {
  stroke: var(--ink);
  opacity: 1;
  transition: opacity 400ms var(--ease);
}

.saved {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 650;
  font-size: 0.9375rem;
  transition: opacity 300ms var(--ease);
}

.panel-col {
  display: none;
}

@media (min-width: 48rem) {
  .steps {
    grid-column: 3 / 8;
    gap: 0;
  }
  .step {
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
    min-height: 70vh;
    display: flex;
    align-items: center;
  }
  .step:first-child {
    min-height: 50vh;
  }
  .step:last-child {
    min-height: 90vh;
  }
  .step .num {
    display: block;
    font-family: var(--display);
    font-size: clamp(3.5rem, 6vw, 5rem);
    line-height: 1;
    color: var(--accent);
    margin-bottom: 0.75rem;
  }
  .step h3 {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(1.6rem, 2.4vw, 2rem);
  }
  .step p {
    max-width: 34ch;
    font-size: 1.125rem;
  }
  .frag {
    display: none;
  }
  .panel-col {
    display: block;
    grid-column: 8 / 13;
  }
  .slip {
    position: sticky;
    top: 15vh;
    display: grid;
    gap: 1.4rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--shadow-lift);
  }
  .slip-head {
    font-size: 0.8125rem;
    color: var(--ink-muted);
    border-bottom: 1px dashed var(--line-strong);
    padding-bottom: 0.75rem;
  }
  /* Label on row 1; the placeholder and the filled content share row 2. */
  .layer {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .layer > .ph,
  .layer > .layer-body {
    grid-area: 2 / 1;
  }
  .layer > :not(.slip-label) {
    transition:
      opacity 300ms var(--ease),
      transform 200ms var(--ease);
  }
}

/* Placeholders for a pending layer: an unfilled form, not a blank card. */
.ph {
  opacity: 0;
  pointer-events: none;
}

.ph-line {
  align-self: start;
  height: 2.35rem;
  border-bottom: 1px dashed var(--line-strong);
}

.ph-id {
  align-self: center;
  height: 0;
  width: 70%;
}

.ph-dots {
  align-self: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ph-dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
}

.ph-sig {
  align-self: start;
  height: 110px;
  max-width: 360px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
}

/* Hidden states only exist with JavaScript and motion allowed. */
@media (prefers-reduced-motion: no-preference) {
  html.js .layer:not(.on) > :not(.slip-label) {
    opacity: 0;
  }
  html.js .layer:not(.on) > .ph {
    opacity: 1;
  }
  html.js .layer:not(.on) .dot {
    opacity: 0;
    transform: scale(0.3);
  }
  html.js .layer[data-layer="3"]:not(.on) > .layer-body {
    transform: scale(1.08);
  }
  html.js .sig-draw {
    stroke-dashoffset: 1;
  }
  html.js .frag-sign .sig-draw {
    transition: stroke-dashoffset 1100ms var(--ease);
  }
  html.js .frag-sign.drawn .sig-draw {
    stroke-dashoffset: 0;
  }
  html.js :is(.frag-sign, .slip):not(.done) :is(.sig-ink, .saved) {
    opacity: 0;
  }
  html.js .sig-once {
    transition: stroke-dashoffset 900ms var(--ease);
  }
  html.js .drawn .sig-once {
    stroke-dashoffset: 0;
  }
}

/* ---------- Features ---------- */

.bento {
  display: grid;
  gap: 1.5rem;
  margin-top: 3rem;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
  transition:
    transform 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
  }
}

.card > p {
  color: var(--ink-muted);
}

.icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.counter {
  font-family: var(--mono);
  font-size: 0.9375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--sunken);
}

.demo-qs {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.q {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: var(--paper);
  min-width: 0;
}

.q legend {
  float: left;
  width: 100%;
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.pills {
  clear: both;
  display: flex;
  gap: 0.5rem;
}

.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 64px;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  font-weight: 650;
  cursor: pointer;
  transition: background-color 160ms var(--ease);
}

.pill:hover {
  background-color: var(--sunken);
}

.pill input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.pill:has(input:checked),
.pill.on {
  background-color: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.pill:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.flag-wrap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition:
    grid-template-rows 200ms var(--ease),
    opacity 200ms var(--ease),
    visibility 200ms;
}

.q.flagged .flag-wrap {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
}

.flag-note {
  overflow: hidden;
  min-height: 0;
  margin-top: 0;
  border-left: 6px solid var(--flag);
  background: var(--flag-soft);
  border-radius: 6px;
  padding: 0 0.85rem;
  font-size: 1rem;
}

.q.flagged .flag-note {
  margin-top: 0.7rem;
  padding-block: 0.6rem;
}

.card-submit {
  justify-content: flex-start;
}

.card-submit .btn {
  align-self: flex-start;
}

/* A static picture of the app's fields the summary points at. */
.mock-form {
  display: grid;
  gap: 0.9rem;
  margin-block: 0.4rem 0.3rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  pointer-events: none;
  user-select: none;
}

.mock-label {
  font-weight: 500;
  font-size: 0.9375rem;
  margin-bottom: 0.4rem;
}

.mock-input,
.mock-pills,
.mock-sigbox {
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color 200ms var(--ease);
}

.mock-input {
  height: 44px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
}

.mock-pills {
  display: inline-flex;
  gap: 0.5rem;
  border-radius: 999px;
}

.mock-pills span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 64px;
  padding: 0.3rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  font-weight: 650;
}

.mock-sigbox {
  height: 72px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
}

.card-submit.missing :is(.mock-input, .mock-pills, .mock-sigbox) {
  outline-color: var(--accent);
}

.summary {
  border: 1.5px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.6rem;
}

.summary[hidden] {
  display: none;
}

.summary h4 {
  font-size: 1.0625rem;
  font-weight: 650;
  color: var(--accent);
}

.summary ul {
  padding-left: 1.2rem;
}

.mock-link {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.field-label {
  font-weight: 650;
  font-size: 1rem;
}

.search,
select {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  border: 1.5px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.records {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--line);
}

.records li {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.records li[hidden] {
  display: none;
}

.r-name {
  font-weight: 650;
}

.r-date {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  align-self: center;
}

.r-meta {
  color: var(--ink-muted);
  font-size: 1rem;
}

.badge {
  justify-self: end;
  font-size: 0.8125rem;
  font-weight: 650;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--flag-soft);
  color: var(--flag);
}

.care-demo {
  display: grid;
  gap: 1.25rem;
}

.care-controls {
  display: grid;
  gap: 0.4rem;
  align-content: start;
}

.care-controls select + .field-label {
  margin-top: 0.6rem;
}

.care-sheet {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  rotate: 1deg;
  transition: opacity 160ms var(--ease);
}

.care-sheet.fading {
  opacity: 0;
}

.care-title {
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.2;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.care-sheet ul {
  padding-left: 1.1rem;
  margin-block: 0.75rem;
  display: grid;
  gap: 0.4rem;
  font-size: 1rem;
}

.care-heal {
  font-size: 1rem;
  color: var(--ink-muted);
  border-top: 1px dashed var(--line-strong);
  padding-top: 0.6rem;
}

.own-art {
  width: 100%;
  max-width: 260px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.own-art .stroke {
  stroke: var(--ink);
  stroke-width: 2;
}

.own-art .cross {
  stroke: var(--accent);
  stroke-width: 3;
}

.file-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--sunken);
}

.file-chip svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.swatch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  max-width: 320px;
}

.swatch > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  font-family: var(--display);
  font-size: 1.75rem;
}

.swatch svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sw-light {
  background: var(--swatch-light-paper);
  color: var(--swatch-light-ink);
}

.sw-dark {
  background: var(--swatch-dark-paper);
  color: var(--swatch-dark-ink);
}

@media (min-width: 48rem) {
  .bento {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  .card {
    padding: 2rem;
  }
  .card-flags {
    grid-column: 1 / 8;
  }
  .card-submit {
    grid-column: 8 / 13;
  }
  .card-search {
    grid-column: 1 / 6;
  }
  .card-care {
    grid-column: 6 / 13;
  }
  .card-own {
    grid-column: 1 / 7;
  }
  .card-offline {
    grid-column: 7 / 13;
  }
  .care-demo {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }
}

/* ---------- Try it ---------- */

.try {
  background: var(--sunken);
  overflow: clip;
}

.flash-try {
  position: absolute;
  inset: 0;
  opacity: 0.25;
}

.try .wrap {
  position: relative;
}

.try .lede {
  margin-top: 1.25rem;
  max-width: 40rem;
}

.try-layout {
  margin-top: 2.5rem;
  display: grid;
  gap: 2rem;
}

.try-stage {
  display: grid;
  gap: 1rem;
  justify-items: center;
}

.phone-only {
  text-align: center;
}

.try-stage .btn {
  width: 100%;
}

.device {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.device-screen iframe {
  display: block;
  width: 100%;
  height: 80vh;
  border: 0;
  background: var(--paper);
}

.wide-only {
  display: none !important;
}

.try-notes {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  align-content: start;
}

@media (min-width: 48rem) {
  .phone-only {
    display: none !important;
  }
  .wide-only {
    display: inline-flex !important;
  }
  .try-stage .btn {
    width: auto;
  }
  .device {
    max-width: calc(820px + 24px);
    border: 0;
    border-radius: 32px;
    padding: 12px;
    background: var(--ink);
    box-shadow: var(--shadow-deep);
  }
  .device-screen {
    width: 100%;
    max-width: 820px;
    height: calc(1080px * var(--s, 1));
    border-radius: 21px;
    overflow: hidden;
    background: var(--paper);
  }
  .device-screen iframe {
    width: 820px;
    height: 1080px;
    transform: scale(var(--s, 1));
    transform-origin: 0 0;
  }
  .try-notes {
    max-width: 40rem;
    margin-inline: auto;
  }
}

@media (min-width: 80rem) {
  .try-layout {
    grid-template-columns: minmax(0, 1fr) 16rem;
    align-items: center;
  }
}

/* ---------- Trust ---------- */

.trust-cols {
  display: grid;
  margin-top: 2.5rem;
}

.trust-cols > div {
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}

.trust-cols h3 {
  margin-bottom: 0.5rem;
}

.trust-cols p {
  color: var(--ink-muted);
}

@media (min-width: 48rem) {
  .trust-cols {
    grid-column: 3 / 13;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .trust-cols > div {
    border-top: 0;
    padding: 0 2rem;
    border-left: 1px solid var(--line);
  }
  .trust-cols > div:first-child {
    border-left: 0;
    padding-left: 0;
  }
}

/* ---------- Closing call to action ---------- */

.cta {
  background: var(--ink);
  color: var(--paper);
  padding-block: var(--pad);
  text-align: center;
}

.cta-in {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  max-width: 48rem;
}

.logo-big {
  width: 160px;
  height: 160px;
  margin-bottom: 1.5rem;
}

.logo-big .logo-slip,
.logo-big .logo-fold {
  stroke-width: 1;
}

.logo-big .logo-sig {
  stroke: var(--ink);
  stroke-width: 1;
}

.cta .body-lg {
  max-width: 34rem;
  margin-bottom: 2rem;
}

.cta :focus-visible {
  outline-color: var(--paper);
}

.btn-big {
  min-height: 60px;
  padding-inline: 2.25rem;
  font-size: 1.1875rem;
}

/* Light mode: a resting ring so oxblood holds its edge on the dark band. */
@media not (prefers-color-scheme: dark) {
  .cta .btn-primary {
    box-shadow:
      0 0 0 1.5px color-mix(in srgb, var(--paper) 40%, transparent),
      0 10px 30px -8px color-mix(in srgb, var(--accent) 80%, transparent);
  }
}

.cta .btn-primary:hover {
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent),
    0 12px 40px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}

@media (prefers-color-scheme: dark) {
  .cta {
    background: var(--surface);
    color: var(--ink);
  }
  .cta :focus-visible {
    outline-color: var(--accent);
  }
}

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

.footer {
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--line);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.footer-links {
  display: flex;
  gap: 0.25rem;
  margin-inline: -0.75rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding-inline: 0.75rem;
  font-weight: 500;
  text-underline-offset: 3px;
}

/* ---------- Section reveal ---------- */

@media (prefers-reduced-motion: no-preference) {
  html.js [data-reveal] > * {
    transition:
      opacity 500ms var(--ease),
      translate 500ms var(--ease),
      transform 200ms var(--ease),
      box-shadow 200ms var(--ease);
    transition-delay: calc(var(--i, 0) * 60ms), calc(var(--i, 0) * 60ms), 0ms, 0ms;
  }
  html.js [data-reveal]:not(.in) > * {
    opacity: 0;
    translate: 0 16px;
  }
}

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