/* Flavour — hovimestarin polku. Kolme neutraalia + yksi aksentti, Futura PT. */

:root {
  --musta: #120505;
  --zinc: #18181b;
  --luu: #f5f2ef;
  --puna: #e21e26;
  --rail: clamp(1.1rem, 4vw, 3.5rem);
}

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

body {
  margin: 0;
  background: var(--musta);
  color: var(--luu);
  font-family: "config-mono-vf", ui-monospace, "SFMono-Regular", monospace;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2 {
  margin: 0;
  font-family: "brillante-vf", "Futura", system-ui, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.035em;
  line-height: 1.08;
}
h1 { font-size: clamp(2.6rem, 7vw, 6.4rem); }
h2 { font-size: clamp(2.1rem, 5vw, 4.6rem); }
h1 span, h2 span { color: var(--puna); }

p { margin: 0; }

.skip { position: absolute; left: -100vw; }
.skip:focus { left: 1rem; top: 1rem; z-index: 30; background: var(--luu); color: var(--musta); padding: 0.6rem 1rem; }

.veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at center, rgba(18, 5, 5, 0.55) 0%, rgba(18, 5, 5, 0.82) 100%),
    linear-gradient(to top, rgba(18, 5, 5, 0.7) 0%, rgba(18, 5, 5, 0) 40%);
}

/* ---------- napit ---------- */

.pill {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  background: var(--luu);
  color: var(--musta);
  font: inherit;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1rem 2rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.pill:hover, .pill:focus-visible { background: var(--puna); color: #fff; }

.plain {
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(245, 242, 239, 0.88);
  padding: 0.3rem 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.35em;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(245, 242, 239, 0.5);
  transition: color 0.2s, text-decoration-color 0.2s;
}
.plain:hover, .plain:focus-visible { color: var(--puna); text-decoration-color: var(--puna); }

.puhe {
  max-width: min(42ch, 100%);
  margin-inline: auto;
  font-size: clamp(1.02rem, 1.35vw, 1.22rem);
  font-weight: 450;
  line-height: 1.55;
  color: rgba(245, 242, 239, 0.96);
}

.acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.2rem 2rem; }

/* ---------- logo ---------- */

.mark { position: fixed; top: var(--rail); left: var(--rail); z-index: 10; }
.mark img {
  width: clamp(84px, 8vw, 124px);
  height: auto;
  filter: drop-shadow(0 1px 10px rgba(18, 5, 5, 0.55));
}

/* ---------- Hugo ---------- */

.hugo {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  align-content: end;
  justify-items: center;
  padding: var(--rail);
}
.hugo .veil {
  background: linear-gradient(to top,
    rgba(18, 5, 5, 0.94) 0%, rgba(18, 5, 5, 0.6) 26%, rgba(18, 5, 5, 0.08) 52%, rgba(18, 5, 5, 0.25) 100%);
}
.hugo video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hugo-inner {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 1.6rem;
  justify-items: center;
  text-align: center;
  max-width: 60rem;
  transition: opacity 0.45s;
}
body.playing .hugo-inner { opacity: 0; pointer-events: none; }
.bar { position: absolute; z-index: 3; right: var(--rail); bottom: var(--rail); display: flex; gap: 1.6rem; }
.bar[hidden] { display: none; }

/* ---------- polku ---------- */

.path {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(1.5rem, 4vh, 3rem);
  padding: var(--rail);
}
.stage { position: absolute; inset: 0; z-index: 0; }
.stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.7s ease;
}
.stage img.on { opacity: 1; }
.path.tumma .veil { background: rgba(18, 5, 5, 0.88); }

.path-top { justify-content: flex-end !important; gap: 2rem !important; }
.path-top, .foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem 2rem;
  flex-wrap: wrap;
}
.path-top .back[hidden] { visibility: hidden; display: block; }
.tally {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 242, 239, 0.78);
}
.foot { font-size: 0.95rem; }

.path-top, .foot, .panel { text-shadow: 0 1px 16px rgba(18, 5, 5, 0.85); }
.lomake, .lomake * { text-shadow: none; }

.panel {
  position: relative;
  z-index: 2;
  align-self: center;
  justify-self: center;
  width: min(64rem, 100%);
  display: grid;
  gap: clamp(1rem, 2.4vh, 1.8rem);
  justify-items: center;
  text-align: center;
}

/* ---------- valintakortit ---------- */

.kortit { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(0.8rem, 1.8vw, 1.6rem); margin-top: 0.4rem; }

.kortti {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  width: clamp(112px, 13vw, 158px);
  display: grid;
  gap: 0.6rem;
  justify-items: center;
  text-align: center;
  transition: transform 0.2s;
}
.kortti .ikoni { width: 100%; height: auto; display: block; }
.kortti .numero {
  font-family: "brillante-vf", "Futura", system-ui, sans-serif;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--puna);
  color: #fff;
  font-weight: 700;
  font-size: clamp(1.2rem, 2.2vw, 1.9rem);
  letter-spacing: -0.02em;
  transition: filter 0.2s;
}
.kortti .nimi {
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
}
.kortti .apu { font-size: 0.82rem; font-weight: 450; color: rgba(245, 242, 239, 0.78); line-height: 1.3; margin-top: -0.35rem; }
.kortti:hover, .kortti:focus-visible { transform: translateY(-5px); outline: none; }
.kortti:hover .ikoni, .kortti:focus-visible .ikoni,
.kortti:hover .numero, .kortti:focus-visible .numero { filter: brightness(1.18); }
.kortit.luvut .kortti { width: clamp(104px, 11vw, 138px); }

/* ---------- suositus ---------- */

.fakta {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 242, 239, 0.82);
}
.peruste { max-width: min(44ch, 100%); margin-inline: auto; font-size: clamp(1rem, 1.35vw, 1.25rem); line-height: 1.55; }
/* kuvakavalkadi suositusruudussa */
.pisteet { display: flex; gap: 0.55rem; justify-content: center; }
.pisteet button {
  width: 9px; height: 9px; padding: 0; border: 0; border-radius: 999px;
  background: rgba(245, 242, 239, 0.38); cursor: pointer;
  transition: background 0.25s, transform 0.25s;
}
.pisteet button:hover, .pisteet button:focus-visible { background: rgba(245, 242, 239, 0.8); outline: none; }
.pisteet button.on { background: var(--puna); transform: scale(1.25); }

/* Liike on koko kaistassa, ei yksittäisessä kuvassa: zoom ei nollaudu kuvan vaihtuessa,
   vaan hengittää edestakaisin ja kuvat ristihäivyttyvät sen sisällä. */
@keyframes liuku { from { transform: scale(1.02); } to { transform: scale(1.1); } }
.path.kavalkadi .stage { animation: liuku 18s ease-in-out infinite alternate; will-change: transform; }
.path.kavalkadi .stage img { transition: opacity 1.2s ease; }

.vaiht { font-size: 0.95rem; font-weight: 450; color: rgba(245, 242, 239, 0.8); }

/* ---------- lomake ---------- */

.lomake {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.6rem;
  width: min(46rem, 100%);
}
.lomake { text-align: left; margin-inline: auto; }
.lomake label { display: grid; gap: 0.2rem; }
.lomake .leveä, .lomake .acts, .lomake .virhe { grid-column: 1 / -1; }
.lomake .acts { justify-content: flex-start; }
.lomake span { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(245, 242, 239, 0.8); }
.lomake input, .lomake textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(245, 242, 239, 0.3);
  border-radius: 0;
  background: none;
  font: inherit;
  font-size: 1.05rem;
  color: var(--luu);
  padding: 0.45rem 0;
}
.lomake textarea { resize: vertical; }
.lomake input:focus, .lomake textarea:focus { outline: none; border-bottom-color: var(--puna); }
.lomake input::placeholder, .lomake textarea::placeholder { color: rgba(245, 242, 239, 0.45); }
.virhe { color: var(--puna); font-size: 0.95rem; }
.lupaus { font-size: 0.92rem; color: rgba(245, 242, 239, 0.75); }

/* ---------- kapea ---------- */

@media (max-width: 820px) {
  /* pitkät versaaliotsikot eivät saa levittää ruutua kapealla */
  h1 { font-size: clamp(1.6rem, 7.6vw, 3rem); }
  h2 { font-size: clamp(1.5rem, 7vw, 2.6rem); }
  .hugo-inner, .panel { max-width: 100%; min-width: 0; }
  .acts { gap: 0.9rem 1.2rem; }
  .mark { position: absolute; }
  .lomake { grid-template-columns: 1fr; }
  .kortti { width: clamp(96px, 27vw, 130px); }
  .veil { background: linear-gradient(to top, rgba(18, 5, 5, 0.92) 0%, rgba(18, 5, 5, 0.45) 60%, rgba(18, 5, 5, 0.55) 100%); }
}

@media (pointer: coarse) {
  .lomake input, .lomake textarea { font-size: 16px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .stage img, .kortti, .pill, .hugo-inner { transition: none; }
  .path.kavalkadi .stage { animation: none; }
}
