/* ============================================================
   CleanDeen — Design System
   Earthy, cozy, premium. Forest green + brown + warm neutrals.
   ============================================================ */

:root {
  /* --- Surfaces (warm paper neutrals) --- */
  --paper:        oklch(0.967 0.013 84);   /* page background */
  --paper-2:      oklch(0.945 0.016 82);   /* alt section bg */
  --surface:      oklch(0.992 0.006 86);   /* cards */
  --surface-sunk: oklch(0.955 0.014 83);   /* inset wells */

  /* --- Forest greens (primary) --- */
  --forest-900: oklch(0.30 0.045 155);
  --forest-700: oklch(0.40 0.058 153);
  --forest-600: oklch(0.47 0.067 151);
  --forest-500: oklch(0.55 0.072 149);
  --forest-100: oklch(0.90 0.030 150);
  --forest-50:  oklch(0.95 0.020 150);

  /* --- Browns / clay (secondary) --- */
  --brown-800: oklch(0.36 0.040 60);
  --brown-600: oklch(0.47 0.055 62);
  --clay-500:  oklch(0.62 0.082 58);
  --clay-300:  oklch(0.80 0.055 66);
  --clay-100:  oklch(0.92 0.028 72);

  /* --- Warm accent (terracotta) --- */
  --terra-600: oklch(0.58 0.135 38);
  --terra-400: oklch(0.70 0.115 45);

  /* --- Ink / text --- */
  --ink:       oklch(0.27 0.018 70);
  --ink-soft:  oklch(0.42 0.018 72);
  --ink-mute:  oklch(0.56 0.016 74);
  --ink-faint: oklch(0.68 0.014 76);
  --on-dark:   oklch(0.96 0.014 90);
  --on-dark-soft: oklch(0.86 0.018 95);

  /* --- Lines --- */
  --line:      oklch(0.88 0.014 80);
  --line-soft: oklch(0.92 0.012 82);
  --line-strong: oklch(0.80 0.018 78);

  /* --- Severity (microbe load) — earthy but legible --- */
  --sev-high:   oklch(0.57 0.150 33);   /* rust */
  --sev-med:    oklch(0.71 0.115 72);   /* ochre */
  --sev-low:    oklch(0.66 0.080 130);  /* sage */
  --sev-clean:  oklch(0.52 0.090 152);  /* forest */
  --sev-high-bg: oklch(0.93 0.045 40);
  --sev-med-bg:  oklch(0.94 0.045 80);
  --sev-low-bg:  oklch(0.94 0.035 135);
  --sev-clean-bg:oklch(0.93 0.035 150);

  /* --- Type --- */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --mono:  "Hanken Grotesk", ui-monospace, monospace;

  /* --- Radii --- */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* --- Shadow (soft, warm) --- */
  --sh-sm: 0 1px 2px oklch(0.40 0.03 70 / 0.06), 0 1px 3px oklch(0.40 0.03 70 / 0.05);
  --sh-md: 0 2px 6px oklch(0.40 0.03 70 / 0.07), 0 8px 20px oklch(0.40 0.03 70 / 0.07);
  --sh-lg: 0 8px 24px oklch(0.36 0.03 70 / 0.10), 0 24px 56px oklch(0.36 0.03 70 / 0.12);

  --maxw: 1180px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root { min-height: 100vh; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; margin: 0; line-height: 1.08; letter-spacing: -0.01em; color: var(--forest-900); }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font-family: inherit; font-size: inherit; color: var(--ink); }

.serif { font-family: var(--serif); }
.eyebrow {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brown-600);
}
.muted { color: var(--ink-mute); }

/* ---------- App layout primitives ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; width: 100%; }
.flex { display: flex; }
.col { display: flex; flex-direction: column; }
.center { align-items: center; }
.between { justify-content: space-between; }

/* ---------- Wordmark ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 10px; user-select: none; }
.wordmark .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(150deg, var(--forest-600), var(--forest-900));
  display: grid; place-items: center;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.18);
  position: relative; overflow: hidden;
}
.wordmark .mark::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 18%, oklch(0.78 0.10 145 / 0.55), transparent 60%);
}
.wordmark .mark svg { width: 19px; height: 19px; position: relative; z-index: 1; }
.wordmark .wm-text { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--forest-900); letter-spacing: -0.01em; line-height: 1; }
.wordmark .wm-text .deen { color: var(--clay-500); font-style: italic; }
.wordmark.sm .mark { width: 28px; height: 28px; border-radius: 8px; }
.wordmark.sm .mark svg { width: 16px; height: 16px; }
.wordmark.sm .wm-text { font-size: 18px; }
.wordmark.lg .mark { width: 46px; height: 46px; border-radius: 13px; }
.wordmark.lg .mark svg { width: 26px; height: 26px; }
.wordmark.lg .wm-text { font-size: 28px; }
.wordmark.on-dark .wm-text { color: var(--on-dark); }
.wordmark.on-dark .wm-text .deen { color: var(--clay-300); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid transparent; border-radius: var(--r-pill);
  padding: 11px 21px; font-size: 14.5px; font-weight: 600;
  transition: transform .12s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--forest-700); color: var(--on-dark); box-shadow: var(--sh-sm); }
.btn-primary:hover { background: var(--forest-900); box-shadow: var(--sh-md); }
.btn-ghost { background: transparent; color: var(--forest-900); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface); border-color: var(--forest-600); }
.btn-clay { background: var(--clay-500); color: var(--on-dark); }
.btn-clay:hover { background: var(--brown-600); }
.btn-soft { background: var(--forest-50); color: var(--forest-900); }
.btn-soft:hover { background: var(--forest-100); }
.btn-lg { padding: 14px 26px; font-size: 15.5px; }
.btn-sm { padding: 8px 15px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Cards / chips ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 600; background: var(--forest-50); color: var(--forest-700);
  border: 1px solid var(--forest-100);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.sev-high  { color: var(--sev-high);  background: var(--sev-high-bg);  border-color: transparent; }
.sev-med   { color: oklch(0.50 0.10 70); background: var(--sev-med-bg);  border-color: transparent; }
.sev-low   { color: oklch(0.45 0.07 135); background: var(--sev-low-bg);  border-color: transparent; }
.sev-clean { color: var(--sev-clean); background: var(--sev-clean-bg); border-color: transparent; }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.input, .select, textarea.input {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  padding: 12px 14px; font-size: 14.5px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--forest-600); box-shadow: 0 0 0 3px var(--forest-100);
}

/* ---------- Segmented toggle ---------- */
.seg { display: inline-flex; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px; }
.seg button {
  border: none; background: transparent; padding: 9px 20px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; color: var(--ink-mute); transition: all .18s ease;
}
.seg button.on { background: var(--forest-700); color: var(--on-dark); box-shadow: var(--sh-sm); }

/* ---------- Placeholder media ---------- */
.ph {
  position: relative; overflow: hidden; border-radius: var(--r-md);
  background:
    repeating-linear-gradient(135deg, oklch(0.90 0.02 90) 0 12px, oklch(0.93 0.015 90) 12px 24px);
  display: grid; place-items: center;
}
.ph span {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-mute); background: var(--surface); padding: 5px 11px; border-radius: var(--r-pill);
  border: 1px solid var(--line); box-shadow: var(--sh-sm);
}

/* ---------- scrollbars (subtle) ---------- */
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid var(--paper); }

.fade-in { animation: fadeIn .4s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Faux-3D isometric room
   ============================================================ */
.iso-stage {
  --fw: 340px;   /* floor width  */
  --fd: 300px;   /* floor depth  */
  --wh: 168px;   /* wall height  */
  perspective: 1600px;
  display: grid; place-items: center;
  padding: 40px 10px 20px;
  min-height: 420px;
  position: relative;
  overflow: hidden;
}
.iso-scene {
  position: relative;
  width: var(--fw); height: var(--fd);
  transform-style: preserve-3d;
  transform: rotateX(56deg) rotateZ(-46deg);
  transition: transform .6s cubic-bezier(.4,.05,.2,1);
}
.iso-face { position: absolute; transform-style: preserve-3d; }

/* floor */
.iso-floor {
  left: 0; top: 0; width: var(--fw); height: var(--fd);
  background:
    linear-gradient(oklch(0.93 0.02 88 / 0.6), oklch(0.93 0.02 88 / 0.6)),
    repeating-linear-gradient(0deg, oklch(0.86 0.02 88) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, oklch(0.86 0.02 88) 0 1px, transparent 1px 34px),
    oklch(0.90 0.022 86);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 0 50px oklch(0.50 0.03 70 / 0.10);
}
/* back wall — rises from the floor's top (far-right) edge */
.iso-wall-back {
  left: 0; bottom: 100%; width: var(--fw); height: var(--wh);
  transform-origin: bottom; transform: rotateX(-90deg);
  backface-visibility: visible;
  background:
    repeating-linear-gradient(90deg, oklch(0.92 0.015 86) 0 1px, transparent 1px 38px),
    linear-gradient(oklch(0.955 0.012 86), oklch(0.915 0.016 86));
  border: 1px solid var(--line);
}
/* left wall — rises from the floor's left (far-left) edge */
.iso-wall-left {
  left: 0; top: 0; width: var(--fd); height: var(--wh);
  transform-origin: left top; transform: rotate3d(1, 1, 1, 120deg);
  backface-visibility: visible;
  background:
    repeating-linear-gradient(0deg, oklch(0.88 0.015 86) 0 1px, transparent 1px 38px),
    linear-gradient(oklch(0.925 0.012 86), oklch(0.885 0.016 86));
  border: 1px solid var(--line);
}

/* contamination blobs lie flat on their surface */
.iso-blob {
  position: absolute; border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer; border: none; padding: 0;
  transition: width .55s cubic-bezier(.4,0,.2,1), height .55s cubic-bezier(.4,0,.2,1), filter .2s, box-shadow .2s;
  mix-blend-mode: multiply;
}
.iso-blob::after {
  content: ""; position: absolute; inset: 28%; border-radius: 50%;
}
.iso-blob.sel { box-shadow: 0 0 0 3px oklch(1 0 0 / 0.9), 0 0 0 5px var(--forest-700); }
.iso-blob:hover { filter: brightness(1.04); }
.b-high  { background: radial-gradient(circle, oklch(0.57 0.150 33 / 0.85), oklch(0.57 0.150 33 / 0.12) 70%); }
.b-med   { background: radial-gradient(circle, oklch(0.71 0.130 70 / 0.82), oklch(0.71 0.130 70 / 0.10) 70%); }
.b-low   { background: radial-gradient(circle, oklch(0.66 0.090 130 / 0.7),  oklch(0.66 0.090 130 / 0.08) 70%); }
.b-clean {
  background: oklch(0.52 0.09 152); mix-blend-mode: normal;
  display: grid; place-items: center;
  box-shadow: 0 2px 6px oklch(0.40 0.05 150 / 0.4);
}
.b-clean svg { width: 60%; height: 60%; }

.iso-legend { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 6px; }
.iso-legend .lg { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-soft); font-weight: 500; }
.iso-legend .sw { width: 13px; height: 13px; border-radius: 50%; }
.iso-hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 11.5px; font-weight: 600; color: var(--ink-mute); background: oklch(0.99 0.006 86 / 0.8); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 5px 12px; pointer-events: none; backdrop-filter: blur(4px); }
.iso-hint svg { color: var(--forest-600); }

/* wrap = positioning context for expand button + popover + fullscreen */
.iso-wrap { position: relative; }
.iso-expand {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: oklch(0.99 0.006 86 / 0.85); color: var(--forest-700);
  backdrop-filter: blur(4px); box-shadow: var(--sh-sm); transition: all .15s;
}
.iso-expand:hover { background: var(--forest-50); border-color: var(--forest-500); }

/* fullscreen overlay */
.iso-wrap.is-fs {
  position: fixed; inset: 0; z-index: 200;
  background: radial-gradient(circle at 50% 30%, oklch(0.40 0.05 150), oklch(0.27 0.04 150));
  display: grid; place-items: center;
}
.iso-wrap.is-fs .iso-stage {
  --fw: 520px; --fd: 460px; --wh: 240px;
  min-height: 70vh; width: min(92vw, 900px);
}
.iso-wrap.is-fs .iso-expand {
  top: 24px; right: 24px; width: 42px; height: 42px;
  background: oklch(1 0 0 / 0.12); color: var(--on-dark); border-color: oklch(1 0 0 / 0.25);
}
.iso-wrap.is-fs .iso-expand:hover { background: oklch(1 0 0 / 0.2); }
.iso-wrap.is-fs .iso-hint { background: oklch(1 0 0 / 0.12); color: var(--on-dark); border-color: oklch(1 0 0 / 0.2); }

/* microbe popover (click a red blob) */
.iso-pop {
  position: absolute; left: 16px; bottom: 16px; z-index: 6; max-width: 300px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--sh-lg); padding: 15px 16px 16px;
}
.iso-wrap.is-fs .iso-pop { left: 50%; bottom: 32px; transform: translateX(-50%); max-width: 380px; }
.iso-pop-x { position: absolute; top: 9px; right: 9px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; border: none; background: var(--surface-sunk); color: var(--ink-mute); }
.iso-pop-x:hover { background: var(--sev-high-bg); color: var(--sev-high); }
.iso-pop-top { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; padding-right: 26px; }
.iso-pop-detail { font-size: 12px; color: var(--ink-mute); font-weight: 600; }
.iso-pop-name { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--forest-900); }
.iso-pop-harm { font-size: 13px; color: var(--ink-soft); line-height: 1.55; margin-top: 7px; }
.iso-pop-harm strong { color: var(--brown-600); }

/* ============================================================
   Pricing calculator
   ============================================================ */
.calc-grid { display: grid; grid-template-columns: 1fr 380px; gap: 26px; align-items: start; }
.room-row { display: grid; grid-template-columns: 1fr 130px 38px; gap: 10px; align-items: center; }
.size-input { position: relative; display: flex; align-items: center; }
.size-input .input { padding-right: 42px; }
.size-input span { position: absolute; right: 12px; font-size: 12px; color: var(--ink-mute); pointer-events: none; white-space: nowrap; }
.size-input.flat { background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--r-md); height: 44px; justify-content: center; }
.size-input.flat span { position: static; font-style: italic; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink-mute); transition: all .15s; }
.icon-btn:hover { border-color: var(--sev-high); color: var(--sev-high); background: var(--sev-high-bg); }

.addon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.addon { display: flex; gap: 12px; text-align: left; padding: 13px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); transition: all .15s; align-items: flex-start; }
.addon:hover { border-color: var(--forest-500); }
.addon.on { border-color: var(--forest-600); background: var(--forest-50); }
.addon.hot.on { border-color: var(--clay-500); background: var(--clay-100); }
.addon .check { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; margin-top: 1px; transition: all .15s; }
.addon.on .check { background: var(--forest-600); border-color: var(--forest-600); }
.addon.hot.on .check { background: var(--clay-500); border-color: var(--clay-500); }
.addon .al { font-size: 13.5px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.addon .sig { font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--clay-500); background: var(--clay-100); padding: 2px 6px; border-radius: 99px; }
.addon .ap { font-size: 13px; font-weight: 600; color: var(--forest-700); white-space: nowrap; }
.addon .as { font-size: 12px; color: var(--ink-mute); margin-top: 3px; }

.freq-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.freq { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); text-align: center; transition: all .15s; }
.freq:hover { border-color: var(--forest-500); }
.freq.on { border-color: var(--forest-600); background: var(--forest-50); }
.freq .fl { font-size: 14px; font-weight: 600; color: var(--ink); }
.freq .fn { font-size: 10.5px; color: var(--forest-600); font-weight: 600; line-height: 1.2; }

.estimate-col { position: sticky; top: 88px; }
.estimate-card { padding: 0; overflow: hidden; }
.est-head { background: linear-gradient(155deg, var(--forest-700), var(--forest-900)); color: var(--on-dark); padding: 24px 24px 22px; }
.est-price { font-family: var(--serif); font-size: 46px; font-weight: 600; line-height: 1; margin-top: 8px; }
.est-price span { font-family: var(--sans); font-size: 15px; font-weight: 500; opacity: 0.7; margin-left: 8px; }
.est-save { font-size: 12.5px; margin-top: 10px; color: var(--clay-300); font-weight: 600; }
.est-body { padding: 22px 24px 24px; }
.est-line { display: flex; justify-content: space-between; font-size: 14px; padding: 7px 0; color: var(--ink-soft); }
.est-line.subtle { color: var(--ink-mute); }
.est-line.total { font-weight: 700; color: var(--forest-900); font-size: 16px; }
.est-divider { height: 1px; background: var(--line); margin: 8px 0; }
.plan-preview { margin-top: 18px; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--r-md); padding: 15px; }
.plan-preview ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plan-preview li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-soft); }
.plan-preview li svg { flex: none; color: var(--forest-600); margin-top: 3px; }
.est-note { font-size: 11.5px; color: var(--ink-mute); text-align: center; margin-top: 12px; line-height: 1.4; }
.est-ok { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--forest-700); margin-top: 12px; }
.est-ok svg { color: var(--forest-600); }

/* notes & files */
.file-drop { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); background: var(--surface-sunk); color: var(--ink-soft); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all .15s; }
.file-drop:hover { border-color: var(--forest-500); color: var(--forest-700); background: var(--forest-50); }
.file-drop svg { color: var(--clay-500); flex: none; }
.file-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.file-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 8px 6px 11px; border-radius: var(--r-pill); background: var(--forest-50); border: 1px solid var(--forest-100); font-size: 12.5px; font-weight: 600; color: var(--forest-700); }
.file-chip svg { color: var(--forest-600); }
.file-chip button { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: none; background: oklch(1 0 0 / 0.5); color: var(--ink-mute); }
.file-chip button:hover { background: var(--sev-high-bg); color: var(--sev-high); }

@media (max-width: 920px) {
  .calc-grid { grid-template-columns: 1fr; }
  .estimate-col { position: static; }
  .addon-grid { grid-template-columns: 1fr; }
  .freq-grid { grid-template-columns: 1fr 1fr; }
}

