/* pesito.css — shared tokens + variant-specific styles */

/* ─── Tokens ───────────────────────────────────────────────────────────── */
:root {
  --bg:        oklch(0.97 0.012 70);
  --surface:   oklch(0.99 0.005 70);
  --surface-2: oklch(0.94 0.014 70);
  --surface-3: oklch(0.91 0.018 70);
  --ink:       oklch(0.22 0.028 60);
  --ink-soft:  oklch(0.46 0.020 60);
  --char:      oklch(0.30 0.022 60);
  --char-2:    oklch(0.38 0.018 60);
  --line:      oklch(0.88 0.012 70);
  --line-soft: oklch(0.92 0.010 70);
  --line-strong: oklch(0.74 0.014 70);
  --brand:     oklch(0.62 0.16 28);
  --brand-deep:oklch(0.54 0.17 28);
  --brand-soft:oklch(0.93 0.04 28);
  --brand-wash:oklch(0.95 0.025 28);
  --sun:       oklch(0.84 0.16 92);
  --green:     oklch(0.55 0.13 155);
  --danger:    oklch(0.58 0.18 25);

  --serif: "Antonio", "Oswald", "Bebas Neue", system-ui, sans-serif;
  --sans:  "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* Warm dark — deviates from brief by user request, but keeps editorial spirit:
   espresso/walnut surfaces, parchment text, brand stays terracotta. */
[data-theme="dark"] {
  --bg:        oklch(0.18 0.014 60);
  --surface:   oklch(0.21 0.016 60);
  --surface-2: oklch(0.25 0.018 60);
  --surface-3: oklch(0.29 0.020 60);
  --ink:       oklch(0.94 0.014 80);
  --ink-soft:  oklch(0.74 0.018 75);
  --char:      oklch(0.86 0.014 78);
  --char-2:    oklch(0.78 0.014 75);
  --line:      oklch(0.34 0.020 60);
  --line-soft: oklch(0.28 0.018 60);
  --line-strong: oklch(0.50 0.022 60);
  --brand:     oklch(0.74 0.16 32);
  --brand-deep:oklch(0.82 0.16 32);
  --brand-soft:oklch(0.32 0.06 28);
  --brand-wash:oklch(0.26 0.04 28);
  --sun:       oklch(0.86 0.16 92);
  --green:     oklch(0.70 0.13 155);
  --danger:    oklch(0.72 0.18 25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ─── Shared: Mini calendar ───────────────────────────────────────────── */
.cal {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 24px;
}
.cal-hd {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 18px;
  font-family: var(--sans);
}
.cal-month {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink);
}
.cal-key { font-size: 10px; color: var(--ink-soft); display: flex; gap: 14px; align-items: center; letter-spacing: .04em; text-transform: uppercase; }
.cal-key-i {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  margin-right: 4px; vertical-align: -2px;
  border: 2px solid var(--brand);
}
.cal-key-i.cal-paid-key { background: var(--brand); }
.cal-key-i.cal-late-key { border-color: var(--danger); background: transparent; }

.cal-dow {
  display: grid; grid-template-columns: repeat(7,1fr);
  font-size: 10px; color: var(--ink-soft); letter-spacing: .12em;
  text-align: center; padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7,1fr);
  margin-top: 10px;
}
.cal-cell {
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  color: var(--char);
}
.cal-empty { color: transparent; }
.cal-n { font-variant-numeric: tabular-nums; }
.cal-due::before {
  content: ""; position: absolute; inset: 12%;
  border: 2px solid var(--brand); border-radius: 50%;
}
.cal-paid::before {
  content: ""; position: absolute; inset: 12%;
  border-radius: 50%; background: var(--brand);
}
.cal-paid .cal-n { color: var(--surface); }
.cal-late::before {
  content: ""; position: absolute; inset: 12%;
  border: 2px solid var(--danger); border-radius: 50%;
}
.cal-today .cal-n { font-weight: 700; }
.cal-today::after {
  content: ""; position: absolute; left: 30%; right: 30%; bottom: 18%;
  height: 1px; background: var(--ink);
}

/* ─── Shared: contract strip (signature move #2) ──────────────────────── */
.contract-strip {
  display: grid;
  grid-template-columns: auto 1px 1fr 1px auto;
  align-items: center;
  gap: 24px;
  padding: 18px 36px;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-soft);
  position: sticky; bottom: 0;
  z-index: 50;
  backdrop-filter: blur(6px);
}
.contract-strip .cs-rule { width: 1px; height: 32px; background: var(--brand); opacity: .6; }
.cs-mark { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 18px; font-weight: 500; color: var(--ink); letter-spacing: .015em; }
.cs-bullet { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.cs-reg { display: flex; flex-direction: column; gap: 2px; }
.cs-reg-line { color: var(--char); font-weight: 500; letter-spacing: .005em; }
.cs-reg-sub { color: var(--ink-soft); font-size: 10px; letter-spacing: .04em; }
.cs-cat { display: flex; align-items: baseline; gap: 8px; font-family: var(--mono); }
.cs-cat-l { font-size: 10px; letter-spacing: .12em; color: var(--ink-soft); }
.cs-cat-n { font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--ink); }
.cs-cat-s { font-size: 10px; color: var(--ink-soft); max-width: 160px; line-height: 1.3; }

/* ─── Shared: range input ─────────────────────────────────────────────── */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; background: transparent; height: 28px;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 1px; background: var(--line-strong); border: 0;
}
input[type="range"]::-moz-range-track { height: 1px; background: var(--line-strong); border: 0; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--brand);
  margin-top: -7px;
  transition: transform .15s ease, background .15s ease;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--brand);
}
input[type="range"]:hover::-webkit-slider-thumb { background: var(--brand); }
input[type="range"]:focus { outline: none; }

/* ─── Shared button shapes ────────────────────────────────────────────── */
.va-btn, .vb-btn, .vc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-weight: 600;
  padding: 14px 22px; font-size: 14px; letter-spacing: .005em;
  border: 1px solid transparent; border-radius: 0;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  cursor: pointer;
}
.va-btn-primary, .vb-btn-primary, .vc-btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.va-btn-primary:hover, .vb-btn-primary:hover, .vc-btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: var(--bg); }
.va-btn-ghost, .vb-btn-ghost, .vc-btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.va-btn-ghost:hover, .vb-btn-ghost:hover, .vc-btn-ghost:hover { border-color: var(--ink); }
.va-btn-lg, .vb-btn-lg, .vc-btn-lg { padding: 18px 32px; font-size: 15px; }

/* hide tweaks panel scaling artifact */
.twk-panel { font-family: var(--sans) !important; }
