/* Washi paper, sumi ink, and a mizuhiki cord of vermilion and gold. */
:root {
  --bg: #f3eee4;
  --surface: #fbf8f1;
  --text: #2d2924;
  --muted: #847a6d;
  --border: #e2d8c7;
  --shu: #b5452f;        /* vermilion */
  --shu-soft: #f3e1d8;
  --gold: #b08a45;
  --sage: #6e7d5f;
  --on-shu: #fffaf2;
  --ok-bg: #e8ecdf;
  --ok-text: #4a5a3c;
  --err-bg: #f5e0d8;
  --err-text: #8c2f1e;
  --wave: rgba(120, 100, 70, .05);
  --serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a17;
    --surface: #24221e;
    --text: #ebe4d7;
    --muted: #a39887;
    --border: #3a362f;
    --shu: #dc7a62;
    --shu-soft: #3d2620;
    --gold: #cfaa64;
    --sage: #9aa889;
    --on-shu: #1b1a17;
    --ok-bg: #2a3024;
    --ok-text: #bccbaa;
    --err-bg: #46251d;
    --err-text: #f1b3a2;
    --wave: rgba(230, 210, 170, .035);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  /* faint seigaiha waves */
  background-image:
    radial-gradient(circle at 50% 100%, transparent 42%, var(--wave) 43%, var(--wave) 47%, transparent 48%,
                    transparent 56%, var(--wave) 57%, var(--wave) 61%, transparent 62%,
                    transparent 70%, var(--wave) 71%, var(--wave) 75%, transparent 76%),
    radial-gradient(circle at 50% 100%, transparent 42%, var(--wave) 43%, var(--wave) 47%, transparent 48%,
                    transparent 56%, var(--wave) 57%, var(--wave) 61%, transparent 62%,
                    transparent 70%, var(--wave) 71%, var(--wave) 75%, transparent 76%);
  background-size: 64px 32px;
  background-position: 0 0, 32px 16px;
}
a { color: var(--shu); text-underline-offset: 3px; }
h1, h2, .brand, .item-title, .person strong {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: .01em;
}
h1 { font-size: 1.85rem; line-height: 1.25; margin: 0 0 .35rem; }
h2 { font-size: 1.2rem; margin: 0 0 .25rem; }
main { max-width: 760px; margin: 0 auto; padding: 2rem 16px 5rem; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .9rem; margin-top: 0; }
.lede { color: var(--muted); margin: 0 0 1.75rem; }

/* header, with a two-strand cord along the bottom */
.top {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  align-items: center; justify-content: space-between;
  padding: .8rem 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 4px;
  background:
    linear-gradient(var(--shu), var(--shu)) 0 0 / 100% 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 3px / 100% 1px no-repeat;
  opacity: .85;
}
.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: 1.25rem; text-decoration: none; color: var(--text);
}
.top nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; align-items: center; font-size: .95rem; }
.top nav a { color: var(--text); text-decoration: none; }
.top nav a:hover { color: var(--shu); }
form.inline { display: inline; }

/* cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.15rem 1.3rem;
}
.narrow { max-width: 440px; margin: 2rem auto; }
.stack { display: grid; gap: 1.25rem; max-width: 480px; }
.empty { color: var(--muted); text-align: center; padding: 2.5rem 1.3rem; }

/* login */
.login { text-align: center; padding: 2.5rem 2rem 2rem; margin-top: 12vh; }
.login .mark { display: block; margin: 0 auto .75rem; }
.login h1 { font-size: 2.1rem; }
.tagline { color: var(--muted); font-family: var(--serif); margin: 0 0 1.75rem; }
.login form { text-align: left; }
.login button { width: 100%; margin-top: .25rem; }

/* people */
ul.people, ul.items { list-style: none; padding: 0; margin: 0; display: grid; gap: .85rem; }
.person {
  display: flex; align-items: center; gap: .9rem;
  text-decoration: none; color: var(--text);
  transition: border-color .2s, transform .2s;
}
.person:hover { border-color: var(--gold); transform: translateY(-1px); }
.person strong { font-size: 1.15rem; }
.person > .muted:last-child { margin-left: auto; font-size: .9rem; }
.initial {
  flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600; font-size: 1.1rem;
  color: var(--shu); background: var(--shu-soft);
  border: 1px solid color-mix(in srgb, var(--shu) 30%, transparent);
}

/* list */
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.item {
  display: flex; flex-wrap: wrap; gap: .75rem 1.25rem;
  justify-content: space-between; align-items: flex-start;
  scroll-margin-top: 1rem;
  border-left: 3px solid var(--border);
}
.item:has(.prio.p1) { border-left-color: var(--shu); }
.item:has(.prio.p2) { border-left-color: var(--gold); }
.item:has(.prio.p3) { border-left-color: var(--sage); }
.item-main { flex: 1 1 18rem; min-width: 0; }
.item-title { font-size: 1.15rem; line-height: 1.35; overflow-wrap: anywhere; }
.item-title a { color: var(--text); text-decoration: none; }
.item-title a:hover { color: var(--shu); }
.meta { display: flex; flex-wrap: wrap; gap: .2rem 1rem; font-size: .88rem; color: var(--muted); margin-top: .3rem; }
.notes {
  margin: .6rem 0 0; padding-left: .75rem;
  border-left: 1px solid var(--border);
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem;
}
.item.done { opacity: .62; }
.item.done .item-title a, .item.done .item-title { text-decoration: line-through; text-decoration-color: var(--muted); }

.prio {
  display: block; width: fit-content;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: .2rem;
}
.prio.p1 { color: var(--shu); }
.prio.p2 { color: var(--gold); }
.prio.p3 { color: var(--sage); }

.buy { flex: 0 1 auto; text-align: right; }
.status { margin: 0 0 .5rem; font-size: .88rem; color: var(--muted); }
.stamp {
  display: inline-block; margin-right: .35rem;
  font-family: var(--serif); font-weight: 700; font-size: .85rem; letter-spacing: .1em;
  color: var(--shu); border: 1.5px solid var(--shu); border-radius: 4px;
  padding: 0 .4rem; transform: rotate(-4deg);
}
.actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; align-items: center; }
.actions form { display: flex; gap: .4rem; align-items: center; margin: 0; }
form .actions { justify-content: flex-start; margin-top: .75rem; }

/* forms */
label { display: block; margin-bottom: 1rem; font-size: .92rem; font-weight: 500; }
input, select, textarea {
  display: block; width: 100%; margin-top: .35rem;
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: .6rem .75rem;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent);
}
input.qty { width: 4.5rem; margin: 0; padding: .45rem .5rem; }
.row { display: grid; grid-template-columns: 1fr 2fr; gap: .75rem; }

button, .button {
  display: inline-block; font: inherit; font-size: .92rem; cursor: pointer;
  padding: .5rem 1rem; border-radius: 4px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  text-decoration: none; white-space: nowrap;
  transition: border-color .15s, background-color .15s;
}
button:hover, .button:hover { border-color: var(--gold); }
.primary { background: var(--shu); border-color: var(--shu); color: var(--on-shu); font-weight: 600; }
.primary:hover { background: color-mix(in srgb, var(--shu) 88%, #000); border-color: transparent; }
.danger { color: var(--err-text); }
.danger:hover { border-color: var(--err-text); }
button.link { background: none; border: none; padding: 0; color: var(--text); font-size: .95rem; }
button.link:hover { color: var(--shu); }

.flash { padding: .65rem 1rem; border-radius: 4px; margin: 0 0 1.25rem; }
.flash.ok { background: var(--ok-bg); color: var(--ok-text); }
.flash.error { background: var(--err-bg); color: var(--err-text); }

@media (max-width: 520px) {
  main { padding-top: 1.5rem; }
  h1 { font-size: 1.6rem; }
  .buy { text-align: left; flex-basis: 100%; }
  .buy .actions { justify-content: flex-start; }
  .row { grid-template-columns: 1fr; }
  .login { margin-top: 4vh; padding: 2rem 1.25rem 1.5rem; }
}
