:root {
  --bg: #faf8f5;
  --bg-elevated: #ffffff;
  --text: #201a14;
  --text-muted: #6b6058;
  --border: #e8e1d8;
  --accent: #d9622b;
  --accent-strong: #b84e1e;
  --accent-soft: #fbe6d8;
  --shadow: 0 1px 2px rgba(32, 26, 20, 0.06), 0 8px 24px rgba(32, 26, 20, 0.06);
  --shadow-hover: 0 2px 4px rgba(32, 26, 20, 0.08), 0 16px 32px rgba(32, 26, 20, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16130f;
    --bg-elevated: #201b16;
    --text: #f3ede4;
    --text-muted: #a89c8d;
    --border: #33291f;
    --accent: #f0803d;
    --accent-strong: #ff9757;
    --accent-soft: #3a2416;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 32px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px max(16px, calc((100vw - var(--max-width)) / 2));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.search-wrap {
  flex: 1;
  min-width: 160px;
  max-width: 420px;
}

#search {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  min-height: 44px;
}

#search:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Main / layout */

.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.hero {
  padding: 24px 0 8px;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: 0 0 6px;
}

.hero p {
  color: var(--text-muted);
  margin: 0;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 8px 0 4px;
}

.breadcrumb a {
  text-decoration: none;
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent-strong);
}

.crumb-sep {
  margin: 0 8px;
}

/* Folder tiles */

.folder-section {
  margin: 20px 0 32px;
}

.folder-section h2,
.section-label {
  font-size: 1.05rem;
  margin: 0 0 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.folder-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.folder-tile {
  position: relative;
  display: block;
  text-decoration: none;
  color: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.folder-tile:hover,
.folder-tile:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.folder-tile-media {
  position: absolute;
  inset: 0;
}

.folder-tile-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 8, 6, 0.82), rgba(10, 8, 6, 0.15) 55%);
}

.folder-tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.folder-tile-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px;
}

.folder-tile-body h3 {
  margin: 0 0 2px;
  font-size: 1.05rem;
}

.folder-tile-body span {
  font-size: 0.82rem;
  opacity: 0.85;
}

/* Grid + cards */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card[hidden] {
  display: none;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--accent-soft);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 14px 16px 16px;
}

.card-body h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  line-height: 1.3;
}

.card-meta {
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 0;
}

/* Recipe detail page */

.recipe-media {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--accent-soft);
  box-shadow: var(--shadow);
  margin-top: 8px;
}

.recipe-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-head {
  padding: 20px 0 4px;
}

.recipe-head h1 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  font-size: 0.8rem;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

.info-box {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 0 8px;
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.info-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-row dt {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.info-row dd {
  margin: 0;
  font-weight: 600;
}

.info-row a {
  color: var(--accent-strong);
}

.recipe-section {
  margin: 28px 0;
}

.recipe-section h2 {
  font-size: 1.2rem;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.recipe-section ul,
.recipe-section ol {
  padding-left: 1.3em;
  margin: 0;
}

.recipe-section li {
  margin: 6px 0;
}

.recipe-section table {
  width: 100%;
  border-collapse: collapse;
}

.recipe-section th,
.recipe-section td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.tips-box {
  margin: 28px 0;
  padding: 16px 18px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.tips-box h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.tips-box ul {
  margin: 0;
  padding-left: 1.2em;
}

/* Footer */

.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 24px 16px 40px;
}

/* Mobile */

@media (max-width: 600px) {
  .site-header {
    padding: 12px 16px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }

  .card-body {
    padding: 10px 12px 12px;
  }

  .card-body h3 {
    font-size: 0.92rem;
  }
}
