/* The World: owner's page. One window onto a little one's day in 망원동. */

:root {
  /* the little one's own colours, taken from the felt */
  --felt-cream: #fdf7eb;   /* the art's background; letters and the window glow */
  --periwinkle: #9db4de;   /* body */
  --lilac: #b39be6;        /* star-puff ears; stars */
  --cardigan: #c8644a;     /* hearts and the one warm action */
  --button: #f3e7d3;       /* button felt */

  /* the frame: changes with the hour in Seoul (see [data-phase]) */
  --sky-top: #e3e9f6;
  --sky-bottom: #f5f6fb;
  --ink: #2f3557;
  --ink-soft: #636a8c;
  --ink-faint: #9aa0bb;
  --line: rgba(47, 53, 87, 0.14);
  --frame: #ffffff;
  --glow: rgba(255, 247, 226, 0);
  --paper: var(--felt-cream);
  --paper-ink: #2f3557;
  --sheet: #f7f8fc;

  --hand-track: -0.015em;
  --hand: "Gaegu", "Gowun Dodum", ui-rounded, system-ui, sans-serif;
  --frame-font: "Gowun Dodum", ui-rounded, system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;

  --col: 440px;
  --gutter: 20px;
}

[data-phase="dawn"] {
  --sky-top: #d9dff4;
  --sky-bottom: #f7ecee;
}
[data-phase="day"] {
  --sky-top: #e1e8f6;
  --sky-bottom: #f6f7fb;
}
[data-phase="dusk"] {
  --sky-top: #c8bfe5;
  --sky-bottom: #f2dfe3;
  --glow: rgba(255, 214, 150, 0.55);
  --sheet: #f6f1f6;
}
[data-phase="night"] {
  --sky-top: #191d3d;
  --sky-bottom: #2a2d58;
  --ink: #ebe8f6;
  --ink-soft: #b3b2d3;
  --ink-faint: #7f80a8;
  --line: rgba(235, 232, 246, 0.16);
  --frame: #3a3e6e;
  --glow: rgba(160, 170, 255, 0.18);
  --paper: #f4ecdc;
  --sheet: #23264b;
}

* { box-sizing: border-box; }

html {
  background: var(--sky-bottom);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--frame-font);
  font-size: 16px;
  line-height: 1.55;
  background: linear-gradient(180deg, var(--sky-top) 0, var(--sky-bottom) 640px) var(--sky-bottom) no-repeat;
  transition: background 0.6s ease, color 0.6s ease;
}

/* a few stars behind everything at night and dusk */
.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 27% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 68% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 84% 26%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 91% 6%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 6% 42%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 48% 4%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 95% 48%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 38% 22%, #fff 50%, transparent 51%);
}
[data-phase="night"] .sky { opacity: 0.85; }
[data-phase="dusk"] .sky { opacity: 0.35; }

.page {
  position: relative;
  max-width: var(--col);
  margin: 0 auto;
  padding: 18px var(--gutter) 40px;
}

button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible {
  outline: 2px solid var(--lilac);
  outline-offset: 3px;
  border-radius: 8px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- top line ---------- */

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.name {
  margin: 0;
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-weight: 700;
  font-size: 38px;
  line-height: 1;
  letter-spacing: 0.01em;
}
.days {
  font-size: 14px;
  color: var(--ink-soft);
  text-align: right;
}
.clock {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---------- the window (the one bold thing) ---------- */

.window-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 26px 0 10px;
}

.window {
  position: relative;
  width: min(62vw, 236px);
  aspect-ratio: 370 / 430;
  border-radius: 999px 999px 14px 14px;
  border: 9px solid var(--frame);
  background: var(--felt-cream);
  overflow: hidden;
  box-shadow:
    0 0 0 1px var(--line),
    0 0 60px 10px var(--glow),
    0 18px 30px -18px rgba(30, 34, 70, 0.35);
  transition: border-color 0.6s ease, box-shadow 0.6s ease;
}
.window img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transition: opacity 0.35s ease, filter 0.6s ease;
}
.window::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.35) 0%, transparent 38%);
}
[data-phase="dusk"] .window::after {
  background: radial-gradient(circle at 50% 110%, rgba(255, 190, 120, 0.28), transparent 60%);
}
/* night, still up: the lamp is on behind the glass */
[data-phase="night"] .window::after {
  background: radial-gradient(circle at 50% 100%, rgba(255, 196, 120, 0.25), transparent 65%);
}
[data-phase="night"]:not([data-asleep]) { --glow: rgba(255, 210, 140, 0.32); }
/* asleep: lamp off */
[data-asleep] .window img {
  filter: brightness(0.62) saturate(0.75) hue-rotate(-8deg);
}
[data-asleep] .window::after {
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 246, 214, 0.9) 0 7px, transparent 8px),
    radial-gradient(circle at 81% 19%, rgba(42, 45, 88, 1) 0 7px, transparent 8px),
    linear-gradient(180deg, rgba(25, 29, 61, 0.35), rgba(25, 29, 61, 0.1));
}

.sill {
  width: min(70vw, 264px);
  height: 10px;
  margin-top: -2px;
  border-radius: 6px;
  background: var(--frame);
  box-shadow: 0 0 0 1px var(--line), 0 6px 10px -6px rgba(30, 34, 70, 0.3);
}

.zz {
  position: absolute;
  right: 18%;
  top: 30%;
  z-index: 3;
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-weight: 700;
  color: #f4ecdc;
  font-size: 20px;
  opacity: 0;
}
[data-asleep] .zz.on { opacity: 0.9; animation: drift 5s ease-in-out infinite; }
@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.where {
  margin: 16px 0 0;
  text-align: center;
  font-size: 18px;
  line-height: 1.35;
}
.where .ko { font-weight: 400; }
.doing {
  margin: 4px auto 0;
  max-width: 30ch;
  text-align: center;
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-size: 22px;
  line-height: 1.25;
  color: var(--ink);
}
.ears {
  margin: 6px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- sections ---------- */

.part { margin-top: 38px; }
.part > h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}
.part > h2::after {
  content: "";
  flex: 1;
  border-top: 1px dashed var(--line);
}

.says {
  margin: 0 0 14px;
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-size: 23px;
  line-height: 1.3;
}
.says::before { content: "\201C"; }
.says::after { content: "\201D"; }

.quiet {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

/* morning choices: paper slips on the breakfast table */
.slips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.slip {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 4px 14px 14px 4px;
  background: var(--paper);
  color: var(--paper-ink);
  font-size: 16px;
  line-height: 1.4;
  box-shadow: 0 1px 0 rgba(47, 53, 87, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.3s ease;
}
.slip:hover { transform: translateX(3px); }
.slip:active { transform: translateX(3px) scale(0.99); }
.slip .dot {
  flex: none;
  width: 12px; height: 12px;
  margin-top: 5px;
  border-radius: 50%;
  border: 1.5px solid var(--periwinkle);
}
.slip[disabled] { cursor: default; }
.slip[disabled]:hover { transform: none; }
.slip.chosen .dot {
  background: var(--lilac);
  border-color: var(--lilac);
  box-shadow: 0 0 0 3px rgba(179, 155, 230, 0.25);
}
.slip.gone { opacity: 0.4; }
.slips.settled .slip:not(.chosen) { display: none; }
.hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-faint);
}

.outcome {
  margin: 12px 0 0;
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 15px;
  color: var(--ink-soft);
}
.outcome .mark {
  flex: none;
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}

/* home's bag: one small thing from the cupboard, if home likes (a gentle extra under the pick) */
.bag { margin-top: 26px; }
.bag-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bag-ask {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink-soft);
}
.satchel {
  position: relative;
  flex: none;
  width: 46px;
  height: 46px;
}
.satchel svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.satchel svg path, .satchel svg rect {
  stroke: #2f3557;
  stroke-width: 1.3;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.satchel .sb-strap-line { fill: none; stroke-width: 5.2; }
.satchel .sb-strap { fill: none; stroke: var(--periwinkle); stroke-width: 2.6; }
.satchel .sb-inside { fill: #dcc7a4; }
.satchel .sb-body { fill: var(--button); }
.satchel .sb-stitch { fill: none; stroke: rgba(47, 53, 87, 0.4); stroke-width: 1; stroke-dasharray: 1.5 2.2; }
.satchel .sb-star { fill: var(--lilac); stroke-width: 1; }
.sb-item {
  position: absolute;
  left: 42%;
  top: 9px;
  font-size: 18px;
  line-height: 1;
  transform: translateX(-50%) rotate(-14deg);
}
.satchel.drop .sb-item { animation: tuck 0.6s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes tuck {
  from { opacity: 0; transform: translate(-50%, -22px) rotate(-24deg); }
  50% { opacity: 1; }
  to { transform: translateX(-50%) rotate(-14deg); }
}

.cupboard {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cup {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  font-size: 21px;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(47, 53, 87, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.3s ease;
}
.cup:hover { transform: translateY(-2px); }
.cup.on {
  transform: translateY(-3px);
  border-color: var(--lilac);
  box-shadow: 0 0 0 3px rgba(179, 155, 230, 0.3), 0 6px 10px -6px rgba(30, 34, 70, 0.35);
}
.cupboard.choosing .cup:not(.on) { opacity: 0.5; }

.bag-pick {
  min-height: 40px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bag-pick .hint, .bag-pick .error { margin: 0; }
.bag-what {
  margin: 0;
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-size: 21px;
  line-height: 1.25;
}
.bag .btn { flex: none; padding: 8px 16px; font-size: 14px; }
.bag-sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.bag .bag-note { margin-top: 8px; }

/* today's moments: a thread down the day */
.moments {
  list-style: none;
  margin: 0;
  padding: 0 0 0 18px;
  border-left: 1.5px dotted var(--line);
  display: grid;
  gap: 22px;
}
.moment {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: start;
}
.moment::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 9px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--lilac);
  box-shadow: 0 0 0 3px var(--sky-bottom);
}
.moment time {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--ink-faint);
  line-height: 1;
}
.moment .text {
  margin: 0;
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-size: 21px;
  line-height: 1.3;
}

.photo {
  margin: 4px 0 0;
  padding: 10px 10px 12px;
  background: #fffdf8;
  border-radius: 3px;
  transform: rotate(-1.4deg);
  box-shadow: 0 1px 2px rgba(30, 34, 70, 0.15), 0 10px 20px -12px rgba(30, 34, 70, 0.35);
  max-width: 280px;
}
.photo .print {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  border-radius: 2px;
  background:
    radial-gradient(60% 50% at 70% 30%, rgba(255, 255, 255, 0.7), transparent 70%),
    radial-gradient(120% 90% at 30% 20%, #f3ebdd 0%, #e4d9c8 60%, #d3c8bb 100%);
  color: #4a4440;
  font-size: 14px;
  line-height: 1.45;
}
.photo figcaption {
  margin-top: 8px;
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-size: 17px;
  color: #6b6377;
}

.heart {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  margin-top: -8px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
}
.heart svg { width: 24px; height: 24px; overflow: visible; }
.heart path { fill: none; stroke: currentColor; stroke-width: 1.8; transition: fill 0.2s ease; }
.heart.sent { color: var(--cardigan); cursor: default; }
.heart.sent path { fill: var(--cardigan); }
.heart.pop svg { animation: pop 0.45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* the evening: a letter on the table */
.letter {
  position: relative;
  padding: 22px 22px 20px;
  background:
    repeating-linear-gradient(180deg, transparent 0 33px, rgba(157, 180, 222, 0.28) 33px 34px) 0 14px / 100% calc(100% - 28px) no-repeat,
    var(--paper);
  color: var(--paper-ink);
  border-radius: 3px;
  transform: rotate(0.6deg);
  box-shadow: 0 1px 2px rgba(30, 34, 70, 0.14), 0 16px 28px -18px rgba(30, 34, 70, 0.4);
}
.letter ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.letter li, .letter .thread {
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-size: 21px;
  line-height: 34px;
}
.letter .thread {
  margin: 0;
  color: #6a5aa8;
}
.letter .sign {
  margin: 0;
  text-align: right;
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-size: 19px;
  color: #6b6377;
}

/* the note for tomorrow */
.note-box {
  position: relative;
}
.note-box textarea {
  display: block;
  width: 100%;
  min-height: 104px;
  resize: none;
  padding: 14px 14px 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff9d9;
  color: #3a3550;
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-size: 21px;
  line-height: 1.3;
  box-shadow: 0 8px 18px -14px rgba(30, 34, 70, 0.45);
}
.note-box textarea::placeholder { color: #a39d8a; }
.note-box .count {
  position: absolute;
  right: 12px;
  bottom: 8px;
  font-size: 12px;
  color: #8f8a78;
}
.note-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.btn {
  padding: 11px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--cardigan);
  color: #fff8f0;
  font-size: 15px;
  box-shadow: 0 2px 0 #9c4936;
  transition: transform 0.1s ease, opacity 0.2s ease;
}
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn[disabled] { opacity: 0.4; cursor: default; }
.btn-soft {
  background: var(--button);
  color: #3a3550;
  box-shadow: 0 2px 0 #d9c9ad;
}

.sticky {
  margin: 0;
  padding: 14px 16px 16px;
  background: #fff9d9;
  color: #3a3550;
  border-radius: 3px;
  transform: rotate(-1deg);
  max-width: 320px;
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-size: 21px;
  line-height: 1.3;
  box-shadow: 0 8px 18px -12px rgba(30, 34, 70, 0.5);
}
.read-state {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.offline {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.4);
  font-size: 14px;
  color: var(--ink-soft);
}
[data-phase="night"] .offline { background: rgba(255, 255, 255, 0.07); }
.offline-first { margin-top: 40vh; text-align: center; background: none; }

.error {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--cardigan);
}
[data-phase="night"] .error { color: #f0a58f; }

/* ---------- the three small doors ---------- */

.doors {
  margin-top: 46px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.door {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 60px 60px 12px 12px;
  background: transparent;
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink);
  text-align: center;
  transition: background 0.2s ease;
}
.door:hover { background: rgba(255, 255, 255, 0.25); }
[data-phase="night"] .door:hover { background: rgba(255, 255, 255, 0.06); }
.door svg { width: 26px; height: 26px; }
.door .n { color: var(--ink-faint); font-size: 12px; }

.mockbar {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-faint);
}
.mockbar select {
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
}
.mockbar option { color: #2f3557; }

/* ---------- sheets ---------- */

dialog.sheet {
  width: 100%;
  max-width: var(--col);
  max-height: 88vh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 -10px 40px rgba(20, 22, 50, 0.25);
}
dialog.sheet::backdrop { background: rgba(25, 28, 60, 0.4); }
dialog.sheet[open] { animation: rise 0.32s cubic-bezier(.2, .8, .3, 1); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 640px) {
  dialog.sheet { margin: auto; border-radius: 22px; }
}
.sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter) 10px;
  background: var(--sheet);
}
.sheet-head h2 {
  margin: 0;
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-weight: 700;
  font-size: 26px;
}
.close {
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
}
.sheet-body {
  padding: 4px var(--gutter) 32px;
}
.sheet-body .letter + .letter, .sheet-body .past + .past { margin-top: 26px; }
.past h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-soft);
}
.past:nth-child(even) .letter { transform: rotate(-0.5deg); }

.sky-card {
  border-radius: 16px;
  background: radial-gradient(120% 100% at 50% 0%, #2f3370 0%, #1b1e42 70%);
  padding: 8px;
}
.sky-card svg { display: block; width: 100%; height: auto; }
.sky-card .link { stroke: rgba(225, 215, 255, 0.35); stroke-width: 1; stroke-dasharray: 2 4; fill: none; }
.sky-card .star { fill: #f3ecd4; transition: fill 0.2s ease; }
.sky-card .star.newest { fill: #d8c8ff; }
.sky-card .halo { fill: rgba(216, 200, 255, 0.18); }
.sky-card g.s { cursor: pointer; outline: none; }
.sky-card g.s:focus-visible .halo { fill: rgba(216, 200, 255, 0.55); }
.sky-card g.s.on .star { fill: #fff; }
.sky-card g.s.on .halo { fill: rgba(216, 200, 255, 0.4); }
.sky-card .newest-twinkle { animation: twinkle 2.4s ease-in-out 2; transform-origin: center; transform-box: fill-box; }
@keyframes twinkle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.35); }
}
.star-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.star-list li {
  display: grid;
  grid-template-columns: 54px 1fr;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.2s ease;
}
.star-list li.on { background: rgba(179, 155, 230, 0.18); }
.star-list .d { font-size: 13px; color: var(--ink-faint); padding-top: 2px; }
.star-list .l { font-family: var(--hand); font-size: 20px; line-height: 1.25; }
.sky-caption { margin: 12px 2px 0; font-size: 14px; color: var(--ink-soft); }

.remember {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.remember li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-size: 21px;
  line-height: 1.3;
}
.remember li::before {
  content: "";
  width: 9px; height: 9px;
  margin-top: 10px;
  border-radius: 50%;
  background: var(--lilac);
}

/* ---------- arrival: the doormat ---------- */

.arrival {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  background: var(--felt-cream);
  color: #2f3557;
  transition: opacity 0.7s ease;
}
.arrival.leaving { opacity: 0; pointer-events: none; }
.arrival-inner {
  min-height: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 44px var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.knock {
  margin: 0;
  font-size: 15px;
  color: #6b6f8c;
}
.knock-big {
  margin: 6px 0 0;
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.15;
}
.doorstep {
  position: relative;
  margin-top: 26px;
  width: min(78vw, 300px);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.doorstep .kid {
  width: 54%;
  height: auto;
  display: block;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 55%, #000 72%, transparent 100%);
  mask-image: radial-gradient(ellipse 60% 70% at 50% 55%, #000 72%, transparent 100%);
  animation: settle 1.6s ease-out both;
}
@keyframes settle {
  from { opacity: 0; transform: translateY(-18px); }
  to { opacity: 1; transform: none; }
}
.mat {
  position: relative;
  width: 86%;
  height: 74px;
  margin-top: -6px;
  border-radius: 10px;
  background:
    repeating-linear-gradient(90deg, rgba(90, 62, 30, 0.12) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(0deg, rgba(90, 62, 30, 0.1) 0 2px, transparent 2px 5px),
    #c9a979;
  transform: perspective(300px) rotateX(38deg);
  transform-origin: top center;
  box-shadow: inset 0 0 0 5px rgba(120, 82, 40, 0.25);
}
.folded {
  position: absolute;
  right: 9%;
  bottom: 14px;
  width: 74px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: linear-gradient(135deg, #fffdf6 0%, #fffdf6 49%, #efe6d2 50%, #fbf6ea 100%);
  box-shadow: 0 4px 8px rgba(60, 40, 20, 0.3);
  transform: rotate(-9deg);
  animation: nudge 1s ease-in-out 1.8s 2;
}
.folded::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, var(--lilac) 0 4px, transparent 5px);
}
@keyframes nudge {
  0%, 100% { transform: rotate(-9deg); }
  40% { transform: rotate(-4deg) translateY(-3px); }
}
.tap-note {
  margin: 30px 0 0;
  font-size: 14px;
  color: #6b6f8c;
}
.unfolded {
  margin-top: 26px;
  width: 100%;
  text-align: left;
  padding: 22px 22px 20px;
  background:
    repeating-linear-gradient(180deg, transparent 0 33px, rgba(157, 180, 222, 0.3) 33px 34px) 0 14px / 100% calc(100% - 28px) no-repeat,
    #fffdf6;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(60, 40, 20, 0.12), 0 20px 30px -18px rgba(60, 40, 20, 0.45);
  transform-origin: top center;
  animation: unfold 0.7s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes unfold {
  from { opacity: 0; transform: perspective(600px) rotateX(-70deg); }
  to { opacity: 1; transform: none; }
}
.unfolded p {
  margin: 0;
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-size: 21px;
  line-height: 34px;
  color: #2f3557;
}
.unfolded p.from { margin-top: 0; text-align: right; color: #6a5aa8; }
.let-in { margin-top: 24px; }

/* ---------- around 망원동: the hand-drawn map ---------- */

:root {
  --map-paper: #fbf5e8;
  --map-ink: #2f3557;
  --map-soft: rgba(47, 53, 87, 0.42);
  --map-block: rgba(47, 53, 87, 0.075);
  --map-block-line: rgba(47, 53, 87, 0.17);
  --map-street: #fffcf5;
  --map-water: #bccbe8;
  --map-water-line: #8ea4d2;
  --map-grass: #d7e2bf;
  --map-tree: #a9c38e;
  --map-line6: #c4843f;
  --map-awning: #e2a08a;
  --map-wall: #fffdf8;
}
[data-phase="dawn"] { --map-paper: #fbf2ee; --map-street: #fffaf6; }
[data-phase="dusk"] {
  --map-paper: #f8ede8;
  --map-street: #fff8f2;
  --map-water: #c4bfe3;
  --map-water-line: #9d93cf;
}
[data-phase="night"] {
  --map-paper: #2b2f5f;
  --map-ink: #e6e3f5;
  --map-soft: rgba(230, 227, 245, 0.45);
  --map-block: rgba(235, 232, 246, 0.07);
  --map-block-line: rgba(235, 232, 246, 0.14);
  --map-street: #363b70;
  --map-water: #1e2350;
  --map-water-line: #4f5a9c;
  --map-grass: #2f4256;
  --map-tree: #46645f;
  --map-line6: #d59a55;
  --map-awning: #9b6a6a;
  --map-wall: #3d4278;
}

.map-card {
  padding: 6px 6px 12px;
  border-radius: 4px;
  background: var(--map-paper);
  color: var(--map-ink);
  transform: rotate(-0.4deg);
  box-shadow: 0 1px 2px rgba(30, 34, 70, 0.14), 0 16px 28px -18px rgba(30, 34, 70, 0.4);
  transition: background 0.6s ease;
}
[data-phase="night"] .map-card {
  box-shadow: 0 0 0 1px var(--line), 0 16px 28px -18px rgba(0, 0, 0, 0.6);
}
.map {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--hand);
}

.map .m-blocks rect { fill: var(--map-block); stroke: var(--map-block-line); stroke-width: 0.6; }
.map .m-lamps circle { fill: #ffd98f; opacity: 0; transition: opacity 0.6s ease; }
[data-phase="dusk"] .map .m-lamps .early { opacity: 0.7; }
[data-phase="night"] .map .m-lamps circle { opacity: 0.85; }
[data-asleep] .map .m-lamps .early { opacity: 0; }

.map .m-grass { fill: var(--map-grass); }
.map .m-water { fill: var(--map-water); }
.map .m-wave { fill: none; stroke: var(--map-water-line); stroke-width: 1.2; stroke-linecap: round; }
.map .m-trees circle { fill: var(--map-tree); }
.map .m-lane { fill: none; stroke: var(--map-street); stroke-width: 5; stroke-linecap: round; }
.map .m-road { fill: none; stroke: var(--map-street); stroke-width: 7; stroke-linecap: round; }
.map .m-main { fill: none; stroke: var(--map-street); stroke-width: 11; stroke-linecap: round; }
.map .m-road.m-edge { stroke: var(--map-soft); stroke-width: 9; }
.map .m-main.m-edge { stroke: var(--map-soft); stroke-width: 13.5; }
.map .m-tunnel { fill: none; stroke: var(--map-soft); stroke-width: 1.4; }
.map .m-bridge { fill: none; stroke: var(--map-soft); stroke-width: 1.6; }
.map .m-bridge-tick { fill: none; stroke: var(--map-soft); stroke-width: 1; }
.map .m-awning-base { fill: none; stroke: var(--map-wall); stroke-width: 10; stroke-linecap: round; }
.map .m-awning { fill: none; stroke: var(--map-awning); stroke-width: 10; stroke-dasharray: 4 4; }
.map .m-line6 { fill: none; stroke: var(--map-line6); stroke-width: 1.6; stroke-dasharray: 5 4; opacity: 0.85; }
.map .m-line6-tip { fill: none; stroke: var(--map-line6); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.map .m-road-name { font-size: 10px; fill: var(--map-soft); }
.map .m-line6-name { font-size: 11px; font-weight: 700; fill: var(--map-line6); }
.map .m-river-name { font-size: 22px; font-weight: 700; fill: var(--map-water-line); letter-spacing: 0.2em; }
.map .m-north path { fill: none; stroke: var(--map-water-line); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.map .m-north text { font-size: 11px; font-weight: 700; fill: var(--map-water-line); }

/* the places */
.map .pl { cursor: pointer; outline: none; }
.map .pl-hit { fill: transparent; stroke: transparent; stroke-width: 1.5; transition: fill 0.2s ease; }
.map .pl:focus-visible .pl-hit { stroke: var(--lilac); }
.map .pl.sel .pl-hit { fill: rgba(179, 155, 230, 0.24); stroke: var(--lilac); stroke-dasharray: 3 3; }
.map .pl-glow { opacity: 0; transition: opacity 0.6s ease; }
.map .pl.lit .pl-glow { opacity: 1; }
.map .pl-icon { transition: opacity 0.3s ease; }
.map .pl.shut .pl-icon { opacity: 0.42; }
.map .pl.shut .pl-name { fill: var(--map-soft); }
.map .pl-name {
  font-size: 13px;
  font-weight: 700;
  fill: var(--map-ink);
  stroke: var(--map-paper);
  stroke-width: 3.5px;
  stroke-linejoin: round;
  paint-order: stroke;
  letter-spacing: -0.03em;
}
.map .pl-icon * { stroke: var(--map-ink); stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.map .i-line, .map .i-steam, .map .i-note { fill: none; }
.map .i-wall { fill: var(--map-wall); }
.map .i-win { fill: var(--map-paper); stroke-width: 0.8 !important; }
.map .pl.lit .i-win.me { fill: #ffd98f; }
.map .i-sign { fill: var(--periwinkle); }
.map .i-drum { fill: var(--map-water); }
.map .i-crock { fill: #a96f4a; }
.map .i-awn { fill: var(--map-awning); }
.map .i-awn-stripe { fill: none; stroke: var(--map-wall) !important; stroke-width: 1.6 !important; }
.map .i-empty { fill: var(--map-wall); stroke-dasharray: 2.5 2; }
.map .i-tent { fill: #e88a4d; }
.map .i-note-dot { fill: var(--map-ink); stroke: none !important; }
.map .i-six { fill: var(--map-line6); }
.map .i-six-n { font-family: var(--frame-font); font-size: 11px; font-weight: 700; fill: #fff8ee; stroke: none !important; }
.map .i-tree { fill: var(--map-tree); }

/* the little one, walking about */
.map .kin { pointer-events: none; }
.map .kin-halo { fill: rgba(179, 155, 230, 0.32); animation: kin-breathe 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.map .kin-star { fill: var(--periwinkle); stroke: #2f3557; stroke-width: 1.3; stroke-linejoin: round; }
.map .kin-eye { fill: #2f3557; }
.map .kin-steps { fill: none; stroke: var(--lilac); stroke-width: 2; stroke-linecap: round; }
.map .kin.asleep .kin-halo { animation: none; fill: rgba(179, 155, 230, 0.14); }
.map .kin.asleep .kin-star { fill: #7d8db8; stroke: #23264b; }
.map .kin.asleep .kin-eye { fill: transparent; }
.map .kin-z { font-size: 12px; font-weight: 700; fill: var(--map-ink); opacity: 0.8; }
.map .trail { fill: none; stroke: var(--lilac); stroke-width: 2.4; stroke-dasharray: 1 6; stroke-linecap: round; }
.map .trail-end { fill: var(--lilac); }
@keyframes kin-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.55; }
}

/* far away: off the map, a ride on Line 6 */
.map-far {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 4px 6px 0;
}
.map-far-label {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--map-soft);
}
.far-tag {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 5px 4px 6px;
  border: 1px dashed var(--map-line6);
  border-radius: 12px;
  background: transparent;
  color: var(--map-ink);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}
.far-tag .ko { font-family: var(--hand); font-weight: 700; font-size: 16px; }
.far-tag .en { color: var(--map-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.far-tag.sel { background: rgba(179, 155, 230, 0.22); border-style: solid; border-color: var(--lilac); }
.far-tag.here { border-style: solid; }
.far-tag.shut:not(.here) { opacity: 0.5; }
.far-kin { position: absolute; top: -9px; right: -5px; width: 22px; height: 22px; }
.far-kin path { fill: var(--periwinkle); stroke: #2f3557; stroke-width: 1.6; stroke-linejoin: round; }

/* what's there: one line under the map */
.map-cap {
  margin: 16px 2px 0;
  min-height: 72px;
}
.map-cap-name {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}
.map-cap-name .ko { font-family: var(--hand); font-weight: 700; font-size: 21px; letter-spacing: var(--hand-track); }
.map-cap-name .en { color: var(--ink-soft); }
.map-here {
  display: inline-block;
  margin: 2px 0 0;
  padding-left: 16px;
  font-size: 13px;
  color: var(--ink-soft);
  background: radial-gradient(circle at 5px 50%, var(--lilac) 0 4px, transparent 5px) no-repeat;
}
.map-cap-line {
  margin: 4px 0 0;
  font-family: var(--hand);
  letter-spacing: var(--hand-track);
  font-size: 19px;
  line-height: 1.3;
}
.map-cap-meta {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-faint);
}
.map-hint {
  margin: 8px 2px 0;
  font-size: 13px;
  color: var(--ink-faint);
}

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

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

/* the live test only: WH's one tap a day, kept quiet and apart from the little one's page */
.feel {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}
.feel p { margin: 0; }
.feel-row { display: flex; flex-wrap: wrap; gap: 6px; }
.feel-chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
}
.feel-chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.feel-chip:disabled:not(.on) { opacity: .45; }
.feel-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
