/* Privacy Policy and Terms (privacy.html, terms.html): a notebook sheet with a red margin,
   section numbers written in the margin, and the short version sealed in an envelope.
   Loaded after styles.css, so it uses the same tokens. */

.legal-hero { position: relative; padding-block: 48px 40px; }
@media (min-width: 960px) { .legal-hero { padding-block: 72px 56px; } }

.legal-back {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 18px;
  font-family: var(--f-mono); font-size: 13px; letter-spacing: 0.06em; color: var(--muted); text-decoration: none;
}
.legal-back:hover { color: var(--ink); }
.legal-back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.legal-hero h1 {
  margin-top: 12px;
  font-family: var(--f-title); font-style: italic; font-weight: 400;
  font-size: clamp(44px, 9vw, 84px); line-height: 1; letter-spacing: -0.02em;
}
.legal-hero .lede { max-width: 34em; }
.legal-date { margin-top: 26px; }

/* The short version: an envelope with the gist inside, sealed in wax. */
.legal-gist {
  position: relative;
  margin-top: 40px; max-width: 46em;
  padding: 40px 26px 26px;
  background: #EADFCB;
  border: 1px solid #D8C8AA;
  border-radius: 6px;
  box-shadow: 0 14px 30px rgba(31, 42, 58, 0.12);
}
.legal-gist::before {
  /* The flap's fold. */
  content: ""; position: absolute; inset: 0 0 auto; height: 64px;
  background: linear-gradient(to bottom right, transparent 49.6%, rgba(31, 42, 58, 0.12) 50%, transparent 50.6%) left / 50% 100% no-repeat,
              linear-gradient(to bottom left, transparent 49.6%, rgba(31, 42, 58, 0.12) 50%, transparent 50.6%) right / 50% 100% no-repeat;
  pointer-events: none;
}
.legal-gist .wax { position: absolute; top: 40px; inset-inline-start: 50%; translate: -50% -50%; width: 46px; height: 46px; font-size: 20px; }
.legal-gist h2 { margin-top: 30px; font-family: var(--f-mono); font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--seal); text-align: center; }
.legal-gist ul { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; }
.legal-gist li { position: relative; padding-inline-start: 34px; font-size: 18px; line-height: 1.5; }
.legal-gist li::before {
  content: ""; position: absolute; inset-inline-start: 4px; top: 0.35em;
  width: 9px; height: 15px; border: solid var(--seal); border-width: 0 2.5px 2.5px 0; transform: rotate(40deg);
}
.legal-gist li b { font-weight: 500; }

/* The body: a contents list in the margin, and the sheet. */
.legal-grid { display: grid; gap: 28px; padding-bottom: 96px; }
@media (min-width: 1000px) {
  .legal-grid { grid-template-columns: 230px minmax(0, 1fr); gap: 56px; align-items: start; }
}

.legal-toc { font-family: var(--f-mono); font-size: 13px; }
@media (min-width: 1000px) { .legal-toc { position: sticky; top: 96px; } }
.legal-toc details { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.legal-toc summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 48px;
  list-style: none; cursor: pointer;
  font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.legal-toc summary::-webkit-details-marker { display: none; }
.legal-toc summary::after { content: "+"; font-size: 18px; color: var(--ink); }
.legal-toc details[open] summary::after { content: "–"; }
@media (min-width: 1000px) {
  .legal-toc details { border: 0; }
  .legal-toc summary { pointer-events: none; min-height: 0; margin-bottom: 12px; }
  .legal-toc summary::after, .legal-toc details[open] summary::after { content: none; }
}
.legal-toc ol { list-style: none; margin: 0; padding: 0 0 14px; counter-reset: toc; }
.legal-toc li { counter-increment: toc; }
.legal-toc a {
  display: flex; gap: 10px; align-items: baseline; min-height: 36px; padding-block: 8px;
  color: var(--body); text-decoration: none; line-height: 1.35;
}
.legal-toc a::before { content: counter(toc, decimal-leading-zero); flex: none; width: 22px; color: var(--muted); font-size: 11px; }
.legal-toc a:hover { color: var(--ink); }
.legal-toc a[aria-current="true"] { color: var(--seal); }
.legal-toc a[aria-current="true"]::before { color: var(--seal); }

.legal-sheet {
  --margin: 30px;
  position: relative;
  padding: 36px 22px 44px calc(var(--margin) + 22px);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(31, 42, 58, 0.04), 0 18px 40px rgba(31, 42, 58, 0.08);
  counter-reset: section;
}
.legal-sheet::before {
  content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: var(--margin);
  width: 1.5px; background: var(--seal); opacity: 0.45;
}
@media (min-width: 760px) { .legal-sheet { --margin: 88px; padding: 56px 56px 64px calc(var(--margin) + 36px); } }

.legal-sheet section { position: relative; counter-increment: section; scroll-margin-top: 90px; }
.legal-sheet section + section { margin-top: 44px; padding-top: 40px; border-top: 1px solid var(--rule); }
.legal-sheet h2 {
  font-family: var(--f-title); font-style: italic; font-weight: 400;
  font-size: clamp(26px, 4vw, 32px); line-height: 1.15;
}
/* The section number, written in the margin like a notebook. */
.legal-sheet h2::before {
  content: "§ " counter(section, decimal-leading-zero);
  display: block; margin-bottom: 6px;
  font-family: var(--f-mono); font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--seal);
}
@media (min-width: 760px) {
  .legal-sheet h2::before {
    position: absolute; inset-inline-start: calc(-1 * var(--margin) - 36px); width: calc(var(--margin) - 12px);
    margin: 0; padding-top: 0.75em; text-align: end;
  }
}
.legal-sheet h3 { margin-top: 28px; font-family: var(--f-mono); font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.legal-sheet p, .legal-sheet li { max-width: 40em; color: var(--body); font-size: 18px; line-height: 1.65; }
.legal-sheet p { margin-top: 14px; }
.legal-sheet ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.legal-sheet ul li { position: relative; padding-inline-start: 22px; }
.legal-sheet ul li::before { content: ""; position: absolute; inset-inline-start: 2px; top: 0.72em; width: 7px; height: 7px; border-radius: 47% 53% 50% 50%; background: var(--ink); opacity: 0.75; }
.legal-sheet strong { color: var(--ink); font-weight: 500; }
.legal-sheet a { color: var(--ink); text-underline-offset: 3px; }
.legal-sheet a:hover { color: var(--seal); }

/* Where things live: three cards, from most private to what we can see. */
/* Stacked like layers, from the phone outward. On wider sheets each card puts its title
   beside its list. */
.legal-where { display: grid; gap: 14px; margin-top: 24px; }
.where-card {
  position: relative; padding: 22px 20px 20px; border-radius: 6px;
  display: grid; gap: 10px; align-content: start;
}
.where-card h3 { padding-inline-end: 96px; }
@media (min-width: 700px) {
  .where-card { grid-template-columns: 200px minmax(0, 1fr); gap: 6px 28px; padding: 24px 26px; }
  .legal-where .where-card h3 { grid-column: 1; grid-row: 1 / span 3; align-self: start; flex-direction: column; align-items: flex-start; gap: 12px; padding-inline-end: 0; font-size: 14px; line-height: 1.4; }
  .legal-where .where-card h3 svg { width: 26px; height: 26px; }
  .where-card p, .where-card ul { grid-column: 2; }
  .legal-where .where-card ul { margin-top: 0; }
  /* The wax and the stamp sit under the title instead of in the corner. */
  .legal-where .where-sealed .wax, .legal-where .where-seen .stamp { position: static; grid-column: 1; grid-row: 3; justify-self: start; align-self: end; margin-top: 10px; }
}
.where-card h3 { margin: 0; display: flex; align-items: center; gap: 10px; color: inherit; }
.where-card h3 svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.where-card p { margin: 0; font-size: 16px; line-height: 1.5; color: inherit; }
.where-card ul { margin: 4px 0 0; gap: 4px; }
.where-card ul li { font-size: 16px; line-height: 1.45; color: inherit; }
.where-card ul li::before { background: currentColor; }
.where-phone { background: var(--night); color: #E8E2D5; }
.where-phone h3 { color: var(--paper); }
.where-sealed { background: #EADFCB; color: var(--ink); border: 1px solid #D8C8AA; }
.where-sealed .wax { position: absolute; top: 14px; inset-inline-end: 14px; width: 30px; height: 30px; font-size: 13px; }
.where-seen { background: #FFFDF8; color: var(--ink); border: 1.5px dashed var(--line); }
.where-seen .stamp { position: absolute; top: 14px; inset-inline-end: 12px; font-size: 10px; padding: 2px 7px; }

/* Plain tables: what we keep and for how long; who helps us run Jourday. */
.legal-table { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
.legal-table th, .legal-table td { padding: 12px 12px 12px 0; text-align: start; vertical-align: top; border-bottom: 1px solid var(--rule); color: var(--body); }
.legal-table th { font-family: var(--f-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border-bottom: 1.5px solid var(--ink); }
.legal-table td:first-child { color: var(--ink); font-weight: 500; }
@media (max-width: 600px) {
  .legal-table thead { display: none; }
  .legal-table tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .legal-table td { display: block; padding: 2px 0; border: 0; }
}

/* The sign-off at the bottom of the sheet. */
.legal-sign {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
  margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--rule);
}
.legal-sign .wax { width: 52px; height: 52px; font-size: 22px; }
.legal-sign p { margin: 0; font-family: var(--f-title); font-style: italic; font-size: 22px; color: var(--ink); }
.legal-sign small { display: block; margin-top: 4px; font-family: var(--f-mono); font-style: normal; font-size: 12px; color: var(--muted); }
