:root {
  --ink: #241f1b;
  --paper: #f6efe6;
  --clay: #c45d3c;
  --deep: #2f2b26;
  --mist: rgba(0, 0, 0, 0.08);
  --glow: rgba(196, 93, 60, 0.25);
  --card: #fff8f0;
  --accent: #2c7a7b;
  --accent-strong: #1f4d50;
  --brick-base: #e7c9a4;
  --brick-edge: #d4b086;
  --brick-mortar: #f6e7cf;
  --leaf: #3d7a3b;
  --leaf-dark: #2f5f2c;
  --flower: #ef7b3a;
  --flower-dark: #c65321;
  --brick-shadow: rgba(120, 90, 55, 0.18);
  --brick-highlight: rgba(255, 255, 255, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Nanum Myeongjo", "Noto Serif KR", serif;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, #cfe7f6 0%, #dff0fb 38%, #f6efe6 38%),
    radial-gradient(circle at 12% 20%, rgba(196, 93, 60, 0.12), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(44, 122, 123, 0.16), transparent 40%);
  z-index: -1;
}

.wrap {
  min-height: 100vh;
  padding: 0;
}

.hero {
  text-align: left;
  margin-bottom: 32px;
  animation: fadeUp 0.6s ease-out both;
}

.kicker {
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin: 0 0 12px;
}

.hero h1 {
  font-size: clamp(32px, 4vw, 52px);
  margin: 0 0 8px;
  color: var(--deep);
}

.sub {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}

.panel {
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 40px var(--mist);
  border: 1px solid rgba(0, 0, 0, 0.05);
  animation: fadeUp 0.6s ease-out 0.1s both;
}

.panel-right {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: min(340px, calc(100% - 56px));
  z-index: 3;
}

.panel h2,
.wall h2 {
  margin-top: 0;
  font-size: 22px;
}

label {
  display: block;
  margin: 14px 0 8px;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

button {
  margin-top: 16px;
  padding: 12px 18px;
  background: var(--clay);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px var(--glow);
}

.status {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 14px 20px;
  font-size: 14px;
  color: #1f4d50;
  background: rgba(255, 248, 240, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.18);
  z-index: 4;
  pointer-events: none;
  animation: toastPop 0.2s ease-out both;
}

.wall {
  --sky-height: 190px;
  min-height: 100vh;
  padding: calc(var(--sky-height) + 12px) 36px 72px;
  border-radius: 0;
  position: relative;
  background-color: #ead4b5;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60' viewBox='0 0 120 60'%3E%3Crect width='120' height='60' fill='%23f1dfc4'/%3E%3Crect x='0' y='0' width='58' height='26' rx='2' ry='2' fill='%23e6c39b'/%3E%3Crect x='62' y='0' width='58' height='26' rx='2' ry='2' fill='%23e1bb91'/%3E%3Crect x='30' y='32' width='58' height='26' rx='2' ry='2' fill='%23e7c7a3'/%3E%3Crect x='92' y='32' width='28' height='26' rx='2' ry='2' fill='%23e2bd94'/%3E%3Crect x='0' y='32' width='26' height='26' rx='2' ry='2' fill='%23e2bd94'/%3E%3C/svg%3E"),
    radial-gradient(circle at 18% 35%, rgba(0, 0, 0, 0.08) 0 1px, transparent 2px),
    radial-gradient(circle at 78% 60%, rgba(0, 0, 0, 0.07) 0 1px, transparent 2px),
    radial-gradient(circle at 40% 75%, rgba(0, 0, 0, 0.07) 0 1px, transparent 2px);
  background-size: 100% 100%, 120px 60px, 100% 100%, 100% 100%, 100% 100%;
  background-position: 0 0, 0 0, 0 0, 0 0, 0 0;
  box-shadow: 0 24px 48px rgba(70, 50, 25, 0.16);
  border: 1px solid rgba(140, 105, 70, 0.22);
  animation: fadeUp 0.6s ease-out 0.2s both;
}

.wall::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--sky-height) - 60px);
  z-index: 3;
  height: 120px;
  background:
    linear-gradient(90deg, rgba(61, 122, 59, 0.6), rgba(61, 122, 59, 0.6)) 0 72px / 100% 3px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='140' viewBox='0 0 600 140'%3E%3Crect width='600' height='140' fill='none'/%3E%3Cpath d='M0 72 C60 60 120 60 180 72 S300 84 360 72 480 60 600 72' stroke='%233b7a39' stroke-width='6' fill='none' stroke-linecap='round'/%3E%3Cellipse cx='70' cy='64' rx='16' ry='9' fill='%234c9b49' transform='rotate(-20 70 64)'/%3E%3Cellipse cx='120' cy='70' rx='12' ry='7' fill='%23468f46' transform='rotate(14 120 70)'/%3E%3Cellipse cx='180' cy='66' rx='15' ry='8' fill='%233f8a3d' transform='rotate(-18 180 66)'/%3E%3Cellipse cx='240' cy='68' rx='11' ry='7' fill='%2353a052' transform='rotate(20 240 68)'/%3E%3Cellipse cx='300' cy='64' rx='15' ry='8' fill='%234c9b49' transform='rotate(-18 300 64)'/%3E%3Cellipse cx='360' cy='68' rx='12' ry='7' fill='%233f8a3d' transform='rotate(18 360 68)'/%3E%3Cellipse cx='420' cy='64' rx='15' ry='8' fill='%2353a052' transform='rotate(-20 420 64)'/%3E%3Cellipse cx='480' cy='70' rx='11' ry='7' fill='%23468f46' transform='rotate(16 480 70)'/%3E%3Cellipse cx='200' cy='62' rx='10' ry='6' fill='%2358a857' transform='rotate(-25 200 62)'/%3E%3Cellipse cx='215' cy='70' rx='9' ry='6' fill='%234a9748' transform='rotate(18 215 70)'/%3E%3Cellipse cx='400' cy='62' rx='10' ry='6' fill='%2358a857' transform='rotate(-22 400 62)'/%3E%3Cellipse cx='415' cy='70' rx='9' ry='6' fill='%234a9748' transform='rotate(16 415 70)'/%3E%3Cg transform='translate(40 80) scale(1.15)'%3E%3Ccircle cx='0' cy='0' r='12' fill='%23d64a4a'/%3E%3Ccircle cx='-7' cy='-2' r='8' fill='%23f2a3a3'/%3E%3Ccircle cx='7' cy='-2' r='8' fill='%23f2a3a3'/%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23f6c5c5'/%3E%3Ccircle cx='0' cy='2' r='3' fill='%23b63a3a'/%3E%3C/g%3E%3Cg transform='translate(120 96) scale(1.15)'%3E%3Ccircle cx='0' cy='0' r='10' fill='%23f19aa9'/%3E%3Ccircle cx='-6' cy='-2' r='7' fill='%23f8c7d0'/%3E%3Ccircle cx='6' cy='-2' r='7' fill='%23f8c7d0'/%3E%3Ccircle cx='0' cy='-8' r='6' fill='%23fbdbe2'/%3E%3Ccircle cx='0' cy='2' r='2.5' fill='%23d66278'/%3E%3C/g%3E%3Cg transform='translate(200 84) scale(1.15)'%3E%3Ccircle cx='0' cy='0' r='12' fill='%23e35c69'/%3E%3Ccircle cx='-7' cy='-2' r='8' fill='%23f5a4b2'/%3E%3Ccircle cx='7' cy='-2' r='8' fill='%23f5a4b2'/%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23f9c7d1'/%3E%3Ccircle cx='0' cy='2' r='3' fill='%23c23d4a'/%3E%3C/g%3E%3Cg transform='translate(280 98) scale(1.15)'%3E%3Ccircle cx='0' cy='0' r='9' fill='%23ffb2c4'/%3E%3Ccircle cx='-5' cy='-2' r='6.5' fill='%23ffd5e1'/%3E%3Ccircle cx='5' cy='-2' r='6.5' fill='%23ffd5e1'/%3E%3Ccircle cx='0' cy='-7' r='6' fill='%23ffe7ee'/%3E%3Ccircle cx='0' cy='2' r='2.5' fill='%23e66b86'/%3E%3C/g%3E%3Cg transform='translate(360 82) scale(1.15)'%3E%3Ccircle cx='0' cy='0' r='12' fill='%23c93b3b'/%3E%3Ccircle cx='-7' cy='-2' r='8' fill='%23f0a1a1'/%3E%3Ccircle cx='7' cy='-2' r='8' fill='%23f0a1a1'/%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23f6c1c1'/%3E%3Ccircle cx='0' cy='2' r='3' fill='%23a92f2f'/%3E%3C/g%3E%3Cg transform='translate(440 96) scale(1.15)'%3E%3Ccircle cx='0' cy='0' r='10' fill='%23f27b90'/%3E%3Ccircle cx='-6' cy='-2' r='7' fill='%23f9b7c5'/%3E%3Ccircle cx='6' cy='-2' r='7' fill='%23f9b7c5'/%3E%3Ccircle cx='0' cy='-8' r='6' fill='%23ffd0dc'/%3E%3Ccircle cx='0' cy='2' r='2.5' fill='%23d65773'/%3E%3C/g%3E%3Cg transform='translate(520 86) scale(1.15)'%3E%3Ccircle cx='0' cy='0' r='11' fill='%23de4f5f'/%3E%3Ccircle cx='-6' cy='-2' r='7.5' fill='%23f3a7b5'/%3E%3Ccircle cx='6' cy='-2' r='7.5' fill='%23f3a7b5'/%3E%3Ccircle cx='0' cy='-8' r='6.5' fill='%23f8c8d2'/%3E%3Ccircle cx='0' cy='2' r='2.5' fill='%23bc3a4a'/%3E%3C/g%3E%3C/svg%3E") repeat-x;
  pointer-events: none;
}

.wall::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 26px;
  background:
    radial-gradient(circle at 22% 20%, var(--brick-highlight), transparent 55%),
    radial-gradient(circle at 78% 62%, var(--brick-shadow), transparent 60%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.25), transparent 50%),
    linear-gradient(200deg, rgba(0, 0, 0, 0.14), transparent 45%);
  pointer-events: none;
}

.wall-sky {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--sky-height);
  background:
    linear-gradient(180deg, #b8dcf3 0%, #d5edf8 80%);
  border-bottom: 4px solid #b7a07a;
  z-index: 1;
  pointer-events: none;
}

.wall-sky::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 52%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='200' viewBox='0 0 800 200'%3E%3Crect width='800' height='200' fill='none'/%3E%3Cg fill='%23ffffff' fill-opacity='0.95'%3E%3Cpath d='M90 70c-10-18 6-38 26-38 14 0 26 8 30 20 4-2 9-3 14-3 18 0 32 14 32 32s-14 32-32 32H100c-18 0-32-14-32-32 0-13 7-24 22-31z'/%3E%3Cpath d='M360 60c-10-18 6-38 26-38 14 0 26 8 30 20 4-2 9-3 14-3 18 0 32 14 32 32s-14 32-32 32H370c-18 0-32-14-32-32 0-13 7-24 22-31z'/%3E%3Cpath d='M610 80c-10-18 6-38 26-38 14 0 26 8 30 20 4-2 9-3 14-3 18 0 32 14 32 32s-14 32-32 32H620c-18 0-32-14-32-32 0-13 7-24 22-31z'/%3E%3Cpath d='M520 120c-8-14 4-30 20-30 11 0 20 6 23 16 3-2 7-2 11-2 14 0 25 11 25 25s-11 25-25 25H530c-14 0-25-11-25-25 0-9 5-17 15-21z'/%3E%3C/g%3E%3Cg fill='%23f4fbff' fill-opacity='0.9'%3E%3Cpath d='M210 120c-8-14 4-30 20-30 11 0 20 6 23 16 3-2 7-2 11-2 14 0 25 11 25 25s-11 25-25 25H220c-14 0-25-11-25-25 0-9 5-17 15-21z'/%3E%3Cpath d='M700 130c-8-14 4-30 20-30 11 0 20 6 23 16 3-2 7-2 11-2 14 0 25 11 25 25s-11 25-25 25H710c-14 0-25-11-25-25 0-9 5-17 15-21z'/%3E%3C/g%3E%3C/svg%3E") repeat-x;
  background-size: 800px 200px;
  background-position: 0 8px;
  pointer-events: none;
}

.wall-sky::after {
  content: "";
  position: absolute;
  right: 8%;
  top: 26px;
  width: 160px;
  height: 90px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='90' viewBox='0 0 160 90'%3E%3Crect width='160' height='90' fill='none'/%3E%3Cg fill='%238fb9cf'%3E%3Cpath d='M20 40c8-10 22-12 34-6-6-12-2-26 12-30 10-3 20 1 26 10 10-6 22-4 30 4-14 4-22 12-26 22-8-10-20-12-30-6-6-10-20-8-26 6-6 14 2 26 18 26H16c-8 0-12-10-6-20z' opacity='0.7'/%3E%3Cpath d='M84 48c6-8 18-9 28-4-4-9-2-20 10-23 8-2 16 1 20 8 8-5 18-3 24 4-12 3-18 9-21 17-6-8-16-9-24-4-5-8-16-6-20 4-4 10 1 18 14 18H78c-6 0-9-7-4-14z' opacity='0.8'/%3E%3C/g%3E%3Cg fill='%23f2a7b8'%3E%3Ccircle cx='46' cy='34' r='3'/%3E%3Ccircle cx='104' cy='42' r='3'/%3E%3Ccircle cx='62' cy='54' r='3'/%3E%3C/g%3E%3C/g fill='%2380a7be'%3E%3Cpath d='M18 18c6 2 10 6 12 12-8-4-14-4-22 0 2-6 6-10 10-12z'/%3E%3Cpath d='M56 12c6 2 10 6 12 12-8-4-14-4-22 0 2-6 6-10 10-12z'/%3E%3Cpath d='M98 16c6 2 10 6 12 12-8-4-14-4-22 0 2-6 6-10 10-12z'/%3E%3Cpath d='M132 22c6 2 10 6 12 12-8-4-14-4-22 0 2-6 6-10 10-12z'/%3E%3C/g%3E%3C/svg%3E") no-repeat;
  opacity: 0.9;
}

.sky-content {
  position: absolute;
  top: 28px;
  left: 36px;
  right: 36px;
  z-index: 2;
}

.refresh-floating {
  position: absolute;
  top: 24px;
  right: 24px;
  background: var(--accent);
  z-index: 2;
}

.error {
  margin-top: 16px;
  padding: 12px 14px;
  background: #ffe5d8;
  border-radius: 12px;
  color: #9a3412;
  font-size: 14px;
}

.note-list {
  list-style: none;
  padding: 0;
  margin: 56px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  position: relative;
  z-index: 2;
  padding-right: min(360px, 40vw);
}

.note-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 243, 231, 0.96));
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 24px var(--mist);
  border: 1px solid rgba(0, 0, 0, 0.05);
  animation: floatIn 0.4s ease-out both;
  position: relative;
}

.note-card::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 20px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0 3px, #c04f3a 4px 100%);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.note-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.note-card p {
  margin: 0 0 12px;
  line-height: 1.5;
}

.note-card time {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.55);
}

.delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  color: var(--accent-strong);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  margin: 0;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.08);
}

.delete-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.12);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastPop {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (max-width: 720px) {
  .wrap {
    padding: 32px 16px 64px;
  }

  .panel-right {
    position: static;
    width: 100%;
    margin-top: 20px;
  }

  .refresh-floating {
    position: static;
    margin-bottom: 16px;
  }

  .note-list {
    padding-right: 0;
  }
}
