/* Molara — shared design tokens + base styles */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400..700;1,400..700&family=Inter+Tight:wght@300..700&family=JetBrains+Mono:wght@300;400;500&display=swap');

:root {
  /* Palette — medical blue + paper white */
  --ink:        oklch(22% 0.02 240);
  --ink-2:      oklch(38% 0.02 240);
  --ink-3:      oklch(52% 0.02 240);
  --ink-4:      oklch(68% 0.015 240);
  --line:       oklch(90% 0.01 240);
  --line-2:     oklch(94% 0.008 240);
  --paper:      oklch(98.8% 0.004 240);
  --paper-2:    oklch(96.5% 0.006 240);
  --white:      #ffffff;

  --blue:       oklch(55% 0.14 240);
  --blue-deep:  oklch(42% 0.14 245);
  --blue-soft:  oklch(92% 0.03 240);
  --blue-tint:  oklch(96% 0.015 240);

  --accent:     oklch(72% 0.13 165);     /* mint — success / availability */
  --warn:       oklch(70% 0.14 60);      /* amber — caution */
  --danger:     oklch(58% 0.17 25);      /* coral — errors / hangup */

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow-1:  0 1px 2px rgba(14,20,40,.04), 0 1px 3px rgba(14,20,40,.04);
  --shadow-2:  0 4px 16px rgba(14,20,40,.06), 0 1px 3px rgba(14,20,40,.04);
  --shadow-3:  0 14px 40px rgba(14,20,40,.08), 0 2px 6px rgba(14,20,40,.04);

  --sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --display: 'Instrument Sans', 'Inter Tight', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

/* Wrap every artboard in .ml-root so global styles don't bleed into
   design-canvas chrome. */
.ml-root {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  line-height: 1.45;
  height: 100%;
  box-sizing: border-box;
}
.ml-root *, .ml-root *::before, .ml-root *::after { box-sizing: border-box; }

.ml-root button,
.ml-root a,
.site-nav button {
  -webkit-tap-highlight-color: transparent;
}

.ml-root h1, .ml-root h2, .ml-root h3, .ml-root h4 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0;
}

/* Photography placeholder — subtle diagonal stripes, monospace caption */
.ml-photo {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      oklch(88% 0.02 240) 0 1px,
      transparent 1px 12px),
    linear-gradient(180deg, oklch(92% 0.02 240), oklch(86% 0.03 240));
  color: oklch(42% 0.04 240);
  overflow: hidden;
}
.ml-photo::after {
  content: attr(data-caption);
  position: absolute; left: 10px; bottom: 8px;
  font-family: var(--mono);
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.08em;
  color: oklch(34% 0.03 240);
  opacity: 0.7;
}

/* Tiny stripe used as initial/avatar background */
.ml-avatar {
  background:
    repeating-linear-gradient(45deg,
      oklch(85% 0.04 240) 0 2px,
      oklch(88% 0.03 240) 2px 6px);
  color: oklch(30% 0.04 240);
  font-weight: 500;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-family: var(--display);
}

/* Buttons */
.ml-btn {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.005em;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .12s, background .12s, box-shadow .15s, border-color .12s;
  white-space: nowrap;
}
.ml-btn:active { transform: translateY(1px); }
.ml-btn:disabled,
.ml-root button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}
.ml-btn--primary { background: var(--blue); color: #fff; }
.ml-btn--primary:hover { background: var(--blue-deep); }
.ml-btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.ml-btn--ghost:hover { background: var(--paper-2); }
.ml-btn--link { background: transparent; color: var(--blue); padding: 0; border-radius: 0; }
.ml-btn--dark { background: var(--ink); color: #fff; }
.ml-btn--dark:hover { background: #000; }

/* Pill */
.ml-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: var(--sans);
  font-weight: 500;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  letter-spacing: 0.01em;
}
.ml-pill--mono { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.ml-pill--mint { background: oklch(94% 0.06 165); color: oklch(35% 0.12 165); }
.ml-pill--ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }

/* Card */
.ml-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}

/* Divider */
.ml-hr { height: 1px; background: var(--line); border: none; margin: 0; }

/* Live dot */
.ml-live {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px oklch(92% 0.07 165);
}

/* Focus ring */
.ml-root input:focus, .ml-root select:focus, .ml-root textarea:focus {
  outline: none;
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 3px oklch(92% 0.05 240);
}
.ml-root button:focus-visible,
.ml-root a:focus-visible,
.site-nav button:focus-visible,
.ml-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Inputs */
.ml-input {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
}
.ml-input::placeholder { color: var(--ink-4); }

/* Section label — tiny mono uppercase */
.ml-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Utility */
.ml-muted { color: var(--ink-3); }
.ml-quiet { color: var(--ink-4); }

/* Toggle strip used for copy-tone */
.ml-tonestrip {
  display: inline-flex;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  font-size: 12px;
}
.ml-tonestrip button {
  border: none; background: transparent;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
}
.ml-tonestrip button.active {
  background: var(--ink);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .ml-root *,
  .site-nav *,
  .tweaks * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
