/* ── BASE ── vars, reset, typography, layout, animations */

:root {
  --ink:          #f0ecff;
  --paper:        rgba(255, 255, 255, 0.07);
  --paper-dark:   rgba(255, 255, 255, 0.03);
  --accent:       #7c3aed;
  --accent-2:     #0891b2;
  --accent-muted: rgba(124, 58, 237, 0.25);
  --rule:         rgba(160, 140, 255, 0.18);
  --mono:         'DM Mono', monospace;
  --serif:        'Playfair Display', Georgia, serif;
  --sans:         'DM Sans', sans-serif;
  --grad:         linear-gradient(135deg, #7c3aed, #4f46e5, #0891b2);
  --grad-a:       #7c3aed;
  --grad-b:       #4f46e5;
  --grad-c:       #0891b2;
  --radius:       10px;
  --radius-sm:    6px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(ellipse 80% 55% at 0% 0%, rgba(124, 58, 237, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 70% 55% at 100% 100%, rgba(8, 145, 178, 0.16) 0%, transparent 60%),
    radial-gradient(ellipse 60% 45% at 65% 50%, rgba(79, 70, 229, 0.10) 0%, transparent 60%),
    #0e0c18;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  overflow-x: hidden;
}

/* ── Layout ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 4vw;
}

/* ── Section header (shared across all sections) ── */
.section-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2.5rem 4vw 1.5rem;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.section-rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.section-num {
  font-family: var(--serif);
  font-size: 0.75rem;
  color: var(--rule);
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.anim-1 { opacity: 0; animation: fadeUp 0.8s 0.0s ease forwards; }
.anim-2 { opacity: 0; animation: fadeUp 0.8s 0.2s ease forwards; }
.anim-3 { opacity: 0; animation: fadeUp 0.8s 0.4s ease forwards; }
.anim-4 { opacity: 0; animation: fadeUp 0.8s 0.5s ease forwards; }
.anim-5 { opacity: 0; animation: fadeUp 0.8s 0.6s ease forwards; }

/* ── Footer ── */
footer {
  border-top: 3px solid transparent;
  border-image: var(--grad) 1;
  padding: 1rem 4vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer span {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

/* ── Refresh icon ── */
.refresh-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.4);
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  position: relative;
  transition: color 0.2s;
  flex-shrink: 0;
}

.refresh-btn:hover,
.refresh-btn:focus-visible { color: var(--accent); outline: none; }

@keyframes spin { to { transform: rotate(360deg); } }

.refresh-btn.spinning svg { animation: spin 0.6s linear; }

.refresh-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(20, 16, 36, 0.95);
  color: #f0ecff;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: none;
  padding: 0.3rem 0.6rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.refresh-btn:hover::after,
.refresh-btn:focus-visible::after { opacity: 1; }

/* ── Refresh notification ── */
.refresh-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 4vw;
  background: var(--grad);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: fadeUp 0.4s ease forwards;
}

.refresh-notice-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.65;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.refresh-notice-dismiss:hover { opacity: 1; }

/* ── Responsive ── */
@media (max-width: 768px) {
  footer {
    flex-direction: column;
    gap: 0.4rem;
    text-align: center;
  }
}
