:root {
  --bg-deep: #16331f;
  --bg-mid: #224b2f;
  --leaf-light: #b7d68a;
  --leaf-mid: #7faa5f;
  --leaf-dark: #365e37;
  --card: rgba(246, 250, 239, 0.9);
  --text-main: #1f2c1e;
  --text-sub: #496147;
  --accent: #2f7d32;
  --accent-strong: #1f5d22;
  --danger: #9f2f26;
  --shadow: 0 18px 40px rgba(10, 30, 12, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nanum Myeongjo", "Noto Serif KR", serif;
  color: var(--text-main);
  background: linear-gradient(160deg, var(--bg-deep), var(--bg-mid));
  position: relative;
  overflow-x: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-1 {
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 48px,
      rgba(183, 214, 138, 0.08) 48px,
      rgba(183, 214, 138, 0.08) 54px,
      transparent 54px,
      transparent 98px
    ),
    radial-gradient(circle at 20% 20%, rgba(183, 214, 138, 0.15), transparent 42%),
    radial-gradient(circle at 80% 75%, rgba(125, 170, 88, 0.18), transparent 45%);
  animation: sway 14s ease-in-out infinite alternate;
}

.bg-2 {
  background: linear-gradient(
    to top,
    rgba(14, 37, 21, 0.55) 0%,
    rgba(14, 37, 21, 0.2) 24%,
    rgba(14, 37, 21, 0) 55%
  );
}

.site-header {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #ecf8dc;
  padding: 48px 16px 26px;
  animation: riseIn 0.8s ease-out;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.04em;
}

.site-header p {
  margin-top: 10px;
  color: #d4e7b8;
  font-size: 1rem;
}

.layout {
  width: min(1100px, 94vw);
  margin: 0 auto 50px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--card);
  border: 1px solid rgba(39, 78, 44, 0.24);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
  animation: riseIn 0.7s ease both;
}

.write-card {
  animation-delay: 0.05s;
}

.wall-card {
  animation-delay: 0.12s;
}

h2 {
  margin: 0 0 14px;
  font-size: 1.3rem;
}

label {
  display: block;
  margin: 12px 0 6px;
  color: var(--text-sub);
  font-size: 0.95rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(42, 86, 47, 0.34);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  background: rgba(255, 255, 255, 0.92);
}

textarea {
  resize: vertical;
  min-height: 110px;
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease, background-color 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

#noteForm button {
  margin-top: 14px;
  width: 100%;
  background: var(--accent);
  color: #f4fbef;
  font-weight: 700;
}

#noteForm button:hover {
  background: var(--accent-strong);
}

.wall-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#refreshBtn {
  background: #d7eac3;
  color: #27452d;
}

#refreshBtn:hover {
  background: #c7deb0;
}

.status {
  margin: 10px 0 12px;
  color: #2a4c2e;
  min-height: 24px;
}

.note-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.note-item {
  border: 1px solid rgba(43, 90, 49, 0.25);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  padding: 14px;
  animation: fadeIn 0.35s ease;
}

.note-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.note-top strong {
  font-size: 1rem;
}

.note-date {
  font-size: 0.82rem;
  color: #5d7358;
}

.note-content {
  margin: 9px 0 12px;
  white-space: pre-wrap;
  line-height: 1.5;
}

.note-actions {
  display: flex;
  gap: 8px;
}

.edit-btn {
  background: #dceebe;
  color: #30501f;
}

.delete-btn {
  background: #f0cdc8;
  color: var(--danger);
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .site-header {
    padding-top: 34px;
  }
}

@keyframes sway {
  from {
    transform: translateX(-6px);
  }
  to {
    transform: translateX(6px);
  }
}

@keyframes riseIn {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
