/*
 * Public pages on api.cuplikin.com (privacy, terms, support, about).
 * Tokens mirror cuplikin.com (website/public/assets/site.css) and the app's
 * design colors (feature_common/assets/color/colors.xml: design_* and
 * design_dark_*), so these pages read as part of the same product.
 */
@font-face {
  font-family: Jost;
  src: url('./fonts/jost.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: Mulish;
  src: url('./fonts/mulish.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #f8f9f3;
  --surface: #ffffff;
  --ink: #192c42;
  --muted: #526174;
  --line: #dce1d9;
  --strong-line: #c9d1d6;
  --blue: #1460ed;
  --blue-dark: #0745b8;
  --link: #0745b8;
  --sky: #e8f1ff;
  --sky-line: #c8dafb;
  --mint: #d3f7ac;
  --shadow-ink: #192c42;
  --display: Jost, 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  --body:
    Mulish, -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --text-label: 0.75rem;
  --text-small: 0.875rem;
  --text-body: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #141416;
    --surface: #1c1c1f;
    --ink: #ededf0;
    --muted: #a1a1aa;
    --line: #303034;
    --strong-line: #45454b;
    --blue: #356fbd;
    --blue-dark: #2c60a4;
    --link: #91b7ef;
    --sky: #263249;
    --sky-line: #34476a;
    --mint: #29352d;
    /* The app drops the offset ink shadow in dark mode; borders carry the shape. */
    --shadow-ink: transparent;
  }
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: var(--text-body) / 1.75 var(--body);
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: var(--mint);
  color: var(--ink);
}
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}
a {
  color: var(--link);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--blue);
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
h1,
h2,
h3 {
  font-family: var(--display);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.wrap,
main {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 10;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 7px;
}
.skip-link:focus {
  top: 12px;
}

/* Site bar: same brand lockup as cuplikin.com. */
.site-bar {
  border-bottom: 1px solid var(--line);
}
.site-bar .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 84px;
  padding-block: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font: 700 1.75rem/1 var(--display);
  letter-spacing: -1.4px;
}
.brand:hover {
  color: var(--ink);
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.brand-period {
  color: var(--blue);
}

.language-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font: 700 var(--text-small) / 1.5 var(--mono);
}
main > .language-nav {
  margin: 32px 0 0;
}
.language-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 14px;
  border: 1.5px solid var(--strong-line);
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
}
.language-nav a:hover {
  border-color: var(--ink);
}
.language-nav a[aria-current='page'] {
  background: var(--sky);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--shadow-ink);
}

/* Title card, also used by the hand-written support and about pages. */
main {
  padding: 40px 0 72px;
}
main > header {
  margin-top: 24px;
  padding: clamp(24px, 4vw, 44px);
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 6px 6px 0 var(--shadow-ink);
}
main > .language-nav + header {
  margin-top: 20px;
}
.eyebrow {
  display: inline-block;
  padding: 5px 11px;
  background: var(--sky);
  border: 1px solid var(--sky-line);
  border-radius: 5px;
  color: var(--link);
  font: 700 var(--text-label) / 1.5 var(--mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
h1 {
  margin: 18px 0 0;
  font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -2px;
}
main > header p {
  margin: 16px 0 0;
  max-width: 44rem;
  color: var(--muted);
}
.updated {
  font: 600 var(--text-small) / 1.7 var(--mono);
}

/* Legal document layout: sticky contents beside the text on wide screens. */
.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  margin-top: 40px;
}
.toc {
  padding: 18px 20px;
  background: var(--surface);
  border: 1.5px solid var(--strong-line);
  border-radius: 10px;
}
.toc-title {
  margin: 0 0 8px;
  color: var(--muted);
  font: 700 var(--text-label) / 1.5 var(--mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-small);
  line-height: 1.5;
}
.toc a {
  display: block;
  padding: 6px 0;
  color: var(--ink);
  text-decoration: none;
}
.toc a:hover {
  color: var(--blue);
  text-decoration: underline;
}
@media (min-width: 960px) {
  .legal-layout {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 56px;
  }
  .toc {
    position: sticky;
    top: 24px;
    align-self: start;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
  }
}

/* Document text. */
.doc,
main > section {
  max-width: 46rem;
}
main > section {
  margin-top: 36px;
}
.doc > :first-child {
  margin-top: 0;
}
h2 {
  margin: 2.2em 0 0.5em;
  padding-top: 0.2em;
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.5px;
}
h3 {
  margin: 1.6em 0 0.35em;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
}
p,
li {
  color: var(--muted);
}
p {
  margin: 0 0 1em;
}
strong {
  color: var(--ink);
}
ul {
  margin: 0 0 1em;
  padding-left: 1.3em;
}
li {
  margin: 0.35em 0;
}
li::marker {
  color: var(--blue);
}

/* Components used by the support and about pages. */
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.pill {
  padding: 5px 12px;
  border: 1px solid var(--strong-line);
  border-radius: 999px;
  color: var(--ink);
  font-size: var(--text-small);
  font-weight: 700;
}
.callout {
  margin: 28px 0;
  padding: 18px 22px;
  background: var(--sky);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--shadow-ink);
  color: var(--ink);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 8px 0 28px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 18px;
  background: var(--blue);
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  box-shadow: 4px 4px 0 var(--shadow-ink);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}
.button:hover {
  background: var(--blue-dark);
  color: #fff;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--shadow-ink);
}
.button.secondary {
  background: transparent;
  border-color: var(--strong-line);
  box-shadow: none;
  color: var(--ink);
}
.button.secondary:hover {
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--strong-line);
}

/* Footers: the site footer on generated pages, the inline one on hand-written pages. */
.site-footer {
  margin-top: 24px;
  border-top: 1px solid var(--line);
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  padding-block: 32px 24px;
}
.footer-top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  font-weight: 700;
}
.footer-top nav a,
main > footer a {
  color: var(--ink);
  text-decoration: none;
}
.footer-top nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.footer-top nav a:hover,
main > footer a:hover {
  color: var(--blue);
  text-decoration: underline;
}
.footer-bottom {
  padding-block: 20px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-small);
}
main > footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-small);
}

@media (max-width: 600px) {
  main {
    padding-top: 24px;
  }
  .site-bar .wrap {
    min-height: 72px;
  }
  .brand {
    font-size: 1.5rem;
  }
  .brand img {
    width: 30px;
    height: 30px;
  }
  main > header {
    box-shadow: 4px 4px 0 var(--shadow-ink);
  }
  h1 {
    letter-spacing: -1.2px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .button {
    transition: none;
  }
}
