/*
 * Yupsly public site — shared stylesheet for index.html and whitepaper.html.
 * No build step, no external assets, no JavaScript required.
 */

:root {
  color-scheme: light dark;

  --paper: #fbfbf8;
  --surface: #ffffff;
  --surface-2: #f2f5fa;
  --ink: #161f2d;
  --ink-soft: #3b4757;
  --muted: #5d6b7f;
  --line: #dbe1ea;
  --line-strong: #b9c4d3;

  --brand: #1b4bd1;
  --brand-ink: #123a9f;
  --brand-wash: #eaf0ff;

  --seal: #0d6b53;
  --seal-wash: #e6f4ef;

  --wip: #8a5300;
  --wip-wash: #fdf2dd;

  --plan: #4c4390;
  --plan-wash: #efedfa;

  --warn: #9c2b21;
  --warn-wash: #fdeceb;

  --code-bg: #f4f6fa;

  --radius: 10px;
  --radius-lg: 16px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "SF Mono",
    Consolas, "Liberation Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e131c;
    --surface: #151d29;
    --surface-2: #1b2431;
    --ink: #e8edf5;
    --ink-soft: #c3ccd9;
    --muted: #97a3b4;
    --line: #2a3444;
    --line-strong: #3c4859;

    --brand: #7ba4ff;
    --brand-ink: #b6cdff;
    --brand-wash: #17223a;

    --seal: #64d3b0;
    --seal-wash: #132821;

    --wip: #e6b558;
    --wip-wash: #2a2113;

    --plan: #b3aaff;
    --plan-wash: #1e1c33;

    --warn: #f2938a;
    --warn-wash: #2c1917;

    --code-bg: #111a25;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
}

.wrap {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.wrap-narrow {
  max-width: 46rem;
}

/* ------------------------------------------------------------------ type */

h1,
h2,
h3,
h4 {
  color: var(--ink);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.012em;
  scroll-margin-top: 5rem;
}

h1 {
  font-size: clamp(1.9rem, 1.4rem + 2.4vw, 3rem);
  margin: 0 0 0.6rem;
}

h2 {
  font-size: clamp(1.4rem, 1.2rem + 1vw, 1.9rem);
  margin: 2.6rem 0 0.8rem;
  padding-top: 0.4rem;
}

h3 {
  font-size: 1.14rem;
  margin: 1.9rem 0 0.5rem;
}

h4 {
  font-size: 1rem;
  margin: 1.4rem 0 0.4rem;
  color: var(--ink-soft);
}

p {
  margin: 0 0 1rem;
}

.lead {
  font-size: clamp(1.06rem, 1rem + 0.4vw, 1.22rem);
  color: var(--ink-soft);
  margin-bottom: 1.4rem;
}

.kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 0.6rem;
}

.sub {
  font-size: 0.9rem;
  color: var(--muted);
}

small {
  font-size: 0.85rem;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

code {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  line-height: 1.55;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--brand-ink);
}

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

ul,
ol {
  padding-left: 1.35rem;
  margin: 0 0 1rem;
}

li {
  margin-bottom: 0.4rem;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.4rem 0;
}

/* ------------------------------------------------------------------ chrome */

.site-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 0.8rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand .dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--brand);
  display: inline-block;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  align-items: center;
  font-size: 0.92rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.hero {
  background:
    radial-gradient(60rem 22rem at 12% -10%, var(--brand-wash), transparent),
    var(--surface);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(2.2rem, 5vw, 4rem);
}

.hero .wrap {
  display: grid;
  gap: 1.6rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-top: 0.4rem;
}

.section {
  padding-block: clamp(2rem, 4vw, 3.2rem);
  border-top: 1px solid var(--line);
}

.section-alt {
  background: var(--surface);
}

.section:first-of-type {
  border-top: 0;
}

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: 2rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.site-foot a {
  color: var(--brand);
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-block;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid var(--brand);
  background: var(--brand);
  color: #fff;
}

.btn:hover {
  background: var(--brand-ink);
  border-color: var(--brand-ink);
  color: #fff;
}

.btn-lg {
  font-size: 1.08rem;
  padding: 0.95rem 1.8rem;
}

.btn-secondary {
  background: transparent;
  color: var(--brand);
}

.btn-secondary:hover {
  background: var(--brand-wash);
  color: var(--brand-ink);
}

/* ------------------------------------------------------------------ blocks */

.grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: 1.2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.25rem;
}

.section-alt .card {
  background: var(--surface-2);
}

.card > :last-child {
  margin-bottom: 0;
}

.card h3 {
  margin-top: 0;
}

.card .kicker {
  margin-bottom: 0.35rem;
}

.note {
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 1.3rem 0;
}

.note > :last-child {
  margin-bottom: 0;
}

.note-warn {
  border-left-color: var(--warn);
  background: var(--warn-wash);
}

.note-key {
  border-left-color: var(--seal);
  background: var(--seal-wash);
}

.note-plan {
  border-left-color: var(--plan);
  background: var(--plan-wash);
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 1.4rem 0 0;
  font-size: 0.94rem;
}

.status-line .label {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--muted);
}

.stamp {
  display: inline-block;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
}

/* ------------------------------------------------------------------ pills */

.pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  border: 1px solid currentColor;
  vertical-align: 0.1em;
  white-space: nowrap;
}

.pill-ship {
  color: var(--seal);
  background: var(--seal-wash);
}

.pill-wip {
  color: var(--wip);
  background: var(--wip-wash);
}

.pill-plan {
  color: var(--plan);
  background: var(--plan-wash);
}

.pill-no {
  color: var(--warn);
  background: var(--warn-wash);
}

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

.table-scroll {
  overflow-x: auto;
  margin: 1.3rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.94rem;
}

caption {
  caption-side: top;
  text-align: left;
  padding: 0.8rem 1rem 0;
  font-weight: 700;
  color: var(--ink-soft);
}

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

thead th {
  background: var(--surface-2);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom-width: 2px;
}

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

td .pill {
  margin-left: 0.2rem;
}

.priced td:last-child,
.priced th:last-child {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ lists without bullets */

.checks {
  list-style: none;
  padding-left: 0;
}

.checks li {
  padding-left: 1.6rem;
  position: relative;
  margin-bottom: 0.5rem;
}

.checks li::before {
  position: absolute;
  left: 0;
  font-weight: 800;
}

.checks-yes li::before {
  content: "\2713";
  color: var(--seal);
}

.checks-no li::before {
  content: "\00D7";
  color: var(--warn);
}

/* ------------------------------------------------------------------ whitepaper */

.doc-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(1.8rem, 4vw, 3rem);
}

.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.3rem;
  margin: 2rem 0;
}

.toc h2 {
  margin: 0 0 0.7rem;
  font-size: 1.05rem;
  padding-top: 0;
}

.toc ol {
  columns: 2;
  column-gap: 2rem;
  margin: 0;
  padding-left: 1.3rem;
  font-size: 0.94rem;
}

.toc li {
  margin-bottom: 0.3rem;
  break-inside: avoid;
}

.toc a {
  color: var(--ink-soft);
}

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

@media (max-width: 44rem) {
  .toc ol {
    columns: 1;
  }
}

.section-num {
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

dl {
  margin: 0 0 1rem;
}

dt {
  font-weight: 700;
  color: var(--ink);
  margin-top: 0.7rem;
}

dd {
  margin: 0.15rem 0 0;
  color: var(--ink-soft);
}

.pillars {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0 0;
}

.pillars li {
  padding-left: 0;
  margin: 0 0 0.5rem;
}

.back-top {
  font-size: 0.85rem;
  margin-top: 1rem;
}
