/* มูละมุน: café journal. Lilac page, paper stickers, washi tape, plum ink. Light by day, night sky by night. */
:root {
  color-scheme: light dark;
  /* brand constants (same in both themes) */
  --plum: #4B3A78;
  --butter: #FFD866;
  --blush: #F6B8CC;
  --mint: #BFE8D6;
  --tape-ink: #2E2347;
  /* theme tokens: light */
  --page: #E7E1FA;
  --paper: #FFFDFB;
  --ink: #2E2347;
  --ink-soft: #54467A;
  --link: #3A2C61;
  --line: #CFC4EE;
  --field: #F7F4FF;
  --field-2: #F3EFFF;
  --placeholder: #6E6390;
  --accent-bg: #4B3A78;
  --accent-bg-hover: #3A2C61;
  --accent-fg: #FFFFFF;
  --disabled-bg: #B9AFD6;
  --disabled-fg: #3A2C61;
  --note-butter: #FFF6D6;
  --note-blush: #FDE8EF;
  --frame: #FFFFFF;
  --shadow-rgb: 46, 35, 71;
  --shadow: 0 6px 18px rgba(var(--shadow-rgb), .14), 0 1px 3px rgba(var(--shadow-rgb), .10);
  --shadow-lift: 0 14px 30px rgba(var(--shadow-rgb), .20), 0 2px 6px rgba(var(--shadow-rgb), .10);
  --r: 18px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --display: 'Sriracha', 'Mali', cursive;
  --ui: 'Mali', 'Noto Sans Thai', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #17122A;
    --paper: #251D3D;
    --ink: #EFEAFF;
    --ink-soft: #C3B8E8;
    --link: #D9CCFF;
    --line: #42376A;
    --field: #2E2549;
    --field-2: #322850;
    --placeholder: #A79CCB;
    --accent-bg: #FFD866;
    --accent-bg-hover: #FFE48F;
    --accent-fg: #2E2347;
    --disabled-bg: #3A3158;
    --disabled-fg: #B4A9D8;
    --note-butter: rgba(255, 216, 102, .14);
    --note-blush: rgba(246, 184, 204, .14);
    --frame: #F4F0FF;
    --shadow-rgb: 4, 2, 12;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; caret-color: var(--link); accent-color: var(--accent-bg); scrollbar-color: #A99BD6 var(--page); }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 400 17px/1.6 var(--ui);
  background: var(--page) url('/stars.svg') 0 0 / 480px 480px;
}
::selection { background: var(--butter); color: var(--tape-ink); }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 10px; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

main { max-width: 600px; margin: 0 auto; padding: 18px 16px 56px; }
.top { display: flex; align-items: center; gap: 6px; min-height: 44px; margin-bottom: 4px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--link); font-weight: 600; text-decoration: none; padding: 8px 10px 8px 2px; }
.back:hover { text-decoration: underline; text-underline-offset: 4px; }
h1, h2, .display { font-family: var(--display); font-weight: 400; line-height: 1.25; margin: 0; }
h1 { font-size: clamp(34px, 9vw, 46px); }
h2 { font-size: 26px; margin: 0 0 10px; }
h1, h2 { text-wrap: balance; }
.lede { color: var(--ink-soft); margin: 4px 0 22px; text-wrap: pretty; }
/* Phosphor Icons (filled glyph paths) */
.icon { width: 22px; height: 22px; flex: none; fill: currentColor; }

/* the sticker: paper with a soft lift */
.sticker { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.tape {
  display: inline-block; padding: 3px 14px; font: 600 15px/1.4 var(--ui); color: var(--tape-ink);
  background: color-mix(in srgb, var(--blush) 88%, transparent);
  transform: rotate(-3deg); box-shadow: 0 1px 2px rgba(var(--shadow-rgb), .12);
  clip-path: polygon(3% 0, 100% 4%, 97% 100%, 0 96%);
}
.tape.butter { background: color-mix(in srgb, var(--butter) 92%, transparent); transform: rotate(2deg); }
.tape.mint { background: color-mix(in srgb, var(--mint) 92%, transparent); transform: rotate(-1.5deg); }

/* radius rule: panels 18px · controls 14px · chips pill · tarot/photo frames 8-12px */
label, .label { display: block; font-weight: 600; font-size: 15px; margin: 14px 0 8px; color: var(--ink); }
label:first-child, .label:first-child { margin-top: 0; }
input[type=text], textarea {
  width: 100%; font: inherit; color: var(--ink); padding: 12px 14px; min-height: 48px;
  background: var(--field); border: 1.5px solid var(--line); border-radius: 14px; outline: none;
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:focus-visible, textarea:focus-visible { border-color: var(--link); box-shadow: 0 0 0 4px color-mix(in srgb, var(--link) 22%, transparent); outline: none; }
textarea { resize: vertical; min-height: 84px; }

/* chips = segmented choice (aria-pressed buttons) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 8px 16px; border-radius: 999px; cursor: pointer; font: 600 15px var(--ui);
  color: var(--ink); background: var(--field-2); border: 1.5px solid var(--line); display: inline-flex; align-items: center; gap: 8px;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.chip:hover { border-color: var(--link); }
.chips.even { display: grid; grid-template-columns: repeat(4, 1fr); }
.chips.even .chip { justify-content: center; padding: 8px 4px; white-space: nowrap; }
@media (max-width: 400px) { .chips.even { grid-template-columns: repeat(2, 1fr); } }
.chip[aria-pressed=true] { background: var(--accent-bg); border-color: var(--accent-bg); color: var(--accent-fg); }
.dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.7); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px;
  border: 0; border-radius: 14px; cursor: pointer; font: 700 18px var(--ui); text-decoration: none; white-space: nowrap;
  color: var(--accent-fg); background: var(--accent-bg); box-shadow: 0 6px 16px rgba(var(--shadow-rgb), .28);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.btn:hover { background: var(--accent-bg-hover); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(var(--shadow-rgb), .32); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { background: var(--disabled-bg); color: var(--disabled-fg); box-shadow: none; cursor: not-allowed; transform: none; }
.btn.soft { background: var(--paper); color: var(--link); border: 1.5px solid var(--line); box-shadow: none; }
.btn.soft:hover { border-color: var(--link); background: var(--field); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.note { font-size: 15px; color: var(--ink-soft); margin: 12px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

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