:root {
  --bg: #14110f;
  --surface: #1e1917;
  --surface-2: #272120;
  --line: #3a302d;
  --text: #f3ece6;
  --muted: #a99a92;
  --ember: #e2622a;
  --ember-soft: #f08a4b;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--ember-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 18px 64px; }

/* ---------- header ---------- */

header.bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.wordmark {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.wordmark span { color: var(--ember); }

.spacer { flex: 1; }

.who {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40vw;
}

/* ---------- buttons ---------- */

button, .btn {
  font: inherit;
  font-size: 14px;
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
button:hover, .btn:hover { border-color: var(--ember); text-decoration: none; }

.btn-primary {
  background: var(--ember);
  border-color: var(--ember);
  color: #1a1109;
  font-weight: 600;
}
.btn-primary:hover { background: var(--ember-soft); }

.btn-danger { color: #ffb4a2; border-color: #5a2f28; }
.btn-danger:hover { border-color: #a8443a; }

.btn-ghost { background: transparent; }

/* ---------- filters ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 22px;
}

.chip {
  font-size: 13px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  background: var(--ember);
  border-color: var(--ember);
  color: #1a1109;
  font-weight: 600;
}

input[type="search"], input[type="text"], input[type="password"], select, textarea {
  font: inherit;
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--ember);
  outline-offset: 1px;
}
textarea { min-height: 320px; resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; }

.search { flex: 1; min-width: 180px; }

/* ---------- grid ---------- */

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

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
}
.card:hover { border-color: var(--ember); text-decoration: none; }

.thumb {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  background: var(--surface-2);
  display: block;
}

.card-body { padding: 13px 15px 16px; }
.card h3 { margin: 0 0 4px; font-size: 16px; line-height: 1.3; }
.card .meta { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- recipe page ---------- */

.hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-2);
  margin-bottom: 22px;
}

article h1 { font-size: 30px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.02em; }
article h2 { font-size: 20px; margin: 30px 0 10px; color: var(--ember-soft); }
article h3 { font-size: 17px; margin: 22px 0 8px; }
article ul, article ol { padding-left: 22px; }
article li { margin: 5px 0; }
article p { margin: 12px 0; }
article img { max-width: 100%; border-radius: 10px; }

.tag {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 12px;
}

.actions { display: flex; gap: 10px; margin: 26px 0 0; }

/* ---------- auth ---------- */

.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-box {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.auth-box h1 { font-size: 24px; margin: 0 0 4px; }
.auth-box .sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
#pin { letter-spacing: 0.5em; font-size: 20px; text-align: center; }

/* ---------- forms ---------- */

.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.error { color: #ff9b84; font-size: 13px; min-height: 18px; margin: 10px 0 0; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }

@media (max-width: 560px) {
  .wrap { padding: 0 14px 48px; }
  article h1 { font-size: 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .who { display: none; }
}
