:root {
  --ink: #1c2422;
  --paper: #f7f6f0;
  --line: rgba(28, 36, 34, 0.13);
  --dock-surface: rgba(231, 237, 230, 0.96);
  --dock-ink: #26352e;
  --dock-muted: rgba(38, 53, 46, 0.68);
  --dock-line: rgba(38, 53, 46, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.light-app {
  --light-color: rgb(var(--light-rgb));
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  background: var(--light-color);
  color: var(--ink);
  transition: background-color 280ms ease;
}

.light-field {
  background:
    radial-gradient(circle at 50% -20%, rgba(255, 255, 255, 0.52), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0));
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  left: 0;
  padding: 30px 38px;
  position: absolute;
  right: 0;
  top: 0;
  transition: opacity 300ms ease, transform 300ms ease;
  z-index: 2;
}

.brand-lockup,
.live-indicator {
  align-items: center;
  display: flex;
}

.brand-lockup {
  gap: 10px;
}

.brand-mark {
  background: var(--ink);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(28, 36, 34, 0.07);
  display: inline-block;
  height: 12px;
  margin-right: 3px;
  width: 12px;
}

.brand-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-divider {
  background: var(--line);
  height: 17px;
  margin: 0 3px;
  width: 1px;
}

.brand-context,
.live-indicator {
  color: rgba(28, 36, 34, 0.62);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.live-indicator {
  gap: 8px;
}

.live-dot {
  background: #5d8369;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(93, 131, 105, 0.12);
  height: 7px;
  width: 7px;
}

.control-dock {
  backdrop-filter: blur(22px);
  background: var(--dock-surface);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 26px;
  bottom: 25px;
  box-shadow: 0 28px 70px rgba(32, 38, 34, 0.15), 0 4px 12px rgba(32, 38, 34, 0.08);
  color: var(--dock-ink);
  left: 50%;
  max-width: 710px;
  padding: 26px 28px 21px;
  position: absolute;
  transform: translateX(-50%);
  transition: opacity 380ms ease, transform 380ms ease, visibility 380ms ease;
  width: calc(100% - 48px);
  z-index: 3;
}

.dock-heading {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
}

.dock-kicker {
  color: var(--dock-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin: 0 0 7px;
  text-transform: uppercase;
}

.dock-heading h1 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.035em;
  margin: 0;
}

.current-readout {
  align-items: center;
  display: flex;
  gap: 10px;
  text-align: right;
}

.current-readout span:last-child {
  display: grid;
  gap: 3px;
}

.current-readout strong {
  font-size: 13px;
  font-weight: 600;
}

.current-readout small {
  color: var(--dock-muted);
  font-size: 11px;
}

.readout-swatch {
  background: var(--light-color);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(255, 245, 215, 0.2);
  height: 24px;
  width: 24px;
}

.slider-stack {
  display: grid;
  gap: 20px;
  margin-top: 25px;
}

.slider-control {
  display: grid;
  gap: 11px;
}

.slider-label-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.slider-label-row > span:first-child {
  display: grid;
  gap: 4px;
}

.slider-label-row strong {
  font-size: 13px;
  font-weight: 600;
}

.slider-label-row small {
  color: var(--dock-muted);
  font-size: 11px;
}

.slider-value {
  color: rgba(38, 53, 46, 0.74);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  --track: rgba(38, 53, 46, 0.18);
  appearance: none;
  background: linear-gradient(90deg, rgba(38, 53, 46, 0.76), rgba(38, 53, 46, 0.76)) no-repeat, var(--track);
  background-size: var(--range-progress, 50%) 100%, 100% 100%;
  border-radius: 999px;
  cursor: ew-resize;
  height: 5px;
  margin: 0;
  outline: none;
  width: 100%;
}

#light-level {
  --range-progress: var(--light-level);
}

.temperature-track {
  display: grid;
  height: 17px;
  position: relative;
}

.temperature-track::before {
  background: linear-gradient(90deg, #ffd2a0 0%, #fff5e2 50%, #eff6ff 100%);
  border-radius: 999px;
  content: "";
  height: 5px;
  left: 0;
  opacity: 0.85;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 6px;
  z-index: 0;
}

.temperature-track input[type="range"] {
  --track: transparent;
  align-self: center;
  background: transparent;
  display: block;
  position: relative;
  z-index: 1;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  background: #fffefa;
  border: 3px solid rgba(38, 53, 46, 0.72);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6), 0 2px 7px rgba(0, 0, 0, 0.3);
  height: 17px;
  width: 17px;
}

input[type="range"]::-moz-range-thumb {
  background: #fffefa;
  border: 3px solid rgba(38, 53, 46, 0.72);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6), 0 2px 7px rgba(0, 0, 0, 0.3);
  height: 11px;
  width: 11px;
}

input[type="range"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(91, 143, 110, 0.42);
}

.preset-row {
  align-items: center;
  border-top: 1px solid var(--dock-line);
  display: flex;
  gap: 8px;
  margin-top: 25px;
  padding-top: 19px;
}

.preset-title {
  color: var(--dock-muted);
  font-size: 11px;
  margin-right: 3px;
}

.preset-button {
  background: transparent;
  border: 1px solid rgba(38, 53, 46, 0.22);
  border-radius: 10px;
  color: rgba(38, 53, 46, 0.78);
  display: grid;
  gap: 2px;
  padding: 8px 11px 7px;
  text-align: left;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.preset-button span {
  font-size: 11px;
  font-weight: 600;
}

.preset-button small {
  color: var(--dock-muted);
  font-size: 10px;
}

.preset-button:hover,
.preset-button.selected {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(38, 53, 46, 0.48);
  color: var(--dock-ink);
}

.preset-button:focus-visible,
.fullscreen-button:focus-visible,
.reveal-button:focus-visible {
  outline: 2px solid #679a79;
  outline-offset: 3px;
}

.dock-footer {
  align-items: center;
  border-top: 1px solid var(--dock-line);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 17px;
}

.helper-copy {
  color: var(--dock-muted);
  font-size: 10px;
}

kbd {
  border: 1px solid rgba(38, 53, 46, 0.3);
  border-radius: 4px;
  color: var(--dock-ink);
  font-family: inherit;
  font-size: 9px;
  padding: 2px 4px;
}

.fullscreen-button {
  align-items: center;
  background: #d4e7d8;
  border: 0;
  border-radius: 999px;
  color: #26382e;
  display: flex;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  gap: 7px;
  padding: 10px 14px;
  transition: background 180ms ease, transform 180ms ease;
}

.fullscreen-button:hover {
  background: #e8f4e9;
  transform: translateY(-1px);
}

.fullscreen-button span:first-child {
  font-size: 16px;
  line-height: 0.7;
}

.reveal-button {
  align-items: center;
  background: var(--dock-surface);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  bottom: 24px;
  box-shadow: 0 9px 20px rgba(27, 35, 33, 0.17);
  color: var(--dock-ink);
  display: flex;
  height: 42px;
  justify-content: center;
  position: absolute;
  right: 25px;
  width: 42px;
  z-index: 3;
}

.reveal-button span {
  font-size: 21px;
  font-weight: 300;
}

.controls-hidden .topbar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  visibility: hidden;
}

.controls-hidden .control-dock {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  visibility: hidden;
}

@media (max-width: 640px) {
  .topbar {
    padding: 22px 20px;
  }

  .brand-context,
  .live-indicator span:last-child {
    display: none;
  }

  .control-dock {
    border-radius: 21px;
    bottom: 12px;
    padding: 22px 18px 17px;
    width: calc(100% - 24px);
  }

  .dock-heading h1 {
    font-size: 21px;
  }

  .preset-row {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .preset-title {
    align-self: center;
    width: 100%;
  }

  .preset-button {
    flex: 1;
  }

  .dock-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .helper-copy {
    line-height: 1.4;
    text-align: center;
  }

  .fullscreen-button {
    justify-content: center;
  }
}

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