/* style.css — the instrument look of Crane Wind Window.
   Dark background, very large numerals, three signal colours, nothing decorative. */

:root {
  color-scheme: dark;
  --bg: #0f1113;
  --panel: #181b1f;
  --ink: #f2f2ee;
  --muted: #9aa0a6;
  --line: #2a2e33;
  --green: #3ddc84;
  --yellow: #ffc107;
  --red: #ff4d3d;
  --font: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: dark; background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
  padding-block: env(safe-area-inset-top, 0px) env(safe-area-inset-bottom, 0px);
}

[hidden] { display: none !important; }

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- crane card ---------- */

.title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 8px 0 4px;
}

.lead {
  color: var(--muted);
  margin: 0 0 20px;
}

.h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 8px 0 12px;
}

.field { margin: 0 0 14px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}

input[type="text"] {
  display: block;
  width: 100%;
  font: 18px/1.3 var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
}

input[type="text"]:focus { border-color: var(--ink); }

select {
  display: block;
  width: 100%;
  font: 18px/1.3 var(--font);
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

select:focus { border-color: var(--ink); }

#model-other { margin-top: 8px; }

.hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  margin: 8px 0 0;
}

.hint b { color: var(--ink); font-weight: 600; }

input[aria-invalid="true"] { border-color: var(--red); }

.msg {
  color: var(--red);
  font-size: 13px;
  margin: 6px 0 0;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.primary {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 14px 16px;
  font-size: 17px;
  font-weight: 700;
  color: #0f1113;
  background: var(--ink);
  border: 0;
  border-radius: 12px;
}

.secondary {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 13px 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* ---------- window: top lines ---------- */

.top {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 14px;
}

.linebtn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 6px 0;
  font-size: 15px;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}

.linebtn:active { color: var(--ink); }

/* the place name is the answer to "where am I": readable, the rest muted */
#location-line { font-size: 17px; line-height: 1.35; padding: 8px 0 4px; }
#location-line .loc-name { color: var(--ink); font-weight: 600; }
#location-line .loc-extra { color: var(--muted); font-size: 14px; font-weight: 400; }

/* ---------- Now card ---------- */

.now {
  background: var(--panel);
  border-radius: 16px;
  padding: 18px 18px 16px;
  margin: 0 0 18px;
}

.now-main {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.now-number {
  font-size: 96px;
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.03em;
  min-width: 2ch;
}

.now-number.green { color: var(--green); }
.now-number.yellow { color: var(--yellow); }
.now-number.red { color: var(--red); }

.now-side { padding-bottom: 6px; }

.now-unit {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.now-sub {
  font-size: 16px;
  color: var(--muted);
  margin-top: 6px;
}

.now-ground {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 6px;
}

/* ---------- status and error ---------- */

.status-line {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 14px;
}

.error {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 16px;
}

.error p { margin: 0 0 10px; }

.error .primary { margin-top: 0; }

/* ---------- day strips (filled in slice 2) ---------- */

.day { margin: 0 0 18px; }

.day-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}

.strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 4px;
}

.cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 5px 0;
  border: 0;
  border-radius: 8px;
  color: #0f1113;
  appearance: none;
}

.cell .h { font-size: 12px; font-weight: 600; opacity: 0.8; line-height: 1; }
.cell .v { font-size: 21px; font-weight: 800; line-height: 1.15; margin-top: 3px; }

.cell.green { background: var(--green); }
.cell.yellow { background: var(--yellow); }
.cell.red { background: var(--red); }

.cell.past { opacity: 0.45; }

.cell.current {
  outline: 3px solid var(--ink);
  outline-offset: -3px;
}

.cell[aria-expanded="true"] {
  box-shadow: 0 0 0 3px var(--bg) inset, 0 0 0 5px currentColor inset;
  color: #0f1113;
}

.cell[aria-expanded="true"] .h { opacity: 1; }

.window-line {
  margin: 10px 0 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.detail {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: var(--panel);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- place search ---------- */

.results {
  list-style: none;
  margin: 0;
  padding: 0;
}

.results li { margin: 0; }

.results button {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  font-size: 16px;
}

.results .note {
  color: var(--muted);
  font-size: 14px;
  padding: 10px 2px;
}

/* ---------- footer ---------- */

.foot {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 8px 0 20px;
}

.foot a { color: var(--muted); }
