/* ==========================================================================
   Метеостанция «Бийск» — оформление.

   Совместимость: никаких CSS-переменных и CSS Grid — только flexbox,
   запасные значения размеров и обычные цвета. Так страница выглядит
   нормально и на старых браузерах (Chrome 30+, Firefox 25+, IE 10+),
   и на современных. Тяжёлых эффектов нет: фон статичный, размытий нет.
   ========================================================================== */

*,*::before,*::after{ box-sizing: border-box; }

html,body{ height:100%; }

body{
  margin:0;
  color:#eef2ff;
  background-color:#080d1e;
  background-image:
    radial-gradient(920px 520px at 10% -10%, rgba(88,112,255,.30), rgba(88,112,255,0) 68%),
    radial-gradient(760px 500px at 94% 2%, rgba(150,86,255,.22), rgba(150,86,255,0) 66%),
    radial-gradient(1100px 620px at 48% 118%, rgba(20,128,168,.18), rgba(20,128,168,0) 70%),
    linear-gradient(178deg,#0a1026 0%,#080d1e 52%,#060a16 100%);
  background-attachment: fixed;
  font-family: "Segoe UI", "Inter", -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Старые движки не знают радиальных градиентов — остаётся тёмный линейный фон. */

.sprite{ position:absolute; width:0; height:0; overflow:hidden; }

svg{ fill:none; stroke: currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }

/* ---------- каркас ---------- */

.app{
  height:100vh;
  height:100dvh;
  display:flex;
  flex-direction:column;
  padding:12px 16px 14px;
}

.top{
  flex:none;
  height:40px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
}

.place{ display:flex; align-items:baseline; min-width:0; }
.city{ font-size:19px; font-weight:700; letter-spacing:-.01em; }
.region{ font-size:13px; color:#94a1c6; white-space:nowrap; margin-left:10px; }
.top-date{ font-size:13.5px; color:#94a1c6; white-space:nowrap; }

.status{
  display:flex;
  align-items:center;
  padding:7px 13px;
  border:1px solid rgba(255,255,255,.085);
  border-radius:999px;
  background:rgba(255,255,255,.035);
  font-size:12.5px;
  color:#94a1c6;
  white-space:nowrap;
}
.dot{
  width:8px; height:8px;
  margin-right:8px;
  border-radius:50%;
  background:#7dd3fc;
  box-shadow:0 0 0 3px rgba(125,211,252,.14);
  animation:pulse 2.4s ease-in-out infinite;
}
.dot[data-state="ok"]{ background:#4ade80; box-shadow:0 0 0 3px rgba(74,222,128,.15); }
.dot[data-state="stale"]{ background:#fbbf24; box-shadow:0 0 0 3px rgba(251,191,36,.15); }
.dot[data-state="error"]{ background:#f87171; box-shadow:0 0 0 3px rgba(248,113,113,.15); }

@keyframes pulse{
  0%,100%{ opacity:1; }
  50%{ opacity:.45; }
}

/* ---------- каркас сетки (flexbox) ---------- */

.grid{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
}

.row-main{
  flex:1;
  min-height:0;
  display:flex;
  margin-bottom:12px;
}

.card{
  position:relative;
  min-width:0;
  background-color:rgba(255,255,255,.05);
  background-image:linear-gradient(158deg, rgba(255,255,255,.072), rgba(255,255,255,.022) 58%, rgba(255,255,255,.015));
  border:1px solid rgba(255,255,255,.085);
  border-radius:18px;
  box-shadow: 0 26px 60px -34px rgba(0,0,0,.95), inset 0 1px 0 rgba(255,255,255,.05);
}

/* Мягкие световые пятна — статичные градиенты, без размытий и анимации. */
.clock:after,
.now:after{
  content:"";
  position:absolute;
  pointer-events:none;
  border-radius:50%;
}
.clock:after{
  left:-110px;
  bottom:-170px;
  width:460px;
  height:460px;
  background:radial-gradient(circle, rgba(86,140,255,.13), rgba(86,140,255,0) 64%);
}
.now:after{
  right:-90px;
  top:-120px;
  width:380px;
  height:380px;
  background:radial-gradient(circle, rgba(158,120,255,.14), rgba(158,120,255,0) 62%);
}

/* ---------- часы ---------- */

.clock{
  flex-grow:1.15;
  flex-shrink:1;
  flex-basis:0;
  min-width:0;
  margin-right:12px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:16px 26px;
  overflow:hidden;
}

.clock-time{
  font-size:140px;
  font-size:clamp(76px, 13.2vw, 164px);
  line-height:.9;
  font-weight:600;
  letter-spacing:-.045em;
  font-variant-numeric: tabular-nums;
  color:#eef3ff;
  text-shadow:0 16px 44px rgba(120,140,255,.16);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)){
  .clock-time{
    background-image:linear-gradient(180deg,#ffffff 18%,#c3cdff 100%);
    -webkit-background-clip:text;
    background-clip:text;
    color:transparent;
  }
}

.clock-date{
  margin-top:12px;
  font-size:16.5px;
  color:#cfd8f4;
  letter-spacing:.005em;
}

.clock-foot{ display:flex; flex-wrap:wrap; margin-top:14px; }

.pill{
  padding:5px 11px;
  margin-right:8px;
  border:1px solid rgba(255,255,255,.085);
  border-radius:999px;
  background:rgba(255,255,255,.04);
  font-size:11.5px;
  color:#c4cee9;
  white-space:nowrap;
}
.pill.ghost{ color:#6d7a9e; background:transparent; }

/* ---------- текущая погода ---------- */

.now{
  flex-grow:1;
  flex-shrink:1;
  flex-basis:0;
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 22px;
  overflow:hidden;
}

.now-main{ min-width:0; }

.now-temp{
  display:flex;
  align-items:flex-start;
  font-size:64px;
  font-size:clamp(50px, 5.9vw, 82px);
  font-weight:600;
  line-height:1;
  letter-spacing:-.035em;
  font-variant-numeric: tabular-nums;
}
.now-temp .deg{ font-size:.52em; font-weight:500; margin-top:.16em; color:#dfe6ff; }

.now-desc{ margin-top:10px; font-size:15.5px; color:#dfe6ff; }

.now-feels{ margin-top:5px; font-size:13px; color:#94a1c6; }
.now-feels b{ color:#c9d3ef; font-weight:600; }

.now-extra{ margin-top:8px; font-size:12.5px; color:#6d7a9e; }

.now-icon{
  flex:none;
  width:118px;
  height:118px;
  margin-left:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#c9d4f2;
}
.now-icon svg{ width:100%; height:100%; stroke-width:1.35; }
.now-icon.is-day{ color:#fbbf24; }
.now-icon.is-night{ color:#aab8ff; }
.now-icon.is-wet{ color:#8ecbff; }
.now-icon.is-snow{ color:#d8e6ff; }

/* ---------- показатели ---------- */

.metrics{
  display:flex;
  margin-bottom:12px;
}

.metric{
  flex-grow:1;
  flex-shrink:1;
  flex-basis:0;
  min-width:0;
  margin-right:12px;
  padding:11px 15px 12px;
  min-height:88px;
  overflow:hidden;
}
.metric:last-child{ margin-right:0; }

.m-label{
  display:block;
  font-size:10.5px;
  letter-spacing:.09em;
  text-transform:uppercase;
  color:#6d7a9e;
}

.m-value{
  margin-top:9px;
  font-size:21px;
  font-weight:600;
  letter-spacing:-.015em;
  white-space:nowrap;
  font-variant-numeric: tabular-nums;
}

.m-sub{
  margin-top:3px;
  font-size:11.5px;
  color:#94a1c6;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.m-ic{
  position:absolute;
  top:11px;
  right:12px;
  width:19px;
  height:19px;
  color:#6d7a9e;
  opacity:.7;
}

.metric:nth-child(1) .m-ic{ color:#7ec8f0; }
.metric:nth-child(2) .m-ic{ color:#8fd7c4; }
.metric:nth-child(3) .m-ic{ color:#b3a6f2; }
.metric:nth-child(4) .m-ic{ color:#f0c674; }
.metric:nth-child(5) .m-ic{ color:#f3aa6e; }

.sun-times{ display:flex; margin-top:10px; }
.sun-t{ display:flex; align-items:center; margin-right:14px; font-size:17px; font-weight:600; font-variant-numeric: tabular-nums; }
.sun-t .tiny{ width:14px; height:14px; margin-right:5px; color:#f3aa6e; stroke-width:2; }

/* ---------- почасовой прогноз ---------- */

.hourly{
  padding:11px 14px 10px;
  margin-bottom:12px;
}

.card-label{
  font-size:10.5px;
  letter-spacing:.09em;
  text-transform:uppercase;
  color:#6d7a9e;
  margin-bottom:7px;
}

.hours{
  display:flex;
}

.hour{
  flex-grow:1;
  flex-shrink:1;
  flex-basis:0;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  margin:0 1px;
  padding:2px 0;
  border-radius:10px;
}
.hour.is-now{ background:rgba(125,211,252,.075); }

.hour-time{ margin-bottom:3px; font-size:11.5px; color:#94a1c6; font-variant-numeric: tabular-nums; }
.hour.is-now .hour-time{ color:#bfe6ff; }

.hour-ic{ width:25px; height:25px; margin-bottom:3px; color:#cfd9f5; stroke-width:1.5; }
.hour-ic.is-day{ color:#ffd479; }
.hour-ic.is-night{ color:#aab8ff; }
.hour-ic.is-wet{ color:#8ecbff; }
.hour-ic.is-snow{ color:#dfe9ff; }

.hour-temp{ margin-bottom:3px; font-size:14.5px; font-weight:600; font-variant-numeric: tabular-nums; }
.hour-p{ font-size:10px; color:#7dd3fc; min-height:12px; }

/* ---------- прогноз на 3 дня ---------- */

.daily{
  display:flex;
  align-items:center;
  padding:10px 14px;
}
.daily .card-label{ margin:0 14px 0 0; flex:none; width:96px; line-height:1.25; }

.days{
  flex:1;
  display:flex;
  min-width:0;
}

.day{
  flex-grow:1;
  flex-shrink:1;
  flex-basis:0;
  min-width:0;
  display:flex;
  align-items:center;
  margin-right:10px;
  padding:5px 10px;
  border:1px solid rgba(255,255,255,.055);
  border-radius:12px;
  background:rgba(255,255,255,.028);
}
.day:last-child{ margin-right:0; }

.day-ic{ width:27px; height:27px; margin-right:9px; flex:none; color:#cfd9f5; stroke-width:1.5; }
.day-ic.is-day{ color:#ffd479; }
.day-ic.is-night{ color:#aab8ff; }
.day-ic.is-wet{ color:#8ecbff; }
.day-ic.is-snow{ color:#dfe9ff; }

.day-text{ min-width:0; display:flex; flex-direction:column; line-height:1.2; }
.day-name{ font-size:12.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.day-date{ font-size:10.5px; color:#6d7a9e; white-space:nowrap; }

.day-temp{
  margin-left:auto;
  font-size:13.5px;
  font-weight:600;
  white-space:nowrap;
  font-variant-numeric: tabular-nums;
}
.day-temp span{ color:#94a1c6; font-weight:500; }

/* ---------- прочее ---------- */

.nojs{
  position:fixed;
  left:16px;
  right:16px;
  bottom:16px;
  padding:12px 16px;
  background:#1a2140;
  border:1px solid rgba(255,255,255,.14);
  border-radius:12px;
  text-align:center;
}

/* Планшет / узкий экран: одна колонка и обычная прокрутка. */
@media (max-width: 980px){
  body{ overflow:auto; }
  .app{ height:auto; min-height:100vh; }
  .row-main{ flex:none; flex-direction:column; margin-bottom:0; }
  .clock{
    flex:none;
    margin-right:0;
    margin-bottom:12px;
  }
  .now{ flex:none; }
  .metrics{ flex-wrap:wrap; }
  .metric{ flex:1 1 45%; margin:0 12px 12px 0; }
  .metric:nth-child(2n){ margin-right:0; }
  .hours{ flex-wrap:wrap; }
  .hour{ flex:0 0 16.666%; }
  .days{ flex-direction:column; }
  .day{ margin:0 0 8px 0; }
  .day:last-child{ margin-bottom:0; }
  .now-icon{ width:92px; height:92px; }
  .clock-time{ font-size:72px; font-size:clamp(64px,18vw,120px); }
}

/* Невысокие экраны (например, 1366×768 с панелью задач): чуть плотнее. */
@media (max-height: 730px) and (min-width: 981px){
  .app{ padding:10px 14px 12px; }
  .top{ margin-bottom:8px; }
  .row-main{ margin-bottom:10px; }
  .metrics{ margin-bottom:10px; }
  .hourly{ margin-bottom:10px; padding:9px 14px 8px; }
  .metric{ min-height:82px; padding:9px 14px 10px; margin-right:10px; }
  .m-value{ font-size:19px; margin-top:7px; }
  .hour-ic{ width:22px; height:22px; }
  .clock-date{ margin-top:8px; font-size:15px; }
  .clock-foot{ margin-top:10px; }
}

@media (max-height: 640px) and (min-width: 981px){
  .clock-time{ font-size:110px; font-size:clamp(60px, 9.5vw, 110px); }
  .now-icon{ width:88px; height:88px; }
  .now-temp{ font-size:52px; }
}

/* Уменьшенная анимация — для экономии батареи. */
@media (prefers-reduced-motion: reduce){
  .dot{ animation:none; }
}

/* Печать не нужна, но пусть будет аккуратно. */
@media print{
  body{ background:#fff; color:#000; }
  .card{ border:1px solid #ccc; box-shadow:none; }
}
