/**
 * @file
 * Hero sekce úvodní stránky — studiografix.cz
 *
 * Font Sen je hostovaný z tématu (fonts/), ne z Google CDN — kvůli GDPR
 * i rychlosti. Oba subsety jsou nutné: latin-ext nese české háčky a čárky.
 */

@font-face {
  font-family: 'Sen';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/sen-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Sen';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/sen-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

.sg-hero {
  --ink: #09070f;
  --purple: #8363d5;
  --accent: #a98ee8;
  --purple-soft: #cfbefc;
  --text: #efedfb;
  --muted: rgba(239, 237, 251, 0.8);
  --faint: rgba(239, 237, 251, 0.36);
  --hair: rgba(239, 237, 251, 0.1);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Sen', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pad: clamp(20.0px, 4.6vw, 60.0px);

  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

/* ------------------------------------------------------------ pozadí */

.sg-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.sg-hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  will-change: transform;
}

.sg-hero__glow--a {
  top: -14%;
  right: -6%;
  width: min(880px, 92vw);
  height: 430px;
  background: radial-gradient(closest-side, rgba(131, 99, 213, 0.6), transparent 72%);
  animation: sg-float-a 17s ease-in-out infinite alternate;
}

.sg-hero__glow--b {
  top: 20%;
  right: 8%;
  width: min(600px, 76vw);
  height: 330px;
  background: radial-gradient(closest-side, rgba(169, 142, 232, 0.36), transparent 70%);
  animation: sg-float-b 13s ease-in-out infinite alternate;
}

.sg-hero__glow--c {
  bottom: -16%;
  left: -12%;
  width: min(520px, 68vw);
  height: 300px;
  background: radial-gradient(closest-side, rgba(131, 99, 213, 0.34), transparent 72%);
  animation: sg-float-a 21s ease-in-out infinite alternate-reverse;
}

@keyframes sg-float-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-46px, 52px, 0) scale(1.12); }
}

@keyframes sg-float-b {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to { transform: translate3d(58px, -44px, 0) scale(0.92); }
}

.sg-hero__cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 640px;
  height: 640px;
  margin: -320px 0 0 -320px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(169, 142, 232, 0.16), transparent 70%);
  filter: blur(30px);
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: transform;
}

.sg-hero[data-pointer='true'] .sg-hero__cursor {
  opacity: 1;
}

.sg-hero__lines {
  position: absolute;
  inset: 0;
}

.sg-hero__lines i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  overflow: hidden;
  background: var(--hair);
}

.sg-hero__lines i:nth-child(1) { left: 25%; }
.sg-hero__lines i:nth-child(2) { left: 50%; }
.sg-hero__lines i:nth-child(3) { left: 75%; }

.sg-hero__lines i::after {
  content: '';
  position: absolute;
  left: 0;
  width: 1px;
  height: 30%;
  background: linear-gradient(180deg, transparent, var(--accent), transparent);
  animation: sg-sweep 7.5s linear infinite;
}

.sg-hero__lines i:nth-child(2)::after {
  background: linear-gradient(180deg, transparent, var(--purple-soft), transparent);
  animation-duration: 10s;
  animation-delay: 2.4s;
}

.sg-hero__lines i:nth-child(3)::after {
  animation-duration: 12.5s;
  animation-delay: 5s;
}

@keyframes sg-sweep {
  from { top: -30%; }
  to { top: 100%; }
}

.sg-hero__wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(115% 78% at 6% 42%, var(--ink) 32%, transparent 76%),
    linear-gradient(0deg, var(--ink) 1%, transparent 32%);
}

.sg-hero__portrait {
  position: absolute;
  right: -1%;
  bottom: 0;
  z-index: 1;
  width: auto;
  height: min(90vh, 940px);
  opacity: 0.92;
  user-select: none;
  pointer-events: none;
  animation: sg-portrait 1.2s cubic-bezier(0.2, 0.7, 0.3, 1) 0.25s both;
}

@keyframes sg-portrait {
  from { opacity: 0; transform: translateX(34px); }
  to { opacity: 0.92; transform: none; }
}

/* ------------------------------------------------------------ mřížka */

.sg-hero__main {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.78fr);
  align-items: center;
  gap: clamp(34.0px, 4.6vw, 68.0px);
  width: 100%;
  padding: clamp(30.0px, 5.5vh, 64.0px) var(--pad);
}

.sg-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: var(--accent);
  font-size: 0.68750rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.sg-hero__eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--accent);
  opacity: 0.75;
  transform-origin: left;
  animation: sg-grow 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) 0.1s both;
}

@keyframes sg-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.sg-hero__title {
  margin: 0;
  font-size: clamp(2.37500rem, 5.5vw, 4.87500rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.032em;
  text-transform: uppercase;
  hyphens: none;
}

.sg-hero__title .sg-dot { color: var(--accent); font-style: normal; }

.sg-hero__ln { display: block; overflow: hidden; }

.sg-hero__ln > span {
  display: block;
  transform: translateY(105%);
  animation: sg-up 0.9s cubic-bezier(0.16, 0.84, 0.3, 1) both;
}

.sg-hero__ln:nth-of-type(1) > span { animation-delay: 0.1s; }
.sg-hero__ln:nth-of-type(2) > span { animation-delay: 0.22s; }

@keyframes sg-up {
  to { transform: none; }
}

.sg-hero__lede {
  max-width: 47ch;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(0.87500rem, 1.2vw, 1.03125rem);
  line-height: 1.68;
}

.sg-hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 34px;
}

.sg-hero__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  padding: 16px 28px;
  border: 0;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-family: inherit;
  font-size: 0.81250rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.sg-hero__btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 22%, rgba(255, 255, 255, 0.42) 50%, transparent 78%);
  transform: translateX(-130%);
}

.sg-hero__btn:hover::after { animation: sg-shine 0.85s ease; }

@keyframes sg-shine {
  to { transform: translateX(130%); }
}

.sg-hero__btn:hover,
.sg-hero__btn:focus-visible {
  background: #9375de;
  box-shadow: 0 14px 36px rgba(131, 99, 213, 0.4);
  transform: translateY(-2px);
}

.sg-hero__btn svg { position: relative; transition: transform 0.18s ease; }
.sg-hero__btn:hover svg { transform: translateX(3px); }

.sg-hero__ghost {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 15px 2px;
  border-bottom: 1px solid transparent;
  color: var(--text);
  font-size: 0.87500rem;
  font-weight: 700;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.sg-hero__ghost:hover,
.sg-hero__ghost:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

.sg-hero__kanka {
  display: block;
  width: clamp(120.0px, 14vw, 168.0px);
  height: auto;
  margin-top: 26px;
  filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.5));
  animation: sg-kanka 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) 0.55s both;
}

@keyframes sg-kanka {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

.sg-hero__kanka {
  position: absolute;
  left: clamp(360.0px, 28vw, 420.0px);
  top: clamp(548.0px, 40vh, 590.0px);
  z-index: 1;
  width: min(15vw, 205px);
  height: auto;
  opacity: 0.9;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 24px 44px rgba(0, 0, 0, 0.55));
  animation: sg-kanka 1.1s cubic-bezier(0.2, 0.7, 0.3, 1) 0.4s both;
}

@keyframes sg-kanka {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 0.9; transform: none; }
}

@media (max-width: 820px) {
  .sg-hero__kanka { display: none; }
}

.sg-hero__human {
  display: flex;
  align-items: center;
  gap: 13px;
  max-width: 47ch;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--hair);
}

.sg-hero__avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--purple), var(--purple-soft));
  box-shadow: 0 0 0 1px rgba(239, 237, 251, 0.16), 0 6px 18px rgba(131, 99, 213, 0.28);
  color: #fff;
  font-size: 0.81250rem;
  font-weight: 800;
}

.sg-hero__human p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.sg-hero__human b { color: var(--text); font-weight: 700; }

/* ------------------------------------------------------------ panel */

.sg-hero__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 19px;
  align-self: end;
  margin-bottom: clamp(0.0px, 3vh, 34.0px);
  padding: 25px;
  border-radius: 18px;
  background: rgba(12, 9, 22, 0.55);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12), 0 30px 74px rgba(0, 0, 0, 0.52);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
  backdrop-filter: blur(14px) saturate(125%);
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
  animation: sg-fade 0.9s ease 0.45s both;
}

@keyframes sg-fade {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; }
}

.sg-hero__panel::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1.3px;
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.05) 44%, rgba(169, 142, 232, 0.32));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

/* Snímky panelu — připraveno pro střídání sdělení. */
.sg-hero__slides { position: relative; display: grid; }

.sg-hero__slide {
  display: flex;
  flex-direction: column;
  gap: 19px;
  grid-area: 1 / 1;
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
  transition: opacity 0.7s ease, transform 0.7s ease, filter 0.7s ease;
}

/* Defocus dissolve: odchozí se rozmaže a zvětší, příchozí doostří.
   Uprostřed přechodu jsou oba snímky rozmazané → plynulá výměna bez blikání. */
.sg-hero__slide[aria-hidden='true'] {
  opacity: 0;
  transform: scale(1.05);
  filter: blur(16px);
  pointer-events: none;
}

.sg-hero__panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sg-hero__label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.65625rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.sg-hero__pulse {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: sg-pulse 2.4s ease-out infinite;
}

@keyframes sg-pulse {
  0% { box-shadow: 0 0 0 0 rgba(169, 142, 232, 0.55); }
  70% { box-shadow: 0 0 0 11px rgba(169, 142, 232, 0); }
  100% { box-shadow: 0 0 0 0 rgba(169, 142, 232, 0); }
}

.sg-hero__loc {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.65625rem;
  letter-spacing: 0.05em;
}

.sg-hero__panel h2 {
  margin: 0;
  font-size: 1.31250rem;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.015em;
}

.sg-hero__panel h2 em { color: var(--purple-soft); font-style: normal; }

.sg-hero__panel-p {
  margin: -7px 0 0;
  color: var(--muted);
  font-size: 0.81250rem;
  line-height: 1.6;
}

.sg-hero__rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border-radius: 11px;
  background: var(--hair);
}

.sg-hero__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  background: rgba(9, 7, 15, 0.6);
  transition: background 0.2s ease;
}

.sg-hero__row:hover { background: rgba(131, 99, 213, 0.16); }

.sg-hero__row dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.78125rem;
}

.sg-hero__row dd {
  margin: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.84375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sg-hero__row dd small { color: var(--faint); font-size: 0.68750rem; font-weight: 400; }

.sg-hero__panel-foot {
  display: flex;
  gap: 9px;
  margin: 0;
  color: var(--faint);
  font-size: 0.71875rem;
  line-height: 1.5;
}

.sg-hero__panel-foot svg { flex: none; margin-top: 1px; color: var(--purple-soft); }

/* ------------------------------------------------------------ spodní lišta */

.sg-hero__strip {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 30px;
  padding: 17px var(--pad);
  border-top: 1px solid var(--hair);
}

.sg-hero__strip ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sg-hero__strip li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.78125rem;
}

.sg-hero__strip svg { flex: none; color: var(--accent); }

.sg-hero__note {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.68750rem;
  letter-spacing: 0.06em;
}

/* ------------------------------------------------------------ přístupnost */

.sg-hero a:focus-visible,
.sg-hero button:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ------------------------------------------------------------ responzivita */

@media (max-width: 1120px) {
  /* Na úzkých obrazovkách je obsah vždy vyšší než okno, takže roztahovací
     řádek 1fr nemá co vyplňovat — jen by vyrobil prázdné místo, kdykoli je
     okno vysoké (tablet na výšku, snímek celé stránky). */
  .sg-hero { min-height: auto; grid-template-rows: auto auto auto; }
  .sg-hero__main { grid-template-columns: 1fr; align-items: start; align-content: start; gap: 38px; }
  .sg-hero__panel { align-self: auto; margin-bottom: 0; }
  .sg-hero__portrait { display: none; }
}

@media (max-width: 820px) {
  .sg-hero__lines { display: none; }
}

@media (max-width: 700px) {
  /* Pruh s výhodami vypadá na mobilu líp vycentrovaný než na levém okraji. */
  .sg-hero__strip { justify-content: center; }
  .sg-hero__strip ul { justify-content: center; gap: 8px 20px; }
}

@media (max-width: 560px) {
  .sg-hero__main { padding-top: 26px; padding-bottom: 26px; }
  .sg-hero__lede { font-size: 0.90625rem; }
  .sg-hero__cta { gap: 12px 16px; margin-top: 26px; }
  .sg-hero__btn { padding: 14px 22px; font-size: 0.78125rem; }
  .sg-hero__panel { padding: 20px; }
  .sg-hero__strip { padding-top: 14px; padding-bottom: 14px; }
  .sg-hero__strip li { font-size: 0.75000rem; }
}

@media (max-width: 760px) {
  .sg-hero__note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sg-hero *,
  .sg-hero *::before,
  .sg-hero *::after {
    animation: none !important;
    transition: none !important;
  }

  .sg-hero__ln > span { transform: none !important; }
  .sg-hero__panel { opacity: 1 !important; }
  .sg-hero__cursor { display: none; }
}

/* ============================================================
   Mobil: pohyb navázaný na scroll a dotyk
   Na dotykovém displeji odpadá kurzorová záře, náklon panelu i hover.
   Nahrazuje je odhalování při scrollu, přejíždění prstem a odezva na stisk.
   ============================================================ */

/* Tečky pod panelem — ukazují, že snímků je víc. */
.sg-hero__dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}

.sg-hero__dots button {
  width: 26px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: rgba(239, 237, 251, 0.22);
  cursor: pointer;
  transition: background 0.25s ease, width 0.25s ease;
}

.sg-hero__dots button[aria-selected='true'] {
  width: 38px;
  background: var(--accent);
}

.sg-hero__dots button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Panel se dá přejíždět prstem. */
.sg-hero__slides[data-swipe] {
  touch-action: pan-y;
}

/* Odezva na stisk — na dotyku nahrazuje hover. */
@media (hover: none) {
  .sg-hero__btn:active,
  .sg-hero__ghost:active { transform: scale(0.97); }
  .sg-hero__panel:active { transform: scale(0.995); }
  .sg-hero__row:active { background: rgba(131, 99, 213, 0.2); }
}

/* Odhalení při scrollu. Bez JS i bez podpory zůstane obsah viditelný —
   třída se přidává až skriptem, takže nic nezmizí, když selže. */
.sg-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.3, 1),
              transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.sg-reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Položky pruhu naskakují po sobě, ne najednou. */
.sg-hero__strip li.sg-reveal:nth-child(1) { transition-delay: 0.05s; }
.sg-hero__strip li.sg-reveal:nth-child(2) { transition-delay: 0.13s; }
.sg-hero__strip li.sg-reveal:nth-child(3) { transition-delay: 0.21s; }

@media (prefers-reduced-motion: reduce) {
  .sg-reveal,
  .sg-reveal.is-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
