/* Pan - pisen nespoutaneho lesa */
/* barvy: nocni obloha z fotky prechazi dolu do mechu, akcent = pryskyrice a drevo sochy */

:root {
  --noc: #1b1f3a;
  --soumrak: #232a36;
  --mech: #1e2a21;
  --pryskyrice: #d39a4a;
  --kura: #e9c98f;
  --kost: #e6dfcf;
  --lisejnik: #9aa77c;

  --measure: 46rem;
  --step-0: clamp(1.06rem, 0.98rem + 0.35vw, 1.2rem);
  --step-1: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem);
  --step-2: clamp(1.6rem, 1.35rem + 1vw, 2.1rem);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--kost);
  font-family: "Alegreya", Georgia, serif;
  font-size: var(--step-0);
  line-height: 1.62;
  background:
    linear-gradient(180deg, var(--noc) 0%, var(--soumrak) 45%, var(--mech) 100%) fixed;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

/* zrno jako kura / stary papir */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero__photo {
  position: absolute;
  inset: 0;
  margin: 0;
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 46% 40%;
  display: block;
  transform: scale(1.18);
  transform-origin: 46% 52%;
}

/* fotka se rozplyva do noci */
.hero__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(27, 31, 58, 0) 45%, rgba(27, 31, 58, 0.75) 72%, var(--noc) 97%),
    radial-gradient(120% 70% at 46% 42%, rgba(0, 0, 0, 0) 40%, rgba(15, 17, 34, 0.55) 100%);
}

.hero__title {
  position: relative;
  padding: 0 1.25rem 2.5rem;
  text-align: center;
}

h1 {
  margin: 0;
  font-family: "Alegreya SC", Georgia, serif;
  font-weight: 800;
  font-size: clamp(6rem, 30vw, 13rem);
  line-height: 0.8;
  letter-spacing: 0.06em;
  margin-right: -0.06em;
  /* vyrezane do dreva: zrnita vypln + vnitrni stin */
  color: var(--kura);
  background:
    repeating-linear-gradient(97deg, rgba(120, 70, 20, 0.0) 0 7px, rgba(120, 70, 20, 0.35) 7px 9px, rgba(120, 70, 20, 0.0) 9px 15px),
    linear-gradient(180deg, #f3d9a4 0%, var(--pryskyrice) 55%, #8e5a22 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(40, 22, 6, 0.9)) drop-shadow(0 0 28px rgba(211, 154, 74, 0.35));
  animation: rozzehnuti 2.4s ease-out both;
}

.hero__pre {
  display: block;
  margin: 0 0 0.35em;
  font-family: "Alegreya", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.4rem, 1.1rem + 1.6vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: var(--kura);
  -webkit-text-fill-color: var(--kura);
}

.hero__sub {
  margin: 0.9rem 0 0;
  font-style: italic;
  font-size: var(--step-1);
  color: var(--kura);
  letter-spacing: 0.02em;
  animation: rozzehnuti 2.4s 0.5s ease-out both;
}

/* tlacitko poslechu */
.listen {
  --p: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.6rem;
  padding: 0.75rem 1.4rem 0.85rem 1.1rem;
  border: 1px solid rgba(233, 201, 143, 0.55);
  border-radius: 999px;
  background: rgba(20, 22, 44, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--kura);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  overflow: hidden;
  animation: rozzehnuti 2.4s 0.9s ease-out both;
  transition: border-color 0.2s, background-color 0.2s;
}

.listen:hover {
  border-color: var(--pryskyrice);
  background: rgba(20, 22, 44, 0.75);
}

.listen:focus-visible {
  outline: 2px solid var(--kura);
  outline-offset: 3px;
}

.listen__icon {
  width: 1.5rem;
  height: 1.5rem;
  fill: var(--pryskyrice);
  flex: none;
}

.listen .i-pause { display: none; }
.listen.is-playing .i-play { display: none; }
.listen.is-playing .i-pause { display: inline; }

.listen__time {
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  color: var(--lisejnik);
}

/* prubeh prehravani - tenka linka u spodniho okraje */
.listen__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--pryskyrice);
  transform-origin: left center;
  transform: scaleX(var(--p));
}

/* jedina animace: jako kdyz se rozhori lucerna */
@keyframes rozzehnuti {
  0%   { opacity: 0; }
  35%  { opacity: 0.55; }
  45%  { opacity: 0.3; }
  100% { opacity: 1; }
}

/* ---------- text ---------- */

.text {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.text p {
  margin: 0 0 1em;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.intro {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--kura);
}

h2 {
  margin: 0 0 0.7em;
  font-family: "Alegreya SC", Georgia, serif;
  font-weight: 500;
  font-size: var(--step-2);
  line-height: 1.15;
  color: var(--pryskyrice);
  text-wrap: balance;
}

.text em {
  font-style: italic;
  color: var(--kura);
}

blockquote {
  margin: 1.2em 0;
  padding: 0;
  text-align: center;
  font-family: "Alegreya SC", Georgia, serif;
  font-weight: 500;
  font-size: var(--step-2);
  line-height: 1.2;
  color: var(--kura);
}

/* syrinx - sedm rakosovych pistal jako predel */
.reed {
  display: block;
  width: 5.2rem;
  height: 2.8rem;
  margin: 2.6rem auto 2.4rem;
  color: var(--lisejnik);
  opacity: 0.7;
}

/* ---------- zaver ---------- */

.closing {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(154, 167, 124, 0.3);
  text-align: center;
}

.closing p {
  font-style: italic;
  hyphens: manual;
}

.closing .closing__vow {
  margin-top: 1.4em;
  font-family: "Alegreya SC", Georgia, serif;
  font-style: normal;
  font-weight: 500;
  font-size: var(--step-2);
  line-height: 1.25;
  color: var(--pryskyrice);
  text-wrap: balance;
}

.closing .closing__greek {
  margin: 3rem 0 0;
  font-family: "Alegreya SC", Georgia, serif;
  font-style: normal;
  font-size: 0.95rem;
  letter-spacing: 0.6em;
  margin-right: -0.6em;
  color: var(--lisejnik);
  opacity: 0.6;
}

.closing .closing__author {
  margin: 1.6rem 0 0;
  font-style: normal;
  font-size: 0.95rem;
  color: var(--kost);
  opacity: 0.8;
}

.closing__author a {
  color: var(--kura);
  text-decoration: underline;
  text-decoration-color: rgba(233, 201, 143, 0.45);
  text-underline-offset: 0.2em;
}

.closing__author a:hover,
.closing__author a:focus-visible {
  color: var(--pryskyrice);
  text-decoration-color: currentColor;
}

/* ---------- desktop: socha stoji vlevo a hlida ctenare ---------- */

@media (min-width: 960px) {
  .layout {
    display: grid;
    grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
  }

  .hero {
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 0;
  }

  .hero__photo::after {
    background:
      linear-gradient(90deg, rgba(27, 31, 58, 0) 60%, rgba(27, 31, 58, 0.85) 100%),
      linear-gradient(180deg, rgba(27, 31, 58, 0) 55%, rgba(27, 31, 58, 0.85) 100%);
  }

  .hero__photo img { transform: none; }

  h1 { font-size: clamp(7rem, 12vw, 12rem); }

  .text {
    padding: 14vh 3rem 6rem;
    margin: 0;
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  h1,
  .hero__sub,
  .listen { animation: none; }
}
