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

/* ===========================
   CSS Variables
   =========================== */
:root {
  --bg-primary:    #1e1e1e;
  --bg-secondary:  #2a2a2a;
  --bg-card:       #313131;
  --border:        #3d3d3d;
  --text-primary:  #f0f0f0;
  --text-secondary:#a0a0a0;
  --accent:        #af9bdd;
  --accent-hover:  #b8a5e2;
  --font-heading:  'Georgia', serif;
  --font-body:     'Courier New', monospace;
  --radius:        6px;
  --transition:    0.2s ease;
}

/* ===========================
   Base
   =========================== */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===========================
   Typography
   =========================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: normal;
  line-height: 1.25;
  color: var(--text-primary);
}

h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.75rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ===========================
   Layout
   =========================== */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===========================
   Header / Nav
   =========================== */
header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ===========================
   Main / Sections
   =========================== */
main {
  padding: 4rem 0;
}

section {
  margin-bottom: 4rem;
}

/* ===========================
   Hero
   =========================== */
.hero {
  text-align: center;
  padding: 4rem 0;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  max-width: 540px;
  margin: 0 auto 2rem;
}

/* ===========================
   Card
   =========================== */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

/* ===========================
   Button
   =========================== */
.btn {
  display: inline-block;
  background-color: var(--accent);
  color: #fff;
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition);
}

.btn:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background-color: var(--accent);
  color: #fff;
}

/* ===========================
   Footer
   =========================== */
footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  margin-top: auto;
}

footer p {
  font-size: 0.85rem;
  margin: 0;
}

/* ===========================
   Utilities
   =========================== */
.text-accent   { color: var(--accent); }
.text-muted    { color: var(--text-secondary); }
.text-center   { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }

/* ===========================
   Tag
   =========================== */
.tag {
  display: inline-block;
  padding: 0.45em 1.1em;
  border-radius: 999px;
  font-size: 1rem;
  font-family: var(--font-body);
  color: #fff;
  white-space: nowrap;
  border: 2px solid rgba(0, 0, 0, 0.75);
  /* colour is set inline via JS */
}

/* ===========================
   Tag Spinner
   =========================== */
.tag-spinner-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 1.5rem 0 0;
}

.tag-spinner-label {
  white-space: nowrap;
}

/* Clipping window — crops anything above/below */
.tag-spinner-window {
  position: relative;
  height: 2.4em;
  overflow: hidden;
  min-width: 200px;
}

/* Each item fills the window and stacks via absolute */
.tag-spinner-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tag-spinner-item.enter {
  transform: translateY(100%);
  opacity: 0;
}

.tag-spinner-item.visible {
  animation: spinnerIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.tag-spinner-item.exit {
  animation: spinnerOut 0.38s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes spinnerIn {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes spinnerOut {
  from { transform: translateY(0);     opacity: 1; }
  to   { transform: translateY(-100%); opacity: 0; }
}
