/* mikeos-weather-web — weather.osmike.com
   The MikeOS "new dawn" system (Fraunces + Manrope, coral/rose/peri) in its
   dark register: same named hues as enterprises.osmike.com and photos, on a
   warm near-black ground rather than the warm cream one. Nothing here is a new
   palette — the accents are the ecosystem's, the neutrals are ink pushed down.
   Fonts are self-hosted; this stack ships no third-party requests at all. */

@font-face { font-family: "Fraunces"; font-weight: 300 600; font-display: swap; src: url("/fonts/fraunces.woff2") format("woff2"); }
@font-face { font-family: "Manrope";  font-weight: 400 700; font-display: swap; src: url("/fonts/manrope.woff2")  format("woff2"); }

:root {
  /* ground — ink (#17130E) pushed down, hue held warm toward the coral accent */
  --bg: #100C09;
  --card: #1A1511;
  --raise: #241D17;
  --line: #2E251C;
  --line-soft: #221B15;

  /* text */
  --paper: #F7F2EA;
  --muted: #A39684;
  --faint: #756A5C;

  /* MikeOS accents — unchanged from the light register */
  --coral: #FF8A5B;
  --rose: #FF6FA5;
  --peri: #7C7CFF;
  --sky: #4FC4E8;
  --grad: linear-gradient(100deg, var(--coral), var(--rose) 42%, var(--peri) 82%);

  /* semantic, kept separate from the accent identity */
  --wet: #4FC4E8;      /* precipitation */
  --warn: #FFC46B;

  --disp: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 11px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;         /* the body never scrolls sideways */
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* Every focusable thing gets the same visible ring. */
:focus-visible {
  outline: 2px solid var(--peri);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 22px; }

/* Atmosphere: one dawn wash at the top of the page, fixed and inert. It is the
   only decorative element — the rest of the page is data. */
.sky {
  position: fixed; inset: 0 0 auto 0; height: 70vh;
  z-index: 0; pointer-events: none; overflow: hidden;
}
.sky::before, .sky::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(100px); opacity: .30;
}
.sky::before {
  width: 78vw; height: 78vw; left: -22vw; top: -34vw;
  background: radial-gradient(circle at 45% 45%, var(--coral), transparent 62%);
}
.sky::after {
  width: 62vw; height: 62vw; right: -20vw; top: -20vw;
  background: radial-gradient(circle at 55% 45%, var(--peri), transparent 62%);
}
.content { position: relative; z-index: 1; }

/* ---------- masthead ---------- */

.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 24px 0 6px;
}
.logo { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.logo .mark { width: 21px; height: 21px; border-radius: 7px; background: var(--grad); flex: none; }
.logo .sub-name { color: var(--faint); font-weight: 600; }
.top .home { font-size: 14.5px; font-weight: 600; color: var(--muted); transition: color .2s; }
.top .home:hover { color: var(--paper); }

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

.finder { padding: 26px 0 8px; position: relative; z-index: 20; }
.finder-inner {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch;
  box-shadow: 0 34px 70px -50px rgba(0,0,0,.9);
}
.field { position: relative; flex: 1 1 320px; min-width: 0; }
.field label {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: .11em;
  text-transform: uppercase; color: var(--faint); margin: 0 0 8px 4px;
}
.field input {
  width: 100%; font-family: var(--sans); font-size: 18px; font-weight: 500;
  color: var(--paper); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 15px 46px 15px 18px; outline: none;
  transition: border-color .2s;
}
.field input::placeholder { color: var(--faint); font-weight: 400; }
.field input:focus { border-color: var(--peri); }
.field .stat-icon {
  position: absolute; right: 16px; bottom: 15px;
  width: 20px; height: 20px; color: var(--faint); pointer-events: none;
}
.field .spin {
  position: absolute; right: 16px; bottom: 15px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--coral);
  animation: spin .7s linear infinite; display: none;
}
.field.busy .spin { display: block; }
.field.busy .stat-icon { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.locate {
  align-self: flex-end; flex: 0 0 auto;
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  color: var(--paper); background: var(--raise);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 15px 20px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 9px;
  transition: border-color .2s, background .2s;
}
.locate:hover { border-color: var(--muted); background: #2B231B; }
.locate:disabled { opacity: .5; cursor: default; }
.locate svg { width: 17px; height: 17px; flex: none; }

/* suggestions */
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 6px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.95);
  max-height: 330px; overflow-y: auto; display: none;
}
.suggest.open { display: block; }
.suggest li { list-style: none; }
.suggest button {
  width: 100%; text-align: left; font-family: var(--sans);
  background: transparent; border: 0; border-radius: var(--r-sm);
  padding: 11px 14px; cursor: pointer; color: var(--paper);
  display: block;
}
.suggest button:hover, .suggest button[aria-selected="true"] { background: var(--raise); }
.suggest .s-name { font-weight: 600; font-size: 15.5px; display: block; }
.suggest .s-region { color: var(--faint); font-size: 13.5px; display: block; margin-top: 1px; }
.suggest .s-none { padding: 14px; color: var(--faint); font-size: 15px; }
.suggest ul { margin: 0; padding: 0; }

/* ---------- shared card furniture ---------- */

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 24px;
}
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin: 0 0 14px;
}
.sec-head h2 {
  font-family: var(--disp); font-weight: 400; font-size: 24px;
  letter-spacing: -.02em; margin: 0; color: var(--paper);
}
.sec-head .note { color: var(--faint); font-size: 13.5px; }

.kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint); margin: 0;
}

/* ---------- now ---------- */

.stage { padding: 22px 0 0; display: flex; flex-direction: column; gap: 18px; }

.place-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 4px; }
.place-line h1 {
  font-family: var(--disp); font-weight: 400;
  font-size: clamp(30px, 5.2vw, 46px); letter-spacing: -.025em;
  line-height: 1.08; margin: 0; text-wrap: balance;
}
.place-line .where { color: var(--faint); font-size: 15px; }

.now {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 30px; align-items: center;
}
.now-read { min-width: 0; }
.now-temp {
  font-family: var(--disp); font-weight: 300;
  font-size: clamp(76px, 15vw, 140px); line-height: .9;
  letter-spacing: -.045em; margin: 0;
  font-variant-numeric: tabular-nums;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.now-temp .deg { font-size: .42em; letter-spacing: -.02em; }
.now-cond {
  font-size: 20px; font-weight: 600; margin: 10px 0 0;
  display: flex; align-items: center; gap: 11px;
}
.now-cond .glyph { width: 26px; height: 26px; flex: none; color: var(--coral); }
.now-feels { color: var(--muted); font-size: 16px; margin: 6px 0 0; }
.now-feels .derived { color: var(--faint); font-size: 13.5px; }

.readings {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 1px; background: var(--line-soft);
  border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden;
}
.reading { background: var(--card); padding: 15px 17px; min-width: 0; }
.reading dt {
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint); margin: 0 0 5px;
}
.reading dd {
  margin: 0; font-size: 21px; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reading dd .u { font-size: 13.5px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.reading dd .sub { display: block; font-size: 12.5px; font-weight: 500; color: var(--faint); letter-spacing: 0; }

/* ---------- hourly ---------- */

/* The chart is wide by nature: it scrolls inside its own box, never the body. */
.chart-scroll { overflow-x: auto; overflow-y: hidden; margin: 0 -4px; padding: 0 4px 6px; }
.chart-scroll canvas { display: block; height: 210px; }
.chart-legend {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  color: var(--muted); font-size: 13.5px; margin: 12px 0 0;
}
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.chart-legend .t-swatch { background: linear-gradient(120deg, var(--coral), var(--rose)); }
.chart-legend .p-swatch { background: var(--wet); }

/* ---------- daily ---------- */

.days { display: flex; flex-direction: column; gap: 1px; background: var(--line-soft);
        border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; }
.day {
  display: grid;
  grid-template-columns: 92px 62px minmax(120px, 1fr) 62px;
  align-items: center; gap: 16px;
  background: var(--card); padding: 14px 18px;
}
.day .d-name { font-weight: 600; font-size: 15.5px; }
.day .d-name .d-date { display: block; color: var(--faint); font-size: 12.5px; font-weight: 500; }
.day .d-lo, .day .d-hi {
  font-variant-numeric: tabular-nums; font-size: 16.5px; font-weight: 600;
  text-align: right;
}
.day .d-lo { color: var(--muted); }
/* the week's temperature range, each day drawn against the whole week's span */
.d-bar { position: relative; height: 7px; border-radius: 999px; background: var(--raise); }
.d-bar i {
  position: absolute; top: 0; bottom: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--peri), var(--coral) 55%, var(--rose));
}
.day .d-wet {
  grid-column: 1 / -1; color: var(--wet); font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; gap: 7px; margin-top: -2px;
}
.day .d-wet svg { width: 13px; height: 13px; flex: none; }

/* ---------- day detail ---------- */

/* Each day in the outlook is a button; the open one is marked. */
.day {
  font-family: var(--sans); font-size: inherit; color: inherit; text-align: left;
  border: 0; width: 100%; cursor: pointer;
  transition: background .18s;
}
.day:hover { background: var(--raise); }
.day[aria-current="true"] { background: var(--raise); box-shadow: inset 3px 0 0 var(--coral); }

.detail-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 0 0 4px;
}
.detail-head h2 {
  font-family: var(--disp); font-weight: 400; font-size: clamp(23px, 3.6vw, 32px);
  letter-spacing: -.02em; margin: 0; text-wrap: balance;
}
.detail-head .d-sun { color: var(--muted); font-size: 14.5px; margin: 7px 0 0; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-ghost {
  font-family: var(--sans); font-size: 14.5px; font-weight: 600;
  color: var(--paper); background: var(--raise);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 18px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: border-color .2s, color .2s;
}
.btn-ghost:hover { border-color: var(--muted); }
.btn-ghost svg { width: 15px; height: 15px; flex: none; }
.btn-ghost.done { color: var(--sky); border-color: var(--sky); }

/* shown only when the browser refuses the clipboard — the link, pre-selected */
.link-out { display: block; flex: 1 1 240px; }
.link-out input {
  width: 100%; font-family: var(--sans); font-size: 13.5px;
  color: var(--paper); background: var(--bg);
  border: 1px solid var(--sky); border-radius: var(--r-sm);
  padding: 9px 12px;
}

/* one sparkline card per available variable — generated from the data */
.sparks {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 12px; margin: 20px 0 0;
}
.spark {
  background: var(--bg); border: 1px solid var(--line-soft);
  border-radius: var(--r-md); padding: 13px 14px 9px; min-width: 0;
}
.spark h3 {
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.spark .s-val {
  font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums;
  letter-spacing: -.01em; display: block;
}
.spark .s-val .u { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.spark .s-range { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.spark canvas { display: block; width: 100%; height: 40px; margin-top: 7px; }

/* the full hourly table — every variable, all 24 hours */
.table-scroll {
  overflow-x: auto; margin: 20px 0 0;
  border: 1px solid var(--line-soft); border-radius: var(--r-md);
}
table.hours {
  border-collapse: collapse; width: 100%; min-width: max-content;
  font-size: 14px; font-variant-numeric: tabular-nums;
}
table.hours th, table.hours td { padding: 9px 13px; text-align: right; white-space: nowrap; }
table.hours thead th {
  background: var(--raise); color: var(--muted);
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
table.hours thead th .u {
  display: block; font-weight: 500; letter-spacing: .02em;
  color: var(--faint); text-transform: none; font-size: 10.5px;
}
/* the hour column stays put while the rest scrolls under it */
table.hours th.h-hour, table.hours td.h-hour {
  position: sticky; left: 0; z-index: 2; text-align: left;
  background: var(--card); font-weight: 600;
  border-right: 1px solid var(--line-soft);
}
table.hours thead th.h-hour { background: var(--raise); z-index: 3; }
table.hours tbody tr:nth-child(even) td { background: #1E1813; }
table.hours tbody tr:hover td { background: var(--raise); }
table.hours td.nil { color: var(--faint); }
table.hours td.now-cell { color: var(--coral); }
.table-note { color: var(--faint); font-size: 13px; margin: 11px 0 0; }

/* ---------- provenance ---------- */

.prov { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px 26px; }
.prov div { min-width: 0; }
.prov dt { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 0 0 5px; }
.prov dd { margin: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.prov dd small { display: block; color: var(--faint); font-size: 13px; margin-top: 2px; }

/* ---------- states ---------- */

.msg {
  border: 1px solid var(--line); background: var(--card);
  border-radius: var(--r-lg); padding: 28px 26px; text-align: center;
}
.msg h2 { font-family: var(--disp); font-weight: 400; font-size: 22px; margin: 0 0 8px; letter-spacing: -.01em; }
.msg p { color: var(--muted); margin: 0; font-size: 15.5px; }
.msg.bad { border-color: #4A2A22; }
.msg .retry {
  margin-top: 16px; font-family: var(--sans); font-size: 15px; font-weight: 600;
  background: var(--raise); color: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; padding: 10px 22px; cursor: pointer; transition: border-color .2s;
}
.msg .retry:hover { border-color: var(--muted); }

/* skeleton shown while the first forecast is in flight */
.skel { border-radius: var(--r-sm); background: var(--raise); animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .55; } 50% { opacity: .95; } }
.skel-temp { height: clamp(76px, 15vw, 140px); width: 62%; max-width: 340px; }
.skel-line { height: 15px; margin-top: 14px; width: 46%; }
.skel-grid { height: 96px; margin-top: 6px; }
.skel-chart { height: 210px; }

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

footer {
  border-top: 1px solid var(--line); margin-top: 46px; padding: 30px 0 60px;
  color: var(--faint); font-size: 14px; line-height: 1.65;
}
footer .f-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px 34px; }
footer h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
footer p { margin: 0 0 7px; }
footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); transition: color .2s, text-decoration-color .2s; }
footer a:hover { color: var(--paper); text-decoration-color: var(--muted); }
footer .f-base { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: space-between; }

.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- narrow ---------- */

@media (max-width: 780px) {
  body { font-size: 16px; }
  .now { grid-template-columns: 1fr; gap: 22px; }
  .locate { flex: 1 1 100%; justify-content: center; }
  .day { grid-template-columns: 74px 50px minmax(70px, 1fr) 50px; gap: 11px; padding: 13px 15px; }
  .day .d-lo, .day .d-hi { font-size: 15px; }
  .card { padding: 19px; border-radius: 20px; }
  footer .f-base { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
