:root {
  --bg: #f6f5f2;
  --bg-glass: rgba(246, 245, 242, 0.72);
  --ink: #0c0d10;
  --ink-80: rgba(12, 13, 16, 0.80);
  --muted: rgba(12, 13, 16, 0.44);
  --line: rgba(12, 13, 16, 0.16);
}

body.theme-inverse {
  --bg: #08090c;
  --bg-glass: rgba(8, 9, 12, 0.74);
  --ink: #f3f0ea;
  --ink-80: rgba(243, 240, 234, 0.80);
  --muted: rgba(243, 240, 234, 0.46);
  --line: rgba(243, 240, 234, 0.18);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  transition: background 0.35s ease, color 0.35s ease;
}

#cymaticsCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
}

#cymaticsCanvas.is-interactive {
  cursor: pointer;
}

/* Top-left hit target over the canvas-morphed 15px liquid circle logo + puzzle label */
.logo-home-btn {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  background: transparent;
  border: none;
  color: var(--ink-80);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.logo-home-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.logo-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: transparent;
  display: inline-block;
  flex-shrink: 0;
}

.logo-wordmark {
  position: relative;
  font-size: 0.80rem;
  font-weight: 400;
  letter-spacing: 0.11em;
  color: var(--ink-80);
  white-space: nowrap;
  height: 1.3em;
  display: inline-flex;
  align-items: center;
  overflow: visible;
}

.puzzle-char {
  display: inline-block;
  opacity: 0;
  transform: translate(0px, 0px);
  will-change: transform, opacity;
}

.puzzle-char.visible {
  opacity: 1;
}

/* Circular Autoplay Photo Gallery */
.gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.45s;
}

.gallery-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gallery-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  transform: scale(0.92);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-overlay.open .gallery-stage {
  transform: scale(1);
}

.gallery-circle {
  position: relative;
  width: min(440px, 74vmin);
  height: min(440px, 74vmin);
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.10);
  cursor: pointer;
}

.gallery-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 5.2s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.gallery-img.active {
  opacity: 1;
  transform: scale(1.0);
}

.gallery-hit-left,
.gallery-hit-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 3;
  cursor: pointer;
}

.gallery-hit-left { left: 0; }
.gallery-hit-right { right: 0; }

/* Whisper-thin circular SVG autoplay progress ring */
.gallery-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
  z-index: 4;
}

.gallery-ring-track {
  fill: none;
  stroke: var(--line);
  stroke-width: 0.45;
}

.gallery-ring-prog {
  fill: none;
  stroke: var(--ink-80);
  stroke-width: 0.65;
  stroke-linecap: round;
  stroke-dasharray: 309.13;
  stroke-dashoffset: 309.13;
}

.gallery-nav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.gallery-nav:hover {
  color: var(--ink);
  border-color: var(--line);
}

.gallery-meta {
  position: absolute;
  left: 50%;
  bottom: -42px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.gallery-counter {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.70rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.gallery-close {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
}

.gallery-close:hover {
  color: var(--ink);
}

/* Minimal Copyright */
.site-copyright {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 15;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  pointer-events: none;
}

/* Top-right minimal HUN / ENG Language Switcher */
.lang-switch {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.lang-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 40px;
  height: calc(100% - 6px);
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), background 0.35s ease;
  pointer-events: none;
}

.lang-switch.is-en .lang-indicator {
  transform: translateX(40px);
}

.lang-btn {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s ease;
}

.lang-btn:hover {
  color: var(--ink);
}

.lang-btn.active {
  color: var(--bg);
}

/* 4th Particle Circle -> Capsule Oracle UI */
.oracle-layer {
  position: fixed;
  inset: 0;
  z-index: 32;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.oracle-layer.open {
  pointer-events: auto;
}

.oracle-anchor {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(350px, calc(100vw - 36px));
  pointer-events: none;
}

.oracle-capsule {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 36px;
  height: 36px;
  padding: 0 8px 0 12px;
  border-radius: 999px;
  background: var(--bg-glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.07);
  opacity: 0;
  transform: scale(0.35);
  overflow: hidden;
  transition:
    width 0.44s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.26s ease,
    transform 0.40s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease,
    background 0.35s ease;
}

.oracle-layer.open .oracle-capsule {
  width: 100%;
  opacity: 1;
  transform: scale(1);
}

.oracle-capsule:focus-within {
  border-color: var(--ink-80);
}

.oracle-core-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  flex-shrink: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.oracle-capsule.loading .oracle-core-dot {
  animation: oraclePulse 1.1s ease-in-out infinite;
}

@keyframes oraclePulse {
  0%, 100% { transform: scale(0.75); opacity: 0.35; }
  50% { transform: scale(1.35); opacity: 1; }
}

.oracle-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  user-select: text;
}

.oracle-input::placeholder {
  color: var(--muted);
}

.oracle-submit,
.oracle-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.oracle-submit:hover {
  color: var(--bg);
  background: var(--ink);
}

.oracle-close:hover {
  color: var(--ink);
}

.oracle-card {
  pointer-events: auto;
  width: 100%;
  margin-top: 9px;
  padding: 12px 15px 14px;
  border-radius: 16px;
  background: var(--bg-glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.07);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  visibility: hidden;
  transition:
    opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.32s;
}

.oracle-card.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.oracle-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.oracle-topic {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}

.oracle-source {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  opacity: 0.72;
}

.oracle-answer {
  font-size: 0.80rem;
  line-height: 1.54;
  color: var(--ink-80);
  user-select: text;
  white-space: pre-wrap;
}

@media (max-width: 560px) {
  .gallery-nav { display: none; }
  .lang-switch { top: 18px; right: 16px; }
}
