:root {
  --bg0: #061018;
  --bg1: #0b1a24;
  --card: rgba(10, 28, 38, 0.78);
  --line: rgba(120, 190, 200, 0.16);
  --text: #e8f4f6;
  --muted: #8eacb6;
  --accent: #2ec4b6;
  --accent-2: #f0b429;
  --glow: rgba(46, 196, 182, 0.28);
  --r: 18px;
  --font: "IBM Plex Sans", "IBM Plex Sans Thai", sans-serif;
}

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

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg0);
  line-height: 1.45;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 480px at 12% -10%, rgba(46, 196, 182, 0.18), transparent 60%),
    radial-gradient(700px 420px at 90% 8%, rgba(240, 180, 41, 0.12), transparent 55%),
    linear-gradient(180deg, #07131b 0%, #0a1c26 45%, #061018 100%);
}

.top, main {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.6rem 0 0.8rem;
}

.brand {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.brand-block h1 {
  margin: 0.25rem 0 0.15rem;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  letter-spacing: -0.03em;
  font-weight: 700;
}

.place {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.lang {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
}

.lang-btn {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
}

.lang-btn.is-active {
  background: var(--accent);
  color: #041014;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.2rem;
  margin: 0.6rem 0 1.2rem;
  padding: 1.5rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--r) + 4px);
  background:
    linear-gradient(135deg, rgba(46, 196, 182, 0.12), transparent 45%),
    var(--card);
  backdrop-filter: blur(10px);
  animation: rise 0.7s ease both;
}

.hero.empty { grid-template-columns: 1fr; }

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
}

.temp {
  margin: 0.2rem 0;
  font-size: clamp(3.8rem, 10vw, 6.2rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.temp .unit {
  font-size: 0.35em;
  margin-left: 0.15em;
  color: var(--muted);
  vertical-align: super;
}

.feels {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.feels strong { color: var(--text); font-weight: 600; }

.tagline {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  max-width: 28ch;
}

.updated {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.live-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--glow);
  animation: pulse 2s ease-in-out infinite;
}

.hint {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}

.metric {
  margin: 0;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  animation: rise 0.8s ease both;
}

.metric:nth-child(2) { animation-delay: 0.04s; }
.metric:nth-child(3) { animation-delay: 0.08s; }
.metric:nth-child(4) { animation-delay: 0.12s; }

.metric h2 {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.metric .value {
  margin: 0.45rem 0 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.metric .u {
  margin-left: 0.2rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.metric .sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.lower {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 0.9rem;
  padding-bottom: 2.4rem;
}

.webcam, .reports {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  overflow: hidden;
  animation: rise 0.9s ease both;
}

.webcam figcaption,
.reports h2 {
  margin: 0;
  padding: 0.9rem 1rem 0.55rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.webcam img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #031015;
}

.reports {
  padding: 0 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.reports p {
  margin: 0.35rem 0 1.1rem;
  color: var(--muted);
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.7rem 1.05rem;
  border-radius: 999px;
  background: var(--accent);
  color: #041014;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px var(--glow);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--glow); opacity: 1; }
  50% { box-shadow: 0 0 0 8px transparent; opacity: 0.7; }
}

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero, .lower { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .top { flex-direction: column; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .temp { font-size: 4.2rem; }
}
