:root {
    color-scheme: light;
    --bg: #f7f0e8;
    --paper: #fffaf3;
    --surface: rgba(255, 255, 255, 0.66);
    --surface-strong: rgba(255, 255, 255, 0.86);
    --text: #1b1b1d;
    --muted: #707174;
    --line: rgba(36, 32, 28, 0.09);
    --accent: #0f8b7f;
    --peach: #efb88b;
    --sky: #84a8ff;
    --shadow: 0 18px 55px rgba(53, 43, 32, 0.1);
    --shadow-hover: 0 22px 70px rgba(53, 43, 32, 0.16);
    --radius: 26px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #101114;
    --paper: #15171b;
    --surface: rgba(25, 27, 32, 0.68);
    --surface-strong: rgba(31, 34, 40, 0.88);
    --text: #f6f1ea;
    --muted: #aaa9a6;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #6cd8cc;
    --peach: #f0b889;
    --sky: #9fb5ff;
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.32);
    --shadow-hover: 0 22px 70px rgba(0, 0, 0, 0.46);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 22% 0%, rgba(239, 184, 139, 0.34), transparent 24rem),
        radial-gradient(circle at 86% 8%, rgba(132, 168, 255, 0.24), transparent 22rem),
        linear-gradient(180deg, var(--bg), var(--paper) 45%, var(--bg));
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

svg {
    width: 1em;
    height: 1em;
    stroke-width: 2;
}

.site-header,
main,
.site-footer {
    width: min(980px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0 10px;
}

.brand,
.header-actions,
.feedback-link,
.search-box,
.search-shortcuts,
.section-head,
.today-card,
.quick-link,
.beta-pill {
    display: flex;
    align-items: center;
}

.brand {
    gap: 10px;
}

.brand-name {
    font-size: 1.18rem;
    font-weight: 950;
}

.beta-pill {
    min-height: 28px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255,255,255,0.42);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 850;
    padding: 0 9px;
    backdrop-filter: blur(18px);
}

.header-actions {
    gap: 8px;
}

.feedback-link,
.icon-button,
.search-shortcuts button,
.search-box button,
.section-hide {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255,255,255,0.5);
    color: var(--text);
    cursor: pointer;
    backdrop-filter: blur(18px);
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

[data-theme="dark"] .feedback-link,
[data-theme="dark"] .icon-button,
[data-theme="dark"] .search-shortcuts button,
[data-theme="dark"] .section-hide {
    background: rgba(255,255,255,0.06);
}

.feedback-link {
    gap: 7px;
    min-height: 38px;
    padding: 0 13px;
    font-size: 0.92rem;
    font-weight: 800;
}

.icon-button,
.section-hide {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
}

.hero {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 48px 0 34px;
    text-align: center;
}

.greeting-line {
    display: flex;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    color: var(--muted);
    font-size: clamp(0.98rem, 2vw, 1.14rem);
    font-weight: 750;
}

.greeting-line span {
    display: inline-flex;
    align-items: center;
}

.greeting-line span + span::before {
    content: "·";
    margin-right: 7px;
    color: rgba(112, 113, 116, 0.58);
}

.daily-phrase {
    margin: 0 0 6px;
    color: var(--text);
    font-size: clamp(1.55rem, 4vw, 2.6rem);
    font-weight: 920;
    letter-spacing: 0;
    line-height: 1.02;
}

.search-box {
    width: min(720px, 100%);
    gap: 12px;
    margin-top: 8px;
    padding: 9px 9px 9px 17px;
    border: 1px solid rgba(255,255,255,0.72);
    border-radius: 999px;
    background: rgba(255,255,255,0.78);
    box-shadow: var(--shadow);
    backdrop-filter: blur(26px);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

[data-theme="dark"] .search-box {
    border-color: var(--line);
    background: rgba(25,27,32,0.78);
}

.search-box:focus-within {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover), 0 0 0 5px rgba(15,139,127,0.1);
}

.search-box > svg {
    color: var(--accent);
    flex: 0 0 auto;
    font-size: 1.16rem;
}

.search-box input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 52px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 1.04rem;
}

.search-box button {
    height: 50px;
    border-color: transparent;
    background: var(--text);
    color: var(--paper);
    font-weight: 900;
    padding: 0 18px;
}

.search-shortcuts {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.search-shortcuts button {
    display: inline-flex;
    gap: 7px;
    min-height: 36px;
    padding: 0 12px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 820;
}

.search-shortcuts button.active {
    background: rgba(15,139,127,0.1);
    color: var(--accent);
}

.today-panel,
.quick-links,
.news-section,
.discoveries {
    margin-top: 18px;
}

.section-head {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.section-head h2 {
    margin: 0;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    line-height: 1.08;
}

.card-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.section-hide {
    width: 34px;
    height: 34px;
    color: var(--muted);
}

.today-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.today-card,
.quick-link,
.news-section,
.discoveries {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.today-card {
    gap: 13px;
    min-height: 112px;
    border-radius: 22px;
    padding: 16px;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.today-card > svg {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 1.35rem;
}

.today-card strong,
.quick-link strong {
    display: block;
}

.today-card small,
.quick-link small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
}

.quick-links {
    padding-top: 4px;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.quick-link {
    min-height: 116px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    border-radius: 24px;
    padding: 16px;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.quick-link span {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(15,139,127,0.13), rgba(132,168,255,0.12));
    color: var(--accent);
}

.content-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.82fr);
    gap: 18px;
    margin-top: 22px;
}

.news-section,
.discoveries {
    border-radius: var(--radius);
    padding: 18px;
}

.news-list {
    display: grid;
    gap: 8px;
}

.news-item {
    display: block;
    border-radius: 16px;
    padding: 10px 11px;
    transition: background 180ms ease, transform 180ms ease;
}

.news-item:hover {
    background: rgba(255,255,255,0.5);
    transform: translateX(2px);
}

[data-theme="dark"] .news-item:hover {
    background: rgba(255,255,255,0.06);
}

.news-item span {
    display: block;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.news-item strong {
    display: block;
    margin-top: 2px;
    font-size: 0.96rem;
    line-height: 1.22;
}

.soft-message,
.rss-note,
.site-footer p {
    color: var(--muted);
}

.rss-note {
    margin: 12px 0 0;
    font-size: 0.88rem;
}

.discovery-grid {
    display: grid;
    gap: 10px;
}

.discovery-card {
    position: relative;
    min-height: 128px;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    justify-content: flex-end;
    border-radius: 20px;
    color: #fff;
    padding: 16px;
    isolation: isolate;
    transition: transform 190ms ease, box-shadow 190ms ease;
}

.discovery-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(145deg, #173e3a, #0f8b7f);
}

.tone-blue::before {
    background: linear-gradient(145deg, #253154, #6478ef);
}

.tone-gold::before {
    background: linear-gradient(145deg, #473016, #d89d38);
}

.discovery-card > svg {
    position: absolute;
    top: 14px;
    right: 14px;
    opacity: 0.75;
    font-size: 1.2rem;
}

.discovery-card span {
    color: rgba(255,255,255,0.72);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.discovery-card strong {
    margin-top: 5px;
    font-size: 1.08rem;
    line-height: 1.12;
}

.feedback-link:hover,
.icon-button:hover,
.search-box button:hover,
.search-shortcuts button:hover,
.section-hide:hover,
.today-card:hover,
.quick-link:hover,
.discovery-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.site-footer {
    padding: 34px 0 42px;
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: 0.92rem;
}

[hidden] {
    display: none !important;
}

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

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

@media (max-width: 860px) {
    .site-header,
    main,
    .site-footer {
        width: min(100% - 26px, 980px);
    }

    .hero {
        padding: 36px 0 28px;
    }

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

    .today-list,
    .content-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .site-header {
        padding-top: 14px;
    }

    .beta-pill,
    .feedback-link {
        display: none;
    }

    .hero {
        gap: 12px;
        padding-top: 34px;
    }

    .daily-phrase {
        font-size: clamp(1.32rem, 8vw, 2rem);
    }

    .search-box {
        display: grid;
        grid-template-columns: auto 1fr;
        border-radius: 24px;
        padding: 11px;
    }

    .search-box button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .search-shortcuts {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 6px;
    }

    .search-shortcuts button {
        flex: 0 0 auto;
    }

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

    .quick-link {
        min-height: 104px;
        border-radius: 20px;
    }

    .today-card {
        min-height: 92px;
    }
}
