/* Pohronské osvetové stredisko — úvodný rozcestník, verzia 2
   Popisy sekcií sú zoznam kariet, nie texty dookola kvetu. */

:root {
  --pos-blue: #134a93;
  --pos-teal: #47aeb6;
  --pos-green: #009f83;
  --pos-yellow: #ffcc00;
  --pos-orange: #f79478;
  --pos-red: #b21a4c;
  --petal-idle: #8e8e93;

  --ink: #0b1220;
  --muted: #44506a;
  --paper: #ffffff;
  --line: rgba(19, 74, 147, 0.14);
  --chrome: rgba(255, 255, 255, 0.94);

  --font: Optima, "Optima LT Std", "Optima Nova", Philosopher, "Segoe UI", "Gill Sans", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 5.5rem;
  --footer-h: 7.5rem;

  --glow-color: var(--pos-blue);
  --glow-x: 50%;
  --glow-y: 48%;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  background: var(--paper);
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
}

body.is-intro2 {
  display: flex;
  flex-direction: column;
}

html:has(body.is-dark) {
  background: #000000;
  color-scheme: dark;
}

body.is-dark {
  --ink: #f5f5f3;
  --muted: #c4c4be;
  --paper: #000000;
  --line: rgba(255, 255, 255, 0.16);
  --chrome: rgba(0, 0, 0, 0.92);
  --petal-idle: #8e8e93;
  color-scheme: dark;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 40;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- ambient glow ---------- */

.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(
      16rem circle at var(--glow-x) var(--glow-y),
      var(--glow-color),
      color-mix(in srgb, var(--glow-color) 62%, var(--paper)) 34%,
      transparent 72%
    ),
    radial-gradient(
      42rem circle at var(--glow-x) var(--glow-y),
      color-mix(in srgb, var(--glow-color) 48%, transparent),
      transparent 70%
    );
  opacity: 0;
  transition: opacity 0.45s ease, background 0.5s ease;
}

body.is-ready.has-hover .glow {
  opacity: 1;
}

/* ---------- chrome (header / footer) ---------- */

.chrome {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
}

.chrome--top {
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
  padding: 0.75rem clamp(1rem, 3vw, 2.5rem);
  transform: translateY(-28px);
  background: linear-gradient(180deg, var(--chrome) 0%, color-mix(in srgb, var(--paper) 72%, transparent) 70%, transparent 100%);
}

.chrome--bottom {
  bottom: 0;
  padding: 1.25rem clamp(1rem, 3vw, 2.5rem) 1rem;
  transform: translateY(28px);
  background: linear-gradient(0deg, var(--chrome) 0%, color-mix(in srgb, var(--paper) 78%, transparent) 68%, transparent 100%);
}

body.is-ready .chrome {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

body.is-ready .chrome--bottom {
  transition-delay: 0.12s;
}

body.is-intro2 .chrome,
body.is-intro2 .chrome--top,
body.is-intro2 .chrome--bottom {
  position: relative;
  top: auto;
  bottom: auto;
}

body.is-intro2 .stage {
  flex: 1 0 auto;
  min-height: 0;
  padding: 1.35rem clamp(1rem, 3vw, 2.5rem) 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 2.6rem;
  height: 2.6rem;
  flex: 0 0 auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  color: var(--pos-blue);
}

.brand-text__lead {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.brand-text__em {
  font-size: 1.05rem;
  font-weight: 700;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.35rem 0.7rem;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  border-radius: 999px;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.nav-link::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 1px;
  background: var(--c, var(--pos-blue));
  transform: rotate(45deg);
  flex: 0 0 auto;
}

.nav-link[data-id="tanec"] { --c: var(--pos-red); }
.nav-link[data-id="vzdelavanie"] { --c: var(--pos-orange); }
.nav-link[data-id="remeslo"] { --c: var(--pos-green); }
.nav-link[data-id="film"] { --c: var(--pos-teal); }
.nav-link[data-id="divadlo"] { --c: var(--pos-yellow); }

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-hot {
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: var(--ink);
}

.nav-link:focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 2px;
}

/* ---------- stage / flower ---------- */

.stage {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + 0.4rem) 1rem calc(var(--footer-h) + 0.6rem);
}

.orb {
  position: relative;
  width: min(1080px, 94vw);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 3.25rem);
  flex: 0 1 auto;
}

.flower-wrap {
  position: relative;
  left: auto;
  top: auto;
  width: min(420px, 38vw, calc(100dvh - var(--header-h) - var(--footer-h) - 3rem));
  height: min(420px, 38vw, calc(100dvh - var(--header-h) - var(--footer-h) - 3rem));
  flex: 0 0 auto;
}

.flower {
  width: 100%;
  height: 100%;
  max-width: none;
  overflow: visible;
}

.petal-hit {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: scale(0);
  opacity: 0;
  cursor: pointer;
  outline: none;
}

.petal-hit[data-color="blue"] { fill: var(--pos-blue); cursor: default; }
.petal-hit[data-color="green"] { fill: var(--pos-green); }
.petal-hit[data-color="orange"] { fill: var(--pos-orange); }
.petal-hit[data-color="red"] { fill: var(--pos-red); }
.petal-hit[data-color="yellow"] { fill: var(--pos-yellow); }
.petal-hit[data-color="teal"] { fill: var(--pos-teal); }

.petal-hit.is-in {
  animation: bloom 0.95s var(--ease-out) forwards;
}

.petal-hit.is-settled {
  animation: none;
  opacity: 1;
  transform: scale(1);
  transition: transform 0.45s var(--ease-out), opacity 0.35s ease, filter 0.35s ease, fill 0.35s ease;
}

.petal-hit.is-settled.is-hot,
body.is-ready .petal-hit.is-settled:hover,
body.is-ready .petal-hit.is-settled:focus-visible {
  transform: scale(1.085);
  filter: drop-shadow(0 10px 18px color-mix(in srgb, var(--glow-color) 42%, transparent));
}

body.is-ready.has-hover .petal-hit.is-settled:not(.is-hot) {
  fill: var(--petal-idle);
  opacity: 1;
}

body.is-ready.has-hover .dots .dot {
  fill: var(--petal-idle);
  transition: fill 0.35s ease;
}

.petal-hit:focus-visible path {
  stroke: var(--ink);
  stroke-width: 4;
  stroke-opacity: 0.35;
}

.dots .dot {
  fill: var(--pos-blue);
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  transform: scale(0);
}

.dots.is-in .dot {
  animation: pop 0.55s var(--ease-out) forwards;
}

.dots.is-in g:nth-child(1) .dot { animation-delay: 0.00s; }
.dots.is-in g:nth-child(2) .dot { animation-delay: 0.05s; }
.dots.is-in g:nth-child(3) .dot { animation-delay: 0.10s; }
.dots.is-in g:nth-child(4) .dot { animation-delay: 0.15s; }
.dots.is-in g:nth-child(5) .dot { animation-delay: 0.20s; }
.dots.is-in g:nth-child(6) .dot { animation-delay: 0.25s; }

.dots.is-settled .dot {
  animation: none;
  opacity: 1;
  transform: scale(1);
}

@keyframes bloom {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  68% {
    opacity: 1;
    transform: scale(1.07);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pop {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---------- labels ---------- */

.labels {
  position: static;
  inset: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  width: min(34rem, 46vw);
  flex: 1 1 22rem;
}

.label {
  position: static;
  left: auto;
  top: auto;
  width: auto;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  text-align: left;
  z-index: 2;
}

.label.is-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  pointer-events: auto;
}

.label--pos { --c: var(--pos-blue); }
.label--remeslo { --c: var(--pos-green); }
.label--vzdelavanie { --c: var(--pos-orange); }
.label--tanec { --c: var(--pos-red); }
.label--divadlo { --c: var(--pos-yellow); }
.label--film { --c: var(--pos-teal); }

.label-card {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
  color: var(--ink);
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--c);
  border-radius: 10px;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

a.label-card {
  border-radius: 8px;
}

a.label-card:focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 4px;
}

.label-title {
  font-size: clamp(0.92rem, 1.35vw, 1.1rem);
  font-weight: 700;
  line-height: 1.25;
}

.label-title::before {
  content: "";
  display: inline-block;
  width: 0.48rem;
  height: 0.48rem;
  margin-right: 0.4rem;
  margin-bottom: 0.08rem;
  background: var(--c);
  transform: rotate(45deg);
  vertical-align: middle;
}

body.is-ready .label.is-hot .label-card,
body.is-ready a.label-card:hover {
  background: color-mix(in srgb, var(--c) 18%, var(--paper));
  border-color: color-mix(in srgb, var(--c) 42%, var(--line));
}

body.is-ready .label.is-hot .label-title {
  text-underline-offset: 0.18em;
}

body.is-ready a.label-card:hover .label-title,
body.is-ready .label.is-hot .label-title {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--c) 70%, transparent);
}

/* ---------- footer ---------- */

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 1rem 2rem;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}

.footer-id,
.footer-contact,
.footer-social {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

.footer-contact a,
.footer-social a {
  color: var(--ink);
  text-decoration: none;
}

.footer-contact a:hover,
.footer-social a:hover,
.footer-contact a:focus-visible,
.footer-social a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.footer-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  max-width: 1100px;
  margin: 0.9rem auto 0;
}

.footer-copy {
  max-width: 1100px;
  margin: 0.55rem auto 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- intro controls ---------- */

.intro-controls {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

.version-chip {
  margin: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--chrome);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ctrl-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--chrome);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  min-height: 36px;
  text-decoration: none;
}

.ctrl-btn:hover,
.ctrl-btn:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--pos-blue) 35%, var(--line));
}

.ctrl-btn:focus-visible {
  outline: 2px solid var(--pos-blue);
  outline-offset: 2px;
}

body.is-ready #skip-intro {
  display: none;
}

.noscript {
  position: relative;
  z-index: 20;
  margin: 1rem;
  text-align: center;
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .petal-hit,
  .dots .dot,
  .label,
  .chrome,
  .glow {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .orb {
    flex-direction: column;
    width: min(520px, 94vw);
    gap: 1.1rem;
  }

  .flower-wrap {
    width: min(300px, 72vw);
    height: min(300px, 72vw);
  }

  .labels {
    width: 100%;
    flex-basis: auto;
  }
}

@media (max-width: 860px) {
  .chrome--top {
    position: sticky;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding-top: 0.65rem;
    padding-bottom: 0.4rem;
    background: var(--chrome);
  }

  .chrome--bottom {
    position: relative;
    transform: none;
    background: color-mix(in srgb, var(--ink) 5%, var(--paper));
    border-top: 1px solid var(--line);
  }

  body.is-intro .chrome--bottom {
    opacity: 0;
  }

  .nav-list {
    justify-content: flex-start;
  }

  .nav-link {
    font-size: 0.82rem;
    min-height: 40px;
    padding: 0.25rem 0.55rem;
  }

  .stage {
    padding: 1.25rem 0.75rem 2rem;
    min-height: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 0.65rem;
  }

  .intro-controls {
    right: 0.6rem;
    bottom: auto;
    top: 0.6rem;
    align-items: flex-end;
  }
}

@media (max-width: 480px) {
  .brand-text {
    display: none;
  }

  .nav-link {
    font-size: 0.78rem;
  }
}
