/* ── Variables ────────────────────────────────────────────────── */
:root {
  --bg:           #08080F;
  --surface:      #0F0F1A;
  --surface2:     #141422;
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --text:         #E8E8F5;
  --muted:        rgba(232,232,245,0.45);
  --accent:       #E07B6A;
  --accent-light: #E89A8C;
  --accent-glow:  rgba(224,123,106,0.18);
  --accent-dim:   rgba(224,123,106,0.08);
  --green:        #5BBF8A;
  --radius:       18px;
  --radius-sm:    10px;
  --transition:   0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Back button ──────────────────────────────────────────────── */
.back {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(15,15,26,0.85);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  backdrop-filter: blur(12px);
  transition: color var(--transition), border-color var(--transition);
}
.back:hover { color: var(--text); border-color: var(--border-hover); }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 56vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 24px 60px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 10%, rgba(224,123,106,0.15) 0%, transparent 68%),
    radial-gradient(ellipse 45% 35% at 80% 65%, rgba(224,123,106,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 35% 30% at 10% 70%, rgba(224,160,120,0.05) 0%, transparent 55%);
  animation: aurora 14s ease-in-out infinite alternate;
  pointer-events: none;
}

/* Dot grid overlay */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(224,123,106,0.09) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 65% 65% at 50% 50%, black 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 65% 65% at 50% 50%, black 0%, transparent 72%);
  pointer-events: none;
}

@keyframes aurora {
  from { opacity: 0.75; transform: scale(1); }
  to   { opacity: 1;    transform: scale(1.05); }
}

/* Floating sparks */
.spark {
  position: absolute;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  animation: floatSpark var(--dur, 6s) var(--delay, 0s) ease-in-out infinite;
}
.spark:nth-child(1)  { width:4px; height:4px; left:15%; top:30%; --dur:7s;   --delay:0s; }
.spark:nth-child(2)  { width:3px; height:3px; left:80%; top:20%; --dur:9s;   --delay:1s; }
.spark:nth-child(3)  { width:5px; height:5px; left:65%; top:70%; --dur:6s;   --delay:2s; }
.spark:nth-child(4)  { width:3px; height:3px; left:30%; top:65%; --dur:8s;   --delay:0.5s; }
.spark:nth-child(5)  { width:4px; height:4px; left:50%; top:15%; --dur:7s;   --delay:3s; }
.spark:nth-child(6)  { width:3px; height:3px; left:88%; top:50%; --dur:10s;  --delay:1.5s; }
.spark:nth-child(7)  { width:6px; height:6px; left:10%; top:55%; --dur:8s;   --delay:4s; }
.spark:nth-child(8)  { width:3px; height:3px; left:72%; top:40%; --dur:6.5s; --delay:2.5s; }

@keyframes floatSpark {
  0%   { opacity: 0;    transform: translateY(0)    scale(0.8); }
  20%  { opacity: 0.55; }
  50%  { opacity: 0.3;  transform: translateY(-28px) scale(1.1); }
  80%  { opacity: 0.5;  }
  100% { opacity: 0;    transform: translateY(-52px) scale(0.7); }
}

/* Hero inner content above bg layers */
.badge,
.hero h1,
.hero-subtitle { position: relative; z-index: 2; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border: 1px solid rgba(224,123,106,0.3);
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 24px;
  background: rgba(224,123,106,0.06);
  animation: fade-up 0.8s cubic-bezier(.16,1,.3,1) 0.3s both;
}
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.75); }
}

.hero h1 {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  animation: fade-up 0.9s cubic-bezier(.16,1,.3,1) 0.45s both;
}
.hero h1 .line1 { color: var(--text); }
.hero h1 .line2 { color: var(--accent); font-style: italic; }

.hero-subtitle {
  max-width: 520px;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  line-height: 1.7;
  animation: fade-up 0.9s cubic-bezier(.16,1,.3,1) 0.6s both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Main layout ──────────────────────────────────────────────── */
main { padding: 0 24px 80px; }

.container {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: border-color var(--transition);
  animation: fade-up 0.65s cubic-bezier(.16,1,.3,1) both;
}
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.15s; }
.card:nth-child(3) { animation-delay: 0.25s; }

.card:hover { border-color: var(--border-hover); }

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.card-icon-wrap {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent-dim);
  border: 1px solid rgba(224,123,106,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.card-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-left: auto;
}

/* ── Today card ───────────────────────────────────────────────── */
.today-date-display {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  letter-spacing: 0.03em;
}

#today-names {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 48px;
  align-items: center;
}

.today-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 600;
  font-style: italic;
  color: var(--accent);
  text-shadow: 0 0 40px rgba(224,123,106,0.25);
  line-height: 1.1;
  animation: fadeInName 0.5s ease both;
}
@keyframes fadeInName {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.no-names {
  color: var(--muted);
  font-size: 1rem;
}

/* ── Search card ──────────────────────────────────────────────── */
.search-wrap {
  position: relative;
  margin-bottom: 20px;
}
.search-wrap svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  transition: color var(--transition);
}
.search-wrap:focus-within svg { color: var(--accent); }

#search-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  padding: 14px 16px 14px 46px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
#search-input::placeholder { color: var(--muted); }
#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#search-results { display: flex; flex-direction: column; gap: 10px; min-height: 48px; }

.search-hint, .search-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 4px 0;
}

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: fadeInName 0.25s ease both;
  flex-wrap: wrap;
}
.result-item:hover { border-color: var(--border-hover); }

.result-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  font-style: italic;
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.result-date {
  font-size: 0.88rem;
  color: var(--muted);
}

.countdown-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--accent-dim);
  border: 1px solid rgba(224,123,106,0.25);
  color: var(--accent-light);
  white-space: nowrap;
}
.countdown-badge.today {
  background: rgba(91,191,138,0.1);
  border-color: rgba(91,191,138,0.3);
  color: var(--green);
  animation: todayPulse 1.8s ease-in-out infinite;
}
@keyframes todayPulse {
  0%, 100% { box-shadow: none; }
  50%       { box-shadow: 0 0 12px rgba(91,191,138,0.3); }
}

/* ── Month browser ────────────────────────────────────────────── */
.tab-scroll {
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 24px;
}
.tab-scroll::-webkit-scrollbar { display: none; }

#month-tabs {
  display: flex;
  gap: 6px;
  width: max-content;
  padding-bottom: 2px;
}

.tab-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.tab-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
}
.tab-btn.active {
  background: var(--accent-dim);
  border-color: rgba(224,123,106,0.4);
  color: var(--accent-light);
}

#month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.month-day {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), background var(--transition);
}
.month-day:hover { border-color: var(--border-hover); }
.month-day.today {
  background: var(--accent-dim);
  border-color: rgba(224,123,106,0.35);
}

.day-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  min-width: 24px;
  flex-shrink: 0;
}
.month-day.today .day-num { color: var(--accent-light); }

.day-names {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}
.month-day:not(.today) .day-names { color: var(--muted); }
.month-day.today .day-names { color: var(--text); font-weight: 500; }

/* ── Footer ───────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
  font-size: 13px;
}
footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}
footer a:hover { color: var(--text); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .card { padding: 22px 18px; }
  .result-item { flex-direction: column; align-items: flex-start; }
  .result-meta { width: 100%; }
  #month-grid { grid-template-columns: 1fr 1fr; }
}
