/* REMODEL — design tokens + shared components
   Editorial / architectural: warm paper, ink, one savings green, construction-document details. */
:root {
  --paper: #f4f1ea;
  --paper-2: #ebe6da;
  --card: #fbfaf6;
  --ink: #16150f;
  --ink-2: #3f3c35;
  --muted: #7d786c;
  --faint: #a9a395;
  --line: #dcd5c6;
  --line-2: #c9c1ae;
  --save: #17643f;
  --save-2: #1f8a55;
  --save-bg: #e2ece3;
  --save-ink: #0e3d26;
  --warn: #a8461f;
  --warn-bg: #f3e1d6;
  --amber: #946200;
  --amber-bg: #f3e8cf;
  --blue: #2b4a69;
  --blue-bg: #dfe6ec;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r: 14px;
  --r-sm: 9px;
  --shadow: 0 1px 0 rgba(22, 21, 15, .04), 0 10px 30px -18px rgba(22, 21, 15, .25);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15px/1.5 var(--sans); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--save-bg); color: var(--save-ink); }

.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); font-feature-settings: 'tnum'; letter-spacing: 0; }
.num { font-feature-settings: 'tnum'; }
.eyebrow { font: 500 11px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.save-c { color: var(--save); }
.warn-c { color: var(--warn); }
.hidden, [hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper); font-weight: 500; font-size: 14px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--ease), background .15s, color .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.save { background: var(--save); border-color: var(--save); color: #fff; }
.btn.warn { background: transparent; color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 52px; padding: 0 26px; font-size: 15px; letter-spacing: .02em; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); cursor: pointer; font-size: inherit; }
.link:hover { text-decoration-color: var(--ink); }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h3, .h3 { margin: 0; font: 500 15px/1.3 var(--sans); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.chip.save { background: var(--save-bg); color: var(--save-ink); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.blue { background: var(--blue-bg); color: var(--blue); }
.chip.ink { background: var(--ink); color: var(--paper); }
.chip.outline { background: transparent; border: 1px solid var(--line-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Savings type labels — never combined misleadingly */
.st-confirmed { background: var(--save-bg); color: var(--save-ink); }
.st-avoided { background: #e4ecdf; color: #2c5a1e; }
.st-projected { background: var(--blue-bg); color: var(--blue); }
.st-potential { background: var(--amber-bg); color: var(--amber); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 500 11px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table tfoot td { border-top: 1px solid var(--ink); font-weight: 600; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Bars */
.bar { height: 8px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--ink); border-radius: inherit; transition: width .8s var(--ease); }
.bar.save > span { background: var(--save-2); }

/* Forms */
.field { display: grid; gap: 6px; }
.field label { font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.input, textarea.input {
  width: 100%; border: 1px solid var(--line-2); background: var(--card); border-radius: 12px;
  padding: 12px 14px; font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(22, 21, 15, .06); }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.5; }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 14px/1 var(--mono); letter-spacing: .28em; }
.logo-mark { width: 22px; height: 22px; }

/* Toast */
.toast-wrap { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 999px; font-size: 14px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.4); animation: toast-in .35s var(--ease); display: flex; gap: 10px; align-items: center; }
.toast b { color: #8fe0b2; font-weight: 600; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---- Time-lapse render ---- */
.timelapse { position: relative; border-radius: 22px; overflow: hidden; background: var(--paper-2); border: 1px solid var(--line); box-shadow: var(--shadow); }
.timelapse svg { width: 100%; height: auto; display: block; }
.tl-hud { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px; pointer-events: none; }
.tl-hud-l, .tl-hud-r { display: grid; gap: 3px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.tl-hud-r { grid-template-columns: auto auto; column-gap: 10px; align-items: baseline; }
.tl-live { display: inline-flex; align-items: center; gap: 6px; font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--warn); }
.tl-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); animation: tl-blink 1s infinite; }
@keyframes tl-blink { 50% { opacity: .25; } }
.tl-week { font-size: 15px; font-weight: 600; }
.tl-stage { font-size: 13px; color: var(--ink-2); }
.tl-cost { font-size: 15px; }
.tl-save { font-size: 15px; color: var(--save); font-weight: 600; }
.tl-bar { position: relative; height: 4px; background: var(--line); }
.tl-bar span { position: absolute; inset: 0 auto 0 0; background: var(--save-2); }
.tl-bar em { position: absolute; top: -3px; width: 2px; height: 10px; background: var(--ink); opacity: .35; }
.tl-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--card); font-size: 12px; color: var(--muted); }
.tl-btn { border: 1px solid var(--line-2); background: var(--paper); border-radius: 99px; padding: 5px 12px; font-size: 12px; cursor: pointer; }
.tl-note { font: 600 13px var(--mono); letter-spacing: .1em; fill: var(--warn); }
.tl-note.light { fill: #fff; font-size: 12px; }
.tl-banner-t { font: 600 20px var(--sans); fill: #8fe0b2; }
.tl-g, .tl-banner { opacity: 0; transition: opacity .45s var(--ease); }
.tl-g.on, .tl-banner.on { opacity: 1; }
.tl-before:not(.on) { transition-duration: .25s; }
.tl-g * { transform-box: fill-box; transform-origin: center; }
.tl-g.now .tl-drop { animation: tl-drop .55s cubic-bezier(.2,1.4,.4,1) var(--d, 0s) both; }
@keyframes tl-drop { from { transform: translateY(-120px); opacity: 0; } }
.tl-g.now .tl-draw { stroke-dasharray: 1; animation: tl-draw 1.1s var(--ease) both; }
@keyframes tl-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.tl-g.now .tl-pop { animation: tl-pop .4s cubic-bezier(.2,1.6,.4,1) .6s both; }
@keyframes tl-pop { from { transform: scale(0); } }
.tl-g.now .tl-panel { animation: tl-panel .6s var(--ease) both; transform-origin: left center; }
@keyframes tl-panel { from { transform: scaleX(0); } }
.tl-g.now .tl-wipe { animation: tl-panel .9s var(--ease) both; transform-origin: left center; }
.tl-g.now .tl-slide { animation: tl-slide .6s var(--ease) var(--d, .2s) both; }
@keyframes tl-slide { from { transform: translateX(-900px); } }
.tl-demo.on .tl-dust { animation: tl-dust 1.2s ease-out infinite; transform-origin: center; }
@keyframes tl-dust { 0% { transform: scale(.2); opacity: .9; } 100% { transform: scale(1.8) translateY(-30px); opacity: 0; } }
.tl-finish.on .tl-glow { animation: tl-glow 2.4s ease-in-out infinite; }
@keyframes tl-glow { 50% { opacity: .55; } }
.tl-finish.on .tl-spark { animation: tl-spark 1.4s ease-in-out infinite; }
@keyframes tl-spark { 0%, 100% { opacity: 0; transform: scale(.3); } 50% { opacity: 1; transform: scale(1.2) rotate(45deg); } }
.tl-trail rect { transition: none; }
@media (max-width: 640px) {
  .tl-hud { padding: 8px; }
  .tl-hud-l, .tl-hud-r { padding: 6px 8px; }
  .tl-week, .tl-cost, .tl-save { font-size: 12px; }
  .tl-stage { font-size: 11px; }
  .tl-hud-r .eyebrow { font-size: 9px; }
}
