/* NOVA of California's own palette and type (novaofcalifornia.com theme, read 18 Nov 2026): Lato, charcoal on white,
   one brass accent. */
:root {
  --ink: #171717;
  --ink-2: #3a3c3a;
  --ink-3: #646464;
  --line: #d7d7d7;
  --line-soft: #ebebeb;
  --paper: #ffffff;
  --wash: #f5f5f5;
  --brass: #c18d46;
  --brass-ink: #8a6230;
  --panel-w: 340px;
  --room: #0e0d0c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--room);
  color: #f2efe9;
  font-family: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; }
a { color: inherit; }

#room {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  outline: none;
}
#room.dragging { cursor: grabbing; }

/* ---------- panel */
#panel {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--panel-w);
  background: var(--paper);
  color: var(--ink);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 22px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 3;
}

.brand { margin: 0 0 6px; color: var(--ink-3); font-size: 13px; }
.titlerow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h1 { margin: 0; font-size: 24px; font-weight: 400; line-height: 1.2; }
.hint { margin: 8px 0 0; color: var(--ink-3); font-size: 13px; }
#more { display: none; }

h2, .blocklabel { display: block; margin: 0; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.blockhead { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.quick { display: flex; gap: 14px; }

.textbtn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink-2);
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  cursor: pointer;
}
.textbtn:hover { color: var(--ink); text-decoration-color: var(--ink-2); }

/* ---------- lamp rows */
.lamp {
  margin: 0 -24px;
  padding: 10px 24px 8px;
  border-top: 1px solid var(--line-soft);
  transition: background-color .2s ease;
}
.lamp:last-child { border-bottom: 1px solid var(--line-soft); }
.lamp.hot { background: var(--wash); }

.lamp .top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.lamp .name {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}
.lamp .name .short { display: none; }
.lamp .name:hover .long { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.lamp .meta { margin: 2px 0 6px; color: var(--ink-3); font-size: 13px; }
.lamp .meta .price { color: var(--ink-2); }
.lamp .more { margin: 6px 0 2px; color: var(--ink-2); font-size: 13px; }
.lamp .more p { margin: 0 0 6px; }

.switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--wash);
  cursor: pointer;
  padding: 0;
  transition: background-color .18s ease, border-color .18s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: var(--paper);
  border: 1px solid var(--line);
  transition: transform .18s ease, border-color .18s ease;
}
.switch[aria-checked="true"] { background: var(--brass); border-color: var(--brass); }
.switch[aria-checked="true"]::after { transform: translateX(18px); border-color: var(--brass-ink); }
.switch:focus-visible, .seg button:focus-visible, .textbtn:focus-visible, .lamp .name:focus-visible, .mark:focus-visible,
input[type=range]:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ---------- sliders */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  margin: 2px 0 0;
  background: transparent;
  cursor: pointer;
  --fill: 50%;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(to right, var(--brass) var(--fill), var(--line) var(--fill));
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--ink-2);
}
input[type=range]::-moz-range-track { height: 2px; background: var(--line); }
input[type=range]::-moz-range-progress { height: 2px; background: var(--brass); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 1px solid var(--ink-2); }
.lamp input[type=range] { height: 18px; }
.lamp.off input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--line) var(--fill), var(--line-soft) var(--fill)); }
.lamp.off input[type=range]::-moz-range-progress { background: var(--line); }

.ends { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 12.5px; }

/* ---------- stand */
.seg { display: flex; margin-top: 8px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button {
  flex: 1;
  border: 0;
  background: var(--paper);
  padding: 8px 6px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- footer */
.foot { margin-top: auto; color: var(--ink-3); font-size: 12px; }
.foot p { margin: 0 0 6px; }
.foot a { color: var(--ink-3); text-underline-offset: 2px; }
.foot .textbtn { font-size: 12px; color: var(--ink-3); }

/* ---------- marks in the room */
#marks { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
.mark {
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform;
}
.mark .ring {
  position: absolute;
  inset: 9px;
  border: 1.5px solid rgba(255, 255, 255, .92);
  border-radius: 50%;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, .6));
  transition: transform .2s ease, border-color .2s ease;
}
.mark.off .ring { border-color: rgba(255, 255, 255, .55); }
.mark:hover .ring, .mark.hot .ring { transform: scale(1.25); border-color: #fff; }
.mark .tip {
  position: absolute;
  left: 36px;
  top: 7px;
  white-space: nowrap;
  background: var(--paper);
  color: var(--ink);
  font-size: 12.5px;
  padding: 3px 8px;
  border-radius: 4px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
}
.mark:hover .tip, .mark.hot .tip, .mark:focus-visible .tip { opacity: 1; transform: none; }
.mark[hidden], .walk[hidden] { display: none; }

/* The button holds the label and the ring on the floor; app.js anchors the ring's centre on the spot. */
.walk {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  will-change: transform;
}
.walk .floor {
  display: block;
  width: 52px;
  height: 18px;
  border: 1.5px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, .55));
}
.walk .label {
  display: block;
  white-space: nowrap;
  background: rgba(23, 23, 23, .62);
  color: #fff;
  font-size: 13px;
  padding: 4px 9px;
  border-radius: 4px;
}
.walk:hover .label { background: rgba(23, 23, 23, .82); }
body.moving #marks { visibility: hidden; }

#draghint {
  position: fixed;
  left: 50%;
  bottom: 200px;
  transform: translateX(-50%);
  margin: 0;
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(23, 23, 23, .62);
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
  transition: opacity .6s ease;
}
#draghint.gone { opacity: 0; }
@media (min-width: 761px) { #draghint { display: none; } }

/* ---------- loading */
#loading {
  position: fixed;
  inset: 0 0 0 var(--panel-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #d9d4cc;
  font-size: 14px;
  z-index: 1;
  transition: opacity .8s ease;
}
#loading p { margin: 0; }
#loading .bar { width: 160px; height: 1px; background: #3a3c3a; }
#loading .bar span { display: block; height: 1px; width: 0; background: var(--brass); transition: width .3s ease; }
#loading.done { opacity: 0; pointer-events: none; }

/* ---------- credits */
dialog {
  max-width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 22px 24px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 13px;
}
dialog::backdrop { background: rgba(14, 13, 12, .55); }
dialog h2 { font-size: 18px; font-weight: 400; color: var(--ink); margin-bottom: 10px; }
dialog ul { margin: 0 0 12px; padding-left: 18px; }
dialog li { margin: 0 0 3px; }

.nojs { position: fixed; inset: 0; display: grid; place-items: center; color: #fff; margin: 0; }

/* ---------- phones: the panel becomes a sheet along the bottom */
@media (max-width: 760px) {
  :root { --panel-w: 0px; }
  #panel {
    top: auto;
    right: 0;
    width: auto;
    max-height: 72dvh;
    border-right: 0;
    border-top: 1px solid var(--line);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    gap: 12px;
  }
  .brand, .hint, .stand, .foot, .lamp .meta, .lamp .more, .lamp input[type=range], .lampsblock .blockhead { display: none; }
  h1 { font-size: 18px; }
  #more { display: inline; }
  #lamps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .lamp { margin: 0; padding: 0; border: 0; }
  .lamp:last-child { border: 0; }
  .lamp .top { flex-direction: column; align-items: center; gap: 6px; }
  .lamp .name { text-align: center; font-size: 13px; }
  .lamp .name .long { display: none; }
  .lamp .name .short { display: inline; }
  .daylight .blocklabel { font-weight: 400; color: var(--ink-3); }

  #panel.open .brand, #panel.open .hint, #panel.open .foot, #panel.open .lampsblock .blockhead { display: block; }
  #panel.open .lampsblock .blockhead { display: flex; }
  #panel.open .stand { display: block; }
  #panel.open #lamps { display: block; }
  #panel.open .lamp { margin: 0 -16px; padding: 10px 16px; border-top: 1px solid var(--line-soft); }
  #panel.open .lamp .top { flex-direction: row; align-items: center; }
  #panel.open .lamp .name { text-align: left; font-size: 14px; }
  #panel.open .lamp .name .long { display: inline; }
  #panel.open .lamp .name .short { display: none; }
  #panel.open .lamp .meta, #panel.open .lamp input[type=range] { display: block; }
  #panel.open .lamp .more:not([hidden]) { display: block; }

  #loading { inset: 0 0 180px 0; }
  .mark .tip { left: auto; right: 36px; }
}
