/* ==========================================================================
   privacy.html (IDL-P): paper sheet, positive polarity for reading.
   Hero strip + title block · FIG. 1 data-flow schematic · numbered clauses
   with a sticky clause index (active clause and reading progress are pure CSS
   scroll-driven state, progressive enhancement; static without support).
   ========================================================================== */

.privacy {
  /* structural rule on paper: ink mixed into paper (decorative, ≥1.9:1) */
  --pv-rule: var(--paper-line);
  --pv-rule: color-mix(in oklab, var(--ink-1) 22%, var(--paper));
  --pv-top: calc(var(--header-h) + 40px);
  min-height: 100svh;
}

/* ---- paper overrides for core components ------------------------------ */
.privacy .label { color: var(--ink-1); }
.privacy .label .idx { color: var(--ink-3); }
.privacy .rule { background: var(--pv-rule); }
.privacy .stamp { color: var(--ink-3); }
.privacy .tblock { border-color: var(--pv-rule); }
.privacy .tblock > div { border-color: var(--pv-rule); }
.privacy .tblock dt { color: var(--ink-3); }
.privacy .tblock dd { color: var(--ink-1); }
.privacy .sheet { background: var(--paper); border-color: var(--pv-rule); }
.privacy .sheet::before, .privacy .sheet::after,
.privacy .sheet > .corner-b::before, .privacy .sheet > .corner-b::after { border-color: var(--ink-1); }
.privacy a:not([class]) { color: var(--ink-1); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: var(--ink-3); transition: text-decoration-color var(--dur-micro) linear; }
.privacy a:not([class]):hover { color: var(--ink-1); text-decoration-color: currentColor; }
.privacy code { font-size: 0.9em; color: var(--ink-1); }

/* ---- Hero --------------------------------------------------------------- */
.pv-hero { padding-top: calc(var(--header-h) + clamp(32px, 5vw, 72px)); padding-bottom: clamp(64px, 8vw, 128px); }
.pv-strip { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px var(--s-5); padding-bottom: 14px; }
.pv-hero__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter);
  margin-top: clamp(56px, 9vw, 152px); align-items: end;
}
.pv-hero__title { grid-column: 1 / span 8; grid-row: 1; color: var(--ink-1); view-transition-name: page-title; }
.pv-hero__lead { grid-column: 1 / span 6; grid-row: 2; margin-top: clamp(24px, 2.6vw, 36px); color: var(--ink-2); }
.pv-tblock { grid-column: 9 / span 4; grid-row: 1 / span 2; align-self: end; --cols: 2; }
.pv-tblock > div { min-height: 68px; padding: 12px 14px 14px; }
.pv-tblock dd { font-size: 15px; }

@media (max-width: 1023px) {
  .pv-hero__title, .pv-hero__lead { grid-column: 1 / -1; }
  .pv-tblock { grid-column: 1 / span 8; grid-row: 3; margin-top: var(--s-7); }
}
@media (max-width: 639px) {
  .pv-tblock { grid-column: 1 / -1; --cols: 2; }
  .pv-strip__rev { color: var(--ink-1); }
}

/* ---- FIG. 1 data flow ---------------------------------------------------- */
.pv-fig { padding-bottom: clamp(72px, 9vw, 144px); }
.pv-flow { margin: 0; padding: clamp(16px, 2.6vw, 40px); }
.pv-flow__svg { width: 100%; height: auto; overflow: visible; color: var(--ink-1); }
.pv-flow__svg--tall { display: none; }
@media (max-width: 1023px) {
  .pv-flow__svg--wide { display: none; }
  .pv-flow__svg--tall { display: block; max-width: 440px; }
}
.pv-flow__svg .o, .pv-flow__svg .d, .pv-flow__svg .h {
  fill: none; vector-effect: non-scaling-stroke; stroke-linecap: square; stroke-linejoin: miter;
}
.pv-flow__svg .o { stroke: currentColor; stroke-width: 1.5; }
.pv-flow__svg .d { stroke: var(--ink-3); stroke-width: 0.75; }
.pv-flow__svg .h { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 6 4; stroke-linecap: butt; }
.pv-flow__svg .dot { fill: var(--ink-3); }
.pv-flow__svg text { font-family: var(--font-mono); font-size: 11.5px; fill: var(--ink-2); letter-spacing: 0.01em; }
.pv-flow__svg .tl { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; fill: var(--ink-1); }
.pv-flow__svg .tl--dim { fill: var(--ink-2); }
.pv-flow__svg .k { font-size: 11px; font-weight: 500; letter-spacing: 0.09em; fill: var(--ink-1); }
.pv-flow__svg .sm { font-size: 11px; fill: var(--ink-3); }
.pv-flow__svg .v { fill: var(--ink-1); font-weight: 500; }

.pv-flow__cap {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--s-4) var(--s-6);
  margin-top: clamp(20px, 2.4vw, 32px); padding-top: var(--s-4); border-top: 1px solid var(--pv-rule);
}
.pv-flow__cap p { max-width: 72ch; font-size: var(--t-small); color: var(--ink-2); }
/* tablet: drawing on the left, its notes beside it */
@media (min-width: 640px) and (max-width: 1023px) {
  .pv-flow { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); column-gap: clamp(28px, 5vw, 56px); align-items: start; }
  .pv-flow > .corner-b { grid-area: 1 / 1; }
  .pv-flow__svg--tall { grid-area: 1 / 1; }
  .pv-flow__cap { grid-area: 1 / 2; flex-direction: column; margin-top: 0; padding-top: var(--s-4); }
}

/* ---- Clauses: grid -------------------------------------------------------- */
.pv-doc { padding-bottom: var(--section); }
.pv-doc__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.pv-index { grid-column: 1 / span 3; }
.pv-index__inner { position: sticky; top: var(--pv-top); }
.pv-body { grid-column: 4 / -1; display: grid; grid-template-columns: subgrid; }
.pv-clause { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; position: relative; padding-block: clamp(36px, 4vw, 60px); }
.pv-clause:first-child { padding-top: 0; }
.pv-clause:first-child .pv-clause__rule { display: none; }
.pv-clause__rule { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--pv-rule); transform-origin: left center; }
.pv-clause__n {
  grid-column: 1; align-self: start;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; color: var(--ink-3);
  line-height: calc(var(--t-h3) * 1.12); font-variant-numeric: tabular-nums slashed-zero;
}
.pv-clause__body { grid-column: 2 / span 7; min-width: 0; }

/* ---- Clauses: type ---------------------------------------------------------- */
.pv-clause h2 { font-size: var(--t-h3); line-height: 1.12; letter-spacing: -0.016em; font-stretch: 96%; color: var(--ink-1); }
.pv-gist {
  margin-top: clamp(14px, 1.4vw, 20px); max-width: 44ch;
  font-size: clamp(1.125rem, 1.05rem + 0.33vw, 1.375rem); line-height: 1.42; letter-spacing: -0.004em;
  font-weight: 430; color: var(--ink-1);
}
.pv-clause__body > p:not(.pv-gist):not(.pv-mail), .pv-defs dd p { max-width: 64ch; color: var(--ink-2); }
.pv-clause__body > p:not(.pv-gist) { margin-top: var(--s-4); }
.pv-clause__body > .pv-gist + p:not(.pv-mail) { margin-top: var(--s-5); }

/* ---- Schedules (tables) --------------------------------------------------- */
.pv-table { margin-top: var(--s-6); border-top: 1px solid var(--ink-1); font-size: var(--t-small); line-height: 1.5; }
.pv-table thead th {
  text-align: left; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-3); padding: 12px 20px 12px 0; border-bottom: 1px solid var(--pv-rule);
}
.pv-table tbody th, .pv-table td { text-align: left; vertical-align: top; padding: 18px 24px 20px 0; border-bottom: 1px solid var(--pv-rule); }
.pv-table tbody th { width: 24%; color: var(--ink-1); font-weight: 520; font-size: var(--t-body); line-height: 1.35; }
.pv-table td { color: var(--ink-2); }
.pv-table td:last-child { padding-right: 0; width: 26%; color: var(--ink-1); }
.pv-table code { font-family: var(--font-mono); font-size: 14px; font-weight: 500; }
.pv-table__sub { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 11px; font-weight: 400; letter-spacing: 0.04em; color: var(--ink-3); }

@media (max-width: 767px) {
  .pv-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pv-table, .pv-table tbody, .pv-table tr, .pv-table th, .pv-table td { display: block; width: auto !important; }
  .pv-table tr { padding: 18px 0 20px; border-bottom: 1px solid var(--pv-rule); }
  .pv-table tbody th, .pv-table td { border: 0; padding: 0; }
  .pv-table td { margin-top: 12px; }
  .pv-table td::before {
    content: attr(data-k); display: block; margin-bottom: 4px;
    font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3);
  }
}

/* ---- Definition lists (services, rights) ------------------------------------ */
.pv-defs { margin-top: var(--s-6); border-top: 1px solid var(--ink-1); }
.pv-defs > div { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 8px var(--gutter); padding: 20px 0 22px; border-bottom: 1px solid var(--pv-rule); }
.pv-defs dt { display: grid; gap: 4px; align-content: start; }
.pv-defs__name { color: var(--ink-1); font-weight: 520; font-size: var(--t-body); line-height: 1.35; }
.pv-defs__role { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.pv-defs dd p + p { margin-top: 10px; }
.pv-defs__link a { display: inline-flex; align-items: center; min-height: 44px; margin-block: -6px -10px; }
.pv-defs--rights .pv-defs__name { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; padding-top: 4px; }
@media (max-width: 639px) {
  .pv-defs > div { grid-template-columns: 1fr; }
}

/* ---- Small pieces ----------------------------------------------------------- */
.pv-updated { display: flex; align-items: baseline; gap: var(--s-4); color: var(--ink-1); font-variant-numeric: tabular-nums; }
.pv-updated .label { color: var(--ink-3); }
.pv-mail { margin-top: var(--s-5); }
.pv-mail__link {
  display: inline-block; padding-block: 4px;
  font-size: var(--t-h3); line-height: 1.15; letter-spacing: -0.016em; font-weight: 480; font-stretch: 96%;
  color: var(--ink-1); overflow-wrap: anywhere;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.16em; text-decoration-color: var(--ink-3);
  transition: text-decoration-color var(--dur-micro) linear;
}
.pv-mail__link:hover { text-decoration-color: var(--ink-1); }

.pv-end {
  grid-column: 2 / span 7; display: flex; align-items: center; gap: var(--s-4);
  margin-top: clamp(24px, 3vw, 40px); color: var(--ink-3);
}
.pv-end::before { content: ""; flex: 0 0 32px; height: 1px; background: var(--ink-1); }
.pv-end::after { content: ""; flex: 1; height: 1px; background: var(--pv-rule); }
.privacy .pv-end span:first-child { color: var(--ink-1); }

/* ---- Clause index ------------------------------------------------------------ */
.pv-index__list { list-style: none; padding: 0; position: relative; border-left: 1px solid var(--pv-rule); }
.pv-index__link {
  position: relative; display: grid; grid-template-columns: 2.4em 1fr; align-items: center;
  min-height: 44px; padding: 6px 0 6px 18px;
  font-size: 15px; line-height: 1.3; color: var(--ink-2); text-decoration: none;
  transition: color var(--dur-micro) linear;
}
.pv-index__link:hover { color: var(--ink-1); }
.pv-index__list .n { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.06em; color: var(--ink-3); font-variant-numeric: tabular-nums slashed-zero; }
.pv-index__link::before { content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 1px; background: var(--ink-1); transform-origin: top center; transform: scaleY(0); pointer-events: none; }
.pv-index__list .tick { position: absolute; left: -1.5px; top: 9px; bottom: 9px; width: 2px; background: var(--accent-ink); transform: scaleY(0); }
.pv-index__meta { margin-top: var(--s-6); padding-left: 19px; }

/* Active clause + reading progress: CSS scroll-driven state (Chromium); static elsewhere.
   Each clause is a view timeline measured against a reading line 33% down the viewport. */
@supports (timeline-scope: --a) and (animation-timeline: view()) {
  .pv-doc__grid { timeline-scope: --pv-who, --pv-collect, --pv-not, --pv-svc, --pv-store, --pv-keep, --pv-share, --pv-rights, --pv-chg, --pv-contact; }
  .pv-clause { view-timeline-inset: 33% 66%; }
  #who { view-timeline-name: --pv-who; }
  #collect { view-timeline-name: --pv-collect; }
  #not-collected { view-timeline-name: --pv-not; }
  #services { view-timeline-name: --pv-svc; }
  #storage { view-timeline-name: --pv-store; }
  #retention { view-timeline-name: --pv-keep; }
  #sharing { view-timeline-name: --pv-share; }
  #rights { view-timeline-name: --pv-rights; }
  #changes { view-timeline-name: --pv-chg; }
  #contact { view-timeline-name: --pv-contact; }

  /* active clause: ink label + accent tick, only while its clause crosses the reading line */
  .pv-index__link { animation: pv-on linear; animation-fill-mode: none; }
  .pv-index__list .tick { animation: pv-tick linear; animation-fill-mode: none; }
  /* progress: each clause's segment of the index rule fills while it is read, then stays filled */
  .pv-index__link::before { animation: pv-fill linear forwards; }
  html.reduce-motion .pv-index__link::before { animation-name: pv-filled; }
  .pv-index__list li:nth-child(1) .pv-index__link, .pv-index__list li:nth-child(1) .tick, .pv-index__list li:nth-child(1) .pv-index__link::before { animation-timeline: --pv-who; }
  .pv-index__list li:nth-child(2) .pv-index__link, .pv-index__list li:nth-child(2) .tick, .pv-index__list li:nth-child(2) .pv-index__link::before { animation-timeline: --pv-collect; }
  .pv-index__list li:nth-child(3) .pv-index__link, .pv-index__list li:nth-child(3) .tick, .pv-index__list li:nth-child(3) .pv-index__link::before { animation-timeline: --pv-not; }
  .pv-index__list li:nth-child(4) .pv-index__link, .pv-index__list li:nth-child(4) .tick, .pv-index__list li:nth-child(4) .pv-index__link::before { animation-timeline: --pv-svc; }
  .pv-index__list li:nth-child(5) .pv-index__link, .pv-index__list li:nth-child(5) .tick, .pv-index__list li:nth-child(5) .pv-index__link::before { animation-timeline: --pv-store; }
  .pv-index__list li:nth-child(6) .pv-index__link, .pv-index__list li:nth-child(6) .tick, .pv-index__list li:nth-child(6) .pv-index__link::before { animation-timeline: --pv-keep; }
  .pv-index__list li:nth-child(7) .pv-index__link, .pv-index__list li:nth-child(7) .tick, .pv-index__list li:nth-child(7) .pv-index__link::before { animation-timeline: --pv-share; }
  .pv-index__list li:nth-child(8) .pv-index__link, .pv-index__list li:nth-child(8) .tick, .pv-index__list li:nth-child(8) .pv-index__link::before { animation-timeline: --pv-rights; }
  .pv-index__list li:nth-child(9) .pv-index__link, .pv-index__list li:nth-child(9) .tick, .pv-index__list li:nth-child(9) .pv-index__link::before { animation-timeline: --pv-chg; }
  .pv-index__list li:nth-child(10) .pv-index__link, .pv-index__list li:nth-child(10) .tick, .pv-index__list li:nth-child(10) .pv-index__link::before { animation-timeline: --pv-contact; }
}
@keyframes pv-on { from, to { color: var(--ink-1); } }
@keyframes pv-tick { from, to { transform: none; } }
@keyframes pv-fill { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pv-filled { from, to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .pv-index__link::before { animation-name: pv-filled; } }

/* Tablet / mobile: index becomes a static contents list above the clauses */
@media (max-width: 1023px) {
  .pv-index, .pv-body { grid-column: 1 / -1; }
  .pv-index { margin-bottom: clamp(48px, 8vw, 72px); }
  .pv-index__inner { position: static; }
  .pv-index__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gutter); border-left: 0; border-top: 1px solid var(--pv-rule); }
  .pv-index__list li { border-bottom: 1px solid var(--pv-rule); }
  .pv-index__list a { padding-left: 0; }
  .pv-index__list .tick, .pv-index__link::before, .pv-index__meta { display: none !important; }
  .pv-body { display: block; }
  .pv-clause { display: block; }
  .pv-clause__n { line-height: 1.3; margin-bottom: var(--s-3); }
  .pv-end { margin-top: var(--s-6); }
}
@media (max-width: 599px) {
  .pv-index__list { grid-template-columns: 1fr; }
}
