/* Look taken over from the Sprachen-Troll project: dark room, one cool accent, Verdana. */
:root {
  --ink: #0f0f0f;
  --panel: #171717;
  --panel-2: #1F1F1F;
  --text: #EDECEA;
  --muted: #A3A3A3;
  --faint: #8A8A8A;
  --line: #2E2E2E;
  --field-bg: #DCDCDC;
  --field-text: #16181C;
  --field-hint: #5A5A5A;
  --accent: #B0C4DE;
  --accent-deep: #8FA8C8;
  --bad: #E4A0A0;
  --font: Verdana, Geneva, Tahoma, "DejaVu Sans", "Bitstream Vera Sans", sans-serif;
  --radius: 0.75rem;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(0.88rem, 0.84rem + 0.2vw, 0.98rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* the glow the whole page stands in */
body::before {
  content: "";
  position: fixed;
  top: -14rem;
  left: 50%;
  width: min(60rem, 170vw);
  height: min(46rem, 130vw);
  transform: translateX(-50%);
  background: radial-gradient(ellipse closest-side,
              color-mix(in srgb, var(--accent-deep) 11%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(1.6rem, 1.1rem + 2.5vw, 2.6rem) clamp(1.1rem, 0.6rem + 2.5vw, 1.75rem)
           clamp(3rem, 2rem + 4vw, 5rem);
}

/* ---------- head ---------- */

.sitehead {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}

.sitehead-inner {
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(1.6rem, 1.1rem + 2vw, 2.4rem) clamp(1.1rem, 0.6rem + 2.5vw, 1.75rem)
           clamp(1.1rem, 0.9rem + 1vw, 1.6rem);
}

.sitetitle {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  font-size: clamp(1.9rem, 1.3rem + 2.8vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-wrap: balance;
}
.sitetitle .dot {
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0.8rem var(--accent);
}

.tagline {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-wrap: pretty;
}

/* ---------- status ---------- */

.status {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.2rem 1.1rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.status::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--faint);
  opacity: 0.5;
}
.status.on::before {
  background: var(--accent);
  opacity: 1;
  box-shadow: 0 0 1.1rem 0.1rem color-mix(in srgb, var(--accent) 60%, transparent);
}
.status.on { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, var(--panel)), var(--panel) 60%); }

.lamp {
  flex: 0 0 auto;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 1.5px solid var(--faint);
}
.status.on .lamp {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0.9rem var(--accent);
  animation: breathe 3.2s ease-in-out infinite;
}
@keyframes breathe { 50% { box-shadow: 0 0 0.3rem var(--accent); } }

.statusline { margin: 0; font-size: 1.12rem; }
.statusline b { font-weight: 700; }
.status.on .statusline b { color: var(--accent); }
.status.off .statusline b { color: var(--muted); }
.statussub { margin: 0.2rem 0 0; color: var(--faint); font-size: 0.84rem; text-wrap: pretty; }

/* ---------- message ---------- */

.flash {
  margin: 1.2rem 0 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0.5rem;
  background: var(--panel);
  color: var(--text);
  text-wrap: pretty;
}
.flash.bad { border-left-color: var(--bad); color: var(--bad); }

/* ---------- start and stop ---------- */

.control {
  display: grid;
  gap: 0.8rem;
  margin: clamp(1.4rem, 1rem + 1.5vw, 1.9rem) 0 0;
}

.asklabel { display: block; color: var(--text); font-size: 0.92rem; }

.field {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--field-bg);
  color: var(--field-text);
  font: inherit;
  transition: border-color 0.18s ease;
}
.field::placeholder { color: var(--field-hint); }
.field:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }

.buttons { display: flex; flex-wrap: wrap; gap: 0.7rem; }

.submit {
  flex: 0 0 auto;
  min-width: 8rem;
  min-height: 3.1rem;
  padding: 0 1.5rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  background: var(--accent);
  color: #0E1620;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}
.submit:hover { background: var(--accent-deep); }
.submit.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.submit.ghost:hover { border-color: var(--accent); color: var(--accent); }
.submit[disabled] { opacity: 0.35; cursor: default; }
.submit[disabled]:hover { background: var(--accent); }
.submit.ghost[disabled]:hover { background: transparent; border-color: var(--line); color: var(--text); }

@media (max-width: 26rem) {
  .submit { flex: 1 1 0; min-width: 0; }
}

/* ---------- reports ---------- */

.sectiontitle {
  margin: clamp(2.4rem, 1.8rem + 2.5vw, 3.4rem) 0 0;
  padding-top: clamp(1.6rem, 1.2rem + 1.5vw, 2.2rem);
  border-top: 1px solid var(--line);
  font-size: clamp(1.3rem, 1.05rem + 1.4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.empty {
  margin: 1.2rem 0 0;
  padding: 2.2rem 1.4rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  text-wrap: pretty;
}

.day { margin: clamp(1.2rem, 1rem + 1vw, 1.6rem) 0 0; }
.day[open] { margin-bottom: clamp(1.6rem, 1.2rem + 1.5vw, 2.2rem); }

/* the day heading is the switch that opens and closes the day */
.dayhead {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 2.75rem;
  margin: 0 0 0.8rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  border-radius: 0.4rem;
}
.dayhead::-webkit-details-marker { display: none; }
.dayhead h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  transition: color 0.18s ease;
}
.day:not([open]) .dayhead { margin-bottom: 0; }
.day:not([open]) .dayhead h3 { color: var(--muted); }
.dayhead:hover h3 { color: var(--accent); }
.dayhead::after {
  content: "";
  order: 1;
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}
.chev {
  order: 2;
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  margin: 0 0.3rem 0.2rem;
  border-right: 2px solid var(--faint);
  border-bottom: 2px solid var(--faint);
  transform: rotate(45deg);
  transition: transform 0.2s ease, border-color 0.18s ease;
}
.day:not([open]) .chev { transform: rotate(-45deg); margin-bottom: 0; }
.dayhead:hover .chev { border-color: var(--accent); }

.dayphase {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: -0.35rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.84rem;
}
/* a small moon: a lit disc, shaded from the side that is dark. --shade is set per day:
   positive = waxing (dark on the left), negative = waning (dark on the right). */
.moonmark {
  flex: 0 0 auto;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset var(--shade, 0rem) 0 0 0 #33373d, 0 0 0.5rem color-mix(in srgb, var(--accent) 35%, transparent);
}

.wcard {
  position: relative;
  padding: 1rem 1.2rem 1.1rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.wcard + .wcard { margin-top: 0.7rem; }
.wcard::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.55;
}

.wtop {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 1rem;
}
.wplace {
  margin: 0;
  color: var(--faint);
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.wtime { color: var(--faint); font-size: 0.74rem; }

.wmain { display: flex; align-items: center; gap: 1rem; margin-top: 0.7rem; }
.wsky { margin: 0; font-size: 1.12rem; color: var(--text); }
.wtemp { margin: 0.1rem 0 0; color: var(--muted); text-wrap: pretty; }
.wtemp b { color: var(--text); font-size: 1.05rem; }

.wfacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.8rem;
  margin: 0.9rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.wfacts dt {
  color: var(--faint);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.wfacts dd { margin: 0; color: var(--text); font-size: 0.92rem; }

/* ---------- sky symbols, drawn in CSS ---------- */

.sky {
  position: relative;
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
}
.sky::before, .sky::after { content: ""; position: absolute; }

/* sun */
.sky-sun::before, .sky-partly::before {
  left: 0.6rem; top: 0.6rem;
  width: 1.4rem; height: 1.4rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 1rem color-mix(in srgb, var(--accent) 70%, transparent);
}
.sky-partly::before { left: 0.2rem; top: 0.3rem; width: 1.2rem; height: 1.2rem; }

/* cloud: one wide pill with a round top */
.sky-partly::after, .sky-cloud::before, .sky-rain::before, .sky-snow::before, .sky-storm::before {
  left: 0.3rem; top: 1.05rem;
  width: 2rem; height: 0.95rem;
  border-radius: 0.5rem;
  background: var(--muted);
  box-shadow: 0.45rem -0.45rem 0 -0.05rem var(--muted);
}
.sky-partly::after { left: 0.55rem; top: 1.2rem; background: #C8C8C8; box-shadow: 0.45rem -0.45rem 0 -0.05rem #C8C8C8; }

/* rain, snow and storm: marks under the cloud */
.sky-rain::after, .sky-snow::after, .sky-storm::after {
  left: 0.75rem; top: 2.15rem;
  width: 2px; height: 0.4rem;
  background: var(--accent);
  box-shadow: 0.45rem 0 0 var(--accent), 0.9rem 0 0 var(--accent);
}
.sky-snow::after {
  width: 0.28rem; height: 0.28rem; border-radius: 50%;
  background: var(--text);
  box-shadow: 0.45rem 0.1rem 0 var(--text), 0.9rem 0 0 var(--text);
}
.sky-storm::after {
  left: 1.1rem; width: 0.5rem; height: 0.5rem;
  background: #E8D48A;
  box-shadow: none;
  clip-path: polygon(40% 0, 100% 0, 60% 45%, 100% 45%, 20% 100%, 40% 55%, 0 55%);
}

/* fog: three soft lines */
.sky-fog::before {
  left: 0.3rem; top: 0.9rem;
  width: 2rem; height: 3px;
  border-radius: 2px;
  background: var(--muted);
  box-shadow: 0 0.4rem 0 var(--muted), 0 0.8rem 0 var(--faint);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 0.3rem;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
