:root {
  --color-black: #000000;
  --color-red: #ff3b30;
  --color-anthracite: #1a1a1a;
  --color-white: #ffffff;
  --color-grey: #8a8a8a;
}

* {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background-image: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.55) 0%,
      rgba(0, 0, 0, 0.35) 40%,
      rgba(0, 0, 0, 0.7) 100%
    ),
    url("img/skytrackerbg.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--color-white);
  font-family: "Hanken Grotesk", sans-serif;
}

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

/* ---------- Hero ---------- */

.hero-band {
  position: relative;
  padding-bottom: clamp(2rem, 6vw, 4rem);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
}

.brand__logo {
  height: 28px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
}

.site-nav a {
  color: var(--color-white);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: var(--color-red);
}

.hero {
  text-align: center;
  padding: clamp(2rem, 8vw, 4.5rem) 1rem 0;
}

.app-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(2.75rem, 8vw, 4.5rem);
  margin: 0 0 2rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.app-title span {
  color: var(--color-red);
}

.search-box {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(26, 26, 26, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 0.35rem 0.35rem 0.35rem 1.25rem;
}

.input-search {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-white);
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.input-search::placeholder {
  color: var(--color-grey);
}

.btn-search {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--color-red);
  color: var(--color-white);
  font-size: 1rem;
  cursor: pointer;
  transition: filter 0.2s ease;
}

.btn-search:hover {
  filter: brightness(1.1);
}

/* ---------- Main / weather card ---------- */

main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem);
}

.weather-card {
  background: rgba(26, 26, 26, 0.72);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.weather-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.weather-main__location .weather-info__city {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  margin: 0 0 0.35rem;
}

.weather-info__day-date {
  margin: 0;
  color: var(--color-grey);
  font-size: 0.9rem;
  text-transform: capitalize;
}

.weather-info__day-date span + span::before {
  content: " · ";
}

.weather-main__condition {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.weather-info__icon img {
  width: 90px;
  height: 90px;
}

.weather-info__description {
  margin: 0;
  font-weight: 600;
  text-transform: capitalize;
}

.weather-main__temp {
  text-align: right;
}

.weather-info__temperature {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(2.25rem, 6vw, 3rem);
  margin: 0;
}

.weather-info__units {
  margin: 0;
  color: var(--color-grey);
  font-size: 0.85rem;
}

.weather-info__units-c::after {
  content: " · ";
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1.25rem;
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.detail {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.detail img {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.detail p {
  margin: 0 0 0.15rem;
  color: var(--color-grey);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail span {
  font-weight: 600;
  font-size: 1rem;
}

/* ---------- Forecast ---------- */

.forecast {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.forecast-card {
  background: rgba(26, 26, 26, 0.72);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.25rem;
  text-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.forecast-card:hover {
  border-color: var(--color-red);
  transform: translateY(-2px);
}

.forecast-card .day {
  margin: 0 0 0.5rem;
  font-weight: 600;
  text-transform: capitalize;
}

.icon-next-day img {
  width: 56px;
  height: 56px;
  margin: 0 auto;
}

.forecast-card .max-temp {
  margin: 0.35rem 0 0;
  color: var(--color-red);
  font-weight: 700;
}

.forecast-card .min-temp {
  margin: 0.15rem 0 0;
  color: var(--color-grey);
}

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

.error-message {
  margin: 1.5rem 0 0;
  text-align: center;
  color: var(--color-red);
  font-size: 0.9rem;
}

.error-message[hidden] {
  display: none;
}

footer {
  margin-top: auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
  color: var(--color-grey);
  font-size: 0.8rem;
}

footer a:hover {
  color: var(--color-red);
}

footer p a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.attribution img {
  height: 20px;
  background: var(--color-white);
  padding: 4px 8px;
  border-radius: 6px;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .weather-main {
    flex-direction: column;
    text-align: center;
  }

  .weather-main__temp {
    text-align: center;
  }

  .weather-details {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-nav {
    font-size: 0.85rem;
  }
}
