:root {
    --bg-1: #06111b;
    --bg-2: #0d2740;
    --panel: rgba(7, 18, 29, 0.74);
    --panel-strong: rgba(9, 20, 34, 0.9);
    --line: rgba(255, 255, 255, 0.12);
    --line-soft: rgba(255, 255, 255, 0.08);
    --text: #f3f7fb;
    --muted: #a9bfd4;
    --accent: #ffd166;
    --accent-2: #ff8a5b;
    --ice: #77dcff;
    --mint: #8ef3c5;
    --shadow: 0 30px 100px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Cairo", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 12%, rgba(255, 209, 102, 0.18), transparent 18%),
        radial-gradient(circle at 86% 18%, rgba(119, 220, 255, 0.18), transparent 20%),
        radial-gradient(circle at 50% 100%, rgba(142, 243, 197, 0.12), transparent 26%),
        linear-gradient(135deg, var(--bg-1), var(--bg-2));
    overflow-x: hidden;
}

body[data-theme="clear-day"] {
    --bg-1: #07111c;
    --bg-2: #123656;
    --accent: #ffd166;
    --accent-2: #ff8a5b;
    --ice: #7fe5ff;
}

body[data-theme="cloudy"] {
    --bg-1: #0d141c;
    --bg-2: #32485d;
    --accent: #f0f4ff;
    --accent-2: #a1b5cb;
    --ice: #b8d7ee;
}

body[data-theme="rain"] {
    --bg-1: #08111a;
    --bg-2: #17344f;
    --accent: #87d7ff;
    --accent-2: #4aa0ff;
    --ice: #99e8ff;
}

body[data-theme="night"] {
    --bg-1: #050916;
    --bg-2: #1a2148;
    --accent: #c8cbff;
    --accent-2: #8b92ff;
    --ice: #91b8ff;
}

.page-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
    opacity: 0.42;
}

.glow-a {
    top: -80px;
    right: -60px;
    width: 300px;
    height: 300px;
    background: rgba(255, 209, 102, 0.22);
}

.glow-b {
    bottom: -120px;
    left: -80px;
    width: 360px;
    height: 360px;
    background: rgba(119, 220, 255, 0.18);
}

.grid-noise {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 72px 72px;
    opacity: 0.18;
    mask-image: radial-gradient(circle at center, black 45%, transparent 92%);
    pointer-events: none;
}

.app-shell {
    position: relative;
    z-index: 1;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 36px;
}

.panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
        var(--panel);
    border: 1px solid var(--line);
    border-radius: 34px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.hero-stage {
    display: grid;
    grid-template-columns: 1.28fr 0.92fr;
    gap: 22px;
    margin-bottom: 22px;
}

.hero-copy,
.now-show,
.metrics-board,
.forecast-board,
.timeline-board {
    padding: 30px;
}

.eyebrow-row,
.search-rack,
.insight-layout,
.metrics-grid,
.forecast-grid,
.hourly-grid {
    display: grid;
    gap: 16px;
}

.eyebrow-row {
    grid-auto-flow: column;
    justify-content: start;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 0.9rem;
}

.eyebrow-alt {
    color: var(--ice);
}

.hero-copy h1 {
    margin: 22px 0 14px;
    max-width: 680px;
    font-size: clamp(2.5rem, 5.2vw, 5rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
}

.lead {
    max-width: 700px;
    margin: 0;
    color: var(--muted);
    line-height: 1.95;
    font-size: 1.02rem;
}

.search-rack {
    margin-top: 28px;
    grid-template-columns: minmax(0, 1.8fr) minmax(180px, 0.6fr) minmax(180px, 0.6fr);
    align-items: end;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--muted);
}

.field input {
    width: 100%;
    min-height: 60px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font: inherit;
    transition: border-color 0.22s ease, transform 0.22s ease, background 0.22s ease;
}

.field input:focus {
    outline: none;
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.09);
}

.btn {
    min-height: 60px;
    border: 0;
    border-radius: 20px;
    padding: 14px 18px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.22s ease, opacity 0.22s ease, box-shadow 0.22s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #182232;
    box-shadow: 0 15px 36px rgba(255, 138, 91, 0.28);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid var(--line-soft);
}

.ticker {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 26px;
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.05);
}

.ticker-label {
    color: var(--muted);
    font-size: 0.92rem;
}

.ticker strong {
    font-size: 1rem;
}

.ticker-separator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--ice));
    opacity: 0.9;
}

.now-show {
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
        var(--panel-strong);
}

.now-show-top,
.temp-cluster,
.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.section-kicker {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.92rem;
}

.now-show h2,
.section-head h3 {
    margin: 0;
}

.weather-code {
    min-width: 92px;
    height: 92px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    font-family: "Chakra Petch", sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #162131;
    background: linear-gradient(135deg, var(--accent), rgba(255, 255, 255, 0.86));
}

.temp-cluster {
    margin-top: 26px;
}

.temp-core span {
    display: block;
    font-family: "Chakra Petch", sans-serif;
    font-size: clamp(3.8rem, 7vw, 6.4rem);
    line-height: 0.9;
}

.temp-core small,
.mini-chip span,
.status-text,
.metric-card span,
.forecast-meta,
.hour-meta {
    color: var(--muted);
}

.temp-core small {
    display: block;
    margin-top: 8px;
}

.temp-meta {
    display: grid;
    gap: 12px;
    min-width: 180px;
}

.mini-chip {
    padding: 14px 16px;
    border-radius: 22px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.06);
}

.mini-chip strong {
    display: block;
    margin-top: 8px;
    line-height: 1.8;
}

.smart-summary {
    margin: 24px 0 0;
    padding: 18px 20px;
    border-radius: 24px;
    border: 1px solid var(--line-soft);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    line-height: 1.95;
    color: #e6eef7;
}

.insight-layout {
    grid-template-columns: 0.92fr 1.08fr;
    margin-bottom: 22px;
}

.section-head {
    margin-bottom: 18px;
}

.status-text {
    margin: 0;
}

.error-box {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 158, 158, 0.24);
    background: rgba(255, 158, 158, 0.12);
    color: #ffdede;
}

.hidden {
    display: none;
}

.metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card {
    min-height: 190px;
    padding: 22px;
    border-radius: 28px;
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: auto -20% -30% auto;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    opacity: 0.2;
}

.metric-wind {
    background: linear-gradient(145deg, rgba(119, 220, 255, 0.12), rgba(255, 255, 255, 0.04));
}

.metric-wind::before {
    background: rgba(119, 220, 255, 0.5);
}

.metric-humidity {
    background: linear-gradient(145deg, rgba(142, 243, 197, 0.12), rgba(255, 255, 255, 0.04));
}

.metric-humidity::before {
    background: rgba(142, 243, 197, 0.45);
}

.metric-rain {
    background: linear-gradient(145deg, rgba(145, 184, 255, 0.14), rgba(255, 255, 255, 0.04));
}

.metric-rain::before {
    background: rgba(145, 184, 255, 0.45);
}

.metric-pressure {
    background: linear-gradient(145deg, rgba(255, 209, 102, 0.14), rgba(255, 255, 255, 0.04));
}

.metric-pressure::before {
    background: rgba(255, 209, 102, 0.45);
}

.metric-card strong {
    display: block;
    margin: 14px 0 10px;
    font-family: "Chakra Petch", sans-serif;
    font-size: 2.2rem;
}

.metric-card p {
    margin: 0;
    max-width: 260px;
    line-height: 1.85;
    color: #dce6f3;
}

.forecast-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.forecast-card {
    min-height: 210px;
    padding: 22px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.forecast-card:hover,
.hour-card:hover,
.metric-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
}

.forecast-head,
.hour-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.forecast-day {
    font-size: 1.1rem;
    font-weight: 700;
}

.forecast-icon,
.hour-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-family: "Chakra Petch", sans-serif;
    font-weight: 700;
    color: #182232;
    background: linear-gradient(135deg, var(--accent), rgba(255, 255, 255, 0.82));
}

.forecast-temp {
    display: block;
    margin: 18px 0 10px;
    font-family: "Chakra Petch", sans-serif;
    font-size: 2rem;
    line-height: 1;
}

.forecast-text {
    color: #e5edf8;
    line-height: 1.8;
}

.forecast-meta {
    margin-top: 10px;
}

.timeline-board {
    overflow: hidden;
}

.hourly-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.hour-card {
    min-height: 190px;
    padding: 20px;
    border-radius: 26px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
}

.hour-time {
    font-size: 0.95rem;
    color: var(--muted);
}

.hour-temp {
    display: block;
    margin: 16px 0 10px;
    font-family: "Chakra Petch", sans-serif;
    font-size: 2rem;
}

.hour-label {
    color: #e8eff8;
    line-height: 1.7;
}

.hour-meta {
    margin-top: 10px;
}

.skeleton {
    min-height: 180px;
    background:
        linear-gradient(110deg, rgba(255, 255, 255, 0.04) 8%, rgba(255, 255, 255, 0.14) 18%, rgba(255, 255, 255, 0.04) 33%),
        rgba(255, 255, 255, 0.03);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
    to {
        background-position-x: -200%;
    }
}

@media (max-width: 1120px) {
    .hero-stage,
    .insight-layout {
        grid-template-columns: 1fr;
    }

    .hourly-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .app-shell {
        width: min(100% - 18px, 1280px);
        padding-top: 12px;
    }

    .hero-copy,
    .now-show,
    .metrics-board,
    .forecast-board,
    .timeline-board {
        padding: 22px;
        border-radius: 26px;
    }

    .search-rack,
    .metrics-grid,
    .forecast-grid,
    .hourly-grid {
        grid-template-columns: 1fr;
    }

    .temp-cluster,
    .now-show-top,
    .section-head {
        flex-direction: column;
    }

    .weather-code {
        min-width: 78px;
        height: 78px;
    }

    .ticker {
        gap: 10px;
    }
}
