/* Rodaki design tokens.
   Palette origins:
   - clay      #C9553D  paint on courtyard swings and benches
   - moss      #4A7C59  park greenery / "verified" signal
   - paper     #FAF7F2  recycled paper of a school notebook
   - ink       #1F1B17  warm near-black, never pure #000
   Neutrals are warm-shifted (hue ~30) to match the paper base. */

:root {
  color-scheme: light;

  /* Base surfaces */
  --paper: #faf7f2;
  --paper-2: #f3eee6;
  --paper-3: #ebe4d9;
  --surface: #ffffff;
  --ink: #1f1b17;
  --ink-2: #524a41;
  --ink-3: #8a7f72;
  --hairline: #e2d9cc;
  --hairline-strong: #cfc3b2;

  /* Accents */
  --clay: #c9553d;
  --clay-soft: #f6e5e0;
  --clay-deep: #a03f2b;
  --moss: #4a7c59;
  --moss-soft: #e4eee6;
  --sky: #3d6b8f;
  --sky-soft: #e3ebf2;
  --amber: #b4802a;
  --amber-soft: #f5ecd9;

  /* Type */
  --font-sans: 'Onest', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.25rem, 1.15rem + 0.4vw, 1.45rem);
  --text-2xl: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --text-3xl: clamp(1.9rem, 1.5rem + 1.8vw, 2.9rem);
  --text-4xl: clamp(2.3rem, 1.6rem + 3.2vw, 4.2rem);

  /* Radii — small and honest, this is not a toy app */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --page: 1120px;
  --gutter: 20px;
}

@media (min-width: 768px) {
  :root { --gutter: 32px; }
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* Shared atoms ------------------------------------------------ */

.mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: var(--text-xs);
  line-height: 1.5;
  white-space: nowrap;
  background: var(--paper-2);
  color: var(--ink-2);
  border: 1px solid var(--hairline);
}
.tag--moss { background: var(--moss-soft); color: #2f5a3d; border-color: #c7dbcd; }
.tag--clay { background: var(--clay-soft); color: var(--clay-deep); border-color: #ecccc3; }
.tag--sky  { background: var(--sky-soft); color: #2c516d; border-color: #c8d8e5; }
.tag--amber{ background: var(--amber-soft); color: #8a601a; border-color: #e6d5ae; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s var(--ease-out), background 0.18s var(--ease-soft);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--clay { background: var(--clay); color: #fff; }
.btn--clay:hover { background: var(--clay-deep); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--hairline-strong); }
.btn--ghost:hover { background: var(--paper-2); }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 14px; font-size: var(--text-xs); }

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
}

.hr { height: 1px; background: var(--hairline); border: 0; margin: 0; }

.avatar {
  border-radius: var(--r-pill);
  background: var(--paper-3);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--ink-2);
  flex: none;
  overflow: hidden;
}

/* The signature motif: distance stamp + match line */
.stamp {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--ink-3);
  white-space: nowrap;
}
.match {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--ink-2);
}
.match::before {
  content: '';
  width: 14px;
  height: 1px;
  background: var(--clay);
  flex: none;
  transform: translateY(-4px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
