/* ============================================================
   Kuchnia - design system
   Koncepcja: "Papryka, maka i ziola"
   gleboka czerwien papryki (apetyt) + krem maki + zielen ziol
   Typografia: Spectral (display) + Hanken Grotesk (body)
   ============================================================ */

:root {
  /* Light */
  --bg: #faf5ec;
  --bg-panel: #f3ecdd;
  --bg-card: #fffdf7;
  --text: #26211c;
  --muted: #6d6353;
  --accent: #b53a26;
  --accent-hover: #9c2f1e;
  --accent-soft: rgba(181, 58, 38, 0.1);
  --accent-subtle: rgba(181, 58, 38, 0.28);
  --herb: #4a6b3a;
  --herb-soft: rgba(74, 107, 58, 0.1);
  --herb-subtle: rgba(74, 107, 58, 0.28);
  --border: #e4d9c3;
  --border-strong: #d6c8aa;
  --header-bg: rgba(250, 245, 236, 0.92);
  --shadow-card: 0 1px 2px rgba(38, 33, 28, 0.05), 0 4px 14px rgba(38, 33, 28, 0.06);
  --shadow-card-hover: 0 2px 4px rgba(38, 33, 28, 0.07), 0 10px 26px rgba(38, 33, 28, 0.1);
  --warn-bg: #fdf1e3;
  --warn-border: #e0a458;
  --warn-text: #7a4a12;
  --tip-bg: #edf3e8;
  --tip-border: #8fae7c;
  --tip-text: #3a552c;
  --danger-text: #a03a1e;
  --pot-body: #b53a26;
  --pot-lid: #d8c9a8;
  --radius: 14px;
  --radius-sm: 8px;
  --header-height: 60px;
  --sidebar-width: 288px;
  --transition: 0.2s ease-out;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181310;
    --bg-panel: #211a14;
    --bg-card: #261e17;
    --text: #ece4d5;
    --muted: #b3a68f;
    --accent: #e06445;
    --accent-hover: #eb7a5a;
    --accent-soft: rgba(224, 100, 69, 0.14);
    --accent-subtle: rgba(224, 100, 69, 0.32);
    --herb: #9db98a;
    --herb-soft: rgba(157, 185, 138, 0.12);
    --herb-subtle: rgba(157, 185, 138, 0.3);
    --border: #33291e;
    --border-strong: #453828;
    --header-bg: rgba(24, 19, 16, 0.92);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.25);
    --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 10px 26px rgba(0, 0, 0, 0.4);
    --warn-bg: #2e2316;
    --warn-border: #b57f3a;
    --warn-text: #e8c088;
    --tip-bg: #1e2a1a;
    --tip-border: #67855a;
    --tip-text: #c2d4b8;
    --danger-text: #f09a7c;
    --pot-body: #e06445;
    --pot-lid: #6b5c42;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 500px at -10% -5%, var(--accent-soft), transparent 60%),
    radial-gradient(800px 480px at 110% 105%, var(--herb-soft), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: "Spectral", Georgia, serif;
  line-height: 1.22;
  text-wrap: balance;
  margin: 0 0 0.5em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { left: 8px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Header ---------- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.app-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-subtle), transparent);
  opacity: 0.3;
  pointer-events: none;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
}

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.menu-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  flex-shrink: 0;
}
.brand:hover { color: var(--text); }
.brand-mark {
  font-size: 1.5rem;
  line-height: 1;
}
.brand-name {
  font-family: "Spectral", Georgia, serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}
.brand-name em {
  font-style: normal;
  color: var(--accent);
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
  margin-left: auto;
}
.search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-results {
  display: none;
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card-hover);
  z-index: 120;
  overflow: hidden;
}
.search-results.open { display: block; }
.search-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--accent-soft); color: var(--text); }
.si-title { font-weight: 600; font-size: 0.9rem; }
.si-section { font-size: 0.75rem; color: var(--muted); }
.search-empty { padding: 12px 14px; font-size: 0.85rem; color: var(--muted); }

.header-tagline {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  font-style: italic;
  font-family: "Spectral", Georgia, serif;
}

/* ---------- Layout ---------- */
.layout {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 18px 16px 40px;
  border-right: 1px solid var(--border);
}
.main-content {
  flex: 1;
  min-width: 0;
  padding: 28px 36px 60px;
}
.app-content > * {
  animation: fadeUp 0.28s ease-out both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Sidebar ---------- */
.side-group { margin-bottom: 6px; }
.side-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 10px 6px;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.side-group-title::-webkit-details-marker { display: none; }
.side-group-title::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid var(--accent);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform var(--transition);
}
.side-group[open] > .side-group-title::before { transform: rotate(90deg); }
.side-group-items { padding: 0 0 8px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.4;
  transition: background var(--transition), color var(--transition);
}
.sidebar-link:hover { background: var(--accent-soft); color: var(--text); }
.sidebar-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.s-icon { font-size: 0.95rem; flex-shrink: 0; }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 90;
}
.sidebar-overlay.show { display: block; }

/* ---------- Hero ---------- */
.home-hero {
  position: relative;
  border-radius: var(--radius);
  padding: 44px 40px;
  margin-bottom: 42px;
  background:
    radial-gradient(720px 340px at 85% 20%, var(--accent-soft), transparent 65%),
    radial-gradient(520px 300px at 8% 90%, var(--herb-soft), transparent 60%),
    var(--bg-panel);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 28px;
  align-items: center;
  overflow: hidden;
}
.hero-inner { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  padding: 4px 12px;
  border: 1px solid var(--accent-subtle);
  border-radius: 999px;
  background: var(--accent-soft);
}
.home-hero h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  margin-bottom: 14px;
}
.accent-word { color: var(--accent); }
.hero-sub {
  font-size: 1.02rem;
  color: var(--muted);
  max-width: 56ch;
  margin-bottom: 22px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(181, 58, 38, 0.28);
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  position: relative;
}
.pot-svg { width: min(300px, 100%); height: auto; transition: transform 0.3s ease-out; }
.hero-visual:hover .pot-svg { transform: translateY(-4px); }
.article-nav .prev { margin-right: auto; }

.steam {
  transform-origin: center bottom;
  animation: steamRise 3.4s ease-in-out infinite;
  stroke-width: 6;
}
.steam.s1 { animation-delay: 0s; }
.steam.s2 { animation-delay: 1.15s; }
.steam.s3 { animation-delay: 2.3s; }
@keyframes steamRise {
  0% { opacity: 0; transform: translateY(8px) scaleX(1); }
  30% { opacity: 0.85; }
  100% { opacity: 0; transform: translateY(-26px) scaleX(1.2); }
}

/* ---------- Home sections & cards ---------- */
.home-section { margin-bottom: 44px; }
.home-section h2 {
  font-size: 1.55rem;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.sec-count {
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--accent-subtle);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 2px 8px;
}
.sec-desc { color: var(--muted); margin: -4px 0 16px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.home-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.home-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--accent-subtle);
  color: var(--text);
}
.hc-icon { font-size: 1.5rem; line-height: 1; }
.home-card h3 { font-size: 0.9rem; margin: 4px 0 0; line-height: 1.35; }
.home-card p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}
.hc-more {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.hc-more .arrow { transition: transform var(--transition); }
.home-card:hover .hc-more .arrow { transform: translateX(4px); }

/* ---------- Article ---------- */
.article-header { margin-bottom: 26px; }
.breadcrumbs {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--border-strong); }
.article-header h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: 10px; }
.article-excerpt { font-size: 1.05rem; color: var(--muted); max-width: 70ch; margin-bottom: 14px; }
.article-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
}
.tag {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-subtle);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.75rem;
}

.article-body {
  max-width: 780px;
  font-size: 1.02rem;
}
.article-body h2 {
  font-size: 1.5rem;
  margin-top: 1.6em;
  padding-top: 0.4em;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-height) + 16px);
}
.article-body h3 { font-size: 1.15rem; margin-top: 1.3em; }
.toc-anchor { scroll-margin-top: calc(var(--header-height) + 16px); }
.article-body p { margin: 0.9em 0; }
.article-body ul, .article-body ol { margin: 0.9em 0; padding-left: 1.4em; }
.article-body li { margin: 0.35em 0; }
.article-body strong { font-weight: 700; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }

.article-toc {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 0 0 26px;
  font-size: 0.9rem;
}
.article-toc summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  font-family: "Spectral", Georgia, serif;
  font-size: 1rem;
}
.article-toc ol { margin: 10px 0 0; padding-left: 1.2em; }
.article-toc li { margin: 4px 0; }
.article-toc a { color: var(--text); }
.article-toc a:hover { color: var(--accent); }

/* info / tip / warn boxes */
.info-box, .tip-box, .warn-box {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 0.95rem;
  border-left: 4px solid;
}
.info-box { background: var(--accent-soft); border-left-color: var(--accent); }
.tip-box { background: var(--tip-bg); border-left-color: var(--tip-border); color: var(--tip-text); }
.warn-box { background: var(--warn-bg); border-left-color: var(--warn-border); color: var(--warn-text); }
.info-box strong, .tip-box strong, .warn-box strong { display: block; margin-bottom: 4px; }
.info-box strong::before { content: "ℹ️ "; font-weight: 400; }
.tip-box strong::before { content: "💡 "; font-weight: 400; }
.warn-box strong::before { content: "⚠️ "; font-weight: 400; }
@media (prefers-color-scheme: dark) {
  .tip-box { color: var(--tip-text); }
  .warn-box { color: var(--warn-text); }
}

/* tables */
.table-responsive { overflow-x: auto; margin: 18px 0; }
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--bg-card);
}
.compare-table th, .compare-table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.compare-table th { background: var(--bg-panel); font-family: "Spectral", Georgia, serif; font-size: 0.95rem; }
.compare-table tr:nth-child(even) td { background: var(--bg-panel); }
.compare-table td:first-child { font-weight: 600; }

/* FAQ */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 12px 0;
  background: var(--bg-card);
}
.faq-item h3 { font-size: 1.02rem; margin: 0 0 6px; }
.faq-item p { margin: 0; font-size: 0.95rem; }

/* glossary */
.glossary { margin: 18px 0; }
.glossary dt {
  font-weight: 700;
  font-family: "Spectral", Georgia, serif;
  font-size: 1.05rem;
  margin-top: 14px;
}
.glossary dd { margin: 2px 0 0; font-size: 0.95rem; color: var(--muted); }

blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-left: 4px solid var(--herb);
  background: var(--herb-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
  font-style: italic;
}

/* article prev/next nav */
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.article-nav a {
  flex: 1;
  max-width: 46%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  transition: border-color var(--transition), transform var(--transition);
}
.article-nav a:hover { border-color: var(--accent-subtle); transform: translateY(-2px); }
.article-nav .next { text-align: right; margin-left: auto; }
.an-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.an-title { font-weight: 600; font-size: 0.9rem; margin-top: 2px; }

/* ---------- Footer ---------- */
.app-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 26px 20px;
  font-size: 0.85rem;
  color: var(--muted);
}
.footer-inner p { margin: 4px 0; }
.footer-note { font-size: 0.78rem; }
.footer-copy { font-size: 0.78rem; }

/* ---------- Cursor orb ---------- */
.cursor-orb {
  position: fixed;
  top: 0;
  left: 0;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 65%);
  opacity: 0.55;
  transform: translate(-200px, -200px);
  transition: opacity 0.4s ease-out;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    width: 300px;
    transform: translateX(-102%);
    transition: transform 0.24s ease-out;
    background: var(--bg);
    z-index: 95;
    box-shadow: var(--shadow-card-hover);
    border-right: 1px solid var(--border);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: flex; }
  .header-tagline { display: none; }
  .main-content { padding: 24px 20px 50px; }
  .home-hero { grid-template-columns: 1fr; padding: 32px 26px; }
  .hero-visual { display: none; }
}

@media (max-width: 600px) {
  body { font-size: 16.5px; }
  .home-hero { padding: 26px 20px; }
  .hero-sub { font-size: 0.95rem; }
  .home-section h2 { font-size: 1.3rem; }
  .card-grid { grid-template-columns: 1fr; }
  .article-nav { flex-direction: column; }
  .article-nav a { max-width: 100%; }
  .search-wrap { max-width: none; }
  .footer-inner { padding: 20px 16px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .cursor-orb { display: none; }
}
