/* Warm, hand-made look inspired by 五歲。i'm Five: cream paper, brown ink, brick red, olive and mustard. */
:root {
  --paper: #fbf4e6;
  --paper-dot: rgba(70, 53, 43, 0.07);
  --card: #fffbf3;
  --ink: #46352b;
  --ink-soft: #7a6657;
  --line: #e3d3bc;
  --brick: #b4472f;
  --brick-ink: #fff8ec;
  --brick-soft: #f8e1d6;
  --olive: #5f6f25;
  --olive-soft: #eef0d8;
  --mustard: #8a6414;
  --mustard-soft: #fbebc4;
  --shadow: rgba(70, 53, 43, 0.16);
  --display: "Huninn", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #221a15;
    --paper-dot: rgba(243, 231, 211, 0.05);
    --card: #2f2620;
    --ink: #f3e7d3;
    --ink-soft: #c2af98;
    --line: #4a3c31;
    --brick: #e07a5f;
    --brick-ink: #2a1a12;
    --brick-soft: #4a2c22;
    --olive: #c3d27f;
    --olive-soft: #36391f;
    --mustard: #f0c46a;
    --mustard-soft: #3e321b;
    --shadow: rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  /* Scattered dots, like the snow in her Christmas cards. */
  background-image: radial-gradient(var(--paper-dot) 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  font: 16px/1.7 system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

.page { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; }

/* Header */
.masthead { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.logo { flex: none; }
.brand { margin: 0; font-family: var(--display); font-size: 30px; line-height: 1.2; color: var(--brick); letter-spacing: 0.04em; }
.tagline { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* Illustration in a taped photo frame */
.hero {
  position: relative;
  margin: 8px 0 20px;
  padding: 10px 10px 12px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 18px 22px 16px 24px / 22px 16px 24px 18px;
  box-shadow: 5px 6px 0 var(--shadow);
  transform: rotate(-0.6deg);
}
.hero::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 110px;
  height: 26px;
  transform: translateX(-50%) rotate(-4deg);
  background: repeating-linear-gradient(45deg, rgba(227, 169, 59, 0.75) 0 8px, rgba(255, 248, 236, 0.75) 8px 16px);
  border-radius: 3px;
}
.hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 50% 42%;
  border-radius: 10px;
}
.hero figcaption { margin-top: 8px; text-align: center; font-family: var(--display); font-size: 18px; color: var(--ink); }

/* Cards */
.card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 20px 16px 22px 18px / 16px 22px 18px 20px;
  box-shadow: 4px 5px 0 var(--shadow);
  padding: 18px 16px;
  margin-bottom: 20px;
}
.memo-title, .question { display: block; margin: 0; font-family: var(--display); font-size: 21px; font-weight: 400; }
label { font-weight: 600; }

textarea, input, select {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--paper);
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
}
textarea { resize: vertical; }
textarea:focus, input:focus, select:focus { outline: none; border-style: solid; border-color: var(--brick); }

.row { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.row.wrap { flex-wrap: wrap; }
.field { flex: 1; font-weight: 400; color: var(--ink-soft); font-size: 15px; }
.field select { color: var(--ink); }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.button.primary { background: var(--brick); color: var(--brick-ink); box-shadow: 3px 3px 0 var(--ink); }
.button.secondary { background: var(--card); color: var(--ink); box-shadow: 2px 2px 0 var(--shadow); }
.button:active { transform: translate(2px, 2px); box-shadow: none; }
.button.small { min-height: 38px; padding: 4px 14px; font-size: 15px; }
.button.wide { width: 100%; margin-top: 18px; font-size: 19px; }
.button:disabled { opacity: 0.55; cursor: progress; }
.icon { width: 22px; height: 22px; }

.hint { color: var(--ink-soft); font-size: 14px; font-weight: 400; margin: 6px 0 0; }
.hint:empty { display: none; }
.status { min-height: 1.5em; margin: 10px 0 0; color: var(--ink-soft); }
.status.error { color: var(--brick); }
.status:empty { display: none; }
.note { background: var(--mustard-soft); border: 2px dashed var(--mustard); border-radius: 12px; padding: 10px 12px; font-size: 14px; }

/* Waiting: a little pot with rising steam, pinned to the bottom so it shows wherever the reader has scrolled */
.loading {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 10;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 6px 18px 6px 10px;
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 4px 0 var(--shadow);
  font-size: 15px;
}
.loading[hidden] { display: none; }
.pot { width: 44px; height: 40px; flex: none; }
.pot-body { fill: var(--brick); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.pot-line { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.steam { fill: none; stroke: var(--ink-soft); stroke-width: 2.2; stroke-linecap: round; animation: steam 1.6s ease-in-out infinite; }
.steam:nth-child(2) { animation-delay: 0.3s; }
.steam:nth-child(3) { animation-delay: 0.6s; }
@keyframes steam {
  0% { transform: translateY(4px); opacity: 0; }
  40% { opacity: 0.9; }
  100% { transform: translateY(-6px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .steam { animation: none; opacity: 0.7; } }

/* Recipe cards */
.summary { margin: 0 4px 14px; color: var(--ink-soft); font-size: 15px; }
.recipe { padding: 0; overflow: hidden; }
.recipe-band { height: 14px; background: repeating-linear-gradient(90deg, var(--brick) 0 12px, var(--card) 12px 24px); border-bottom: 2px solid var(--ink); }
.recipe-body { padding: 16px; }
.recipe h2 { margin: 0 0 8px; font-family: var(--display); font-size: 24px; font-weight: 400; line-height: 1.35; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 14px; border: 1.5px solid transparent; }
.chip.time { background: var(--mustard-soft); color: var(--mustard); border-color: var(--mustard); }
.chip.tool { background: var(--olive-soft); color: var(--olive); border-color: var(--olive); }
.chip.have { background: var(--olive-soft); color: var(--olive); }
.chip.buy { background: var(--card); color: var(--mustard); border: 1.5px dashed var(--mustard); }
.group { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; }
.group-label { flex: none; width: 2.6em; color: var(--ink-soft); font-size: 14px; padding-top: 3px; }
.pantry { margin: 10px 0 0; color: var(--ink-soft); font-size: 14px; }
.steps { counter-reset: step; list-style: none; margin: 14px 0 0; padding: 14px 0 0; border-top: 2px dashed var(--line); }
.steps li { counter-increment: step; position: relative; padding-left: 40px; margin-bottom: 10px; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brick);
  color: var(--brick-ink);
  font-family: var(--display);
  font-size: 15px;
  line-height: 28px;
  text-align: center;
}
.tip { margin: 6px 0 0; padding: 10px 12px; background: var(--brick-soft); border-radius: 12px; font-size: 15px; }
.tip strong { font-family: var(--display); font-weight: 400; color: var(--brick); margin-right: 6px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }

.center { text-align: center; margin-bottom: 22px; }

/* Survey on a sticky note */
.sticky { background: var(--mustard-soft); transform: rotate(-0.8deg); }

.footnote { color: var(--ink-soft); font-size: 13px; margin-top: 28px; }
.footnote p { margin: 4px 0; }
.footnote a { color: var(--brick); }
