/* style.css — all styling */
:root {
  --bg: #14110f;
  --bg-2: #1c1815;
  --surface: #221d19;
  --surface-2: #2a2420;
  --border: #3a322c;
  --text: #f4ece2;
  --muted: #b3a399;
  --accent: #ff8a4c;
  --accent-2: #ffb961;
  --danger: #ff6b6b;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf5ee;
    --bg-2: #f3ebde;
    --surface: #ffffff;
    --surface-2: #f7f0e4;
    --border: #e3d7c6;
    --text: #2a211a;
    --muted: #7a6a5c;
    --accent: #d9651b;
    --accent-2: #f08821;
    color-scheme: light;
  }
}
html[data-theme="dark"] {
  --bg: #14110f; --bg-2: #1c1815; --surface: #221d19; --surface-2: #2a2420;
  --border: #3a322c; --text: #f4ece2; --muted: #b3a399;
  --accent: #ff8a4c; --accent-2: #ffb961; color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #faf5ee; --bg-2: #f3ebde; --surface: #ffffff; --surface-2: #f7f0e4;
  --border: #e3d7c6; --text: #2a211a; --muted: #7a6a5c;
  --accent: #d9651b; --accent-2: #f08821; color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(900px 500px at 110% -10%, rgba(255,138,76,0.12), transparent 60%),
    radial-gradient(700px 400px at -10% 0%, rgba(255,185,97,0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  padding: 0 0 80px;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
body.noscroll { overflow: hidden; }

.topbar {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
  padding: 22px clamp(16px, 4vw, 40px) 14px;
  max-width: 1180px; margin: 0 auto;
}
.brand { display: flex; gap: 14px; align-items: center; }
.logo {
  font-size: 34px; line-height: 1;
  width: 56px; height: 56px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow);
}
.brand h1 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.brand .tag { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.search { flex: 1 1 280px; min-width: 200px; max-width: 420px; }
#search {
  width: 100%; padding: 13px 16px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 15px; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
#search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,138,76,0.18);
}
#search::placeholder { color: var(--muted); }

.cats {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 4px clamp(16px, 4vw, 40px) 8px;
  max-width: 1180px; margin: 0 auto;
}
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); cursor: pointer;
  font-size: 14px; font-weight: 600;
  transition: transform .15s, background .2s, border-color .2s, color .2s;
}
.pill .pe { font-size: 15px; }
.pill:hover { transform: translateY(-1px); border-color: var(--accent); }
.pill:active { transform: translateY(0); }
.pill.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a0f08; border-color: transparent;
  box-shadow: 0 6px 18px rgba(255,138,76,0.35);
}
.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  padding: 16px clamp(16px, 4vw, 40px);
  max-width: 1180px; margin: 0 auto;
}
.card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; position: relative;
  box-shadow: var(--shadow);
  transition: transform .18s, border-color .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 0;
}
.emoji {
  font-size: 40px; width: 64px; height: 64px;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(255,185,97,0.18), transparent 70%);
  border-radius: 14px;
}
.fav {
  background: transparent; border: 1px solid var(--border);
  color: var(--accent-2); width: 38px; height: 38px;
  border-radius: 50%; cursor: pointer; font-size: 18px;
  display: grid; place-items: center;
  transition: background .2s, transform .15s, color .2s;
}
.fav:hover { background: rgba(255,138,76,0.14); transform: scale(1.08); }
.fav.big { width: auto; padding: 0 16px; height: 38px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.fav.big.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a0f08; border-color: transparent; }

.card-body { padding: 12px 16px 18px; flex: 1; }
.cat {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
}
.card-body h3 { margin: 4px 0 6px; font-size: 18px; letter-spacing: -0.01em; }
.desc { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }
.meta {
  display: flex; gap: 14px; font-size: 12.5px; color: var(--muted);
  margin-top: auto;
}

.empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
}
.empty h2 { color: var(--text); margin: 0 0 6px; }

.sheet {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.sheet.open { opacity: 1; pointer-events: auto; }
.sheet-inner {
  width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.4);
  transform: translateY(20px); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  padding: 22px clamp(18px, 4vw, 30px) 30px;
}
.sheet.open .sheet-inner { transform: translateY(0); }
.sheet-head { position: relative; }
.sheet-toprow { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.big-emoji {
  font-size: 52px; width: 84px; height: 84px;
  display: grid; place-items: center; border-radius: 18px;
  background: radial-gradient(circle at 30% 30%, rgba(255,185,97,0.2), transparent 70%);
  border: 1px solid var(--border);
}
.sheet-head h2 { margin: 12px 0 6px; font-size: 26px; letter-spacing: -0.02em; }
.sheet-desc { color: var(--muted); margin: 8px 0 0; font-size: 14.5px; }
.close {
  position: absolute; top: -6px; right: -6px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); cursor: pointer;
  font-size: 24px; line-height: 1;
  transition: background .2s, transform .15s;
}
.close:hover { background: var(--accent); color: #1a0f08; transform: rotate(90deg); }

.sheet-cols {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 22px;
  margin-top: 22px;
}
.sheet-cols h4 {
  margin: 0 0 10px; font-size: 13px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent);
}
.ing { list-style: none; padding: 0; margin: 0; }
.ing li {
  padding: 9px 0; border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li {
  display: flex; gap: 12px; padding: 10px 0;
  font-size: 14.5px; align-items: flex-start;
}
.stepnum {
  flex: 0 0 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a0f08; font-weight: 800; font-size: 13px;
  display: grid; place-items: center;
}

@media (max-width: 620px) {
  .sheet-cols { grid-template-columns: 1fr; gap: 6px; }
  .sheet-inner { border-radius: 18px 18px 0 0; }
  .topbar { padding-top: 18px; }
  .brand h1 { font-size: 19px; }
}

.foot {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: linear-gradient(180deg, transparent, var(--bg) 30%);
  font-size: 12.5px; color: var(--muted);
  pointer-events: none;
}
.foot > * { pointer-events: auto; }
.chip-toggle {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.chip-toggle:hover { transform: translateY(-1px); border-color: var(--accent); }
.chip-toggle.on {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a0f08; border-color: transparent;
}
.chip-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
