/* ============================================================
   Proof of Focus — doc pages (support / privacy / terms / press)
   Same refined-brutalist system as home.css
   ============================================================ */

:root {
  color-scheme: light;
  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "DM Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --text: #0e0f13;
  --paper: #f2f0e8;
  --paper-bright: #faf8f0;
  --surface: #ffffff;
  --header-bg: rgba(242, 240, 232, 0.94);
  --muted: #4b4e56;
  --line: rgba(14, 15, 19, 0.16);
  --line-strong: #0e0f13;
  --accent: #1040e0;
  --accent-dark: #0c30ab;
  --accent-soft: #dde5ff;
  --signal: #c7ff4a;
  --danger: #e83c14;
  --mono: var(--font-mono);
  --sans: var(--font-display);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --text: #f2f0e8;
  --paper: #0c0d12;
  --paper-bright: #14161d;
  --surface: #171a22;
  --header-bg: rgba(12, 13, 18, 0.94);
  --muted: #a9adb8;
  --line: rgba(242, 240, 232, 0.18);
  --line-strong: #f2f0e8;
  --accent: #c7ff4a;
  --accent-dark: #a9e02e;
  --accent-soft: #23280f;
  --signal: #c7ff4a;
  --danger: #ff6248;
}

html[data-theme="pink"] {
  color-scheme: light;
  --text: #21101a;
  --paper: #ffe9f1;
  --paper-bright: #fff3f8;
  --surface: #ffffff;
  --header-bg: rgba(255, 233, 241, 0.94);
  --muted: #6e4556;
  --line: rgba(33, 16, 26, 0.16);
  --line-strong: #21101a;
  --accent: #b81168;
  --accent-dark: #8c0c4f;
  --accent-soft: #ffd2e5;
  --signal: #c7ff4a;
  --danger: #e83c14;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  transition: background-color 0.35s ease, color 0.35s ease;
}

::selection { background: var(--signal); color: #0e0f13; }

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

a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: var(--accent-dark); }
img { display: block; max-width: 100%; }
p, h1, h2, h3 { margin-top: 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  min-height: 72px;
  padding: 6px clamp(16px, 4vw, 44px);
  border-bottom: 2px solid var(--line-strong);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover { color: var(--text); }

.brand img {
  width: 42px;
  height: 42px;
  border: 2px solid var(--line-strong);
  border-radius: 10px;
}

.brand span {
  display: grid;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font: 400 10px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.doc-header-actions,
.nav,
.doc-theme-control {
  display: flex;
  align-items: center;
}

.doc-header-actions { gap: 14px; margin-left: auto; }

.nav {
  gap: 2px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--muted);
  font: 400 12px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid transparent;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.doc-theme-control {
  gap: 2px;
  padding: 2px;
  border: 2px solid var(--line-strong);
  background: var(--paper-bright);
}

.doc-theme-control button {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.doc-theme-control button[aria-pressed="true"] {
  background: var(--text);
}

.doc-theme-control button[aria-pressed="true"] .swatch {
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

.swatch {
  display: block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-strong);
  pointer-events: none;
}

.swatch-light { background: #f2f0e8; }
.swatch-dark  { background: #0c0d12; }
.swatch-pink  { background: #ffd3e4; }

/* ---------- doc body ---------- */

.doc-page {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(56px, 9vh, 110px) 0 110px;
}

.doc-page::before {
  display: block;
  width: 78px;
  height: 8px;
  margin-bottom: 28px;
  background: var(--danger);
  content: "";
}

.doc-meta {
  margin-bottom: 18px;
  color: var(--accent);
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.doc-page h1 {
  max-width: 900px;
  margin-bottom: 34px;
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  text-wrap: balance;
}

.doc-page > p {
  max-width: 820px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.doc-page > .doc-meta + h1 + p {
  color: var(--text);
  font-size: clamp(19px, 2.2vw, 25px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.015em;
}

.doc-page h2 {
  margin: 72px 0 22px;
  padding-top: 24px;
  border-top: 2px solid var(--line-strong);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.doc-page h3 {
  margin: 38px 0 12px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.doc-page ul,
.doc-page ol {
  display: grid;
  gap: 12px;
  max-width: 860px;
  margin: 20px 0 0;
  padding-left: 24px;
  color: var(--muted);
}

.doc-page li { padding-left: 7px; }
.doc-page li::marker { color: var(--accent); font-family: var(--mono); font-weight: 500; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  margin-top: 10px;
  padding: 0 24px;
  border: 2px solid var(--line-strong);
  background: var(--text);
  color: var(--paper);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 6px 6px 0 var(--accent);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.button:hover {
  color: var(--paper);
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--accent);
}

.button:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--accent);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 2px solid var(--line-strong);
  border-left: 2px solid var(--line-strong);
}

.timeline-step {
  position: relative;
  min-height: 190px;
  padding: 26px;
  border-right: 2px solid var(--line-strong);
  border-bottom: 2px solid var(--line-strong);
  background: var(--paper-bright);
}

.timeline-step::before {
  display: block;
  width: 11px;
  height: 11px;
  margin-bottom: 30px;
  background: var(--accent);
  content: "";
}

.timeline-step strong {
  display: block;
  margin-bottom: 8px;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.timeline-step p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* markdown-driven pages */

.markdown-doc-page {
  width: min(1040px, calc(100% - 40px));
}

.markdown-doc-page h1 { max-width: 960px; }

.markdown-doc-page > p,
.markdown-doc-page li {
  max-width: 860px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.72;
}

.markdown-doc-page > .doc-meta + h1 + p {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.65;
}

.markdown-doc-page h2 { scroll-margin-top: 96px; margin-top: 80px; }
.markdown-doc-page h3 { scroll-margin-top: 96px; }

.markdown-table-wrap {
  max-width: 100%;
  margin: 28px 0 0;
  overflow-x: auto;
  border: 2px solid var(--line-strong);
  background: var(--paper-bright);
  box-shadow: 8px 8px 0 var(--accent-soft);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

th,
td {
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--accent-soft);
  color: var(--text);
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tr:last-child td { border-bottom: 0; }
th:last-child, td:last-child { border-right: 0; }

.markdown-status,
.markdown-error { color: var(--muted); }

/* press kit asset list */

.press-assets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 860px;
  margin-top: 22px;
}

.press-assets a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 12px 16px;
  border: 2px solid var(--line-strong);
  background: var(--paper-bright);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.press-assets a:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--accent);
}

.press-assets a small {
  color: var(--muted);
  font: 400 11px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 40px;
  border-top: 2px solid var(--line-strong);
  color: var(--muted);
  font: 400 11px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer strong { color: var(--text); font-family: var(--sans); font-size: 14px; letter-spacing: 0; text-transform: none; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--muted);
  text-decoration: none;
  border: 2px solid transparent;
}

.footer-links a:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .site-header {
    align-items: center;
  }

  .doc-header-actions {
    order: 2;
    margin-left: auto;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid var(--line);
    padding-top: 4px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar { display: none; }
}

@media (max-width: 680px) {
  .brand span { display: none; }
  .brand img { width: 38px; height: 38px; }

  .doc-page,
  .markdown-doc-page {
    width: calc(100% - 32px);
    padding: 60px 0 80px;
  }

  .doc-page::before { width: 56px; height: 6px; }
  .doc-page h1 { font-size: clamp(2.6rem, 13vw, 4.2rem); }
  .doc-page > p { font-size: 16px; }
  .doc-page > .doc-meta + h1 + p { font-size: 18px; }
  .doc-page h2 { margin-top: 58px; font-size: clamp(1.7rem, 8vw, 2.4rem); }
  .doc-page h3 { font-size: 20px; }
  .doc-page ul, .doc-page ol { padding-left: 20px; }
  .timeline { grid-template-columns: 1fr; }
  .timeline-step { min-height: 0; }
  .press-assets { grid-template-columns: 1fr; }

  .markdown-doc-page > p,
  .markdown-doc-page li { font-size: 15px; }

  .site-footer { align-items: flex-start; flex-direction: column; width: calc(100% - 32px); }
}

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