*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #f8fafc;
  color: #1e293b;
}

/* ── Site Header ───────────────────────────────────────── */
#site-header {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px clamp(12px, 2.5vw, 28px) 24px;
  text-align: center;
}

#site-title {
  margin: 0 0 8px;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #1e293b;
}

#site-description {
  margin: 0;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: #64748b;
}

/* ── Search Bar ────────────────────────────────────────────── */
#search-area {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 clamp(12px, 2.5vw, 28px) 20px;
  display: flex;
  gap: 8px;
}

#search-input {
  flex: 1;
  height: 42px;
  padding: 0 16px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 21px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

#search-area button {
  height: 42px;
  padding: 0 20px;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  background: #2563eb;
  border: none;
  border-radius: 21px;
  cursor: pointer;
  transition: background 0.15s ease;
}

#search-area button:hover {
  background: #1d4ed8;
}

#search-empty {
  text-align: center;
  padding: 48px 0;
  font-size: 1rem;
  color: #64748b;
}

/* ── Gallery Surface ───────────────────────────────────── */
#gallery-area {
  max-width: 927px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 20px clamp(12px, 2.5vw, 28px) 48px;
}

#viewport {
  column-count: 1;
  column-gap: 12px;
}

/* ── Note card ─────────────────────────────────────────── */
.note {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  break-inside: avoid;
  text-decoration: none;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(226,232,240,0.8);
  box-shadow:
    0 1px 3px rgba(0,0,0,0.04),
    0 4px 12px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.note:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 12px rgba(0,0,0,0.08),
    0 12px 32px rgba(0,0,0,0.10);
}

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

.note-header {
  padding: 10px 11px 6px;
}

.note-title {
  margin: 0;
  font-weight: 600;
  font-size: 12px;
  color: #0f172a;
  line-height: 1.25;
}

.note-body {
  padding: 0 11px 8px;
  font-size: 11px;
  line-height: 1.4;
  color: #475569;
}

.note-footer {
  padding: 6px 11px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid rgba(226,232,240,0.6);
}

.note-author {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.tag {
  font-size: 9px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.3;
  color: #1e293b;
}

@media (min-width: 640px) {
  #viewport { column-count: 2; }
}

@media (min-width: 1024px) {
  #viewport { column-count: 4; column-gap: 14px; }
}
