:root {
  --bg: #f4f1ea;
  --ink: #2b2b2b;
  --muted: #6b6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.site-header {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}

.site-header h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.5px;
}

.subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.status {
  text-align: center;
  color: var(--muted);
  padding: 1rem;
  font-size: 0.95rem;
}

.status.error {
  color: #b00020;
}

.status.hidden {
  display: none;
}

/* List view: a grid of sticky notes */
.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.75rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

.note {
  position: relative;
  padding: 1.1rem 1.1rem 1.25rem;
  min-height: 200px;
  border-radius: 2px;
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.18);
  font-size: 0.92rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.note:hover {
  transform: rotate(0deg) scale(1.03);
  box-shadow: 3px 7px 16px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

/* Slight playful rotation, varied per note */
.note:nth-child(3n + 1) { transform: rotate(-2deg); }
.note:nth-child(3n + 2) { transform: rotate(1.5deg); }
.note:nth-child(3n + 3) { transform: rotate(-0.75deg); }

/* Rotating set of soft pastel paper colors */
.note:nth-child(6n + 1) { background: #fdf6b2; } /* butter yellow */
.note:nth-child(6n + 2) { background: #c8f0dd; } /* mint */
.note:nth-child(6n + 3) { background: #ffe0c2; } /* peach */
.note:nth-child(6n + 4) { background: #d6dcff; } /* periwinkle */
.note:nth-child(6n + 5) { background: #ffd1dc; } /* blush pink */
.note:nth-child(6n + 6) { background: #d8d2f0; } /* lavender */

.note .date {
  display: inline-block;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.4px;
  margin-bottom: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.25);
}

/* Each column from the sheet is shown as its own row */
.note .field {
  margin: 0.35rem 0;
}

.note .field .value {
  display: block;
  word-break: break-word;
}

.note .field .value .num {
  font-weight: 700;
  color: var(--num, #6b3fa0);
}

/* Number color coordinated with each note's pastel background — kept dark
 * for strong contrast on the light paper. */
.note:nth-child(6n + 1) { --num: #5a4200; } /* butter yellow */
.note:nth-child(6n + 2) { --num: #064a35; } /* mint */
.note:nth-child(6n + 3) { --num: #7a3700; } /* peach */
.note:nth-child(6n + 4) { --num: #232c8a; } /* periwinkle */
.note:nth-child(6n + 5) { --num: #8a1740; } /* blush pink */
.note:nth-child(6n + 6) { --num: #3d2178; } /* lavender */

.note {
  cursor: pointer;
}

.note:focus-visible {
  outline: 3px solid #2b2b2b;
  outline-offset: 3px;
}

/* ---------- Instagram post modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(20, 20, 20, 0.8);
}

.modal.hidden {
  display: none;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.6rem;
  line-height: 1;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
}

.stage {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav {
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  font-size: 1.8rem;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* The Instagram-square card */
.post-card {
  width: min(86vmin, 1080px);
  max-width: calc(100vw - 9rem);
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 9%;
  box-sizing: border-box;
}

.post-card .post-kicker {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.85rem;
  opacity: 0.6;
  margin-bottom: 1.5rem;
}

.post-card .post-date-big {
  font-size: clamp(1.8rem, 7vmin, 4rem);
  font-weight: 800;
  letter-spacing: 1px;
}

.post-card .post-label {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: clamp(0.8rem, 2.4vmin, 1.1rem);
  opacity: 0.55;
  margin-bottom: 1.2rem;
}

.post-card .post-value {
  font-size: clamp(1.6rem, 6vmin, 3.4rem);
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.post-card .post-value .num {
  color: var(--num, #6b3fa0);
}

.post-card .post-foot {
  position: absolute;
  z-index: 1;
  bottom: 8%;
  font-size: clamp(0.7rem, 2vmin, 1rem);
  letter-spacing: 1px;
  opacity: 0.5;
}

.post-card {
  position: relative;
}

/* Tones cycle through the pastel palette, matched to number colors */
.post-card.tone-1  { background: #fdf6b2; --num: #5a4200; }
.post-card.tone-2  { background: #c8f0dd; --num: #064a35; }
.post-card.tone-3  { background: #ffe0c2; --num: #7a3700; }
.post-card.tone-4  { background: #d6dcff; --num: #232c8a; }
.post-card.tone-5  { background: #ffd1dc; --num: #8a1740; }
.post-card.tone-6  { background: #d8d2f0; --num: #3d2178; }
.post-card.tone-7  { background: #ffd0c2; --num: #8a2f12; }
.post-card.tone-8  { background: #c2f0ef; --num: #045b59; }
.post-card.tone-9  { background: #e2f0b2; --num: #4f5e00; }
.post-card.tone-10 { background: #c2e0ff; --num: #0f4a86; }
.post-card.tone-11 { background: #ffc9de; --num: #8a1f4a; }
.post-card.tone-12 { background: #e3c2f0; --num: #5e1f7a; }

/* Decorative random shapes sit behind the text */
.post-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  z-index: 0;
}

.post-shapes .shape {
  position: absolute;
}

.post-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.dots {
  display: flex;
  gap: 0.5rem;
}

.dots button {
  width: 0.6rem;
  height: 0.6rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
}

.dots button.active {
  background: #fff;
}

.hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 480px) {
  .board {
    grid-template-columns: 1fr;
  }

  .post-card {
    max-width: calc(100vw - 7rem);
  }
}
