@font-face {
  font-family: "D-DIN";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/D-DIN.woff2") format("woff2");
}

:root {
  color: #111;
  background: #d9d9d5;
  font-family: "D-DIN", ui-sans-serif, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.preview {
  width: min(100%, 1060px);
}

.device {
  width: 100%;
  padding: clamp(12px, 2vw, 22px);
  border-radius: 22px;
  background: #171717;
  box-shadow: 0 22px 60px rgb(0 0 0 / 24%);
}

.screen {
  display: grid;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  grid-template-rows: 1fr auto auto;
  padding: clamp(24px, 4.7vw, 52px) clamp(22px, 4.6vw, 50px) clamp(22px, 4.3vw, 46px);
  background: #f5f5f2;
}

.primary {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
}

.current-icon,
.primary-value {
  display: flex;
  min-width: 0;
  height: 84%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.current-icon svg {
  width: clamp(130px, 18vw, 196px);
  height: clamp(130px, 18vw, 196px);
  stroke-width: 1.9;
}

.primary-value {
  position: relative;
}

.primary-value::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: repeating-linear-gradient(to bottom, #777 0 2px, transparent 2px 6px);
  content: "";
}

.primary-value time,
.primary-value strong {
  display: block;
  white-space: nowrap;
  font-size: clamp(70px, 12.5vw, 132px);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.86;
  font-variant-numeric: tabular-nums;
}

.primary-value > span,
.metric span {
  display: block;
  font-size: clamp(12px, 1.55vw, 17px);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.primary-value > span {
  margin-top: clamp(12px, 1.8vw, 20px);
}

.current-values {
  display: grid;
  min-height: clamp(112px, 15vw, 154px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  border-top: 1px solid #aaa9a4;
}

.metric {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(12px, 2vw, 22px);
}

.metric svg {
  width: clamp(29px, 3.2vw, 36px);
  height: clamp(29px, 3.2vw, 36px);
  flex: 0 0 auto;
  stroke-width: 1.9;
}

.metric strong {
  display: block;
  margin-top: clamp(7px, 1vw, 12px);
  white-space: nowrap;
  font-size: clamp(34px, 4.7vw, 50px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.day-forecast {
  position: relative;
  min-height: clamp(190px, 27vw, 280px);
  overflow: hidden;
  border-top: 1px solid #aaa9a4;
}

.day-forecast-title {
  position: absolute;
  z-index: 2;
  top: clamp(15px, 2.1vw, 22px);
  left: 0;
  font-size: clamp(12px, 1.55vw, 17px);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1;
}

.forecast-chart {
  position: absolute;
  inset: clamp(42px, 5vw, 54px) 0 0;
}

.temperature-curve {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  overflow: visible;
}

.forecast-area {
  fill: #deded9;
}

.forecast-line {
  fill: none;
  stroke: #111;
  stroke-linecap: round;
  stroke-width: 5;
  vector-effect: non-scaling-stroke;
}

.temperature-curve circle {
  fill: #f5f5f2;
  stroke: #111;
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

.forecast-points {
  position: absolute;
  display: grid;
  inset: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.forecast-point {
  position: relative;
  min-width: 0;
}

.point-reading {
  position: absolute;
  top: var(--point-y);
  left: 50%;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 15px);
  transform: translate(-50%, -145%);
  white-space: nowrap;
}

.point-reading svg {
  width: clamp(27px, 3.7vw, 40px);
  height: clamp(27px, 3.7vw, 40px);
  flex: 0 0 auto;
  stroke-width: 1.9;
}

.point-reading strong {
  font-size: clamp(32px, 4.4vw, 47px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.forecast-point time {
  position: absolute;
  bottom: clamp(7px, 1.2vw, 13px);
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(12px, 1.55vw, 17px);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 700px) {
  body {
    padding: 12px;
  }

  .device {
    border-radius: 14px;
  }

  .screen {
    padding: 16px 14px;
  }

  .current-icon svg {
    width: clamp(50px, 16vw, 94px);
    height: clamp(50px, 16vw, 94px);
  }

  .primary-value time,
  .primary-value strong {
    font-size: clamp(40px, 12vw, 72px);
  }

  .primary-value > span,
  .metric span {
    font-size: 10px;
  }

  .current-values {
    min-height: 64px;
  }

  .metric {
    gap: 5px;
  }

  .metric svg {
    width: clamp(19px, 4.7vw, 28px);
    height: clamp(19px, 4.7vw, 28px);
  }

  .metric strong {
    margin-top: 4px;
    font-size: clamp(22px, 6.5vw, 38px);
  }

  .metric:nth-child(3) strong {
    font-size: clamp(16px, 4.9vw, 28px);
  }

  .day-forecast {
    min-height: 108px;
  }

  .day-forecast-title {
    top: 8px;
    font-size: 8px;
  }

  .forecast-chart {
    inset: 23px 0 0;
  }

  .point-reading {
    gap: 4px;
  }

  .point-reading svg {
    width: clamp(12px, 4vw, 22px);
    height: clamp(12px, 4vw, 22px);
  }

  .point-reading strong {
    font-size: clamp(17px, 5vw, 28px);
  }

  .forecast-point time {
    bottom: 3px;
    font-size: 8px;
  }

}
