/* ============================================================================
   Raplo Design System — portable theme
   Company: Raplo (AI-first). Products: Raplo Capture, + future Raplo products.
   Drop this stylesheet into ANY Raplo product for a consistent look & feel.

   Usage:
     <link rel="stylesheet" href="/brand/raplo-theme.css">
   Requires two self-hosted fonts next to your app (see @font-face paths below):
     /fonts/inter.woff2      (UI / body)
     /fonts/fraunces.woff2   (display headings + headline numbers)
   Theme = warm editorial ("Anthropic-inspired"): ivory canvas, clay accent,
   serif display type, soft warm-cast elevation, no backdrop-blur.

   Per-product accent: override --brand / --brand2 on :root (or a wrapper) and
   everything (buttons, focus rings, links, active chips, gradients) recolors.
   ============================================================================ */

/* ---- Fonts (self-hosted, no CDN) ---------------------------------------- */
@font-face{
  font-family:'Inter';
  src:url('/fonts/inter.woff2') format('woff2');
  font-weight:100 900; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'Fraunces';
  src:url('/fonts/fraunces.woff2') format('woff2');
  font-weight:100 900; font-style:normal; font-display:swap;
}

/* ---- Design tokens ------------------------------------------------------ */
:root{
  /* Neutrals — warm ivory canvas + paper surfaces */
  --bg:#f0eee6;
  --surface:#fefdfb;
  --surface-2:#f4f2ea;
  --surface-3:#eae7db;
  --ink:#1a1915;
  --ink-2:#3b3a34;
  --muted:#6f6e65;
  --line:#e5e2d7;
  --line-2:#eeece3;

  /* Brand — clay (override per product) */
  --brand:#cc785c;
  --brand2:#b5613f;
  --brand-ink:#fffdf9;
  --brand-soft:color-mix(in srgb, var(--brand) 12%, transparent);
  --brand-soft-2:color-mix(in srgb, var(--brand) 20%, transparent);

  /* Semantic / status */
  --ok:#3d7a5d;  --hot:#c1502f;  --warm:#c68a2e;  --cold:#5f8a8c;

  /* Elevation — soft, warm-cast (no blur) */
  --sh-1:0 1px 2px rgba(40,34,24,.05);
  --sh-2:0 4px 18px rgba(40,34,24,.07);
  --sh-3:0 12px 40px rgba(40,34,24,.10);
  --sh-4:0 24px 70px rgba(40,34,24,.16);
  --ring:0 0 0 3px var(--brand-soft-2);

  /* Shape scale */
  --r-xs:8px; --r-sm:10px; --r:14px; --r-lg:18px; --r-xl:24px; --pill:999px;

  /* Motion */
  --ease:cubic-bezier(.16,1,.3,1);
  --ease-io:cubic-bezier(.4,0,.2,1);
  --dur:.22s;

  color-scheme:light;
}

/* Dark — follows system by default … */
@media (prefers-color-scheme:dark){ :root{
  --bg:#1e1d1a; --surface:#282621; --surface-2:#2f2d27; --surface-3:#38352d;
  --ink:#f2efe6; --ink-2:#d6d3c8; --muted:#a29f93; --line:#3a382f; --line-2:#423f35;
  --brand:#d98e72; --brand2:#e0a48c; --brand-ink:#1e1d1a;
  --ok:#5aa17f; --hot:#e0795c; --warm:#d9a24e; --cold:#7fabab;
  --sh-1:0 1px 2px rgba(0,0,0,.4);  --sh-2:0 4px 18px rgba(0,0,0,.45);
  --sh-3:0 12px 40px rgba(0,0,0,.5); --sh-4:0 24px 70px rgba(0,0,0,.6);
  color-scheme:dark;
}}
/* … and an explicit toggle (data-theme wins over system) */
:root[data-theme="light"]{ color-scheme:light; }
:root[data-theme="dark"]{
  --bg:#1e1d1a; --surface:#282621; --surface-2:#2f2d27; --surface-3:#38352d;
  --ink:#f2efe6; --ink-2:#d6d3c8; --muted:#a29f93; --line:#3a382f; --line-2:#423f35;
  --brand:#d98e72; --brand2:#e0a48c; --brand-ink:#1e1d1a;
  --ok:#5aa17f; --hot:#e0795c; --warm:#d9a24e; --cold:#7fabab;
  --sh-1:0 1px 2px rgba(0,0,0,.4);  --sh-2:0 4px 18px rgba(0,0,0,.45);
  --sh-3:0 12px 40px rgba(0,0,0,.5); --sh-4:0 24px 70px rgba(0,0,0,.6);
  color-scheme:dark;
}

/* ---- Base ---------------------------------------------------------------- */
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{
  font-family:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  font-size:15px; line-height:1.55; letter-spacing:-.011em;
  color:var(--ink);
  background:
    radial-gradient(1200px 500px at 50% -280px, color-mix(in srgb,var(--brand) 12%,transparent), transparent 70%),
    var(--bg);
  background-attachment:fixed;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
h1,h2,h3,h4{margin:0;font-weight:700;letter-spacing:-.02em;line-height:1.2}
/* Editorial serif for display headings + headline data (use .serif anywhere) */
h1,.serif,.htitle{
  font-family:'Fraunces',Georgia,'Times New Roman',serif;
  font-weight:500;letter-spacing:-.015em;
}
.num,.stat .n{font-variant-numeric:tabular-nums;font-feature-settings:"tnum"}
.stat .n{font-family:'Fraunces',Georgia,serif;font-weight:600;letter-spacing:-.01em}
a{color:var(--brand);text-underline-offset:2px}
::selection{background:var(--brand-soft-2)}

/* ---- Eyebrow / kicker ---------------------------------------------------- */
.eyebrow{
  font-size:11px;font-weight:700;letter-spacing:.02em;text-transform:uppercase;
  color:var(--brand);display:inline-flex;align-items:center;gap:6px;
}

/* ---- Buttons ------------------------------------------------------------- */
.btn{
  --b:var(--brand);
  position:relative;overflow:hidden;
  font:inherit;font-size:14px;font-weight:600;letter-spacing:-.01em;
  border:1px solid transparent;border-radius:var(--r-sm);
  background:var(--b);color:var(--brand-ink);
  padding:12px 16px;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  box-shadow:var(--sh-1);
  transition:transform .12s var(--ease), box-shadow var(--dur) var(--ease),
             background var(--dur), border-color var(--dur), opacity var(--dur);
}
.btn:hover{transform:translateY(-1px);box-shadow:var(--sh-2)}
.btn:active{transform:translateY(0) scale(.99);box-shadow:var(--sh-1)}
.btn:focus-visible{outline:none;box-shadow:var(--ring)}
.btn:disabled{opacity:.55;cursor:not-allowed;transform:none;box-shadow:var(--sh-1)}
.btn.ghost{background:var(--surface);color:var(--ink);border-color:var(--line);box-shadow:none}
.btn.ghost:hover{background:var(--surface-2);border-color:color-mix(in srgb,var(--brand) 40%,var(--line));box-shadow:var(--sh-1)}
.btn.sm{padding:8px 13px;font-size:13px;border-radius:var(--r-xs)}
.btn.block{width:100%}

/* ---- Card ---------------------------------------------------------------- */
.card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  box-shadow:var(--sh-1);
  padding:18px;
}
.card h2{font-size:15px;margin:0 0 12px;display:flex;align-items:center;gap:9px}

/* ---- Inputs -------------------------------------------------------------- */
input.txt,textarea.txt,select.txt{
  font:inherit;font-size:15px;width:100%;color:var(--ink);
  background:var(--surface-2);
  border:1px solid var(--line);border-radius:var(--r-sm);
  padding:11px 13px;outline:none;
  transition:border-color var(--dur),box-shadow var(--dur),background var(--dur);
}
input.txt::placeholder,textarea.txt::placeholder{color:color-mix(in srgb,var(--muted) 75%,transparent)}
input.txt:focus,textarea.txt:focus,select.txt:focus{border-color:var(--brand);background:var(--surface);box-shadow:var(--ring)}
textarea.txt{resize:vertical;min-height:70px;line-height:1.5}

/* ---- Chips (toggle) ------------------------------------------------------ */
.chip{
  font-size:13px;font-weight:600;color:var(--ink-2);
  border:1px solid var(--line);background:var(--surface-2);
  border-radius:var(--r-sm);padding:8px 13px;cursor:pointer;user-select:none;
  transition:background var(--dur),border-color var(--dur),color var(--dur),transform .12s var(--ease);
}
.chip:active{transform:scale(.96)}
.chip[aria-pressed="true"]{background:var(--brand-soft);border-color:color-mix(in srgb,var(--brand) 55%,transparent);color:var(--brand)}

/* ---- Status tags --------------------------------------------------------- */
.tag{display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:700;border-radius:var(--pill);padding:3px 10px}
.tag.Hot {background:color-mix(in srgb,var(--hot) 15%,transparent);color:var(--hot)}
.tag.Warm{background:color-mix(in srgb,var(--warm) 16%,transparent);color:var(--warm)}
.tag.Cold{background:color-mix(in srgb,var(--cold) 16%,transparent);color:var(--cold)}
.tag.ok  {background:color-mix(in srgb,var(--ok) 16%,transparent);color:var(--ok)}

@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
