/* =====================================================
   Daily Gratitude — stylesheet
   The question is the gift. Everything else steps back.
   ===================================================== */

:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: rgba(17, 17, 17, 0.35);
  --muted-mid: rgba(17, 17, 17, 0.50);
  --accent: #0ea5e9;
  --border: rgba(17, 17, 17, 0.09);
  --card-bg: rgba(255, 255, 255, 0.82);
  --btn-text: rgba(17, 17, 17, 0.30);
  --error: #dc2626;
  --radius: 24px;
  --radius-sm: 14px;
}

body.dark {
  --bg: #0a0a0a;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.28);
  --muted-mid: rgba(255, 255, 255, 0.48);
  --accent: #0ea5e9;
  --border: rgba(255, 255, 255, 0.10);
  --card-bg: rgba(12, 12, 12, 0.70);
  --btn-text: rgba(255, 255, 255, 0.28);
  --error: #f87171;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.6s ease;
}

body.dark {
  background: linear-gradient(180deg, #060a0f 0%, #0a0a0a 100%);
}

/* ---------- Canvas ---------- */

#canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Layout ---------- */

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 580px;
  padding: 48px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ---------- Site label ---------- */

.site-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted) !important;
  margin-bottom: 32px;
  text-decoration: none !important;
  display: inline-block;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.site-label:visited { color: var(--muted) !important; }
.site-label:hover   { color: var(--accent) !important; }

/* ---------- THE GIFT: the prompt card ---------- */

/* Reveal animation — card fades up gently on load */
@keyframes revealCard {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.prompt-card {
  width: 100%;
  padding: 60px 56px 52px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.03),
    0 8px 24px rgba(0, 0, 0, 0.06),
    0 24px 64px rgba(0, 0, 0, 0.07);
  transition: background-color 0.6s ease, border-color 0.6s ease;
  animation: revealCard 0.7s cubic-bezier(0.22, 0.68, 0, 1) both;
  animation-delay: 0.1s;
}

/* Prompt text — the most important element on the page */
.prompt-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: clamp(1.65rem, 5.5vw, 2.3rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.5;
  color: var(--text);
  transition: opacity 0.4s ease;
}

.prompt-text.fading { opacity: 0; }

/* Date — postmark, not metadata */
.prompt-meta {
  margin-top: 28px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.6s ease;
}

/* ---------- Ghost actions — barely there ---------- */

.actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-top: 20px;
  animation: revealCard 0.7s cubic-bezier(0.22, 0.68, 0, 1) both;
  animation-delay: 0.35s;
}

.btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--btn-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.btn svg {
  display: block;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.btn:hover:not(:disabled) {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

body.dark .btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.btn:hover:not(:disabled) svg {
  transform: scale(1.12);
}

.btn:active:not(:disabled) { opacity: 0.55; transform: scale(0.94); }
.btn:disabled { opacity: 0.22; cursor: not-allowed; }
.btn.copied { color: var(--accent); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn-sep {
  color: var(--border);
  font-size: 1rem;
  user-select: none;
  pointer-events: none;
  line-height: 1;
}

/* ---------- Why link ---------- */

.research-link {
  margin-top: 24px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-block;
  animation: revealCard 0.7s cubic-bezier(0.22, 0.68, 0, 1) both;
  animation-delay: 0.5s;
}

.research-link:hover { color: var(--accent); }

/* ---------- Modals ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-backdrop[hidden] { display: none; }

.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 44px 40px 38px;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.08);
  animation: slideUp 0.22s cubic-bezier(0.22, 0.68, 0, 1);
}

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

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: color 0.2s ease;
  line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.modal-sub {
  font-size: 0.85rem;
  color: var(--muted-mid);
  line-height: 1.65;
  margin-bottom: 26px;
}

/* ---------- Share options ---------- */

.share-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.share-option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.share-option-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(14, 165, 233, 0.05);
}

.share-icon {
  font-size: 1rem;
  font-weight: 900;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

/* ---------- Subscribe form ---------- */

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.subscribe-form input {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  padding: 12px 16px;
  transition: border-color 0.2s ease;
}

.subscribe-form input::placeholder { color: var(--muted); }
.subscribe-form input:focus { outline: none; border-color: var(--accent); }

.btn-primary {
  appearance: none;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 13px 20px;
  cursor: pointer;
  margin-top: 6px;
  transition: opacity 0.2s ease;
  letter-spacing: 0.1px;
}

.btn-primary:hover:not(:disabled) { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.subscribe-status {
  margin-top: 10px;
  font-size: 0.83rem;
  min-height: 1.4em;
  color: var(--accent);
  text-align: center;
}

.subscribe-status.error { color: var(--error); }

/* ---------- Built with Sky ---------- */

.bws-badge {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-decoration: none !important;
  color: rgba(17, 17, 17, 0.16) !important;
  transition: color 0.25s ease;
  white-space: nowrap;
}

body.dark .bws-badge { color: rgba(255, 255, 255, 0.12) !important; }
.bws-badge .bws-sky { color: rgba(14, 165, 233, 0.20); transition: color 0.25s ease; }
.bws-badge:hover { color: #111111 !important; }
body.dark .bws-badge:hover { color: #ffffff !important; }
.bws-badge:hover .bws-sky { color: #0ea5e9; }

/* ---------- Corner toggles ---------- */

.toggle {
  position: fixed;
  bottom: 20px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--muted-mid);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.6s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.3s ease;
}

.toggle:hover { border-color: var(--accent); color: var(--accent); }
#mode-toggle { right: 20px; }
#ambience-toggle { left: 20px; }
.toggle.ambience-off { opacity: 0.3; }
.toggle.ambience-off:hover { opacity: 1; }

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  .container { padding: 28px 16px; }
  .prompt-card { padding: 40px 28px 34px; }
  .modal { padding: 36px 24px 30px; }
  .btn { padding: 10px 14px; font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
