:root {
  --terracotta: #c75f40;
  --terracotta-light: #dc8668;
  --sand: #d9ad96;
  --espresso: #24130f;
  --espresso-soft: #3a211a;
  --panel: rgba(43, 23, 18, 0.93);
  --panel-soft: rgba(72, 43, 35, 0.72);
  --cream: #fff3e9;
  --cream-soft: #e8d0c2;
  --orange: #ff6533;
  --gold: #f3bd6b;
  --green: #82d8ad;
  --red: #ff7262;
  --line: rgba(255, 255, 255, 0.11);
  --shadow: rgba(47, 24, 17, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--cream);
  font-family: Inter, Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 90% 6%, rgba(255, 101, 51, 0.34), transparent 25%),
    radial-gradient(circle at 10% 90%, rgba(255, 243, 233, 0.12), transparent 30%),
    linear-gradient(145deg, #d6a892 0%, #b86b50 52%, #8d4635 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: -6%;
  z-index: 0;
  pointer-events: none;
  background: url("assets/cosmico-watermark.jpg") center / 58vw auto no-repeat;
  opacity: 0.055;
  filter: grayscale(1) brightness(2.5) contrast(0.8) blur(0.2px);
  mix-blend-mode: screen;
  transform: rotate(-2deg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 5px
    );
}

#app {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  padding: 2.1vh 1.8vw 1.5vh;
  display: grid;
  grid-template-rows: 8.5vh minmax(0, 1fr) 3vh;
  gap: 1.2vh;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 0.65fr;
  align-items: center;
  min-height: 0;
}

.brand-block .eyebrow,
.section-label {
  color: var(--orange);
  font-size: clamp(10px, 0.82vw, 16px);
  font-weight: 900;
  letter-spacing: 0.22em;
}

.brand-block h1 {
  margin: 0.35vh 0 0;
  font-size: clamp(34px, 3vw, 62px);
  line-height: 0.92;
  letter-spacing: 0.015em;
}

.brand-block h1 span {
  color: var(--orange);
}

.topbar-summary {
  display: flex;
  align-items: center;
  gap: 0.55vw;
  padding: 0.8vh 1vw;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(45, 24, 18, 0.5);
  box-shadow: 0 0.7vh 2vh var(--shadow);
}

.topbar-summary > span:first-child {
  font-size: 1.45vw;
}

.topbar-summary strong {
  font-size: 1.15vw;
}

.topbar-summary > span:last-child {
  color: var(--cream-soft);
  font-size: 0.7vw;
}

.clock {
  text-align: right;
}

.clock strong {
  display: block;
  font-size: clamp(34px, 3vw, 62px);
  line-height: 0.9;
}

.clock span {
  display: block;
  margin-top: 0.65vh;
  color: var(--cream-soft);
  font-size: 0.72vw;
  text-transform: capitalize;
}

.dashboard {
  min-height: 0;
  display: grid;
  grid-template-columns: 0.93fr 1.07fr;
  grid-template-rows: minmax(0, 1.05fr) minmax(0, 0.92fr) 8.5vh 7.8vh;
  grid-template-areas:
    "current media"
    "forecast rescue"
    "conditions conditions"
    "advice advice";
  gap: 1.25vh 1.05vw;
}

.card {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.2vw;
  background:
    linear-gradient(145deg, rgba(68, 38, 31, 0.96), rgba(34, 18, 14, 0.98));
  box-shadow:
    0 1vh 2.6vh var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.current-card {
  grid-area: current;
  padding: 2.2vh 1.5vw;
}

.current-layout {
  height: calc(100% - 2.2vh);
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: 1.35vw;
  align-items: center;
}

.temperature-line {
  display: flex;
  align-items: center;
  gap: 0.8vw;
}

.weather-icon {
  font-size: clamp(48px, 4vw, 82px);
  filter: drop-shadow(0 0.5vh 0.9vh rgba(0, 0, 0, 0.2));
}

.temperature {
  font-size: clamp(70px, 6.3vw, 130px);
  line-height: 0.86;
  letter-spacing: -0.06em;
}

.condition {
  margin: 1.2vh 0 0;
  font-size: clamp(19px, 1.4vw, 29px);
}

.location {
  margin: 0.45vh 0 0;
  color: var(--cream-soft);
  font-size: 0.72vw;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9vh 0.65vw;
}

.metric {
  min-width: 0;
  padding: 1vh 0.8vw;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 0.75vw;
  background: rgba(255, 255, 255, 0.075);
}

.metric span {
  display: block;
  color: var(--cream-soft);
  font-size: 0.58vw;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 0.25vh;
  font-size: 1vw;
  white-space: nowrap;
}

.media-card {
  grid-area: media;
  position: relative;
  padding: 1.5vh 1.05vw 1.1vh;
  display: flex;
  flex-direction: column;
}

.media-heading,
.rescue-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1vw;
}

.media-heading h2,
.rescue-heading h2 {
  margin: 0.35vh 0 0;
  font-size: 1.25vw;
}

.media-indicator,
.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4vw;
  padding: 0.55vh 0.65vw;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cream-soft);
  background: rgba(255, 255, 255, 0.065);
  font-size: 0.58vw;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.live-dot {
  width: 0.48vw;
  height: 0.48vw;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0.75vw rgba(255, 114, 98, 0.65);
}

.media-slider {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 1vh;
  overflow: hidden;
  border-radius: 0.85vw;
  background: #160d0b;
}

.media-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(4%);
  transition: opacity 0.75s ease, transform 0.75s ease;
  pointer-events: none;
}

.media-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.media-slide iframe,
.media-slide img,
.media-slide video {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  object-fit: cover;
}

.promo-slide {
  height: 100%;
  padding: 2.4vh 2vw;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(0deg, rgba(21, 11, 8, 0.86), rgba(21, 11, 8, 0.08)),
    var(--promo-image, linear-gradient(135deg, #b94f33, #2b1612));
  background-size: cover;
  background-position: center;
}

.promo-slide small {
  color: var(--gold);
  font-size: 0.7vw;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.promo-slide strong {
  margin-top: 0.35vh;
  font-size: 2.35vw;
  line-height: 1;
}

.promo-slide p {
  margin: 0.7vh 0 0;
  color: var(--cream-soft);
  font-size: 0.85vw;
}

.slide-dots {
  height: 1.5vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.35vw;
}

.slide-dot {
  width: 0.45vw;
  height: 0.45vw;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.slide-dot.active {
  background: var(--orange);
  box-shadow: 0 0 0.6vw rgba(255, 101, 51, 0.48);
}

.forecast-card {
  grid-area: forecast;
  padding: 1.4vh 1.25vw 1.2vh;
}

.hourly-forecast {
  height: calc(100% - 2.2vh);
  margin-top: 0.8vh;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.55vw;
}

.hour {
  min-width: 0;
  padding: 0.7vh 0.25vw;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 0.75vw;
  background: rgba(255, 255, 255, 0.065);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  text-align: center;
}

.hour .time {
  color: var(--cream-soft);
  font-size: 0.58vw;
}

.hour .icon {
  font-size: 1.6vw;
}

.hour .degrees {
  font-size: 1.05vw;
  font-weight: 900;
}

.hour .rain {
  color: #bfe7ff;
  font-size: 0.55vw;
}

.rescue-card {
  grid-area: rescue;
  padding: 1.4vh 1.15vw 1vh;
  display: flex;
  flex-direction: column;
}

.rescue-posts {
  flex: 1;
  min-height: 0;
  margin-top: 0.9vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7vw;
}

.rescue-post {
  min-width: 0;
  min-height: 0;
  padding: 1vh 0.85vw;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 0.8vw;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.rescue-post-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6vw;
}

.rescue-post h3 {
  margin: 0;
  font-size: 0.92vw;
}

.lifeguard-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.32vw;
  font-size: 0.66vw;
  font-weight: 900;
}

.status-light {
  width: 0.55vw;
  height: 0.55vw;
  border-radius: 50%;
  background: #666;
}

.status-light.on {
  background: var(--green);
  box-shadow: 0 0 0.75vw rgba(130, 216, 173, 0.55);
}

.status-light.off {
  background: #111;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.rescue-state {
  margin: 0.6vh 0 0;
  color: var(--cream-soft);
  font-size: 0.64vw;
  line-height: 1.25;
}

.flag-block {
  margin-top: 0.75vh;
  padding-top: 0.65vh;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55vw;
  align-items: center;
}

.flag-block img {
  width: 2.7vw;
  height: 4.2vh;
  object-fit: contain;
}

.flag-block strong {
  display: block;
  color: var(--gold);
  font-size: 0.68vw;
  line-height: 1.2;
}

.flag-block span {
  display: block;
  margin-top: 0.18vh;
  color: var(--cream-soft);
  font-size: 0.52vw;
  line-height: 1.2;
}

.no-flag {
  margin-top: 0.75vh;
  padding-top: 0.65vh;
  border-top: 1px solid var(--line);
  color: var(--cream-soft);
  font-size: 0.55vw;
}

.rescue-disclaimer {
  margin: 0.55vh 0 0;
  color: var(--cream-soft);
  font-size: 0.5vw;
}

.rescue-loading {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  color: var(--cream-soft);
  font-size: 0.72vw;
}

.conditions-strip {
  grid-area: conditions;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.7vw;
}

.condition-item {
  min-width: 0;
  padding: 1.1vh 1vw;
  border: 1px solid var(--line);
  border-radius: 0.9vw;
  background: rgba(45, 24, 18, 0.78);
  box-shadow: 0 0.8vh 2vh var(--shadow);
  display: flex;
  align-items: center;
  gap: 0.7vw;
}

.condition-icon {
  font-size: 1.5vw;
}

.condition-item small {
  display: block;
  color: var(--cream-soft);
  font-size: 0.55vw;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.condition-item strong {
  display: block;
  margin-top: 0.25vh;
  font-size: 0.92vw;
  white-space: nowrap;
}

.advice-bar {
  grid-area: advice;
  min-height: 0;
  padding: 1.1vh 1.25vw;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.95vw;
  background:
    linear-gradient(100deg, rgba(255, 101, 51, 0.3), rgba(45, 24, 18, 0.85));
  box-shadow: 0 0.8vh 2vh var(--shadow);
  display: flex;
  align-items: center;
  gap: 0.8vw;
}

.advice-icon {
  width: 2.6vw;
  height: 2.6vw;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold);
  font-size: 1.2vw;
}

.advice-bar small {
  display: block;
  color: var(--orange);
  font-size: 0.55vw;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.advice-bar strong {
  display: block;
  margin-top: 0.28vh;
  font-size: 0.86vw;
  line-height: 1.25;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--cream-soft);
  font-size: 0.55vw;
}

.connection-state {
  display: flex;
  align-items: center;
  gap: 0.4vw;
}

.connection-dot {
  width: 0.48vw;
  height: 0.48vw;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0.65vw rgba(255, 101, 51, 0.55);
}

.connection-state.online .connection-dot {
  background: var(--green);
  box-shadow: 0 0 0.65vw rgba(130, 216, 173, 0.55);
}

@media (max-aspect-ratio: 4/3) {
  #app {
    padding-left: 2vw;
    padding-right: 2vw;
  }

  .dashboard {
    grid-template-columns: 1fr 1fr;
  }

  .topbar-summary {
    display: none;
  }

  .topbar {
    grid-template-columns: 1fr 0.7fr;
  }
}
