/* GENERATED FILE - DO NOT EDIT.
   Source: frontend/src/styles/gauge.css
   Regenerate: infra/scripts/sync-gauge-css.sh
   Edits here are overwritten on the next deploy. */

/* ============================================================================
 * SipNudger hydration ring gauge — THE canonical stylesheet.
 * ----------------------------------------------------------------------------
 * This file is the single source of truth for the gauge and the readout panel
 * around it. It is plain CSS (not SCSS) on purpose, so the same bytes can be
 * used by two very different consumers:
 *
 *   1. the Vue app  — imported by src/components/HydrationRing/index.vue
 *   2. the static marketing pages — served as /gauge.css and <link>ed by
 *      infra/nginx/marketing/index.html and demo.html
 *
 * The marketing copy is GENERATED by infra/scripts/sync-gauge-css.sh; never
 * edit it by hand. `sync-gauge-css.sh --check` fails the deploy if the copy has
 * drifted from this file, so the two cannot silently diverge.
 *
 * The device's LED ring (esp32/IoT/main/led-display.cpp) follows the same
 * colour language — aqua arc for progress, amber marker for the pace position —
 * but cannot share code with a stylesheet.
 *
 * Tokens (--surface-1, --accent, --text-1, …) come from identity.scss in the
 * app and from the :root block in each marketing page. Both define the same
 * names, which is what lets this file be shared.
 * ==========================================================================*/

:root {
  /* Overridable so the marketing hero can run a larger gauge than the app. */
  --gauge-size: clamp(168px, 42vw, 208px);
  --gauge-core: 19px;      /* how far the dark core is punched in */
  --gauge-arc: 0deg;       /* progress, set inline: fraction * 360 */
  --gauge-pace: 0deg;      /* where the user should be, set inline */
  --gauge-amber: #e0952b;
}

.gauge {
  position: relative;
  width: var(--gauge-size);
  aspect-ratio: 1;
}

/* The arc itself: a conic gradient with the middle punched out by a radial
 * gradient in the card colour, leaving a ring. */
.gauge__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%,
      var(--surface-1) 0 calc(50% - var(--gauge-core)),
      transparent calc(50% - var(--gauge-core) + 1px)),
    conic-gradient(from -90deg,
      var(--accent) 0deg,
      var(--accent-2) var(--gauge-arc),
      rgba(157, 176, 206, 0.13) var(--gauge-arc),
      rgba(157, 176, 206, 0.13) 360deg);
  filter: drop-shadow(0 0 18px rgba(53, 224, 216, 0.18));
  transition: background 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 24 segments, echoing the device's 24-LED ring, carved by spokes drawn in the
 * card colour. 15deg per segment: 11.6deg lit, 3.4deg gap. */
.gauge__leds {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(from -90deg,
    transparent 0 11.6deg, var(--surface-1) 11.6deg 15deg);
}

/* Pace marker: a short amber tick at the angle the user should have reached. */
.gauge__pace {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transform: rotate(var(--gauge-pace));
}

.gauge__pace::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  width: 3px;
  height: 16px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--gauge-amber);
  box-shadow: 0 0 8px rgba(224, 149, 43, 0.6);
}

.gauge__val {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
}

.gauge__big {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: clamp(28px, 6.5vw, 38px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-1);
}

.gauge__of {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--text-2);
}

.gauge__pct {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}

/* --- the readout panel the gauge sits in ---------------------------------- */

.ring-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  align-items: center;
  margin-bottom: 12px;
}

.ring-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.ring-panel__gauge {
  display: grid;
  place-items: center;
  padding: 6px 0 2px;
}

.ring-panel__rows {
  margin: 0;
  padding: 0 2px;
}

.ring-panel__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}

.ring-panel__row:last-child { border-bottom: 0; }
.ring-panel__row dt { color: var(--text-2); margin: 0; }
.ring-panel__row dd { margin: 0; color: var(--text-1); }
.ring-panel__row .is-behind { color: var(--gauge-amber); }
.ring-panel__row .is-ahead { color: var(--good); }

@media (min-width: 640px) {
  .ring-panel {
    grid-template-columns: minmax(200px, 260px) 1fr;
    gap: 22px;
  }
  .ring-panel__head { grid-column: 1 / -1; }
  .ring-panel__gauge { padding: 4px 0; }
}
