:root {
  --background: #faf6f1;
  --foreground: #3d3229;
  --muted: #8b7355;
  --accent: #d4c4a8;
  --paper: #fffef9;
  --ink: #2c1810;
  --sepia: #704214;
  --font-serif: 'Lora', Georgia, serif;
  --font-handwritten: 'Caveat', cursive;
  --font-typewriter: 'Special Elite', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-serif);
  background-image:
    radial-gradient(ellipse at top, #fdfaf5 0%, transparent 50%),
    radial-gradient(ellipse at bottom, #f5ebe0 0%, transparent 50%);
  min-height: 100vh;
}

main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  max-width: 48rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  text-align: center;
}

header h1 {
  font-size: 3.75rem;
  margin-bottom: 1rem;
}

.header-divider {
  margin-top: 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid #e5e5e5;
}

.header-divider p {
  font-size: 0.875rem;
  padding-top: 1.5rem;
  line-height: 1.75;
}

/* Notes Section */
.notes-section {
  flex: 1;
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

.notes-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
  text-align: center;
  opacity: 0.6;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.loading, .empty, .error {
  text-align: center;
  opacity: 0.5;
  padding: 3rem 0;
}

.empty {
  font-size: 1.5rem;
}

.empty-sub {
  font-size: 0.875rem;
  margin-top: 1rem;
  opacity: 0.7;
}

/* Note Card */
.note-card {
  background: var(--paper);
  background-image: linear-gradient(90deg, transparent 0%, rgba(255,252,240,0.5) 50%, transparent 100%);
  border: 1px solid #e8dcc8;
  border-radius: 0.5rem;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  box-shadow:
    0 1px 2px rgba(60, 40, 20, 0.08),
    0 4px 8px rgba(60, 40, 20, 0.06),
    0 8px 16px rgba(60, 40, 20, 0.04),
    inset 0 0 60px rgba(255, 250, 235, 0.3);
}

.note-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(200, 180, 160, 0.1) 28px);
  pointer-events: none;
  border-radius: inherit;
}

.note-card:hover {
  box-shadow:
    0 2px 4px rgba(60, 40, 20, 0.1),
    0 8px 16px rgba(60, 40, 20, 0.08),
    0 16px 32px rgba(60, 40, 20, 0.06),
    inset 0 0 60px rgba(255, 250, 235, 0.4);
  transform: translateY(-2px);
}

.note-rotation-1 { transform: rotate(-0.8deg); }
.note-rotation-2 { transform: rotate(0.5deg); }
.note-rotation-3 { transform: rotate(-0.3deg); }
.note-rotation-4 { transform: rotate(0.7deg); }
.note-rotation-5 { transform: rotate(-0.5deg); }

.note-card:hover.note-rotation-1 { transform: rotate(-0.8deg) translateY(-2px); }
.note-card:hover.note-rotation-2 { transform: rotate(0.5deg) translateY(-2px); }
.note-card:hover.note-rotation-3 { transform: rotate(-0.3deg) translateY(-2px); }
.note-card:hover.note-rotation-4 { transform: rotate(0.7deg) translateY(-2px); }
.note-card:hover.note-rotation-5 { transform: rotate(-0.5deg) translateY(-2px); }

.note-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.note-title {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.note-date {
  font-size: 0.75rem;
  opacity: 0.7;
}

.note-body {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(212, 196, 168, 0.5);
  position: relative;
  z-index: 1;
}

.note-description {
  color: var(--muted);
  font-size: 0.875rem;
  font-style: italic;
  margin-bottom: 1rem;
  line-height: 1.75;
}

.note-content {
  font-size: 1rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.note-expand {
  margin-top: 1rem;
  text-align: right;
  position: relative;
  z-index: 1;
}

.note-expand span {
  font-size: 0.75rem;
  opacity: 0.4;
}

/* Mood Badges */
.mood {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-weight: 500;
}

.mood-curious { background: #e8d5b7; color: #6b4423; border: 1px solid #d4b896; }
.mood-melancholic { background: #d8cfe0; color: #5c4a6b; border: 1px solid #c4b8d0; }
.mood-hopeful { background: #d4e6d4; color: #3d5c3d; border: 1px solid #b8d4b8; }
.mood-peaceful { background: #d4dfe6; color: #3d4a5c; border: 1px solid #b8c8d4; }
.mood-restless { background: #e6d4c4; color: #5c3d2d; border: 1px solid #d4b8a4; }

/* Typography */
.typewriter {
  font-family: var(--font-typewriter);
  color: var(--sepia);
  letter-spacing: 0.02em;
}

/* Footer */
footer {
  max-width: 48rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  text-align: center;
}

footer p {
  font-size: 0.75rem;
  opacity: 0.6;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--background); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Selection */
::selection {
  background: rgba(212, 196, 168, 0.4);
  color: var(--ink);
}
