/* Meeting Cost Meter — "The Burn". Reactive heat + ember field + odometer.
 * Friendly One Page Toys system, self-contained, theme-aware (light/dark). */

@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap");

:root{
  --font-display: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ink: #211f1d;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f4f2ed;
  --muted: #756f68;
  --line: #ece7df;
  --line-strong: #d9d2c6;
  --accent: #0d9488;
  --accent-hover: #0b7d73;
  --accent-soft: rgba(13, 148, 136, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow: 0 2px 8px rgba(33, 31, 29, 0.06);
  --shadow-md: 0 8px 22px rgba(33, 31, 29, 0.09);
  --shadow-lg: 0 16px 40px rgba(33, 31, 29, 0.12);

  /* odometer heat gradient (red → white-hot, no orange) */
  --hot-1: #c7f5ee;
  --hot-2: #14b8a6;
  --hot-3: #0a7267;
  --heat: 0;
  --glass: rgba(255, 255, 255, 0.72);
}

/* Cool blue-charcoal + warm cream — inspired by synergyprod.com. */
:root[data-theme="dark"]{
  --ink: #e8e2d9;
  --bg: #14171f;
  --surface: #1b1f29;
  --surface-2: #232839;
  --muted: #9a9183;
  --line: #282d39;
  --line-strong: #3a4150;
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-soft: rgba(45, 212, 191, 0.18);
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 10px 30px -6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 48px -10px rgba(0, 0, 0, 0.6);
  --hot-1: #d6fff8;
  --hot-2: #2dd4bf;
  --hot-3: #0d9488;
  --glass: rgba(27, 31, 41, 0.62);
}

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

html, body{ height: 100%; }

body{
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Reactive background ---------- */
.embers{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.heat{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 48% at 50% 34%, rgba(20, 184, 166, calc(0.08 + var(--heat) * 0.32)), transparent 70%),
    radial-gradient(90% 60% at 50% 118%, rgba(13, 148, 136, calc(0.10 + var(--heat) * 0.40)), transparent 72%);
  transition: background 500ms linear;
}

/* ---------- Top bar ---------- */
.topbar{
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px clamp(16px, 4vw, 30px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark{
  width: 1.1em;
  height: 1.1em;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: linear-gradient(90deg, var(--ink) 0 50%, var(--surface) 50% 100%);
}

.topbar__right{ display: inline-flex; align-items: center; gap: 14px; }

.topbar__tag{
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.iconbtn{
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  font-size: 1rem;
  line-height: 1;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.iconbtn:hover{ transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--ink); }
.iconbtn:focus-visible{ outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 5px var(--accent-soft); }
.theme-toggle__sun, .theme-toggle__moon, .theme-toggle__auto{ display: none; }
:root[data-theme-mode="system"] .theme-toggle__auto{ display: inline; }
:root[data-theme-mode="light"] .theme-toggle__sun{ display: inline; }
:root[data-theme-mode="dark"] .theme-toggle__moon{ display: inline; }

/* ---------- Stage ---------- */
.stage{
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: clamp(24px, 5vw, 56px) 20px clamp(56px, 7vw, 84px);
}

.meter{ width: 100%; max-width: 660px; text-align: center; }

.meter__title{
  display: block;
  width: 100%;
  margin: 0 auto 26px;
  border: 0;
  border-bottom: 2px dashed transparent;
  background: transparent;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-align: center;
  outline: none;
  transition: border-color 140ms ease;
}
.meter__title:hover{ border-bottom-color: var(--line-strong); }
.meter__title:focus{ border-bottom-color: var(--accent); }

.meter__eyebrow{
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Odometer ---------- */
.odo{
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3.4rem, 16vw, 8rem);
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  filter: drop-shadow(0 6px 26px rgba(20, 184, 166, calc(0.22 + var(--heat) * 0.5)));
  transition: filter 400ms linear;
  user-select: none;
}

/* Red → white-hot gradient applied per glyph (clip-to-text needs to live on the
 * element that directly contains the text, not the flex container). */
.odo__digit,
.odo__sym{
  background: linear-gradient(176deg, var(--hot-1) 0%, var(--hot-2) 48%, var(--hot-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.odo__reel{
  display: inline-block;
  height: 1em;
  overflow: hidden;
  vertical-align: bottom;
}

.odo__strip{
  display: flex;
  flex-direction: column;
  transition: transform 240ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.odo__digit{
  height: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.odo__sym{ display: inline-block; line-height: 1; }

.meter__compare{
  margin: 14px 0 0;
  min-height: 1.4em;
  font-size: 0.98rem;
  color: var(--muted);
}
.meter__compare strong{ color: var(--ink); font-weight: 700; }

/* ---------- Console (glassy control panel) ---------- */
.console{
  margin-top: 30px;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: var(--shadow-lg);
}

.controls{
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-bottom: 14px;
}

.field{ flex: 1 1 200px; max-width: 280px; text-align: left; }

.field__label{
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.field__box{
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  overflow: hidden;
}
.field__box:focus-within{ border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.step{
  flex: 0 0 auto;
  width: 44px;
  border: 0;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.step:hover{ background: var(--accent); color: #fff; }

.field__input{
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 12px 8px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  color: var(--ink);
  outline: none;
  font-variant-numeric: tabular-nums;
}
.field__input::-webkit-outer-spin-button,
.field__input::-webkit-inner-spin-button{ -webkit-appearance: none; margin: 0; }
.field__input[type="number"]{ -moz-appearance: textfield; }

.presets{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 22px;
}

.preset{
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.preset:hover{ background: var(--surface-2); }
.preset[aria-pressed="true"]{ background: var(--accent); border-color: var(--accent); color: #fff; }

.actions{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.btn{
  appearance: none;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}
.btn:hover{ transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active{ transform: translateY(0); box-shadow: var(--shadow); }
.btn:focus-visible{ outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 5px var(--accent-soft), var(--shadow); }

.btn--primary{
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-size: 1.05rem;
  padding: 16px 34px;
  box-shadow: 0 8px 26px -6px var(--accent);
}
.btn--primary:hover{ background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--running{ background: var(--ink); border-color: var(--ink); color: var(--bg); box-shadow: var(--shadow-md); }

.btn--ghost{ border-color: var(--line-strong); color: var(--muted); box-shadow: none; }
.btn--ghost:hover{ color: var(--ink); border-color: var(--ink); box-shadow: var(--shadow); }

.stats{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.stat{ display: flex; flex-direction: column; gap: 4px; min-width: 96px; }
.stat__label{
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat__value{
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.meter__status{
  margin: 18px 0 0;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.backlink{
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}
.backlink:hover{ color: var(--ink); border-bottom-color: var(--accent); }

@media (prefers-reduced-motion: reduce){
  .odo__strip{ transition: none; }
  .iconbtn, .btn, .step{ transition: none; }
}

.sub{ margin:14px 0 0; min-height:1.4em; font-size:0.98rem; color:var(--muted); }
.sub strong{ color:var(--ink); font-weight:700; }

/* ---------- H/M/S live grid ---------- */
.numgrid{ display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:4px 0 2px; }
.numcard{ container-type:inline-size; overflow:hidden; padding:16px 10px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); box-shadow:var(--shadow); text-align:center; }
.numcard__val{ font-family:var(--font-display); font-weight:900; font-size:clamp(1.4rem,15cqw,2.1rem); letter-spacing:-0.02em; color:var(--ink); font-variant-numeric:tabular-nums; line-height:1; white-space:nowrap; }
.numcard__label{ margin-top:8px; font-family:var(--font-display); font-size:0.6rem; font-weight:700; letter-spacing:0.12em; text-transform:uppercase; color:var(--muted); }

/* preset event chips reuse .presets/.preset from the base */
.field--plain .field__box{ padding:4px 10px; }

/* ---------- Custom date + time picker (native datetime-local can't be themed —
 * dark calendar icon + unthemeable OS popup) ---------- */
.dtpick{ position:relative; }
.dtpick__row{ align-items:stretch; padding:0; }
.dtpick__trigger{
  flex:1 1 auto; min-width:0;
  display:inline-flex; align-items:center; justify-content:center; gap:9px;
  padding:12px 10px; border:0; background:transparent; cursor:pointer;
  font-family:var(--font-display); font-size:1.05rem; font-weight:800; color:var(--ink);
  font-variant-numeric:tabular-nums; letter-spacing:-0.01em;
}
.dtpick__trigger:focus-visible{ outline:none; }
.dtpick__ico{ flex:0 0 auto; color:var(--accent); opacity:0.92; }
.dtpick__value{ line-height:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.dtpop{
  position:absolute; z-index:30; top:calc(100% + 8px); left:50%; transform:translateX(-50%);
  width:min(340px, 92vw); display:flex; flex-direction:column; gap:10px; padding:12px;
  border:1.5px solid var(--line-strong); border-radius:var(--radius-sm);
  background:var(--surface); box-shadow:var(--shadow-lg);
}
.dtpop[hidden]{ display:none; }   /* author display:flex would otherwise beat the UA [hidden] rule */

/* calendar */
.dtcal__head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.dtcal__title{ font-family:var(--font-display); font-weight:800; font-size:0.98rem; color:var(--ink); }
.dtnav{
  width:32px; height:32px; border:1.5px solid var(--line-strong); border-radius:var(--radius-pill);
  background:var(--surface); color:var(--ink); font-size:1.1rem; line-height:1; cursor:pointer;
  transition:background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.dtnav:hover{ background:var(--accent); border-color:var(--accent); color:#fff; }
.dtcal__dow{ display:grid; grid-template-columns:repeat(7,1fr); gap:2px; margin-bottom:4px; }
.dtcal__dow span{ text-align:center; font-family:var(--font-display); font-size:0.62rem; font-weight:700; letter-spacing:0.04em; color:var(--muted); }
.dtcal__grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.dtday{
  aspect-ratio:1/1; display:flex; align-items:center; justify-content:center;
  border:0; border-radius:8px; background:transparent; cursor:pointer;
  font-family:var(--font-display); font-size:0.86rem; font-weight:700; color:var(--ink);
  font-variant-numeric:tabular-nums; transition:background 110ms ease, color 110ms ease;
}
.dtday:hover{ background:var(--surface-2); }
.dtday--muted{ color:var(--muted); opacity:0.5; }
.dtday--today{ box-shadow:inset 0 0 0 1.5px var(--line-strong); }
.dtday[aria-selected="true"]{ background:var(--accent); color:#fff; }
.dtday:focus-visible{ outline:none; box-shadow:0 0 0 2px var(--accent-soft); }

/* time columns */
.dttime{ display:flex; gap:6px; padding-top:10px; border-top:1px solid var(--line); }
.timecol{
  flex:1 1 0; display:flex; flex-direction:column; gap:2px;
  max-height:132px; overflow-y:auto; scroll-behavior:smooth;
  scrollbar-width:thin; scrollbar-color:var(--line-strong) transparent;
}
.timecol::-webkit-scrollbar{ width:8px; }
.timecol::-webkit-scrollbar-thumb{ background:var(--line-strong); border-radius:8px; border:2px solid var(--surface); }
.timecol::-webkit-scrollbar-track{ background:transparent; }
.timecol--ap{ flex:0 0 auto; justify-content:flex-start; }
.timeopt{
  padding:8px 6px; border:0; border-radius:9px; background:transparent;
  font-family:var(--font-display); font-size:0.94rem; font-weight:700; color:var(--ink);
  font-variant-numeric:tabular-nums; text-align:center; cursor:pointer;
  transition:background 110ms ease, color 110ms ease;
}
.timeopt:hover{ background:var(--surface-2); }
.timeopt[aria-selected="true"]{ background:var(--accent); color:#fff; }
.timeopt:focus-visible{ outline:none; box-shadow:0 0 0 2px var(--accent-soft); }

/* hero number: gradient applied directly (text set as plain content) */
.odo{ background:linear-gradient(176deg, var(--hot-1) 0%, var(--hot-2) 48%, var(--hot-3) 100%); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; color:transparent; }
