/* ==========================================================================
   Post Bridge — design system
   Direction: cool porcelain + ink, editorial-technical. The ONLY chromatic
   color is the constellation of platform brand hues; the brand's own accent
   is a single electric ultramarine. Fraunces (display serif) + Hanken Grotesk
   (UI) + JetBrains Mono (counts/eyebrows/code).
   ========================================================================== */

:root {
  /* palette */
  --paper:      #f4f5f7;
  --paper-2:    #eceef2;
  --card:       #ffffff;
  --ink:        #14161c;
  --ink-2:      #3a3e4a;
  --muted:      #6b7180;
  --faint:      #9aa0ad;
  --line:       #e2e5ea;
  --line-2:     #d3d7df;
  --brand:      #3b32ff;
  --brand-2:    #241bd6;
  --brand-tint: #ecebff;
  --brand-ink:  #ffffff;
  --ok:         #12a150;
  --ok-tint:    #e6f6ec;
  --warn:       #b7791f;
  --warn-tint:  #fbf1dd;
  --danger:     #d64545;
  --danger-tint:#fbe9e9;

  /* platform brand colors */
  --p-bluesky:   #1185fe;
  --p-facebook:  #1877f2;
  --p-instagram: #e1306c;
  --p-linkedin:  #0a66c2;
  --p-pinterest: #e60023;
  --p-threads:   #101010;
  --p-tiktok:    #010101;
  --p-tiktok-a:  #25f4ee;
  --p-tiktok-b:  #fe2c55;
  --p-x:         #101419;
  --p-youtube:   #ff0000;

  /* type */
  --serif: "Fraunces", Georgia, serif;
  --sans:  "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* spacing scale (8px base) */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  --radius:   14px;
  --radius-s: 9px;
  --radius-l: 22px;
  --shadow-s: 0 1px 2px rgba(20,22,28,.05), 0 1px 3px rgba(20,22,28,.04);
  --shadow-m: 0 4px 12px rgba(20,22,28,.06), 0 2px 4px rgba(20,22,28,.04);
  --shadow-l: 0 24px 60px -18px rgba(20,22,28,.24), 0 8px 24px -12px rgba(20,22,28,.14);
  --ring: 0 0 0 3px rgba(59,50,255,.28);

  --maxw: 1200px;
  --ease-out: cubic-bezier(.22,.61,.36,1);
  --ease-in-out: cubic-bezier(.65,.05,.36,1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "ss01" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.08; font-weight: 600; letter-spacing: -.02em; }
h1 { font-family: var(--serif); font-weight: 560; }
h2 { font-family: var(--serif); font-weight: 540; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img, svg, video { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--brand); color: #fff; }

.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }
.tnum { font-variant-numeric: tabular-nums; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* eyebrow label */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before {
  content: ""; width: 20px; height: 1px; background: var(--line-2);
}
.eyebrow.no-rule::before { display: none; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-weight: 550; font-size: 15px;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  transition: transform .12s var(--ease-out), background .16s, box-shadow .16s, border-color .16s, color .16s;
  white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; box-shadow: var(--shadow-m); }
.btn-brand { background: var(--brand); color: var(--brand-ink); }
.btn-brand:hover { background: var(--brand-2); box-shadow: 0 8px 22px -8px rgba(59,50,255,.6); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(20,22,28,.03); }
.btn-quiet { background: transparent; color: var(--ink-2); padding: 8px 12px; }
.btn-quiet:hover { background: rgba(20,22,28,.05); color: var(--ink); }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: none; box-shadow: var(--ring);
}
.btn[disabled] { opacity: .5; pointer-events: none; }

/* chips / pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 550; padding: 4px 10px; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-2);
}
.pill.ok { background: var(--ok-tint); color: #0d7a3d; }
.pill.warn { background: var(--warn-tint); color: #8a5a12; }
.pill.brand { background: var(--brand-tint); color: var(--brand-2); }
.pill.danger { background: var(--danger-tint); color: #a92f2f; }

.tag-demo {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; background: var(--warn-tint); color: #8a5a12;
  font-weight: 500;
}
.tag-demo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }

/* cards */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-s);
}

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13.5px; font-weight: 550; color: var(--ink-2); }
.input, .textarea, select.input {
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-s);
  padding: 11px 13px; transition: border-color .15s, box-shadow .15s; width: 100%;
}
.input:focus, .textarea:focus, select.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }

/* utility */
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.grow { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* toast */
#toast-host { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-l);
  animation: toast-in .3s var(--ease-out); display: flex; align-items: center; gap: 10px;
}
.toast.ok { background: #0e7a3d; }
.toast.err { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
