:root {
  --bg: #F3F6F5;
  --surface: #FFFFFF;
  --text: #1B2420;
  --text-muted: #5B6B62;
  --accent: #3F6B4A;
  --accent-soft: #E7EFE9;
  --highlight: #C97A2E;
  --border: #D7DEDA;
  --radius-s: 10px;
  --radius-m: 16px;
  --font-display: 'Fraunces', 'Iowan Old Style', serif;
  --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.45;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* ---------- Hero ---------- */

.hero {
  margin-bottom: 28px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 8vw, 36px);
  line-height: 1.15;
  margin: 0 0 10px;
  max-width: 15ch;
}

.hero__pitch {
  margin: 0;
  color: var(--text-muted);
  font-size: 16px;
  max-width: 34ch;
}

/* ---------- Capture ---------- */

.capture {
  margin-bottom: 28px;
}

.capture__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  width: 100%;
  border: 1.5px dashed var(--text-muted);
  border-radius: var(--radius-m);
  cursor: pointer;
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.capture__frame:hover,
.capture__frame:focus-within {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.capture__hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  padding: 0 24px;
}

.capture__icon {
  width: 34px;
  height: 34px;
  color: var(--accent);
}

.capture__preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.capture__retake {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 4px;
}

.capture__add {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px 16px;
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-s);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.capture__add:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.capture__frame--secondary {
  margin-top: 14px;
  aspect-ratio: 16 / 9;
}

/* ---------- Filters ---------- */

.filters {
  margin-bottom: 24px;
}

.filters__title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.filters__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pill[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.carb-custom {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
}

.carb-custom:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---------- Submit ---------- */

.submit-button {
  display: block;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius-s);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.submit-button:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

.submit-button:not(:disabled):active {
  opacity: 0.85;
}

.status {
  min-height: 20px;
  margin: 12px 2px 0;
  font-size: 14px;
  color: var(--text-muted);
}

.status[data-state="error"] {
  color: #B3413A;
}

/* ---------- Results ---------- */

.results {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.recipe {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  padding: 18px 20px;
}

.recipe__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.recipe__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  margin: 0;
}

.recipe__time {
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--highlight);
  white-space: nowrap;
}

.recipe__subheading {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 14px 0 6px;
}

.recipe__subheading:first-of-type {
  margin-top: 0;
}

.recipe ul,
.recipe ol {
  margin: 0;
  padding-left: 20px;
  font-size: 14.5px;
}

.recipe li + li {
  margin-top: 4px;
}

@media (min-width: 600px) {
  .page {
    padding-top: 56px;
  }
}
