:root {
    --bg: #f2ede2;
    --bg-soft: #f8f3e9;
    --bg-elevated: #fbf7ee;
    --surface: #ffffff;
    --surface-soft: #f6f1e6;
    --surface-warm: #fbeadd;
    --line: #dcd0bb;
    --line-strong: #c0b199;
    --text: #1a1613;
    --text-soft: #3a322b;
    --muted: #6e6558;
    --muted-2: #8a8074;
    --accent: #b04a24;
    --accent-dark: #7a2f14;
    --accent-soft: #e88a5f;
    --sage: #4f6549;
    --shadow-sm: 0 2px 8px rgba(45, 30, 15, 0.05);
    --shadow-md: 0 12px 30px rgba(45, 30, 15, 0.08);
    --shadow-lg: 0 24px 60px rgba(45, 30, 15, 0.1);
    --radius-xl: 32px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 500px at 15% -10%, rgba(255,255,255,.85), transparent 55%),
        radial-gradient(900px 400px at 90% 5%, rgba(255, 230, 205, 0.6), transparent 60%),
        linear-gradient(180deg, #f8f3e9 0%, var(--bg) 100%);
    background-attachment: fixed;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }

.container {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
}
.site-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: saturate(150%) blur(18px);
    -webkit-backdrop-filter: saturate(150%) blur(18px);
    background: rgba(248, 243, 233, 0.78);
    border-bottom: 1px solid rgba(192, 177, 153, 0.5);
}
.site-header-inner {
    display: grid;
    grid-template-columns: auto 1fr minmax(280px, 380px);
    gap: 28px;
    align-items: center;
    padding: 16px 0;
}
.brand-block { display: flex; flex-direction: column; gap: 2px; }
.logo {
    font-family: Georgia, "Times New Roman", "Times Cyr", serif;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text);
}
.brand-tagline {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 600;
}
.site-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.site-nav a {
    color: var(--text-soft);
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 500;
    transition: background-color .2s var(--ease), color .2s var(--ease);
}
.site-nav a:hover { color: var(--text); background: rgba(255,255,255,0.75); }

.search-form { position: relative; }
.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    min-height: 50px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.search-input-wrap:focus-within {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 4px rgba(176, 74, 36, 0.12), var(--shadow-sm);
}
.search-icon {
    color: var(--muted);
    font-size: 18px;
}
.search-form input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    padding: 0;
    font-size: 15px;
}
.search-form input::placeholder { color: var(--muted-2); }
.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    z-index: 40;
}
.search-results a {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 15px;
}
.search-results a:hover { background: var(--surface-soft); }
.search-results .empty { padding: 14px; color: var(--muted); font-size: 14px; }

.site-main { padding: 40px 0 72px; flex: 1; }
.site-footer {
    border-top: 1px solid rgba(192, 177, 153, 0.5);
    background: rgba(255, 255, 255, 0.5);
    margin-top: auto;
}
.site-footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 32px 0 40px;
}
.footer-brand {
    font-family: "Spectral", Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}
.footer-text, .footer-links a { color: var(--muted); font-size: 15px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; align-content: flex-start; }
.footer-links a:hover { color: var(--text); }

/* ---------- Typography helpers ---------- */
.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--sage);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}
.text-link {
    font-weight: 600;
    color: var(--accent-dark);
    border-bottom: 1px dashed transparent;
    transition: border-color .2s var(--ease);
}
.text-link:hover { border-color: var(--accent-dark); }
.muted, .section-note, .card-footer-line, .rating-summary { color: var(--muted); }

/* ---------- Hero ---------- */
.hero-home {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr);
    gap: 28px;
    align-items: stretch;
    margin-bottom: 40px;
}
.hero-home-empty {
    grid-template-columns: 1fr;
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
}
.hero-home-empty .hero-copy {
    text-align: center;
}
.hero-home-empty .hero-copy h1,
.hero-home-empty .hero-copy p {
    margin-left: auto;
    margin-right: auto;
}
.hero-home-empty .hero-actions {
    justify-content: center;
}
.hero-copy,
.feature-card,
.surface-card,
.empty-state-card,
.recipe-hero-card,
.ingredients-box,
.card,
.catalog-hero {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(192, 177, 153, 0.55);
    box-shadow: var(--shadow-md);
}
.hero-copy { padding: 44px; border-radius: var(--radius-xl); position: relative; overflow: hidden; }
.hero-copy::before {
    content: "";
    position: absolute;
    inset: auto -60px -100px auto;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 138, 95, 0.25), transparent 70%);
    pointer-events: none;
}
.hero-copy h1,
.recipe-hero-copy h1,
.section-head h1,
.section-head h2,
.empty-state-card h2 {
    font-family: Georgia, "Times New Roman", "Times Cyr", serif;
    letter-spacing: -0.035em;
    line-height: 1.02;
    margin: 0;
    color: var(--text);
    font-weight: 700;
}
.hero-copy h1 {
    font-size: clamp(42px, 6.2vw, 68px);
    max-width: 12ch;
    margin-bottom: 22px;
}
.hero-copy p {
    max-width: 56ch;
    font-size: 18px;
    color: var(--text-soft);
    margin: 0 0 28px;
    line-height: 1.55;
}
.hero-actions,
.recipe-actions,
.rating-stars,
.ingredients-header,
.cooking-mode-head,
.cooking-controls,
.section-head,
.meta-pills,
.hero-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.hero-actions { margin-bottom: 8px; }

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.005em;
    transition: transform .15s var(--ease),
                background-color .2s var(--ease),
                color .2s var(--ease),
                border-color .2s var(--ease),
                box-shadow .2s var(--ease);
}
.button:hover, .star-button:hover, .page-link:hover, .chip:hover { transform: translateY(-1px); }
.button-primary {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
    box-shadow: 0 8px 24px rgba(26, 22, 19, 0.18);
}
.button-primary:hover { background: #000; box-shadow: 0 12px 30px rgba(26, 22, 19, 0.25); }
.button-ghost, .star-button {
    background: rgba(255, 255, 255, 0.86);
    color: var(--text);
}
.button.is-active, .star-button.is-active {
    background: var(--surface-warm);
    border-color: var(--accent-soft);
    color: var(--accent-dark);
}

.hero-stats {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.stat-card {
    padding: 18px 20px;
    border-radius: var(--radius-md);
    background: rgba(246, 241, 230, 0.75);
    border: 1px solid rgba(192, 177, 153, 0.55);
}
.stat-card strong { display: block; font-size: 24px; line-height: 1.1; margin-bottom: 6px; letter-spacing: -0.02em; }
.stat-card span { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }

.feature-card {
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.feature-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.feature-image { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.feature-image.placeholder { background: linear-gradient(135deg, #ecd6bd, #f6ebd9 55%, #d5dfcd); }
.feature-body { padding: 26px; }
.feature-body .eyebrow { margin-bottom: 8px; }
.feature-body h2 {
    font-family: "Spectral", Georgia, serif;
    font-size: clamp(28px, 3.4vw, 40px);
    line-height: 1.08;
    margin: 0 0 14px;
    letter-spacing: -0.03em;
}
.feature-body a { color: var(--text); }
.feature-body a:hover { color: var(--accent-dark); }

/* ---------- Sections ---------- */
.section-block { margin-top: 40px; }
.section-head { justify-content: space-between; margin-bottom: 22px; align-items: end; }
.section-head-tight { margin-bottom: 16px; }
.section-head-stack { align-items: flex-start; }
.section-head h1 { font-size: clamp(36px, 4.6vw, 54px); }
.section-head h2 { font-size: clamp(28px, 3.2vw, 40px); }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chips-large .chip { min-height: 52px; padding: 0 20px; font-size: 15px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(192, 177, 153, 0.7);
    padding: 10px 16px;
    color: var(--text-soft);
    transition: transform .15s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
}
.chip:hover { border-color: var(--accent-soft); color: var(--accent-dark); background: #fff; }
.chip-label { font-weight: 600; }
.chip-count {
    min-width: 28px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

/* ---------- Cards ---------- */
.grid.cards { display: grid; gap: 22px; }
.cards-home { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards-catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.recipe-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 0;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.recipe-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-media-link { display: block; overflow: hidden; }
.card-media-link .card-image { transition: transform .5s var(--ease); }
.recipe-card:hover .card-media-link .card-image { transform: scale(1.04); }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.card h2, .card h3 {
    font-family: "Spectral", Georgia, serif;
    line-height: 1.15;
    margin: 0;
    letter-spacing: -0.02em;
    font-weight: 700;
}
.card h2 { font-size: 26px; }
.card h3 { font-size: 22px; }
.card h2 a, .card h3 a { color: var(--text); transition: color .2s var(--ease); }
.card h2 a:hover, .card h3 a:hover { color: var(--accent-dark); }

.card-image, .recipe-main-image, .placeholder {
    width: 100%;
    object-fit: cover;
}
.card-image { aspect-ratio: 16 / 11; }
.recipe-main-image { aspect-ratio: 5 / 4; border-radius: var(--radius-lg); }
.placeholder {
    aspect-ratio: 16 / 11;
    background: linear-gradient(135deg, #eed3b5, #f4e6d1 55%, #d9e3d1);
}
.card-footer-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: var(--muted);
    padding-top: 4px;
    border-top: 1px dashed rgba(192, 177, 153, 0.45);
}

/* ---------- Meta pills ---------- */
.meta-pills span, .page-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid rgba(192, 177, 153, 0.6);
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 500;
}
.meta-pills-small span { min-height: 30px; font-size: 13px; padding: 0 12px; }
.meta-pills-large span {
    min-height: 42px;
    padding: 0 18px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.85);
}

.search-hero { background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(251,234,221,.85)); border-left: 4px solid var(--accent); }
.search-hero h1 { color: var(--accent-dark); }

/* ---------- Surfaces ---------- */
.catalog-hero,
.search-hero,
.empty-state-card,
.surface-card,
.ingredients-box,
.recipe-hero-card {
    border-radius: var(--radius-xl);
    padding: 32px;
}
.empty-state-card { text-align: center; padding: 48px 32px; }
.empty-state-card h2 { font-size: clamp(32px, 4vw, 44px); margin-bottom: 8px; }
.empty-state-card p { max-width: 48ch; margin: 6px auto 24px; color: var(--muted); font-size: 16px; }
.empty-state-search {
    max-width: 520px;
    margin: 0 auto 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}
.empty-state-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
@media (max-width: 560px) {
    .empty-state-search { grid-template-columns: 1fr; }
}

/* ---------- Recipe page ---------- */
.recipe-hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
    gap: 32px;
    margin-bottom: 24px;
    align-items: center;
}
.recipe-hero-copy { display: flex; flex-direction: column; justify-content: center; }
.recipe-hero-copy h1 { font-size: clamp(38px, 5.2vw, 60px); margin-bottom: 16px; }
.recipe-excerpt { margin: 0 0 22px; font-size: 19px; color: var(--text-soft); max-width: 52ch; }
.recipe-hero-media .recipe-main-image { box-shadow: var(--shadow-md); }

.recipe-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 24px;
    margin-top: 24px;
    align-items: start;
}
.recipe-aside { position: relative; }
.ingredients-sticky { position: sticky; top: 96px; }
.ingredients-header { justify-content: space-between; align-items: flex-end; margin-bottom: 20px; gap: 16px; }
.servings-label { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; font-weight: 500; }
.servings-label input {
    width: 82px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    text-align: center;
    font-weight: 600;
}
.ingredients-list-clean, .tips-list, .faq-list, .steps-list-modern {
    margin: 0; padding: 0; list-style: none;
}
.ingredients-list-clean li {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 10px;
    align-items: baseline;
    padding: 14px 0;
    border-bottom: 1px solid rgba(192, 177, 153, 0.4);
    font-size: 15px;
}
.ingredients-list-clean li:last-child { border-bottom: 0; padding-bottom: 0; }
.ingredient-amount, .ingredient-unit {
    color: var(--accent-dark);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.ingredient-name { font-weight: 500; color: var(--text); }

.steps-list-modern { display: grid; gap: 16px; }
.recipe-step-item {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 18px;
    align-items: flex-start;
    padding: 20px 22px;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    border: 1px solid rgba(192, 177, 153, 0.45);
    transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.recipe-step-item:hover { border-color: var(--accent-soft); }
.step-number {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--text);
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    font-family: "Spectral", Georgia, serif;
}
.step-text { font-size: 17px; line-height: 1.65; color: var(--text-soft); padding-top: 12px; }

.tips-list { display: grid; gap: 12px; }
.tips-list li, .faq-item {
    padding: 20px 22px;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    border: 1px solid rgba(192, 177, 153, 0.45);
    font-size: 16px;
    line-height: 1.6;
}
.faq-list { display: grid; gap: 12px; }
.faq-item h3 {
    margin: 0 0 10px;
    font-family: "Spectral", Georgia, serif;
    font-size: 22px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.faq-item p { margin: 0; color: var(--text-soft); }

.rating-summary { margin: 0 0 14px; font-size: 15px; }
.rating-summary strong { color: var(--text); font-size: 20px; font-weight: 700; }
.star-button {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    color: var(--text-soft);
    font-weight: 600;
    font-size: 14px;
    transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.star-button:hover { background: var(--surface-warm); border-color: var(--accent-soft); color: var(--accent-dark); }
.star-button.is-selected {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}
.star-button:disabled { opacity: .6; cursor: not-allowed; }
.star-button:disabled.is-selected { opacity: 1; }
.success { color: #256a38; }
.error { color: #a3362f; }

.cooking-step-card {
    padding: 26px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fff 0%, var(--surface-soft) 100%);
    border: 1px solid rgba(192, 177, 153, 0.55);
    font-size: 22px;
    line-height: 1.7;
    color: var(--text);
}
.recipe-page.is-cooking-mode .no-print { display: none !important; }

.pagination { display: flex; flex-wrap: wrap; gap: 10px; margin: 32px 0 6px; }
.page-link {
    color: var(--text-soft);
    font-weight: 600;
    padding: 0 16px;
    min-height: 40px;
    transition: transform .15s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.page-link.is-current {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}
.page-link:not(.is-current):hover { background: #fff; border-color: var(--accent-soft); color: var(--accent-dark); }

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 4px 0 20px;
    color: var(--muted);
    font-size: 13px;
}
.breadcrumbs a { color: var(--muted); transition: color .2s var(--ease); }
.breadcrumbs a:hover { color: var(--accent-dark); }

.related-section { margin-top: 40px; }

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
    .site-header-inner { grid-template-columns: 1fr 1fr; gap: 16px 24px; }
    .site-header-inner .search-form { grid-column: 1 / -1; }
    .site-nav { justify-content: flex-start; }
    .hero-home,
    .recipe-hero-card,
    .recipe-layout { grid-template-columns: 1fr; }
    .cards-home { grid-template-columns: repeat(3, 1fr); }
    .cards-catalog { grid-template-columns: repeat(2, 1fr); }
    .ingredients-sticky { position: static; }
    .hero-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
    .container { width: min(100%, calc(100% - 24px)); }
    .site-header-inner { padding: 12px 0; gap: 12px; }
    .brand-tagline { display: none; }
    .site-nav { gap: 6px; }
    .site-nav a { padding: 7px 10px; font-size: 14px; }
    .hero-copy,
    .catalog-hero,
    .empty-state-card,
    .surface-card,
    .ingredients-box,
    .recipe-hero-card { padding: 24px; border-radius: 22px; }
    .hero-copy { padding: 30px 24px; }
    .cards-home, .cards-catalog { grid-template-columns: repeat(2, 1fr); }
    .card h2, .card h3, .faq-item h3 { font-size: 20px; }
    .recipe-step-item { grid-template-columns: 44px 1fr; padding: 16px 18px; gap: 14px; }
    .step-number { width: 44px; height: 44px; font-size: 15px; }
    .step-text { padding-top: 6px; font-size: 16px; }
    .site-footer-inner { flex-direction: column; padding: 24px 0 32px; }
    .hero-stats { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .logo { font-size: 26px; }
    .site-header-inner { grid-template-columns: 1fr; }
    .cards-home, .cards-catalog { grid-template-columns: 1fr; }
    .hero-copy h1, .recipe-hero-copy h1, .section-head h1, .section-head h2 { line-height: 1.08; }
    .hero-copy p, .recipe-excerpt, .cooking-step-card { font-size: 16px; }
    .search-input-wrap { min-height: 46px; }
    .button { min-height: 44px; padding: 0 18px; font-size: 14px; }
    .ingredients-list-clean li { grid-template-columns: 1fr; gap: 2px; padding: 10px 0; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
    html { scroll-behavior: auto; }
}
