@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;600;700&display=swap');

:root {
    --ink: #17211f;
    --paper: #f2f0e8;
    --blue: #8bd9e8;
    --hot: #ff735f;
    --muted: #68736e;
    --line: #c5c6bb;
}

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(145deg, #dceff0 0%, var(--paper) 38%, #f3dfc8 100%);
    color: var(--ink);
    font-family: 'Space Grotesk', sans-serif;
    margin: 0;
    min-height: 100vh;
    position: relative;
}

body:before {
    background: none;
    content: '';
    inset: 0;
    pointer-events: none;
    position: fixed;
    z-index: -1;
}

body:after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
    content: '';
    height: 100%;
    left: -80%;
    pointer-events: none;
    position: fixed;
    top: 0;
    transform: skewX(-18deg);
    width: 35%;
    z-index: -1;
    animation: cloud-light 12s linear infinite;
}

@keyframes cloud-light {
    to {
        left: 150%;
    }
}

/* =========================
   STICKY HEADER
   ========================= */

header {
    align-items: center;
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
    display: flex;
    justify-content: space-between;
    padding: 20px 7vw;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header a {
    font-weight: 600;
    text-decoration: none;
}

header a:hover {
    text-decoration: underline;
}

header span,
small,
.section-title span {
    color: var(--muted);
    font-family: 'DM Mono', monospace;
    font-size: 11px;
}

.header-tools {
    align-items: center;
    display: flex;
    gap: 18px;
}

.header-tools button {
    background: transparent;
    border-bottom: 1px solid var(--ink);
    color: var(--ink);
    padding: 5px 0;
}

/* =========================
   MAIN CONTENT
   ========================= */

main {
    margin: 0 auto;
    max-width: 1100px;
    padding: 65px 7vw 90px;
}

h1 {
    font-size: clamp(54px, 9vw, 110px);
    letter-spacing: -.08em;
    line-height: .9;
    margin: 0 0 17px;
}

.intro {
    color: var(--muted);
    font-size: 17px;
    margin-bottom: 48px;
}

/* =========================
   FORMS
   ========================= */

label {
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.search-row {
    display: flex;
    gap: 8px;
}

input {
    background: white;
    border: 1px solid var(--line);
    color: var(--ink);
    flex: 1;
    min-width: 0;
    padding: 14px;
}

button {
    background: var(--ink);
    border: 0;
    color: var(--paper);
    cursor: pointer;
    padding: 12px 16px;
}

button:hover {
    background: var(--hot);
    color: var(--ink);
}

#message {
    color: var(--muted);
    font-size: 13px;
    min-height: 20px;
}

/* =========================
   SEARCH SUGGESTIONS
   ========================= */

.suggestions {
    background: white;
    border: 1px solid var(--line);
    max-width: 100%;
    position: relative;
    z-index: 2;
}

.suggestions button {
    background: white;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    display: block;
    font-size: 13px;
    padding: 12px 14px;
    text-align: left;
    width: 100%;
}

.suggestions button:last-child {
    border-bottom: 0;
}

.suggestions button:hover {
    background: var(--blue);
}

/* =========================
   SECTIONS
   ========================= */

section {
    margin-top: 60px;
}

.section-title {
    align-items: baseline;
    border-bottom: 1px solid var(--ink);
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title h2 {
    font-size: 32px;
    margin: 0 0 10px;
}

.map-note {
    color: var(--muted);
    font-size: 13px;
}

/* =========================
   SEASON
   ========================= */

.season-card {
    background: rgba(255, 255, 255, .42);
    border-left: 6px solid var(--hot);
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr 1fr;
    margin-top: 28px;
    padding: 22px;
}

.season-card strong {
    display: block;
    font-size: 28px;
    margin: 10px 0;
}

.season-card p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

/* =========================
   SAVED PLACES
   ========================= */

.saved-controls {
    border-top: 1px solid var(--line);
    min-width: 0;
    padding-top: 14px;
}

.saved-controls > button {
    margin-bottom: 15px;
}

.saved-place {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    max-width: 500px;
}

.saved-place button:first-child {
    background: transparent;
    color: var(--ink);
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
    text-align: left;
}

.saved-place button:first-child span {
    color: var(--muted);
    font-size: 12px;
}

.saved-place .remove-place {
    background: transparent;
    color: var(--hot);
    padding: 8px;
}

/* =========================
   CURRENT WEATHER
   ========================= */

.current-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 1fr;
    margin: 42px 0 70px;
}

.current-card,
.details-card {
    border-top: 1px solid var(--ink);
    padding-top: 20px;
}

.current-card {
    background: var(--blue);
    padding: 22px;
}

.current-card strong {
    display: block;
    font-size: clamp(58px, 10vw, 110px);
    letter-spacing: -.08em;
    line-height: .9;
    margin: 25px 0 15px;
}

.current-card h2 {
    font-size: 26px;
    margin: 0 0 7px;
}

.current-card p {
    margin: 0;
}

.details-card {
    display: grid;
    gap: 1px;
    grid-template-columns: 1fr 1fr;
}

.details-card div {
    border-bottom: 1px solid var(--line);
    padding: 20px;
}

.details-card strong {
    display: block;
    font-size: 22px;
    margin-top: 12px;
}

/* =========================
   MORE DETAILS
   ========================= */

.extra-details {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(2, 1fr);
}

.extra-details div {
    border-bottom: 1px solid var(--line);
    padding: 18px 12px;
}

.extra-details strong {
    display: block;
    font-size: 18px;
    margin-top: 10px;
}

/* =========================
   FORECAST
   ========================= */

.forecast {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.day {
    border-right: 1px solid var(--line);
    padding: 15px 10px;
}

.day:last-child {
    border: 0;
}

.day strong,
.day span {
    display: block;
}

.day strong {
    color: var(--hot);
    font-size: 13px;
    margin: 18px 0;
}

.day span {
    font-size: 13px;
}

.day small {
    font-size: 9px;
}

/* =========================
   HOURLY
   ========================= */

.hourly {
    display: flex;
    overflow-x: auto;
}

.hour {
    border-right: 1px solid var(--line);
    min-width: 90px;
    padding: 16px 12px;
}

.hour strong,
.hour span {
    display: block;
}

.hour strong {
    color: var(--hot);
    font-size: 23px;
    margin: 17px 0 8px;
}

.hour span {
    color: var(--muted);
    font-size: 11px;
}

.sun-times {
    color: var(--muted);
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    margin-top: 15px;
}

/* =========================
   MAP
   ========================= */

#map {
    height: 430px;
    margin-top: 20px;
}

/* =========================
   ACCOUNT DIALOG
   ========================= */

#account-dialog {
    background: var(--paper);
    border: 1px solid var(--ink);
    max-width: 430px;
    padding: 28px;
    width: calc(100% - 30px);
}

#account-dialog input {
    display: block;
    margin-top: 6px;
    width: 100%;
}

#account-dialog form {
    margin: 18px 0;
}

#account-dialog hr {
    border: 0;
    border-top: 1px solid var(--line);
}

.close-button {
    background: transparent;
    color: var(--ink);
    float: right;
    padding: 2px 6px;
}

/* =========================
   SAVE PLACE DIALOG
   ========================= */

#save-place-dialog {
    background: var(--paper);
    border: 1px solid var(--ink);
    max-width: 400px;
    min-width: 0;
    padding: 28px;
    width: calc(100% - 30px);
}

#save-place-dialog::backdrop {
    background: rgba(23, 33, 31, .45);
}

#save-place-dialog input {
    display: block;
    margin: 8px 0 18px;
    width: 100%;
}

#save-place-dialog p {
    color: var(--muted);
    font-size: 13px;
}

/* =========================
   WEATHER SCENE
   ========================= */

.weather-scene {
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    position: fixed;
    z-index: -1;
}

.sun {
    background: #ffd76a;
    border-radius: 50%;
    box-shadow:
        0 0 0 18px rgba(255, 215, 106, .16),
        0 0 80px rgba(255, 180, 80, .42);
    height: 180px;
    position: absolute;
    right: 9vw;
    top: 90px;
    width: 180px;
}

.cloud {
    background: rgba(255, 255, 255, .44);
    border-radius: 50px;
    filter: blur(1px);
    height: 38px;
    position: absolute;
    width: 170px;
}

.cloud:before,
.cloud:after {
    background: inherit;
    border-radius: 50%;
    content: '';
    position: absolute;
}

.cloud:before {
    height: 70px;
    left: 30px;
    top: -30px;
    width: 70px;
}

.cloud:after {
    height: 54px;
    right: 25px;
    top: -21px;
    width: 54px;
}

.cloud-one {
    animation: drift-one 22s linear infinite;
    left: -190px;
    top: 190px;
}

.cloud-two {
    animation: drift-two 28s linear infinite;
    background: rgba(255, 255, 255, .3);
    left: 35%;
    top: 370px;
    transform: scale(.7);
}

@keyframes drift-one {
    to {
        left: 110%;
    }
}

@keyframes drift-two {
    to {
        left: -220px;
    }
}

.horizon {
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .22));
    bottom: 0;
    height: 32vh;
    left: 0;
    position: absolute;
    width: 100%;
}

.rain-streaks {
    background-image: repeating-linear-gradient(
        105deg,
        transparent 0 28px,
        rgba(255, 255, 255, .14) 29px 30px,
        transparent 31px 55px
    );
    inset: 0;
    opacity: .32;
    position: absolute;
    transform: translateY(-40px);
    animation: rain-drift 9s linear infinite;
}

@keyframes rain-drift {
    to {
        transform: translateY(40px);
    }
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 650px) {
    header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .header-tools {
        width: 100%;
        justify-content: space-between;
    }

    .search-row {
        flex-wrap: wrap;
    }

    .search-row input {
        flex-basis: 100%;
    }

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

    .forecast {
        overflow-x: auto;
    }

    .day {
        min-width: 105px;
    }

    #map {
        height: 330px;
    }
}

/* =========================
   REDUCED MOTION
   ========================= */

@media (prefers-reduced-motion: reduce) {
    body:after,
    .cloud-one,
    .cloud-two,
    .rain-streaks {
        animation: none;
    }
}

/* Currently hidden rain streaks */
.rain-streaks {
    display: none;
}

.alerts-section {
    margin-top: 35px;
}

.alert {
    border-left: 6px solid var(--hot);
    background: rgba(255, 255, 255, .55);
    margin-bottom: 12px;
    padding: 18px 20px;
}

.alert h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.alert p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 8px 0;
}

.alert-meta {
    color: var(--muted);
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    margin-top: 12px;
}

.alert-danger {
    border-left-color: #d62828;
}

.alert-warning {
    border-left-color: #f77f00;
}

.alert-watch {
    border-left-color: #fcbf49;
}

.alert-info {
    border-left-color: var(--blue);
}

.no-alerts {
    color: var(--muted);
    font-size: 13px;
    padding: 15px 0;
}