/* ==========================================================================
   PagoDesk — Design System
   Editorial institutional: deep PA blue anchor, warm off-white, orange for CTA
   Typography: Work Sans + Space Mono
   ========================================================================== */

:root {
  /* Brand */
  --blue: #003d7a;
  --blue-900: #002a55;
  --blue-700: #003d7a;
  --blue-500: #0b5fbf;
  --blue-100: #e6eef7;
  --blue-050: #f2f6fb;

  --orange: #ff8c00;
  --orange-600: #e87d00;
  --orange-100: #fff1de;

  /* Neutrals — warm off-white */
  --paper: #f7f5f1;          /* page background */
  --paper-2: #efece5;        /* section alt */
  --card: #ffffff;
  --ink: #111418;
  --ink-2: #2b3138;
  --muted: #5e6774;
  --line: #d9d4ca;           /* warm hairline */
  --line-2: #e7e2d7;

  /* Semantic */
  --ok: #3a7d44;
  --warn: #b4651a;
  --err: #a33a2a;

  /* Type */
  --font-body: 'Work Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, Menlo, monospace;

  /* Radius / shadow (restrained) */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --shadow-soft: 0 1px 2px rgba(0,31,63,.05), 0 8px 24px -12px rgba(0,31,63,.12);

  /* Density */
  --density: 1;
  --gutter: calc(24px * var(--density));
}

/* Density toggle */
:root[data-density="compact"] {
  --density: 0.82;
}

/* Accent toggle (tweakable) */
:root[data-accent="amber"] {
  --orange: #d98a1b;
  --orange-600: #b8720c;
  --orange-100: #f8ecd2;
}
:root[data-accent="terracotta"] {
  --orange: #c05a3a;
  --orange-600: #9e4628;
  --orange-100: #f6e2d9;
}

/* ===== Reset ============================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--blue); color: #fff; }

/* ===== Type scale ========================================================= */
h1, h2, h3, h4, h5 {
  font-family: var(--font-body);
  color: var(--blue);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  line-height: 1.1;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 4.8vw, 3.6rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.02; }
h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }
p  { margin: 0; color: var(--ink-2); text-wrap: pretty; }

.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange-600);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--orange);
  display: inline-block;
}

/* ===== Containers ========================================================= */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}
.section { padding: clamp(64px, 8vw, 112px) 0; }
.section--tight { padding: clamp(48px, 6vw, 80px) 0; }
.section--alt { background: var(--paper-2); }
.section--blue { background: var(--blue); color: #fff; }
.section--blue h1, .section--blue h2, .section--blue h3, .section--blue h4 { color: #fff; }
.section--blue p { color: rgba(255,255,255,.82); }

.hairline { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ===== Header ============================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247,245,241,.88);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--blue);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.25rem;
}
.brand__mark {
  width: 28px; height: 28px;
  background: var(--blue);
  border-radius: 6px;
  display: grid; place-items: center;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  position: relative;
}
.brand__mark::after {
  content: "";
  position: absolute;
  right: -3px; bottom: -3px;
  width: 10px; height: 10px;
  background: var(--orange);
  border-radius: 2px;
  border: 2px solid var(--paper);
}
.brand span { color: var(--orange); }

.site-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
  align-items: center;
}
.site-nav a {
  font-size: 0.94rem;
  color: var(--ink-2);
  padding: 6px 0;
  position: relative;
  transition: color .15s;
}
.site-nav a:hover { color: var(--blue); }
.site-nav a.is-active {
  color: var(--blue);
}
.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -19px;
  height: 2px; background: var(--orange);
}

/* ===== Buttons =========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: var(--r-sm);
  font-weight: 500;
  font-size: 0.96rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: -0.005em;
}
.btn--primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn--primary:hover { background: var(--orange-600); }
.btn--ghost {
  background: transparent;
  color: var(--blue);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--blue); }
.btn--dark {
  background: var(--blue);
  color: #fff;
}
.btn--dark:hover { background: var(--blue-900); }
.btn--sm { padding: 9px 16px; font-size: 0.88rem; }
.btn svg { width: 14px; height: 14px; }

/* ===== Tags / badges ====================================================== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--blue-100);
  color: var(--blue);
  border: 1px solid color-mix(in oklab, var(--blue) 12%, transparent);
}
.tag--orange { background: var(--orange-100); color: var(--orange-600); border-color: color-mix(in oklab, var(--orange) 25%, transparent); }
.tag--ok { background: #e6f1e8; color: var(--ok); border-color: color-mix(in oklab, var(--ok) 20%, transparent); }
.tag--ghost { background: transparent; color: var(--muted); border-color: var(--line); }

/* Status badges — release positioning  ────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.status-badge::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in oklab, currentColor 18%, transparent);
}
.status-badge--early {
  background: color-mix(in oklab, var(--orange) 10%, var(--card));
  color: var(--orange-600);
  border: 1px solid color-mix(in oklab, var(--orange) 30%, transparent);
}
.status-badge--soon {
  background: color-mix(in oklab, var(--blue) 6%, var(--card));
  color: var(--blue);
  border: 1px solid color-mix(in oklab, var(--blue) 24%, transparent);
}
.status-badge--roadmap {
  background: var(--paper-2);
  color: var(--muted);
  border: 1px dashed var(--line);
}
.status-badge--ga {
  background: color-mix(in oklab, var(--ok) 8%, var(--card));
  color: var(--ok);
  border: 1px solid color-mix(in oklab, var(--ok) 24%, transparent);
}

/* Placeholder pill — visible reminders of open items for review */
.placeholder-pill {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 2px;
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: color-mix(in oklab, var(--orange) 14%, transparent);
  border: 1px dashed color-mix(in oklab, var(--orange) 50%, transparent);
  border-radius: 4px;
  color: var(--orange-600);
}

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ===== Footer ============================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 64px 0 28px;
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer .container { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr; gap: 48px; }
.site-footer h5 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 14px;
  font-weight: 500;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a:hover { color: var(--blue); }
.site-footer__bottom {
  max-width: 1240px; margin: 40px auto 0; padding: 20px 32px 0;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-family: var(--font-mono); font-size: 0.76rem;
  color: var(--muted); letter-spacing: 0.02em;
}

/* ===== Common utility layout bits ========================================= */
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 28px; }

.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }
.meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); letter-spacing: 0.04em; }

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 28px;
}

/* ===== Responsive ========================================================= */
@media (max-width: 960px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .site-nav a:not(.btn) { display: none; }
  .site-footer .container { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .site-footer .container { grid-template-columns: 1fr; gap: 32px; }
  h1 { font-size: 2.2rem; }
}

/* ===== Tweaks panel ======================================================= */
.tweaks {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  z-index: 100;
  display: none;
  width: 260px;
  font-size: 0.88rem;
}
.tweaks[data-open="1"] { display: block; }
.tweaks h6 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 12px;
  font-weight: 500;
  display: flex; justify-content: space-between; align-items: center;
}
.tweaks__row { margin-bottom: 14px; }
.tweaks__row:last-child { margin-bottom: 0; }
.tweaks__label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
}
.tweaks__swatches { display: flex; gap: 8px; }
.tweaks__swatch {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--line);
  cursor: pointer;
  padding: 0;
}
.tweaks__swatch[aria-pressed="true"] { border-color: var(--ink); }
.tweaks__segment {
  display: flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden;
}
.tweaks__segment button {
  flex: 1; padding: 7px 10px; background: transparent; border: 0; cursor: pointer;
  font-size: 0.82rem; color: var(--muted);
}
.tweaks__segment button[aria-pressed="true"] {
  background: var(--blue); color: #fff;
}
