/* ── DailyMuse — Design System ─────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500&display=swap');

:root {
  --bg:       #F6F2EA;
  --ink:      #1C1B18;
  --muted:    #6B655C;
  --accent:   #1F3D7A;
  --border:   rgba(28, 27, 24, 0.10);
  --bg-hover: rgba(28, 27, 24, 0.04);

  --serif:    'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans:     'Inter', system-ui, -apple-system, sans-serif;

  --max-w:    520px;
  --px:       1.5rem;
}


/* ── reset & base ─────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100dvh;
}


/* ── layout ───────────────────────────────────────────────────────── */

.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem var(--px) 4rem;
}


/* ── label (small section headers) ────────────────────────────────── */

.label {
  display: block;
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}


/* ── today view ───────────────────────────────────────────────────── */

.entry-date {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 2.5rem;
}

.entry-section {
  margin-bottom: 2.25rem;
}

.entry-line {
  font-family: var(--serif);
  font-size: 1.65rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.entry-lens {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--ink);
}

.entry-prompt {
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* artifact card */
.entry-artifact {
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
}
.entry-artifact .artifact-value {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
}

/* quote shard (epigraph) */
.entry-quote {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.entry-quote blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 0.35rem;
}
.entry-quote cite {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}


/* ── entry actions (favorite, note, archive link) ─────────────────── */

.entry-actions {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.fav-btn {
  font-size: 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s;
  flex-shrink: 0;
}
.fav-btn:hover { color: var(--ink); }
.fav-btn.active { color: #c44; }

.archive-link {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  margin-left: auto;
  padding: 0.3rem 0;
  flex-shrink: 0;
}
.archive-link:hover { text-decoration: underline; }

/* personal note */
.note-toggle {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem 0;
  flex-shrink: 0;
}
.note-toggle:hover { color: var(--ink); }

.note-area {
  display: none;
  margin-top: 1rem;
}
.note-area.open {
  display: block;
}
.note-area textarea {
  width: 100%;
  min-height: 5rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.note-area textarea:focus {
  border-color: var(--accent);
}
.note-saved {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.35rem;
  opacity: 0;
  transition: opacity 0.3s;
}
.note-saved.visible { opacity: 1; }


/* ── login page ───────────────────────────────────────────────────── */

.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: var(--px);
}

.login-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin-bottom: 2.5rem;
  color: var(--ink);
}

.login-form {
  width: 100%;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-form input[type="password"] {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  outline: none;
  text-align: center;
  transition: border-color 0.2s;
}
.login-form input[type="password"]:focus {
  border-color: var(--accent);
}
.login-form input[type="password"]::placeholder {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.login-form button {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.7rem;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  transition: opacity 0.2s;
}
.login-form button:hover { opacity: 0.85; }

.login-error {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: #9e3b3b;
  text-align: center;
  min-height: 1.2em;
  opacity: 0;
  transition: opacity 0.3s;
}
.login-error.visible { opacity: 1; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.shake { animation: shake 0.4s ease; }


/* ── archive page ─────────────────────────────────────────────────── */

.archive-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.archive-month {
  font-family: var(--serif);
  font-size: 1.15rem;
}

.archive-nav {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  transition: color 0.2s;
}
.archive-nav:hover { color: var(--ink); }

.archive-back {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 2rem;
}
.archive-back:hover { text-decoration: underline; }

.archive-list {
  list-style: none;
}

.archive-item {
  display: block;
  text-decoration: none;
  color: var(--ink);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.archive-item:first-child { border-top: 1px solid var(--border); }
.archive-item:hover { background: var(--bg-hover); }

.archive-item-date {
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.archive-item-fav {
  color: #c44;
  font-size: 0.6rem;
}

.archive-item-line {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.4;
}

.archive-empty {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  padding: 2rem 0;
}


/* ── loading & fade-in ────────────────────────────────────────────── */

.loading {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  padding: 3rem 0;
}

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

.fade-in {
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
}
.fade-in:nth-child(2) { animation-delay: 0.08s; }
.fade-in:nth-child(3) { animation-delay: 0.16s; }
.fade-in:nth-child(4) { animation-delay: 0.24s; }
.fade-in:nth-child(5) { animation-delay: 0.32s; }
.fade-in:nth-child(6) { animation-delay: 0.40s; }
.fade-in:nth-child(7) { animation-delay: 0.48s; }


/* ── responsive ───────────────────────────────────────────────────── */

@media (max-width: 480px) {
  :root { --px: 1.25rem; }
  .entry-line { font-size: 1.4rem; }
  .page { padding-top: 2rem; }
}


/* ── utility ──────────────────────────────────────────────────────── */

.hidden { display: none; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
