:root {
    --ink: #243447;
    --muted: #7e8d9c;
    --soft-muted: #aab6c1;
    --accent: #78b8c7;
    --accent-deep: #4d99ad;
    --accent-wash: #e1f0f1;
    --surface: rgba(255, 255, 255, 0.78);
    --surface-strong: rgba(255, 255, 255, 0.94);
    --line: rgba(76, 112, 126, 0.14);
    --shadow: 0 20px 60px rgba(76, 103, 117, 0.12);
    font-family: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.95) 0 10%, transparent 32%),
        radial-gradient(circle at 90% 4%, rgba(205, 232, 231, 0.8) 0 12%, transparent 36%),
        linear-gradient(145deg, #f7f8f4 0%, #eef4f2 52%, #e7f0f1 100%);
    overflow-x: hidden;
}

button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.site-header { padding: 28px 0 58px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; color: white; background: var(--accent); border-radius: 16px; box-shadow: 0 10px 24px rgba(97, 163, 175, .24); }
.brand-mark svg { width: 23px; }
.brand-name { margin: 0; font-family: "Playfair Display", serif; font-size: 1.7rem; font-weight: 600; letter-spacing: -.03em; }
.header-tools { display: flex; align-items: center; gap: 12px; }
.search-wrap { position: relative; width: min(370px, 42vw); }
.search-box { display: flex; align-items: center; gap: 11px; height: 48px; padding: 0 16px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 30px rgba(91, 119, 127, .06); transition: border .2s, box-shadow .2s; }
.search-box:focus-within { border-color: rgba(77, 153, 173, .5); box-shadow: 0 0 0 4px rgba(120, 184, 199, .14); }
.search-box svg { width: 18px; flex: 0 0 auto; }
.search-box input { width: 100%; color: var(--ink); background: transparent; border: 0; outline: 0; }
.search-box input::placeholder { color: #aab5bd; }
.unit-toggle { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 17px; color: var(--accent-deep); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; transition: transform .2s, background .2s; }
.unit-toggle:hover { transform: translateY(-2px); background: white; }
.unit-toggle svg { width: 17px; }
.search-dropdown { position: absolute; z-index: 10; top: calc(100% + 9px); left: 0; right: 0; max-height: 270px; overflow-y: auto; padding: 6px; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.search-dropdown.hidden, .state.hidden, .weather-content.hidden { display: none; }
.search-result { width: 100%; padding: 12px 14px; text-align: left; color: var(--ink); background: transparent; border: 0; border-radius: 12px; }
.search-result:hover { background: var(--accent-wash); }
.search-result strong, .search-result small { display: block; }
.search-result small { margin-top: 3px; color: var(--soft-muted); }

.glass-card, .glass-card-sm { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.glass-card { border-radius: 30px; }
.glass-card-sm { border-radius: 22px; }
.weather-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); gap: 22px; }
.current-card { position: relative; min-height: 390px; padding: 42px 46px; overflow: hidden; }
.current-card::after { position: absolute; right: -80px; bottom: -130px; width: 300px; height: 300px; content: ""; background: rgba(205, 234, 231, .5); border-radius: 50%; }
.current-copy { position: relative; z-index: 1; }
.location-line { display: flex; align-items: center; gap: 7px; margin: 0 0 7px; color: var(--muted); font-size: 1.05rem; }
.location-line svg { width: 17px; color: var(--accent-deep); }
.current-date { margin: 0 0 38px; color: var(--soft-muted); }
.temperature-line { display: flex; align-items: baseline; gap: 7px; margin-bottom: 20px; }
.temperature { margin: 0; font-size: clamp(5.4rem, 12vw, 8.1rem); line-height: .82; font-weight: 500; letter-spacing: -.09em; }
.temperature-unit { color: var(--accent-deep); font-size: 1.65rem; }
.condition-pill { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 42px; padding: 10px 16px; color: var(--ink); background: rgba(255, 255, 255, .62); border: 1px solid var(--line); border-radius: 999px; }
.condition-icon { font-size: 1.2rem; }
.summary-stats { display: flex; gap: 28px; }
.summary-stat + .summary-stat { padding-left: 28px; border-left: 1px solid var(--line); }
.summary-stat span { display: block; margin-bottom: 5px; color: var(--soft-muted); font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.summary-stat strong { font-size: 1.3rem; font-weight: 600; }
.main-icon { position: absolute; z-index: 0; top: 17px; right: 33px; color: rgba(120, 184, 199, .3); font-size: 8rem; pointer-events: none; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.stat-card { display: flex; min-height: 188px; flex-direction: column; justify-content: space-between; padding: 23px; transition: transform .25s, box-shadow .25s; }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 23px 45px rgba(76, 103, 117, .16); }
.stat-icon { display: grid; width: 42px; height: 42px; place-items: center; color: var(--accent-deep); background: var(--accent-wash); border-radius: 14px; }
.stat-icon svg { width: 20px; }
.stat-label { margin: 0 0 4px; color: var(--soft-muted); font-size: .66rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.stat-value { margin: 0; font-size: 1.4rem; font-weight: 600; }
.forecast-section { margin-top: 48px; }
.section-heading { display: flex; align-items: center; gap: 9px; margin: 0 0 17px 4px; color: var(--ink); font-size: .92rem; font-weight: 700; letter-spacing: .04em; }
.section-heading::before { width: 7px; height: 7px; content: ""; background: var(--accent); border-radius: 50%; }
.hourly-container { display: flex; gap: 12px; padding-bottom: 8px; overflow-x: auto; scrollbar-width: none; }
.hourly-container::-webkit-scrollbar { display: none; }
.hourly-card { flex: 0 0 105px; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 12px; text-align: center; }
.hourly-time { color: var(--soft-muted); font-size: .65rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.hourly-icon { font-size: 1.8rem; }
.hourly-temp { font-size: 1.1rem; font-weight: 600; }
.daily-list { overflow: hidden; }
.daily-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 25px; transition: background .2s; }
.daily-row:hover { background: rgba(225, 240, 241, .48); }
.day-name { flex: 1; font-weight: 600; }
.day-date { display: block; margin-top: 3px; color: var(--soft-muted); font-size: .76rem; font-weight: 400; }
.day-condition { display: flex; flex: 2; align-items: center; gap: 12px; color: var(--muted); }
.day-condition span:first-child { font-size: 1.55rem; }
.day-temperatures { display: flex; flex: 1; justify-content: flex-end; align-items: baseline; gap: 14px; }
.day-high { font-size: 1.1rem; font-weight: 700; }
.day-low { color: var(--soft-muted); font-size: .9rem; }
.site-footer { margin: 56px 0 32px; color: #b2bec4; font-size: .68rem; letter-spacing: .12em; text-align: center; text-transform: uppercase; }
.state { min-height: 45vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.state-icon { display: grid; width: 70px; height: 70px; place-items: center; margin-bottom: 19px; color: var(--accent-deep); background: var(--accent-wash); border-radius: 50%; }
.state-icon svg { width: 32px; }
.state h2 { margin: 0 0 7px; font-family: "Playfair Display", serif; font-size: 2rem; font-weight: 600; }
.state p { margin: 0 0 23px; color: var(--muted); }
.reset-button { padding: 11px 20px; color: white; background: var(--accent-deep); border: 0; border-radius: 999px; }
.loader { width: 45px; height: 45px; margin-bottom: 18px; border: 4px solid var(--accent-wash); border-top-color: var(--accent-deep); border-radius: 50%; }
@media (max-width: 800px) {
    .site-header { align-items: stretch; flex-direction: column; padding-bottom: 36px; }
    .header-tools { width: 100%; }
    .search-wrap { width: 100%; }
    .weather-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .app-shell { width: min(100% - 28px, 1160px); }
    .header-tools { align-items: stretch; flex-direction: column; }
    .unit-toggle { justify-content: center; }
    .current-card { min-height: 0; padding: 30px 25px; }
    .temperature { font-size: 5.4rem; }
    .main-icon { top: 18px; right: 15px; font-size: 5rem; }
    .summary-stats { gap: 15px; justify-content: space-between; }
    .summary-stat + .summary-stat { padding-left: 15px; }
    .summary-stat strong { font-size: 1.05rem; }
    .stat-card { min-height: 155px; padding: 17px; }
    .day-condition { flex: 0 0 auto; }
    .day-condition span:last-child { display: none; }
    .daily-row { padding: 17px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
