/* Condei — condei.app
 * Long-form pages: privacy, terms, refunds, cookies, licences, delete-account,
 * the support page, the 404 and the app-link landing page. Loaded after
 * assets/styles.css and built only from its tokens (docs/site-design-plan.md);
 * it is the only home of the .doc-*, .help-*, .qa and .nf rules.
 *
 * The reading page is paper; its masthead is parchment. Fraunces carries the
 * title and the section headings, Karla everything else. No capitals, no
 * cards: hairlines and space do the separating.
 */

/* --------------------------------------------------------------- masthead */

.doc-hero { background: var(--parchment); }
.doc-hero .eyebrow { margin-bottom: var(--s-4); }
.doc-hero .wrap {
  padding-block: clamp(44px, 1.5rem + 5vw, 112px) clamp(32px, 1.2rem + 3vw, 72px);
}
.doc-hero h1,
.help-hero h1 {
  max-width: 18ch;
  font-size: var(--t-display);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 1;
  text-wrap: balance;
}

/* "Effective 8 October 2026" — the same quiet line on every legal page. */
.doc-updated {
  display: block;
  margin-top: var(--s-4);
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--muted);
}

.doc-intro { margin-top: var(--s-5); max-width: 46rem; }
.doc-intro p {
  max-width: 46ch;
  font-size: var(--t-lede);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}
.doc-intro p + p { margin-top: var(--s-4); }
.doc-intro strong { color: var(--ink); }
.doc-intro a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
.doc-intro a:hover, .doc-intro a:focus-visible { text-decoration-thickness: 2px; }
.doc-intro .doc-hr { display: none; }

/* Who it is from, what it covers: a small fact sheet, not a paragraph. */
.doc-intro p.doc-facts {
  max-width: 62ch;
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  font-size: var(--t-small);
  line-height: 1.6;
  color: var(--muted);
}
.doc-intro p.doc-facts:first-child { margin-top: 0; }
.doc-intro p.doc-facts strong { font-weight: 700; color: var(--ink); }

/* ------------------------------------------------------------- the layout */

.doc-layout {
  padding-block: clamp(36px, 2rem + 3vw, 88px) var(--s-section);
}
.doc-body { max-width: 66ch; }

@media (min-width: 900px) {
  .doc-layout { display: flex; align-items: flex-start; gap: clamp(40px, 4vw, 88px); }
  .doc-layout.has-toc { gap: clamp(48px, 5vw, 112px); }
  .doc-body { flex: 1 1 auto; min-width: 0; }
}

/* ------------------------------------------------------------ contents */

.doc-toc { display: none; }
.doc-toc-h {
  margin: 0 0 var(--s-3);
  font-size: var(--t-small);
  font-weight: 700;
  color: var(--ink);
}
.doc-toc ul { display: flex; flex-direction: column; }
.doc-toc code { font-size: 0.9em; }
.doc-toc a {
  transition: color var(--dur-micro) linear, border-color var(--dur-micro) linear;
  display: block;
  padding: 7px 0 7px 14px;
  border-left: 2px solid var(--line);
  font-size: var(--t-small);
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
}
.doc-toc a:hover { color: var(--ink); border-left-color: var(--brass); }
.doc-toc a:focus-visible { color: var(--ink); border-left-color: var(--brass); border-radius: 0 4px 4px 0; outline-offset: -2px; }

@media (min-width: 900px) {
  .doc-toc {
    display: block;
    flex: none;
    width: 252px;
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .doc-toc-m { display: none; }
}

/* Narrow screens: one closed disclosure above the text. */
.doc-toc-m { margin-bottom: var(--s-6); border-block: 1px solid var(--line); }
.doc-toc-m summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  font-size: var(--t-body);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.doc-toc-m summary::-webkit-details-marker { display: none; }
.doc-toc-m summary::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform var(--dur-micro) linear;
}
.doc-toc-m[open]:not(.is-closing) summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.doc-toc-m ul { padding-bottom: var(--s-3); }
.doc-toc-m a {
  display: block;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: var(--t-body);
  line-height: 1.35;
  color: var(--ink);
  text-decoration: none;
}

/* ----------------------------------------------------------------- prose */

.doc-body h2 {
  font-family: "Fraunces", Georgia, serif;
  margin-top: clamp(56px, 2.6rem + 3vw, 96px);
  padding-top: clamp(28px, 1.2rem + 1.4vw, 44px);
  border-top: 1px solid var(--line);
  font-size: clamp(1.625rem, 1.3rem + 1.15vw, 2.25rem);   /* 26 → 36 */
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.016em;
  font-variation-settings: "opsz" 64, "SOFT" 0, "WONK" 0;
  text-wrap: balance;
  scroll-margin-top: 88px;
}
.doc-body > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.doc-hr { display: none; }   /* the h2's own hairline does this job */

.doc-body h3 {
  margin-top: var(--s-7);
  font-size: var(--t-h3);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.005em;
  text-wrap: balance;
  scroll-margin-top: 88px;
}
.doc-body h2 + h3 { margin-top: var(--s-5); }

.doc-body p,
.doc-body li {
  font-size: var(--t-body);
  line-height: 1.7;
  text-wrap: pretty;
}
.doc-body p { margin-top: var(--s-4); }
.doc-body h2 + p, .doc-body h3 + p { margin-top: var(--s-3); }
.doc-body > p:first-child { margin-top: 0; }

.doc-body ul, .doc-body ol { margin-top: var(--s-4); padding-left: 1.3em; display: flex; flex-direction: column; gap: 8px; }
.doc-body ul { list-style: disc; }
.doc-body ol { list-style: decimal; }
.doc-body li::marker { color: var(--muted); font-weight: 400; }
.doc-body li > ul, .doc-body li > ol { margin-top: 8px; }
.doc-body strong { font-weight: 700; }

.doc-body a,
.help-lead a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}
.doc-body a:hover { text-decoration-thickness: 2.5px; }
.doc-body a:focus-visible { text-decoration-thickness: 2px; }

.doc-body blockquote {
  margin: var(--s-5) 0 0;
  padding: 2px 0 2px var(--s-5);
  border-left: 2px solid var(--brass);
}
.doc-body blockquote p { margin-top: var(--s-3); font-size: var(--t-body); color: var(--muted); }
.doc-body blockquote p:first-child { margin-top: 0; }
.doc-body blockquote strong { color: var(--ink); }

.doc-body code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
  background: var(--sel);
  border-radius: 5px;
  padding: 0.1em 0.4em;
  overflow-wrap: anywhere;
}
.doc-body pre {
  margin-top: var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  max-width: 100%;
}
.doc-body pre code { background: none; padding: 0; overflow-wrap: normal; }

/* A paragraph that is one bold sentence, on pages that ask for it
   (delete-account): the thing to do, or the thing to know. */
.doc-body p.doc-callout {
  margin-top: var(--s-5);
  padding: var(--s-4) var(--s-5);
  background: var(--parchment);
  border-left: 3px solid var(--brass);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--t-lede);
  line-height: 1.45;
}
.doc-body h2 + p.doc-callout, .doc-body h3 + p.doc-callout { margin-top: var(--s-4); }

/* ---------------------------------------------------------------- tables */

.table-scroll {
  margin-top: var(--s-5);
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}
.table-scroll:focus-visible { outline-offset: 2px; }
.doc-body table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.doc-body th {
  text-align: left;
  padding: 0 var(--s-5) 10px 0;
  font-size: var(--t-small);
  font-weight: 700;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}
.doc-body td {
  padding: 12px var(--s-5) 12px 0;
  font-size: var(--t-small);
  line-height: 1.55;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
/* The first cell of a body row is a <th scope="row">, so a screen reader
   announces it with every cell: it reads as a bold key, not a header. */
.doc-body th.k {
  width: 36%;
  padding: 12px var(--s-5) 12px 0;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.doc-body tr:last-child td, .doc-body tr:last-child th.k { border-bottom: 0; }
@media (max-width: 599px) {
  /* Two-column tables stack into labelled pairs; wider ones scroll. */
  .doc-body table:not(.wide) { min-width: 520px; }
}

/* --------------------------------------------------------------- support */

.help-hero { background: var(--parchment); }
.help-hero-grid {
  display: grid;
  gap: clamp(36px, 1.5rem + 3vw, 72px);
  padding-block: clamp(44px, 1.5rem + 5vw, 112px) clamp(40px, 1.5rem + 3.5vw, 88px);
}
.help-hero .doc-intro { margin-top: var(--s-5); }
.help-hero .btn-primary { margin-top: var(--s-5); }
@media (min-width: 900px) {
  .help-hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; column-gap: clamp(48px, 6vw, 120px); }
}

.help-tasks h2 {
  font-size: var(--t-small);
  font-weight: 700;
  line-height: 1.3;
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--ink);
}
.help-tasks li { position: relative; border-bottom: 1px solid var(--line); }
.help-tasks a {
  display: block;
  padding: var(--s-4) 0;
  text-decoration: none;
}
.help-task-t {
  display: block;
  font-size: var(--t-h3);
  font-weight: 700;
  line-height: 1.3;
  background: linear-gradient(var(--brass), var(--brass)) 0 100% / 0 2px no-repeat;
  width: fit-content;
  max-width: 100%;
  transition: background-size var(--dur-standard) var(--ease-spring);
}
.help-task-n { display: block; margin-top: 2px; font-size: var(--t-small); color: var(--muted); }
.help-tasks a:hover .help-task-t { background-size: 100% 2px; }
.help-tasks a:focus-visible { outline-offset: -3px; border-radius: 6px; }

.help-section { padding-block: clamp(56px, 2rem + 5vw, 112px); border-top: 1px solid var(--line); }
.help-section:first-of-type { border-top: 0; }
.help-section.band { border-top: 0; }
.help-grid { display: grid; gap: var(--s-6); }
.help-label h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);   /* 28 → 40 */
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.018em;
  font-variation-settings: "opsz" 64, "SOFT" 0, "WONK" 0;
  text-wrap: balance;
  scroll-margin-top: 88px;
}
@media (min-width: 900px) {
  .help-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); column-gap: clamp(48px, 6vw, 120px); }
  .help-label { position: sticky; top: 104px; align-self: start; }
}
.help-content { min-width: 0; max-width: 46rem; }
.help-lead { max-width: 62ch; }
.help-lead.doc-body p:first-child { margin-top: 0; }
.help-lead + .qa-list { margin-top: var(--s-6); }

.qa-list { border-top: 1px solid var(--line); }
.qa { border-bottom: 1px solid var(--line); }
.qa summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-5);
  padding: var(--s-4) 0;
  min-height: 56px;
  cursor: pointer;
  list-style: none;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary h3 {
  margin: 0;
  font-size: var(--t-h3);
  font-weight: 700;
  line-height: 1.35;
  text-wrap: balance;
}
.qa summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin: 10px 4px 0 0;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform var(--dur-standard) var(--ease-spring);
}
.qa[open]:not(.is-closing) summary::after { transform: rotate(-135deg); margin-top: 14px; }
.qa summary:hover h3 { text-decoration: underline; text-decoration-color: var(--brass); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.qa summary:focus-visible { outline-offset: -2px; border-radius: 6px; }
.qa:target summary h3 { text-decoration: underline; text-decoration-color: var(--brass); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.qa-a { padding: 0 0 var(--s-6); max-width: 62ch; }
.qa-a > :first-child { margin-top: 0; }
.qa-a > p:first-child { margin-top: 0; }

/* Getting in touch — the ink band. */
.help-section.band .help-lead { max-width: 52ch; }
.help-section.band .help-lead p { font-size: var(--t-lede); line-height: 1.55; color: var(--muted); }
.help-section.band .help-lead p:first-child { color: var(--ink); }
.help-section.band .help-lead strong { color: var(--ink); }
.help-section.band .help-lead a { color: var(--ink); }
.help-section.band .help-content > .btn-primary { margin-top: var(--s-5); margin-bottom: var(--s-6); }
.help-section.band .help-lead + .btn-primary { margin-top: var(--s-5); }

/* -------------------------------------------------------------------- 404 */

.nf { background: var(--parchment); }
.nf-grid {
  display: grid;
  gap: clamp(36px, 1.5rem + 3vw, 72px);
  padding-block: clamp(56px, 2rem + 6vw, 128px);
}
.nf h1 {
  max-width: 14ch;
  font-size: var(--t-display);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 1;
  text-wrap: balance;
}
.nf-lede { margin-top: var(--s-4); max-width: 34ch; font-size: var(--t-lede); line-height: 1.5; color: var(--muted); text-wrap: balance; }
.nf .btn-primary { margin-top: var(--s-5); }
.nf-links h2 { font-size: var(--t-small); font-weight: 700; line-height: 1.3; padding-bottom: var(--s-3); border-bottom: 1px solid var(--ink); }
.nf-links li { border-bottom: 1px solid var(--line); }
.nf-links a { display: block; padding: var(--s-4) 0; text-decoration: none; }
.nf-links a:focus-visible { outline-offset: -3px; border-radius: 6px; }
.nf-links .help-task-t { font-size: var(--t-h3); }
@media (min-width: 900px) {
  .nf-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; column-gap: clamp(48px, 6vw, 120px); }
}
.nf-links a:hover .help-task-t { background-size: 100% 2px; }

/* Long unbroken strings (URLs, addresses) wrap instead of widening the page. */
.doc-body p, .doc-body li, .doc-body td, .doc-body th { overflow-wrap: anywhere; }
