/* ========================================
   base.css — Jottit tokens, reset, classless elements, utilities
   ======================================== */

/* ── 1. Reset ────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-5);
}

h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

p {
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

textarea {
  resize: none;
}

a {
  color: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ── 2. Tokens ───────────────────────── */
:root {
  /* Brand */
  --brand-1: #117a65;
  --brand-2: #28b463;
  --brand-3: #82e0aa;

  /* Status */
  --success: #2ecc71;
  --error: #e74c3c;

  /* Colors – light */
  --bg: #fff;
  --text: #444;
  --text-muted: #999;
  --text-bright: #111;
  --divider: #ddd;
  --code-bg: #f5f5f5;
  --input-bg: #eee;
  --card-bg: #f7f7f8;

  /* Font families */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;

  /* Font sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.85rem;
  --text-base: 1rem;
  --text-lg: 1.1rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;

  /* Font weights */
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-bold: 600;

  /* Line heights */
  --leading-tight: 1.3;
  --leading-normal: 1.6;
  --leading-loose: 1.8;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3rem;
  --space-9: 4rem;
  --space-10: 6rem;

  /* Layout */
  --measure: 50rem;
  --measure-narrow: 35rem;

  /* Border radius */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --radius-full: 50%;

  /* Transitions */
  --speed-fast: 100ms;
  --speed-normal: 200ms;

  /* Site-specific (always dark) */
  --site-bg: #333840;
  --site-text: #ccc;
  --site-text-muted: #777;
  --site-text-bright: #eee;
  --site-divider: #222;
  --site-code-bg: #1a1a1a;
  --site-font: var(--font-sans);
  --site-font-header: var(--font-sans);
  --site-accent: #eee;
  --site-font-size: var(--text-base);
  --site-leading: var(--leading-normal);
  --site-measure: 40rem;
  --editor-measure: 700px;
  --content-width: 60rem;
}

@media (max-width: 640px) {
  :root {
    --text-2xl: 1.35rem;
    --text-3xl: 1.75rem;
  }
}

/* Breakpoints (used in media queries) */
/* --bp-sm: 640px */
/* --bp-md: 864px */
/* --bp-lg: 1152px */

/* ── 3. Form elements ────────────────── */
label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-bright);
  margin-bottom: var(--space-2);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-bright);
  background: var(--input-bg);
  border: 1px solid var(--divider);
  border-radius: var(--radius-pill);
  transition: border-color var(--speed-fast);
}

input[type].input--sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

textarea {
  border-radius: var(--radius-md);
}

select {
  appearance: none;
  cursor: pointer;
  padding-right: var(--space-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 3l2 2H4L6 3zm0 6L4 7h4L6 9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  background-size: 16px 16px;
}

@media (forced-colors: active) {
  select {
    background-image: none;
  }
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--text-muted);
}

button,
input[type="submit"] {
  border: none;
  background: none;
  cursor: pointer;
}

/* ── 4. Utilities ────────────────────── */
.hidden {
  display: none !important;
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-8 {
  margin-bottom: var(--space-8);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-6 {
  margin-top: var(--space-6);
}

.ml-auto {
  margin-left: auto;
}

.text-muted {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.pl-5 {
  padding-left: var(--space-5);
}

.ph-2 {
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

.text-center {
  text-align: center;
}

.actions {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
}
