:root {
    --bg: #F4EBD9;
    --card: #E6CCAF;
    --text: #293B3F;
    --muted: #6B756F;
    --muted-dark: #4C5956;
    --accent: #D84324;
    --accent-dark: #B9361F;
    --border: #C29872;
    --shadow: rgba(41, 59, 63, .08);
    --radius-lg: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background:
        radial-gradient(circle at 8% 0%, rgba(194,152,114,.10), transparent 28%),
        radial-gradient(circle at 92% 12%, rgba(216,67,36,.045), transparent 24%),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

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

button, input, select { font: inherit; }

code {
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    padding: 86px 0 58px;
    text-align: center;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.eyebrow {
    display: inline-block;
    padding: 7px 12px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255,253,248,.42);
    color: var(--muted-dark);
    font-size: .76rem;
    font-weight: 750;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.logo {
    margin: 0;
    font-size: clamp(3.1rem, 8vw, 5.3rem);
    line-height: .98;
    letter-spacing: -.065em;
    font-weight: 800;
}

.hero-copy {
    width: min(760px, 100%);
    margin: 24px auto 0;
    color: var(--muted-dark);
    font-size: 1.06rem;
}

.download-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 11px;
    flex-wrap: wrap;
    margin-top: 32px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent);
    border-radius: 11px;
    padding: 12px 22px;
    background: var(--accent);
    color: #fff;
    font-weight: 750;
    transition: .18s ease;
}

.download-btn:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    transform: translateY(-1px);
}

.version-select {
    min-width: 225px;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 12px 15px;
    background: rgba(255,253,248,.8);
    color: var(--text);
    outline: none;
}

.version-note {
    margin-top: 11px;
    color: var(--muted);
    font-size: .84rem;
}

.catalog-section { padding: 32px 0 92px; }

.catalog-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 24px;
}

.catalog-head h2 {
    margin: 0;
    font-size: clamp(1.9rem, 3.2vw, 2.55rem);
    letter-spacing: -.035em;
}

.catalog-head p {
    max-width: 560px;
    margin: 0;
    color: var(--muted-dark);
}

.search-wrap {
    position: relative;
    margin-bottom: 19px;
}

.search-icon {
    position: absolute;
    left: 17px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 15px 48px 15px 45px;
    background: rgba(255,253,248,.82);
    color: var(--text);
    outline: none;
    box-shadow: 0 5px 20px var(--shadow);
}

.search-input::placeholder { color: #8A938D; }

.search-input:focus {
    border-color: #A97F5E;
    box-shadow: 0 0 0 3px rgba(194,152,114,.16);
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: none;
}

.search-clear:hover { background: rgba(41,59,63,.07); }

.search-status {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    min-height: 24px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: .84rem;
}

#matchHint {
    margin-left: auto;
    text-align: right;
}

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

.tea-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(230,204,175,.88);
    box-shadow: 0 9px 26px var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease;
}

.tea-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(41,59,63,.11);
}

.tea-card.matched {
    border: 2px solid transparent;
    background:
        linear-gradient(rgba(230,204,175,.97), rgba(230,204,175,.97)) padding-box,
        linear-gradient(115deg, #D84324, #C29872, #4A6B6C, #D84324) border-box;
    background-size: auto, 250% 250%;
    animation: borderShift 2.6s ease infinite;
}

@keyframes borderShift {
    0% { background-position: 0 0, 0% 50%; }
    50% { background-position: 0 0, 100% 50%; }
    100% { background-position: 0 0, 0% 50%; }
}

.tea-visual {
    min-height: 170px;
    display: grid;
    place-items: center;
    background: rgba(255,253,248,.28);
    border-bottom: 1px solid rgba(194,152,114,.72);
}

.bottle-canvas {
    width: 112px;
    height: 112px;
}

.tea-content {
    display: flex;
    flex-direction: column;
    gap: 17px;
    flex: 1;
    padding: 20px;
}

.tea-name {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.25;
    letter-spacing: -.022em;
}

.tea-details {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 18px;
}

.detail-column { min-width: 0; }

.label {
    margin-bottom: 8px;
    color: var(--text);
    font-size: .69rem;
    font-weight: 800;
    letter-spacing: .105em;
    text-transform: uppercase;
}

.effects, .ingredients {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.effect-tag {
    width: fit-content;
    max-width: 100%;
    border: 1px solid rgba(41,59,63,.13);
    border-radius: 8px;
    padding: 5px 8px;
    background: rgba(255,253,248,.34);
    color: var(--muted-dark);
    font-size: .83rem;
    line-height: 1.2;
}

.ingredients {
    margin: 0;
    padding: 0;
    list-style: none;
    color: #465451;
}

.ingredients li {
    position: relative;
    padding-left: 13px;
    font-size: .84rem;
    overflow-wrap: anywhere;
}

.ingredients li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text);
}

.meta {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
}

.rgb {
    color: #5B6763;
    font-size: .74rem;
}

.technical-name {
    color: #596661;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .73rem;
    text-align: right;
    overflow-wrap: anywhere;
}

.info-card {
    margin-top: 34px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(232,219,200,.52);
}

.info-card h2 {
    margin: 0 0 9px;
    font-size: 1.5rem;
}

.info-card p {
    max-width: 850px;
    margin: 0;
    color: var(--muted-dark);
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 40px 0 54px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-title {
    margin-bottom: 6px;
    font-weight: 800;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--muted-dark);
}

.footer-links a:hover {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-note {
    color: var(--muted);
    font-size: .82rem;
    text-align: right;
}

.no-results {
    padding: 50px 24px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    background: rgba(255,253,248,.3);
    color: var(--muted-dark);
    text-align: center;
}

@media (max-width: 980px) {
    .catalog-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 700px) {
    .container { width: min(100% - 28px, 600px); }
    .site-header { padding-top: 62px; }
    .catalog-head { display: block; }
    .catalog-head p { margin-top: 10px; }
    .catalog-grid { grid-template-columns: 1fr; }
    .footer-inner { display: block; }
    .footer-note { margin-top: 18px; text-align: left; }
}

@media (max-width: 430px) {
    .tea-details { grid-template-columns: 1fr; }
    .meta { display: block; }
    .technical-name { margin-top: 5px; text-align: left; }
}
