/* ==========================================================================
   Munich Immo Reality Check — Design Tokens
   Town.com Editorial Paper Surfaces + Stitch Deep Forest Intelligence
   ========================================================================== */

:root {
  /* === Surfaces (Town Primitive Palette: Milk / Concrete / Pure Card) === */
  --bg-canvas: #fdfdfc;
  --bg-subtle: #f7f8f4;
  --bg-card: #ffffff;
  --bg-wash: rgba(28, 27, 27, 0.026);
  --bg-wash-strong: rgba(28, 27, 27, 0.055);
  --bg-header-glass: rgba(253, 253, 252, 0.88);

  /* === Ink (Town Espresso Charcoal — never pure #000) === */
  --ink-primary: #1c1b1b;
  --ink-secondary: rgba(28, 27, 27, 0.72);
  --ink-tertiary: rgba(28, 27, 27, 0.54);
  --ink-muted: rgba(28, 27, 27, 0.36);
  --ink-reversed: rgba(255, 255, 255, 0.96);
  --ink-reversed-soft: rgba(255, 255, 255, 0.76);

  /* === Hairline Borders === */
  --border-hairline: rgba(28, 27, 27, 0.09);
  --border-default: rgba(28, 27, 27, 0.15);
  --border-strong: rgba(28, 27, 27, 0.28);
  --border-ink: #1c1b1b;

  /* === Botanical & Mineral Accents === */
  --accent-emerald: #047857;
  --accent-forest: #1b4332;
  --accent-forest-midnight: #012d1d;
  --accent-lake: #509578;
  --accent-forest-deep: #145c2b;
  --accent-forest-soft: #eafaf2;
  --accent-forest-border: rgba(4, 120, 87, 0.24);

  --accent-sun: #d95b31;
  --accent-sun-deep: #912b00;
  --accent-sun-soft: #fcf3f0;
  --accent-sun-border: rgba(217, 91, 49, 0.28);

  --accent-ochre: #b88022;
  --accent-ochre-deep: #78500b;
  --accent-ochre-soft: #fdf7e2;
  --accent-ochre-border: rgba(184, 128, 34, 0.30);

  --accent-red: #df3232;
  --accent-red-deep: #9f1b1b;
  --accent-red-soft: #fdf2f2;
  --accent-red-border: rgba(223, 50, 50, 0.26);

  --accent-rain: #1375a0;
  --accent-rain-muted: #4e9ba2;
  --accent-rain-deep: #0e5473;
  --accent-rain-soft: #eaf6fa;
  --accent-rain-border: rgba(19, 117, 160, 0.24);

  --accent-lichen: #69751d;
  --accent-lichen-soft: #f2f7dc;

  /* === Typography === */
  --font-display: 'Bitter', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* === Type Scale (Minimum 12px micro labels) === */
  --text-display-1: clamp(2rem, 3.2vw, 2.9rem);
  --text-display-2: clamp(1.45rem, 2.1vw, 1.95rem);
  --text-heading-3: 1.25rem;
  --text-heading-4: 1.0625rem;
  --text-body-lg: 1.0625rem;
  --text-body: 1rem;
  --text-card: 0.9375rem;
  --text-sm: 0.875rem;
  --text-xs: 0.75rem;

  /* === Squircle Radii === */
  --radius-xs: 5px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* === Town Hairline Elevation === */
  --shadow-outline: 0 0 0 1px rgba(26, 25, 26, 0.06);
  --shadow-sm: 0 0 0 1px rgba(26, 25, 26, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04), 0 0 1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 0 0 1px rgba(26, 25, 26, 0.08), 0 3px 10px rgba(0, 0, 0, 0.06), 0 0 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 0 0 1px rgba(26, 25, 26, 0.09), 0 8px 24px rgba(0, 0, 0, 0.10);

  /* === Layout & Motion === */
  --sidebar-width: 286px;
  --container-max: 1220px;
  --gutter: 32px;
  --section-gap: 44px;
  --card-pad: 26px;
  --navbar-height: 64px;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-base: 220ms;
}

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

html {
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  font-size: var(--text-body);
  line-height: 1.6;
  overflow-x: clip;
}

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

:focus-visible {
  outline: 2px solid var(--accent-forest);
  outline-offset: 2px;
}

.tabular-nums {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.065em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  line-height: 1.35;
}

/* === Buttons (Town Inversion Tactility) === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.56rem 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-forest);
  background: var(--accent-forest);
  color: var(--ink-reversed);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard);
}

.btn-primary:hover {
  background: var(--bg-card);
  color: var(--accent-forest);
  border-color: var(--accent-forest);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.56rem 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-card);
  color: var(--ink-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--ink-primary);
}

.btn-secondary.is-active {
  background: var(--accent-forest-soft);
  border-color: var(--accent-forest-border);
  color: var(--accent-forest-deep);
}

.btn-compact {
  padding: 0.42rem 0.82rem;
  font-size: var(--text-sm);
}

.btn-icon {
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-card);
  color: var(--ink-secondary);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all var(--dur-fast) var(--ease-standard);
}

.btn-icon:hover {
  border-color: var(--ink-primary);
  color: var(--ink-primary);
  background: var(--bg-subtle);
}

.btn-icon.is-starred {
  color: var(--accent-ochre);
  background: var(--accent-ochre-soft);
  border-color: var(--accent-ochre-border);
}

/* === Semantic Pills & Dots === */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.62rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.25;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill--forest { background: var(--accent-forest-soft); color: var(--accent-forest-deep); border-color: var(--accent-forest-border); }
.pill--ochre  { background: var(--accent-ochre-soft);  color: var(--accent-ochre-deep);  border-color: var(--accent-ochre-border); }
.pill--sun    { background: var(--accent-sun-soft);    color: var(--accent-sun-deep);    border-color: var(--accent-sun-border); }
.pill--red    { background: var(--accent-red-soft);    color: var(--accent-red-deep);    border-color: var(--accent-red-border); }
.pill--rain   { background: var(--accent-rain-soft);   color: var(--accent-rain-deep);   border-color: var(--accent-rain-border); }
.pill--stone  { background: var(--bg-subtle);          color: var(--ink-secondary);      border-color: var(--border-default); }
.pill--dashed { background: var(--bg-subtle);          color: var(--ink-secondary);      border: 1px dashed var(--border-strong); }
.pill--dark   { background: var(--accent-forest-midnight); color: var(--ink-reversed);   border-color: var(--accent-forest-midnight); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot--forest { background: var(--accent-emerald); }
.dot--ochre  { background: var(--accent-ochre); }
.dot--sun    { background: var(--accent-sun); }
.dot--red    { background: var(--accent-red); }
.dot--rain   { background: var(--accent-rain); }
.dot--stone  { background: var(--ink-tertiary); }

.reno-spread-hatch {
  background-image: repeating-linear-gradient(
    -45deg,
    #d95b31,
    #d95b31 6px,
    #ea8967 6px,
    #ea8967 12px
  );
}

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