:root {
    color-scheme: light;
    --bg: #f6f5f0;
    --surface: #fffefa;
    --text: #253c34;
    --muted: #637168;
    --line: #dddfd4;
    --soft: #e9eddf;
    --accent: #d8e69a;
    --accent-text: #26391e;
    --error: #943e2d;
    --error-bg: #fcece5;
    font-family: "Segoe UI", system-ui, sans-serif;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    font-synthesis: none;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #151e1b;
    --surface: #1e2a25;
    --text: #edf0e5;
    --muted: #afbdaf;
    --line: #35463a;
    --soft: #29392d;
    --accent: #c7db8c;
    --accent-text: #25331c;
    --error: #ffc0ae;
    --error-bg: #422d28;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

[hidden] {
    display: none !important;
}

button,
input {
    font: inherit;
}

button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

button:disabled {
    opacity: .5;
    cursor: wait;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid #bd7d3c;
    outline-offset: 4px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    top: -5rem;
    left: 1rem;
    z-index: 10;
    background: var(--accent);
    padding: .8rem;
}

.skip-link:focus {
    top: 1rem;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.4rem max(2rem, calc((100vw - 1280px)/2));
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.brand {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -.07em;
    text-decoration: none;
    line-height: 1.1;
    white-space: nowrap;
}

.brand>span {
    margin-left: .35rem;
    color: #8a9e4c;
}

.brand small {
    display: block;
    font-size: .57rem;
    letter-spacing: .16em;
    margin-top: .6rem;
    font-weight: 650;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.search-wrap {
    position: relative;
    width: 310px;
}

.search-row {
    display: flex;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .25rem;
}

input {
    width: 100%;
    min-width: 0;
    padding: .5rem .7rem;
    border: 0;
    background: transparent;
    color: var(--text);
    outline-offset: 0;
}

button {
    border: 0;
    border-radius: 7px;
    padding: .7rem 1rem;
    background: var(--text);
    color: var(--bg);
    font-size: .85rem;
    font-weight: 650;
}

button:hover {
    filter: brightness(.94);
}

.secondary,
.theme-toggle {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text);
    white-space: nowrap;
}

.theme-toggle {
    font-size: 1.3rem;
    padding: .4rem .8rem;
}

.search-feedback {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 5;
    background: var(--surface);
    box-shadow: 0 14px 24px #0001;
    border-radius: 8px;
}

.search-feedback p:not(:empty) {
    padding: .7rem;
    margin: 0;
    font-size: .85rem;
}

#search-results {
    list-style: none;
    padding: .4rem;
    margin: 0;
}

#search-results button {
    width: 100%;
    text-align: left;
    background: var(--soft);
    color: var(--text);
    margin: .15rem 0;
}

.app {
    max-width: 1280px;
    width: calc(100% - 4rem);
    margin: auto;
}

.intro-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4rem 0 3.5rem;
    gap: 2rem;
}

.eyebrow {
    font-size: .68rem;
    font-weight: 750;
    letter-spacing: .15em;
    margin: 0 0 .8rem;
    color: var(--muted);
}

h1 {
    font-size: clamp(2.6rem, 5.5vw, 4.6rem);
    font-weight: 550;
    letter-spacing: -.065em;
    line-height: 1.08;
    margin: 0;
}

h1 em {
    font-family: Georgia, serif;
    font-weight: 400;
    color: var(--muted);
}

.intro {
    color: var(--muted);
    font-size: 1rem;
    margin-top: 1.4rem;
}

.intro-art {
    width: 300px;
    height: 220px;
    position: relative;
    flex-shrink: 0;
}

.sun {
    width: 125px;
    height: 125px;
    background: var(--accent);
    border-radius: 50%;
    position: absolute;
    top: 8px;
    right: 50px;
    box-shadow: 0 0 0 16px color-mix(in srgb, var(--accent) 20%, transparent);
}

.cloud {
    position: absolute;
    font-size: 180px;
    line-height: 1;
    top: 20px;
    left: 10px;
    color: var(--text);
    opacity: .85;
}

.art-caption {
    font-size: .58rem;
    letter-spacing: .15em;
    position: absolute;
    bottom: 0;
    right: 30px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.section-heading .eyebrow {
    margin-bottom: .3rem;
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -.045em;
    margin: 0;
}

h3 {
    font-size: 1.25rem;
    margin: 0;
    letter-spacing: -.035em;
    font-weight: 650;
}

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

.fine-print,
.timestamp {
    font-size: .73rem;
    color: var(--muted);
}

.overview {
    border-top: 1px solid var(--line);
    padding-top: 2rem;
}

.city-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.city-card {
    display: block;
    text-align: left;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.2rem;
    width: 100%;
    transition: transform .15s, border-color .15s;
}

.city-card:hover {
    transform: translateY(-3px);
    border-color: var(--muted);
}

.city-card[aria-pressed="true"] {
    border-color: var(--text);
    box-shadow: inset 0 3px 0 var(--accent);
}

.city-card-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    margin-bottom: 1.1rem;
}

.city-card-heading span {
    color: var(--muted);
    font-size: .9rem;
}

.mini-days {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .4rem;
}

.mini-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: .7rem;
    font-weight: 400;
    color: var(--muted);
}

.mini-day img {
    width: 42px;
    height: 42px;
}

.mini-day strong {
    font-size: .8rem;
    color: var(--text);
    white-space: nowrap;
}

.city-error {
    font-size: .75rem;
    color: var(--error);
    font-weight: 400;
}

.city-detail {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
    scroll-margin-top: 1.5rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(280px, .85fr) minmax(0, 1.35fr);
    gap: 1.2rem;
}

.weather-card,
.wardrobe-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.7rem;
    background: var(--surface);
}

.weather-card {
    background: var(--soft);
}

.current-weather {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.temperature {
    font-size: 5.5rem;
    letter-spacing: -.08em;
    font-weight: 550;
    line-height: 1.3;
    margin: .4rem 0;
}

.unit {
    font-size: 1.7rem;
    letter-spacing: -.03em;
    vertical-align: super;
    margin-left: .2rem;
}

.description {
    margin: 0 0 1.8rem;
    font-size: 1.1rem;
}

.description::first-letter {
    text-transform: uppercase;
}

.details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
}

dt {
    color: var(--muted);
    font-size: .75rem;
}

dd {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 650;
}

.timestamp {
    margin: 1.3rem 0 0;
}

.wardrobe-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.wardrobe-badge {
    background: var(--accent);
    color: var(--accent-text);
    padding: .35rem .55rem;
    font-size: .55rem;
    font-weight: 750;
    letter-spacing: .06em;
    border-radius: 4px;
    white-space: nowrap;
}

.clothing-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.3rem 0;
}

.clothing-item {
    display: flex;
    align-items: start;
    gap: .7rem;
}

.clothing-icon {
    background: var(--soft);
    color: var(--text);
    width: 43px;
    height: 43px;
    padding: 9px;
    border-radius: 10px;
    flex-shrink: 0;
}

.clothing-item h4 {
    font-size: .86rem;
    margin: 0 0 .2rem;
}

.clothing-item p {
    font-size: .74rem;
    line-height: 1.5;
    color: var(--muted);
    margin: 0;
}

.forecast-section {
    margin-top: 2rem;
}

.daily-forecast {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.day-card {
    text-align: left;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.3rem;
}

.day-card[aria-pressed="true"] {
    background: var(--soft);
    border-color: var(--muted);
}

.day-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.day-top img {
    width: 65px;
    height: 65px;
}

.day-temp {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -.04em;
}

.day-temp small {
    font-size: 1rem;
    color: var(--muted);
    margin-left: .6rem;
}

.day-caption {
    text-transform: capitalize;
    font-weight: 400;
    color: var(--muted);
    font-size: .8rem;
}

.day-metrics {
    display: flex;
    gap: 1rem;
    margin-top: .8rem;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 400;
}

.hourly-heading {
    margin-top: 2rem;
}

.hourly-forecast {
    display: flex;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.hour-slot {
    flex: 1 0 105px;
    padding: 1rem .6rem;
    text-align: center;
    border-right: 1px solid var(--line);
    font-size: .8rem;
}

.hour-slot:last-child {
    border: 0;
}

.hour-slot img {
    display: block;
    width: 50px;
    height: 50px;
    margin: auto;
}

.hour-slot strong {
    display: block;
    font-size: 1.1rem;
}

.hour-slot small {
    color: var(--muted);
}

footer {
    padding: 2rem;
    border-top: 1px solid var(--line);
    text-align: center;
    color: var(--muted);
    font-size: .75rem;
}

footer .brand {
    color: var(--text);
    font-size: 1.2rem;
}

.error {
    color: var(--error);
    background: var(--error-bg);
    border-radius: 8px;
    padding: 1rem;
    font-size: .85rem;
}

#status:empty,
#search-status:empty,
#forecast-status:empty {
    display: none;
}

@media(prefers-reduced-motion:reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

@media(max-width:1050px) {
    .site-header {
        padding: 1rem 2rem;
        gap: 1rem;
    }

    .search-wrap {
        width: 240px;
    }

    .city-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wardrobe-badge {
        display: none;
    }

    .detail-layout {
        grid-template-columns: 1fr 1.2fr;
    }

    .clothing-list {
        grid-template-columns: 1fr;
    }
}

@media(max-width:720px) {
    .site-header {
        flex-wrap: wrap;
        padding: 1rem;
    }

    .header-tools {
        width: 100%;
        flex-wrap: wrap;
        gap: .5rem;
    }

    .search-wrap {
        flex: 1 1 100%;
        width: auto;
    }

    .theme-toggle {
        margin-left: auto;
    }

    .app {
        width: calc(100% - 2rem);
    }

    .intro-section {
        padding: 2.5rem 0 2rem;
    }

    .intro-art {
        display: none;
    }

    .intro {
        font-size: .9rem;
    }

    .section-heading {
        align-items: start;
        flex-wrap: wrap;
        gap: .5rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .section-heading>.muted {
        margin: 0;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .clothing-list {
        grid-template-columns: 1fr 1fr;
    }

    .daily-forecast {
        gap: .5rem;
    }

    .day-card {
        padding: .7rem;
    }

    .day-top {
        flex-direction: column;
        align-items: start;
    }

    .day-temp {
        font-size: 1.5rem;
    }

    .day-temp small {
        font-size: .8rem;
    }

    .day-metrics {
        flex-direction: column;
        gap: .2rem;
    }

    .city-card {
        padding: .8rem;
    }

    .mini-day strong {
        font-size: .7rem;
    }

    .mini-day {
        font-size: .65rem;
    }

    .city-card-heading {
        font-size: 1rem;
    }
}

@media(max-width:380px) {

    .city-grid,
    .clothing-list {
        grid-template-columns: 1fr;
    }

    .desktop-break {
        display: none;
    }
}

.search-row button {
    flex-shrink: 0;
    white-space: nowrap;
}

.header-tools {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.site-header {
    gap: 1rem;
}

.account-panel {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    scroll-margin-top: 1rem;
}

.account-tabs {
    display: flex;
    gap: .5rem;
}

.account-form {
    max-width: 480px;
}

.account-form label {
    display: block;
    margin: 1rem 0 .35rem;
    color: var(--muted);
    font-size: .85rem;
}

.account-form input:not([type="checkbox"]),
.account-form select {
    display: block;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: .7rem;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.account-form>button {
    margin-top: 1.2rem;
}

.profile-grid {
    max-width: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1.5rem;
}

.account-form .check-label {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.check-label input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    accent-color: var(--text);
}

.profile-actions {
    grid-column: 1/-1;
    display: flex;
    gap: .7rem;
    margin-top: 1.5rem;
}

.favourites-section {
    margin-bottom: 2rem;
}

.favourites-list,
.detail-actions {
    display: flex;
    gap: .65rem;
    flex-wrap: wrap;
}

.favourite-chip {
    display: flex;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 8px;
}

.favourite-chip button {
    background: transparent;
    color: var(--text);
}

.favourite-chip button+button {
    border-left: 1px solid var(--line);
    border-radius: 0 7px 7px 0;
}

#favourite-toggle[aria-pressed="true"] {
    background: var(--accent);
    color: var(--accent-text);
}

#account-status:not(:empty) {
    padding: .7rem;
    background: var(--soft);
    border-radius: 8px;
}

.personalised-note {
    color: var(--text);
}

@media(max-width:720px) {
    .account-panel {
        padding: 1.2rem;
    }

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

    .header-tools {
        justify-content: flex-start;
    }

    .header-tools .theme-toggle {
        margin-left: 0;
    }
}