/* =========================================================
   Design tokens
   ========================================================= */
:root {
  --bg: #10142B;           /* natthimmel — deep night navy */
  --bg-card: #1B2147;      /* djupviolett — card surface */
  --bg-card-hover: #232a5c;
  --accent: #C9A15C;       /* guldstoft — the one accent */
  --text: #EDE7D9;         /* pergament — warm parchment white */
  --text-muted: #9FB8C9;   /* månsken — pale moonlight blue-grey */
  --border: rgba(201, 161, 92, 0.25);

  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --wheel-radius: 220px;
  --wheel-item-size: 96px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  padding-bottom: 4rem;
}

a { color: inherit; }

/* =========================================================
   Ambient night sky
   ========================================================= */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(237,231,217,0.5) 50%, transparent),
    radial-gradient(1px 1px at 70% 15%, rgba(237,231,217,0.35) 50%, transparent),
    radial-gradient(1.5px 1.5px at 85% 60%, rgba(201,161,92,0.4) 50%, transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(237,231,217,0.3) 50%, transparent),
    radial-gradient(1px 1px at 55% 45%, rgba(237,231,217,0.4) 50%, transparent),
    radial-gradient(1.5px 1.5px at 10% 65%, rgba(201,161,92,0.3) 50%, transparent),
    radial-gradient(1px 1px at 90% 85%, rgba(237,231,217,0.35) 50%, transparent);
  background-repeat: no-repeat;
  animation: twinkle 6s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes twinkle {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .sky { animation: none; opacity: 0.85; }
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3.5rem 1.5rem 1rem;
}

.back-home {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  transition: background 0.15s ease, transform 0.15s ease;
}

.back-home:hover,
.back-home:focus-visible {
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.back-home:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .back-home { top: 10px; left: 10px; padding: 0.45rem 0.8rem; font-size: 0.75rem; }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.site-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin: 0;
  color: var(--text);
  letter-spacing: 0.01em;
}

.site-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin: 0.75rem 0 0;
}

/* =========================================================
   The wheel (signature element)
   ========================================================= */
.wheel-section {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  margin: 3rem auto 2rem;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-orbit {
  position: absolute;
  width: calc(var(--wheel-radius) * 2 + var(--wheel-item-size));
  height: calc(var(--wheel-radius) * 2 + var(--wheel-item-size));
  max-width: 92%;
  max-height: 92%;
  border: 1px solid var(--border);
  border-radius: 50%;
  animation: rotate-orbit 160s linear infinite;
}

@keyframes rotate-orbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .wheel-orbit { animation: none; }
}

.wheel {
  position: relative;
  width: calc(var(--wheel-radius) * 2 + var(--wheel-item-size));
  height: calc(var(--wheel-radius) * 2 + var(--wheel-item-size));
  max-width: 92%;
  max-height: 92%;
}

.wheel-item {
  --angle: calc(var(--i) * 30deg);
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--wheel-item-size);
  height: var(--wheel-item-size);
  margin: calc(var(--wheel-item-size) / -2);
  transform: rotate(var(--angle)) translate(var(--wheel-radius)) rotate(calc(var(--angle) * -1));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.wheel-item-emoji { font-size: 2.2rem; line-height: 1; display: block; }
.wheel-item span {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.1;
}

.wheel-item:hover,
.wheel-item:focus-visible {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: rotate(var(--angle)) translate(var(--wheel-radius)) rotate(calc(var(--angle) * -1)) scale(1.08);
}

.wheel-item.active {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.wheel-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  pointer-events: none;
}

@media (max-width: 640px) {
  .wheel-logo { width: 90px; height: 90px; }
}

.wheel-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  :root {
    --wheel-radius: 140px;
    --wheel-item-size: 72px;
  }

  .wheel-section {
    max-width: 360px;
    margin: 2rem auto 1rem;
  }
}

/* =========================================================
   Detail panel
   ========================================================= */
.detail {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 2rem auto 0;
  padding: 0 1.5rem;
  min-height: 12rem;
}

.detail-empty,
.detail-loading,
.detail-error {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
  font-family: var(--font-body);
}

.detail-error p { color: var(--accent); }

.detail-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.25rem 2rem;
}

.detail-sign-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.detail-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.9rem;
  margin: 0 0 1rem;
  color: var(--text);
}

.detail-text {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 1.75rem;
}

.detail-meta {
  display: flex;
  gap: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.meta-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.meta-value { font-size: 0.95rem; }
.meta-value.mono { font-family: var(--font-mono); color: var(--accent); }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-top: 4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
