/* Tokens follow docs/design.md in the app repo (mono + lavender). */
:root {
  --background: #F4F4F4;
  --card: #FFFFFF;
  --card-secondary: #F4F4F4;
  --ink: #010101;
  --muted: #6F6F6F; /* darker than the app's #8A8A8A to pass contrast on the web */
  --separator: #E2E2E2;
  --button: #010101;
  --button-ink: #FFFFFF;
  --tint: #6E5AAE;
  --tint-soft: #EFECF4;

  /* Review colors are fixed in both appearances. */
  --finding-fill: rgba(245, 166, 35, 0.38);
  --finding-line: #E39A12;
  --redaction: #010101;

  --gradient:
    radial-gradient(120% 90% at 100% 0%, #F3EEFB 0%, rgba(243, 238, 251, 0) 55%),
    radial-gradient(90% 120% at 85% 30%, #C9B8E8 0%, rgba(201, 184, 232, 0) 60%),
    linear-gradient(155deg, #010101 0%, #2A1F4A 45%, #8C76C2 78%, #C9B8E8 100%);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;

  --measure: 34rem;
  --page: 70rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #010101;
    --card: #141317;
    --card-secondary: #1D1B21;
    --ink: #F4F4F4;
    --muted: #9B98A2;
    --separator: #2A2830;
    --button: #FFFFFF;
    --button-ink: #010101;
    --tint: #C9B8E8;
    --tint-soft: #222027;
  }
}

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

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

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

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

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header */

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand svg { width: 1.6rem; height: 1.6rem; }

.site-nav { display: flex; gap: 1.5rem; }

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

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

/* Hero */

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding-top: clamp(1.5rem, 5vw, 4rem);
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.75rem, 6.4vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0 0 1.5rem;
}

.lede {
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  line-height: 1.5;
  color: var(--muted);
  max-width: 28rem;
  margin: 0 0 2rem;
}

.lede strong { color: var(--ink); font-weight: 600; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--button);
  color: var(--button-ink);
  border-radius: 999px;
  padding: 0.8rem 1.35rem;
  font-weight: 600;
  font-size: 1rem;
}

.badge svg { width: 1.05rem; height: 1.05rem; flex: none; }

.actions a { font-weight: 500; }

/* The redaction demo */

.stage {
  margin: 0;
  position: relative;
  border-radius: 28px;
  background: var(--gradient);
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 4vw, 3rem) clamp(1.25rem, 3vw, 2rem);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--separator);
}

/* The pages sit in one grid cell as a stack; JS sets data-depth and turns the top one. */
.pages {
  display: grid;
  perspective: 1800px;
}

.page {
  grid-area: 1 / 1;
  background: #FFFFFF;
  color: #1A1A1A;
  border-radius: 6px;
  padding: clamp(1.1rem, 3vw, 2rem);
  font-family: var(--sans);
  font-size: clamp(0.76rem, 1.1vw, 0.86rem);
  line-height: 1.5;
  box-shadow: 0 30px 60px -20px rgba(1, 1, 1, 0.55);
  transform-origin: left center;
  backface-visibility: hidden;
  transition: transform 0.7s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.page[data-depth="0"] { z-index: 3; transform: rotate(-1.2deg); }
.page[data-depth="1"] { z-index: 2; transform: translate(5px, 7px) rotate(1.3deg); }
.page[data-depth="2"] { z-index: 1; transform: translate(9px, 12px) rotate(-0.2deg); }

.page.is-turning {
  z-index: 4;
  animation: turn-page 0.95s cubic-bezier(0.55, 0, 0.3, 1) forwards;
}

@keyframes turn-page {
  0% { transform: rotate(-1.2deg); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: rotate(-1.2deg) translateX(-6%) rotateY(-115deg); opacity: 0; }
}

.page p { margin: 0 0 0.85em; }
.page p:last-child { margin-bottom: 0; }

.page--letter {
  font-family: var(--serif);
  font-size: clamp(0.82rem, 1.25vw, 0.95rem);
  line-height: 1.6;
}

.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid #E4E2E8;
  padding-bottom: 0.75em;
  margin-bottom: 1em;
  font-family: var(--sans);
  font-size: 0.86em;
  color: #5A5A5A;
}

.page--letter .doc-head { font-size: 0.82em; }
.doc-head span { white-space: nowrap; }
.doc-head b { color: #1A1A1A; font-weight: 700; font-size: 1.1em; }
.doc-head--rule { border-bottom: 2px solid #1A1A1A; }

.page dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15em 1em;
  margin: 0 0 1em;
}

.page dt { color: #6A6A6A; white-space: nowrap; }
.page dd { margin: 0; }
.page .nobr { white-space: nowrap; }
.page .num { font-variant-numeric: tabular-nums; }

.w2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #C9C6CF;
  border-left: 1px solid #C9C6CF;
}

.w2 > div {
  border-right: 1px solid #C9C6CF;
  border-bottom: 1px solid #C9C6CF;
  padding: 0.4em 0.6em 0.45em;
  min-width: 0;
}

.w2 .wide { grid-column: span 2; }

.w2 small {
  display: block;
  font-size: 0.76em;
  color: #6A6A6A;
  line-height: 1.3;
  margin-bottom: 0.15em;
}

.page table {
  width: 100%;
  border-collapse: collapse;
}

.page td {
  padding: 0.4em 0;
  border-top: 1px solid #ECEAEF;
  vertical-align: top;
}

.page td:first-child { color: #6A6A6A; white-space: nowrap; padding-right: 0.9em; }
.page td.num { text-align: right; white-space: nowrap; padding-left: 0.9em; }

/* A Finding: the sensitive text, then its Redaction burned over it. */
.f {
  position: relative;
  display: inline-block;
  line-height: 1.35;
  padding: 0 0.12em;
  margin: 0 -0.12em;
  border-radius: 3px;
  white-space: nowrap;
}

.f::before,
.f::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 3px;
  pointer-events: none;
}

.f::before {
  background: var(--finding-fill);
  box-shadow: inset 0 0 0 1.5px var(--finding-line);
  opacity: 0;
}

.f::after {
  content: attr(data-placeholder);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--redaction);
  color: #FFFFFF;
  font-family: var(--sans);
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.02em;
  clip-path: inset(0 100% 0 0);
}

.page[data-state="found"] .f::before { opacity: 1; transition: opacity 0.35s ease calc(var(--i, 0) * 90ms); }

.page[data-state="redacted"] .f::before { opacity: 1; }
.page[data-state="redacted"] .f::after {
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.45s cubic-bezier(0.65, 0, 0.35, 1) calc(var(--i, 0) * 110ms);
}

.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(1.25rem, 3vw, 2rem);
  color: #F3EEFB;
  font-size: 0.9rem;
}

.stage-status { margin: 0; min-height: 1.4em; }

.toggle {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #010101;
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 1rem;
  cursor: pointer;
  white-space: nowrap;
}

.toggle:hover { background: #FFFFFF; }
.toggle:focus-visible { outline-color: #FFFFFF; }

/* Sections */

.section {
  border-top: 1px solid var(--separator);
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.section h2 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 750;
  margin: 0 0 1rem;
  max-width: 22ch;
}

.section-intro {
  color: var(--muted);
  max-width: var(--measure);
  margin: 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 6vw, 5rem);
}

/* Promises: a plain list with rules between, not cards. */
.promises {
  list-style: none;
  margin: 0;
  padding: 0;
}

.promises li {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--separator);
}

.promises li:first-child { border-top: 0; padding-top: 0.25rem; }

.promises svg {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--tint);
  margin-top: 0.15rem;
}

.promises h3 {
  margin: 0 0 0.3rem;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.promises p { margin: 0; color: var(--muted); max-width: var(--measure); }

/* Steps: a real sequence, so numbered. */
.steps {
  list-style: none;
  counter-reset: step;
  margin: clamp(2rem, 5vw, 3rem) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
}

.steps li { counter-increment: step; }

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--tint-soft);
  color: var(--tint);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.steps h3 { margin: 0 0 0.4rem; font-size: 1.15rem; letter-spacing: -0.01em; }
.steps p { margin: 0; color: var(--muted); }

.copied {
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  background: var(--card);
  border: 1px solid var(--separator);
  border-radius: 18px;
  padding: clamp(1.25rem, 3vw, 2rem);
  max-width: 44rem;
}

.copied figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.copied blockquote {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.65;
}

.ph {
  background: var(--tint-soft);
  color: var(--tint);
  border-radius: 6px;
  padding: 0.05em 0.35em;
  font-weight: 600;
  font-size: 0.92em;
  white-space: nowrap;
}

/* What it finds */
.kinds {
  margin: clamp(2rem, 5vw, 3rem) 0 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.5rem 2rem;
}

.kinds div { border-top: 2px solid var(--ink); padding-top: 0.85rem; }
.kinds dt { font-weight: 700; margin-bottom: 0.5rem; }
.kinds dd { margin: 0; color: var(--muted); line-height: 1.7; }

.footnote { color: var(--muted); font-size: 0.95rem; margin: 2rem 0 0; max-width: var(--measure); }

/* Closing */
.closing { text-align: center; }
.closing h2 { margin-left: auto; margin-right: auto; }
.closing .section-intro { margin: 0 auto 2rem; }
.closing .actions { justify-content: center; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--separator);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  padding-bottom: 2.5rem;
}

.site-footer nav { display: flex; gap: 1.5rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* Prose pages (Privacy, Support) */
.prose {
  max-width: 40rem;
  padding-top: clamp(1.5rem, 5vw, 3.5rem);
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

.prose h1 {
  font-family: var(--display);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
}

.prose .updated { color: var(--muted); margin: 0 0 2.5rem; }

.prose h2 {
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 0.6rem;
}

.prose h3 { font-size: 1.05rem; margin: 1.75rem 0 0.4rem; }
.prose p, .prose li { color: var(--ink); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }

.summary {
  background: var(--tint-soft);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin: 0 0 1rem;
}

.summary p { margin: 0; }

/* Layout changes */

@media (max-width: 960px) {
  .kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

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

@media (max-width: 480px) {
  .site-nav { gap: 1rem; }
  .page dl { grid-template-columns: minmax(0, 1fr); }
  .page dd { margin-bottom: 0.35em; }
  .stage-bar { flex-direction: column; align-items: stretch; text-align: center; }
  .kinds { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .stage .f::before,
  .stage .f::after,
  .page { transition: none !important; }
  .page.is-turning { animation: none; }
}

.defs { position: absolute; }
