/* The fridge door: a peacock-blue wall with notes pinned to it. */

:root {
  --wall: #1c6f77;
  --wall-deep: #155a61;
  --ink: #1c1c1c;
  --ink-soft: rgba(28, 28, 28, .66);
  --mustard: #f2c14e;
  --coral: #f28b6b;
  --teal: #5cc0bb;
  --paper: #ffffff;
  --shadow: 0 6px 14px rgba(0, 0, 0, .22), 0 1px 3px rgba(0, 0, 0, .12);
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --hand: "Caveat", "Bradley Hand", "Comic Sans MS", cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.wall {
  max-width: 540px;
  margin: 0 auto;
  padding: 18px 16px 60px;
  padding-bottom: calc(60px + env(safe-area-inset-bottom));
}
@media (min-width: 700px) {
  .wall { max-width: 600px; padding: 40px 24px 80px; }
}

/* ---------- header ---------- */
.top { padding: 8px 4px 4px; color: #fff; }
.hand { font-family: var(--hand); font-weight: 600; }
.dates { margin: 0; font-size: 1.45rem; color: var(--mustard); transform: rotate(-1.5deg); transform-origin: left; display: inline-block; }
.top h1 { margin: 4px 0 6px; font-size: clamp(1.9rem, 7.5vw, 2.7rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.02; }
.top .at { margin: 0 0 16px; font-size: 1.25rem; font-weight: 600; color: rgba(255, 255, 255, .85); }
.countdown { margin: 14px 0 26px; }
.countdown .sleeps { display: block; margin: 0 0 8px 4px; font-size: 1.6rem; color: var(--mustard); transform: rotate(-2deg); transform-origin: left; }
.countdown .sleeps:empty { display: none; }
.tiles { display: flex; gap: 8px; }
.tile { flex: 1 1 0; padding: 10px 4px 8px; border-radius: 8px; background: #fff; color: var(--ink); text-align: center; box-shadow: var(--shadow); transform: rotate(-.6deg); }
.tile:nth-child(2) { transform: rotate(.5deg); background: var(--mustard); }
.tile:nth-child(3) { transform: rotate(-.3deg); background: var(--coral); }
.tile:nth-child(4) { transform: rotate(.7deg); background: var(--teal); }
.tile b { display: block; font-size: clamp(1.9rem, 9vw, 2.6rem); font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile small { display: block; margin-top: 4px; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: rgba(0, 0, 0, .55); }
.countdown .big { margin: 0; padding: 14px 18px; border-radius: 8px; background: var(--mustard); color: var(--ink); font-size: 1.6rem; font-weight: 800; box-shadow: var(--shadow); transform: rotate(-.6deg); }
.countdown .note-line { margin: 8px 4px 0; color: rgba(255, 255, 255, .8); font-size: .95rem; }
.countdown #weather-today { margin-top: 4px; }

.polaroid {
  margin: 0 8px 22px;
  padding: 10px 10px 34px;
  background: #fff;
  box-shadow: var(--shadow);
  transform: rotate(-1.6deg);
  position: relative;
  color: var(--ink);
}
.polaroid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
/* the photo turns over */
.polaroid--flip { padding: 0; background: none; box-shadow: none; perspective: 1200px; cursor: pointer; }
.polaroid--flip .faces { display: grid; transition: transform .7s cubic-bezier(.4, .2, .2, 1); transform-style: preserve-3d; }
.polaroid--flip .face { grid-area: 1 / 1; padding: 10px 10px 34px; background: #fff; box-shadow: var(--shadow); backface-visibility: hidden; -webkit-backface-visibility: hidden; position: relative; }
.polaroid--flip .back { transform: rotateY(180deg); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: #fffdf7; }
.polaroid--flip.flipped .faces { transform: rotateY(180deg); }
.polaroid--flip .back .hand { margin: 0; font-size: 1.9rem; line-height: 1.2; color: #2a2a2a; transform: rotate(-2deg); }
.polaroid--flip .back .sig { margin-top: 14px; font-size: 1.6rem; color: #b56a12; }
.polaroid--flip .turn { float: right; margin-right: 6px; font-size: .95rem; color: #999; }
.polaroid--flip .front figcaption { position: static; left: auto; bottom: auto; display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; margin-top: 8px; font-size: 1.25rem; color: #444; }
.polaroid--flip .turn { float: none; margin: 0; }
.polaroid--end { margin: 6px 8px 26px; transform: rotate(1.4deg); }
.wifi + .lines { margin-top: 10px; }
.polaroid figcaption { position: absolute; left: 16px; bottom: 6px; font-size: 1.25rem; color: #444; }

/* ---------- notes ---------- */
.note {
  position: relative;
  margin: 0 0 18px;
  padding: 18px 18px 18px;
  border-radius: 3px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.note--mustard { background: var(--mustard); }
.note--coral { background: var(--coral); }
.note--teal { background: var(--teal); }
.note:nth-of-type(4n+1) { transform: rotate(.5deg); }
.note:nth-of-type(4n+2) { transform: rotate(-.6deg); }
.note:nth-of-type(4n+3) { transform: rotate(.35deg); }
.note:nth-of-type(4n+4) { transform: rotate(-.4deg); }

.pin {
  position: absolute;
  top: -7px;
  left: 18px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #4a4a4a, #111 70%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .35);
}
.note:nth-of-type(3n) .pin { left: auto; right: 22px; }
.note:nth-of-type(5n) .pin { background: radial-gradient(circle at 35% 35%, #ff9b7d, #c9471f 70%); }
.note:nth-of-type(7n) .pin { background: radial-gradient(circle at 35% 35%, #ffe08a, #c8931a 70%); }

.note h2 { margin: 0 0 8px; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.note h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 800; }
.body { margin: 0 0 10px; }
.body:last-child { margin-bottom: 0; }
.muted { color: var(--ink-soft); }
.address { margin: 0 0 12px; font-weight: 700; font-size: 1.05rem; }
.subnote { margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(0, 0, 0, .25); }
.note--small h2 { font-size: 1.1rem; }

.row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.row:last-child { margin-bottom: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--soft { background: rgba(0, 0, 0, .1); color: var(--ink); }
.btn--coral { background: #d9552e; }
.btn--big { flex: 1 1 auto; min-height: 50px; font-size: 1.05rem; }
.form > .btn--big { display: flex; width: 100%; margin-top: 14px; }
.link { background: none; border: 0; padding: 4px 0; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link.danger { color: #9b2c0e; margin-top: 10px; }
.edit {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .12);
  font-size: 1.05rem;
  cursor: pointer;
}

/* ---------- lists inside notes ---------- */
.list { margin: 8px 0 4px; }
.list .day-head { margin: 12px 0 4px; font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.list .day-head:first-child { margin-top: 4px; }
.item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid rgba(0, 0, 0, .12);
}
.item:first-child, .day-head + .item { border-top: 0; }
.item .who { font-weight: 700; flex: 1 1 auto; min-width: 0; }
.item .when { flex: 0 0 auto; color: var(--ink-soft); font-weight: 600; }
.item .sub { display: block; font-weight: 400; font-size: .9rem; color: var(--ink-soft); }
.item .x {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .1);
  cursor: pointer;
  font-size: .95rem;
  line-height: 1;
}
.empty { margin: 6px 0; color: var(--ink-soft); font-style: italic; }
.count { font-weight: 800; }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 6px -4px 8px; padding: 2px 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, .08);
  font-weight: 700;
  cursor: pointer;
}
.tab.on { background: var(--ink); color: #fff; }
.tab small { display: block; font-size: .7rem; font-weight: 600; opacity: .75; line-height: 1; margin-top: 2px; }
.tab.on small { opacity: .8; }
.tab { padding-top: 5px; padding-bottom: 5px; line-height: 1.1; }

.meals { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.meals dt { font-weight: 800; }
.meals dd { margin: 0; }

.lines { margin: 0; padding: 0; list-style: none; }
.lines li { padding: 5px 0; border-top: 1px solid rgba(0, 0, 0, .12); }
.lines li:first-child { border-top: 0; padding-top: 0; }
.lines a { color: inherit; font-weight: 700; }

.menu-block { margin: 6px 0 10px; padding: 12px 14px; background: rgba(255, 255, 255, .45); border-radius: 4px; }
.menu-block h3 { margin: 0 0 2px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.menu-block p { margin: 0 0 10px; }
.menu-block p:last-child { margin: 0; }

.wifi { display: grid; gap: 6px; }
.wifi .kv { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(0, 0, 0, .14); }
.wifi .kv:first-child { border-top: 0; }
.wifi .kv b { font-size: 1.1rem; word-break: break-all; }
.wifi .kv small { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.copy { min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .12); font-weight: 700; font-size: .85rem; cursor: pointer; }

.summary { margin-top: 14px; padding: 12px 14px; background: rgba(255, 255, 255, .5); border-radius: 4px; }
.summary h3 { margin: 0 0 6px; }
.summary pre { margin: 8px 0 0; white-space: pre-wrap; font: .85rem/1.45 ui-monospace, Menlo, monospace; }

.psec { margin-top: 18px; padding-top: 12px; border-top: 1px solid rgba(0, 0, 0, .1); }
.psec:first-of-type { border-top: 0; margin-top: 4px; }
.psec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.psec-head h3 { margin: 0; font-size: 1rem; font-weight: 800; }
.psec .lines li:first-child { padding-top: 5px; }
.psec .empty-line, .ticks .empty-line { color: var(--ink-soft); font-style: italic; }
#packing-dialog .psec-head { margin-bottom: 10px; }
#packing-dialog .psec-head h2 { margin: 0; }
.ticks { margin: 0; padding: 0; list-style: none; }
.ticks li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid rgba(0, 0, 0, .1); cursor: pointer; }
.ticks li:first-child { border-top: 0; }
.ticks .box { width: 22px; height: 22px; border: 2px solid var(--ink); border-radius: 6px; flex: 0 0 auto; display: grid; place-items: center; font-size: .9rem; font-weight: 800; }
.ticks li.done .box { background: var(--ink); color: #fff; }
.ticks li.head { margin-top: 14px; padding-bottom: 2px; border-top: 0; border-bottom: 2px solid var(--ink); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; cursor: default; }
.ticks li.head + li { border-top: 0; }
.ticks li.done span:last-child { text-decoration: line-through; color: var(--ink-soft); }

/* ---------- footer ---------- */
.foot { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 10px; color: rgba(255, 255, 255, .85); }
.foot .link { color: inherit; font-weight: 600; text-decoration-color: rgba(255, 255, 255, .5); }

/* ---------- dialogs ---------- */
.sheet {
  border: 0;
  padding: 0;
  margin: auto 0 0;
  width: 100%;
  max-width: 100%;
  max-height: 92dvh;
  border-radius: 20px 20px 0 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .3);
  overflow: auto;
}
.sheet::backdrop { background: rgba(10, 40, 44, .55); }
.sheet .form { padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); }
.sheet h2 { margin: 0 0 8px; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.sheet .dates { color: #b56a12; }
@media (min-width: 600px) {
  .sheet { margin: auto; width: min(520px, 92vw); border-radius: 18px; max-height: 88vh; }
  .sheet--tall { width: min(620px, 92vw); }
}

.label { display: block; margin: 14px 0 6px; font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.input {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 10px 14px;
  border: 2px solid rgba(0, 0, 0, .18);
  border-radius: 12px;
  background: #fff;
  font-size: 1.05rem;
}
.input:focus { outline: none; border-color: var(--wall); }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.4; }
.pw { position: relative; }
.pw .input { padding-right: 76px; }
.eye { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .08); font-size: .85rem; font-weight: 700; cursor: pointer; }
.error { min-height: 1.2em; margin: 8px 0 0; color: #b3261e; font-weight: 700; }
.error:empty { margin: 0; min-height: 0; }
.sheet .row { margin-top: 16px; }

.pills, .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pill, .chip {
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid rgba(0, 0, 0, .15);
  border-radius: 999px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}
.pill.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill small { display: block; font-size: .7rem; font-weight: 600; opacity: .7; line-height: 1; }
.pill { padding-top: 4px; padding-bottom: 4px; line-height: 1.1; }
.chips { margin-top: 10px; }
.chip { min-height: 38px; font-size: .95rem; }
.chip.on { background: var(--mustard); border-color: var(--mustard); }

/* menu groups in the pizza sheet */
.group { margin-top: 14px; }
.group h3 { margin: 0 0 4px; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.group .hint { margin: 0 0 6px; font-size: .9rem; color: var(--ink-soft); }
.dish {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 6px;
  border-top: 1px solid rgba(0, 0, 0, .1);
  border-radius: 8px;
  cursor: pointer;
}
.dish:first-of-type { border-top: 0; }
.dish input { width: 22px; height: 22px; margin: 0; accent-color: var(--wall); }
.dish .name { font-weight: 700; }
.dish .desc { grid-column: 2 / 4; font-size: .88rem; color: var(--ink-soft); }
.dish .price { font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.dish .tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, .08); font-size: .72rem; font-weight: 800; vertical-align: middle; }
.dish:has(input:checked) { background: rgba(92, 192, 187, .22); }
.sticky-actions { position: sticky; bottom: 0; padding: 12px 0 4px; background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0)); }

/* ---------- delighters ---------- */
/* the wall has depth: a faint texture behind the notes that moves a little slower than they do */
.wallpaper {
  position: fixed; inset: -20% 0 -20% 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .13) 1.2px, transparent 1.6px), radial-gradient(rgba(0, 0, 0, .10) 1.4px, transparent 1.8px);
  background-size: 34px 34px, 52px 52px;
  background-position: 0 0, 17px 21px;
  will-change: transform;
}
/* notes pin themselves on, once per visit */
@keyframes pinOn {
  0% { opacity: 0; transform: translateY(-14px) rotate(-2deg) scale(1.02); }
  70% { opacity: 1; transform: translateY(2px) rotate(.6deg); }
  100% { opacity: 1; transform: none; }
}
.first-load .note { animation: pinOn .55s cubic-bezier(.2, .8, .3, 1) both; animation-delay: calc(var(--i, 0) * 70ms + 120ms); }
.first-load .note:nth-of-type(1) { --i: 1; } .first-load .note:nth-of-type(2) { --i: 2; } .first-load .note:nth-of-type(3) { --i: 3; }
.first-load .note:nth-of-type(4) { --i: 4; } .first-load .note:nth-of-type(5) { --i: 5; } .first-load .note:nth-of-type(6) { --i: 6; }
.first-load .note:nth-of-type(7) { --i: 7; } .first-load .note:nth-of-type(8) { --i: 8; } .first-load .note:nth-of-type(9) { --i: 9; }
/* countdown digits flick over like a departure board */
@keyframes flick {
  0% { transform: rotateX(-38deg); opacity: .55; }
  100% { transform: rotateX(0); opacity: 1; }
}
@keyframes softTick {
  0% { transform: translateY(-3px); opacity: .6; }
  100% { transform: none; opacity: 1; }
}
.tiles { perspective: 500px; }
.tile b { transform-origin: 50% 100%; }
.tile b.flick { animation: flick .5s cubic-bezier(.2, .7, .3, 1); }
#cd-s.flick { animation: softTick .45s ease-out; }
/* weather on the schedule tabs */
.tab .wx { display: block; font-size: .78rem; font-weight: 700; line-height: 1; margin-top: 3px; opacity: .9; }
.tab .wx:empty { display: none; }
.tab { min-width: 58px; }
@keyframes magnet {
  0% { transform: rotate(-3deg) scale(1.04); }
  35% { transform: rotate(2.5deg) scale(1.02); }
  70% { transform: rotate(-1deg); }
  100% { transform: rotate(0); }
}
.item.wobble { animation: magnet .55s ease-out; transform-origin: 12% 50%; }
.note .pin.gold { background: radial-gradient(circle at 35% 35%, #ffe08a, #c8931a 70%); box-shadow: 0 2px 3px rgba(0, 0, 0, .35), 0 0 0 4px rgba(242, 193, 78, .35); }
.rain { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.rain span { position: absolute; top: -8vh; font-size: 30px; animation: fall linear forwards; }
@keyframes fall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(115vh) rotate(540deg); opacity: .9; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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