:root {
  --ink: #3d312b;
  --muted: #786961;
  --paper: #fffaf1;
  --orange: #e77845;
  --line: #ead9c8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background-color: #f4eadb;
  background-image: radial-gradient(#d8c2a8 0.7px, transparent 0.7px);
  background-size: 13px 13px;
  font-family: "Gowun Dodum", sans-serif;
}

.page-shell { width: min(100% - 32px, 1040px); margin: 0 auto; padding: 74px 0 60px; }
.hero { text-align: center; margin-bottom: 42px; }
.eyebrow { margin: 0 0 8px; color: var(--orange); font-size: .73rem; font-weight: bold; letter-spacing: .18em; }
h1, h2 { margin: 0; }
h1 { font-family: "Nanum Pen Script", cursive; font-size: clamp(3.6rem, 10vw, 6.5rem); font-weight: 400; line-height: .9; }
.hero-copy { margin: 20px 0 0; color: var(--muted); font-size: .95rem; line-height: 1.8; }

.writer { position: relative; width: min(100%, 620px); margin: 0 auto 80px; padding: 34px 38px 30px; background: var(--paper); box-shadow: 7px 9px 0 rgba(110, 76, 53, .13), 0 8px 26px rgba(86, 61, 47, .12); transform: rotate(-.6deg); }
.writer::after { content: ""; position: absolute; inset: 8px; pointer-events: none; border: 1px solid #f0e1cd; }
.writer > * { position: relative; z-index: 1; }
.pin { position: absolute; z-index: 2; top: -13px; left: 50%; width: 25px; height: 25px; border-radius: 50%; background: #e85c45; box-shadow: inset -3px -4px 0 rgba(117, 42, 30, .18), 0 3px 4px #ad8c74; }
.writer h2 { margin-bottom: 19px; font-size: 1.3rem; }
label { display: block; margin-top: 14px; }
label span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .75rem; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 3px; padding: 11px 12px; color: var(--ink); background: #fffdf9; font: inherit; font-size: .9rem; outline: none; }
input:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(231, 120, 69, .13); }
textarea { height: 106px; resize: vertical; line-height: 1.6; }
.form-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 13px; }
#character-count { color: #9f9085; font-size: .72rem; }
button { cursor: pointer; font-family: inherit; }
button[type="submit"] { border: 0; border-radius: 3px; padding: 10px 16px; color: white; background: var(--orange); font-size: .86rem; box-shadow: 2px 3px 0 #bc5d36; transition: transform .15s, box-shadow .15s; }
button[type="submit"]:hover { transform: translate(1px, 1px); box-shadow: 1px 2px 0 #bc5d36; }
button:disabled { cursor: wait; opacity: .65; }

.wall-section { padding-top: 4px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-heading h2 { font-family: "Nanum Pen Script", cursive; font-size: 2.25rem; font-weight: 400; }
.refresh-button { border: 0; color: var(--muted); background: transparent; font-size: .78rem; text-decoration: underline; text-underline-offset: 4px; }
.status-message { margin: 16px 0; color: var(--muted); text-align: center; font-size: .9rem; }
.status-message.error { padding: 14px; border: 1px solid #e49882; color: #9d3f29; background: #fff1eb; line-height: 1.7; }
.notes-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
.note { position: relative; min-height: 185px; padding: 27px 22px 22px; background: #fff9d7; box-shadow: 4px 5px 0 rgba(105, 79, 51, .14), 0 5px 13px rgba(93, 67, 48, .1); transition: transform .2s; }
.note:hover { transform: translateY(-4px) rotate(0deg) !important; }
.note:nth-child(3n+2) { background: #e7f3ec; transform: rotate(1.2deg); }
.note:nth-child(3n+3) { background: #fbe4e2; transform: rotate(-1.4deg); }
.note:nth-child(3n+1) { transform: rotate(-.8deg); }
.tape { position: absolute; top: -9px; left: 50%; width: 58px; height: 19px; background: rgba(226, 179, 112, .54); transform: translateX(-50%) rotate(-3deg); }
.note-message { margin: 4px 0 25px; white-space: pre-wrap; word-break: break-word; font-family: "Nanum Pen Script", cursive; font-size: 1.7rem; line-height: 1.25; }
.note-meta { position: absolute; right: 19px; bottom: 16px; left: 19px; display: flex; justify-content: space-between; align-items: center; color: #796d60; font-size: .7rem; }
.note-author { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: bold; }
footer { padding: 25px 16px 38px; color: #958478; text-align: center; font-size: .73rem; }

@media (max-width: 720px) { .notes-wall { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (max-width: 480px) { .page-shell { width: min(100% - 24px, 1040px); padding-top: 52px; } .writer { padding: 30px 22px 24px; } .notes-wall { grid-template-columns: 1fr; } .note { min-height: 155px; } }
