/* ==========================================================================
   PiViK IT — pivikit.cz
   Statický web, žádné externí zdroje (fonty, skripty, obrázky) — vše self-hosted,
   aby stránka fungovala offline-first, rychle a bez cookies třetích stran.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
  color-scheme: dark;

  /* Plochy — hluboká modrofialová, ne černá: méně únavná, teplejší */
  --bg:            #0b0d16;
  --bg-raised:     rgba(255, 255, 255, 0.025);
  --bg-raised-alt: rgba(255, 255, 255, 0.045);

  /* Text — --fg-muted je nejtmavší použitý odstín, na pozadí dává ~6,7:1,
     tedy pohodlnou rezervu i pro drobný text v eyebrow a patičce. */
  --fg:        #ece8e1;
  --fg-soft:   #b6b3c0;
  --fg-muted:  #9a98a6;

  /* Akcenty — teplé zlato jako hlavní, tlumená fialová jako druhá vrstva světla */
  --accent:        #e2b569;
  --accent-strong: #f2c87e;
  --accent-dim:    rgba(226, 181, 105, 0.16);
  --halo-warm:     rgba(226, 181, 105, 0.13);
  --halo-cool:     rgba(111, 107, 216, 0.14);

  /* Linky a rámečky */
  --line:       rgba(255, 255, 255, 0.075);
  --line-hover: rgba(226, 181, 105, 0.32);

  /* Rytmus */
  --radius:     14px;
  --radius-lg:  20px;
  --page-max:   64rem;
  --prose-max:  38rem;
  --gutter:     clamp(1.25rem, 5vw, 3rem);
  --section-gap: clamp(4.5rem, 12vw, 9rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font-sans:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
  --font-mono:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

/* --------------------------------------------------------------------------
   2. Reset a základ
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Dvě měkká světla v pozadí — dávají ploše hloubku bez jediného obrázku. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(64rem 44rem at 50% -14%, var(--halo-warm), transparent 62%),
    radial-gradient(52rem 40rem at 8% 108%, var(--halo-cool), transparent 60%);
}

/* Jemné zrno — bere digitálnímu povrchu plastovost. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.032;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.12;
  text-wrap: balance;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: #14161f;
  font-weight: 600;
  text-decoration: none;
}

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

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */

.page {
  position: relative;
  z-index: 0;
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.section {
  padding-block: var(--section-gap) 0;
}

.section--narrow .prose {
  max-width: var(--prose-max);
}

/* --------------------------------------------------------------------------
   4. Hlavička
   -------------------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--fg);
}

.brand__mark {
  width: 1.6rem;
  height: 1.6rem;
  flex: none;
  color: var(--accent);
  transition: transform 0.6s var(--ease);
}

.brand:hover .brand__mark {
  transform: rotate(28deg);
}

.brand__name {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.055em;
}

.brand__suffix {
  margin-left: 0.28em;
  color: var(--accent);
  font-weight: 400;
}

.site-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  font-size: 0.9375rem;
}

.site-nav a {
  position: relative;
  color: var(--fg-soft);
  text-decoration: none;
  padding-block: 0.25rem;
  transition: color 0.25s var(--ease);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.site-nav a:hover {
  color: var(--fg);
}

.site-nav a:hover::after {
  transform: scaleX(1);
}

/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: clamp(4rem, 16vh, 9rem) clamp(2rem, 6vh, 4rem);
  min-height: min(72vh, 40rem);
}

.hero__body {
  position: relative;
  z-index: 1;
  max-width: 36rem;
}

/* Ensó — nedokončený kruh. Pomalu dýchá, tak akorát, aby si toho člověk
   spíš nevšiml, než všiml. */
.hero__enso {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(38rem, 116vw);
  height: min(38rem, 116vw);
  translate: -50% -50%;
  color: var(--accent);
  opacity: 0.22;
  pointer-events: none;
  animation: breathe 11s var(--ease) infinite;
}

.hero__halo {
  position: absolute;
  top: 46%;
  left: 50%;
  width: min(46rem, 130vw);
  height: min(30rem, 90vw);
  translate: -50% -50%;
  pointer-events: none;
  background: radial-gradient(closest-side, var(--accent-dim), transparent 72%);
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.18;
  }
  50% {
    transform: scale(1.045) rotate(6deg);
    opacity: 0.28;
  }
}

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  color: var(--fg-muted);
  font-size: 0.78125rem;
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.eyebrow__num {
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 0.05em;
}

.hero__title {
  font-size: clamp(2.4rem, 1.6rem + 3.8vw, 4.25rem);
}

.accent {
  color: var(--accent);
}

.hero__lead {
  margin-top: 1.4rem;
  margin-inline: auto;
  max-width: 32rem;
  color: var(--fg-soft);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
  line-height: 1.72;
}

.hero__actions {
  margin-top: 2.25rem;
}

.button {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  border: 1px solid var(--line-hover);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-strong);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition:
    background-color 0.3s var(--ease),
    border-color 0.3s var(--ease),
    transform 0.3s var(--ease);
}

.button:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   6. Sekce a karty
   -------------------------------------------------------------------------- */

.section .eyebrow {
  justify-content: flex-start;
}

.section__title {
  font-size: clamp(1.65rem, 1.25rem + 1.7vw, 2.35rem);
  max-width: 22ch;
}

.prose {
  margin-top: 1.15rem;
  color: var(--fg-soft);
}

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  margin-top: 2.75rem;
}

.card {
  position: relative;
  padding: 1.75rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  transition:
    background-color 0.35s var(--ease),
    border-color 0.35s var(--ease),
    transform 0.35s var(--ease);
}

.card:hover {
  background: var(--bg-raised-alt);
  border-color: var(--line-hover);
  transform: translateY(-3px);
}

.card__title {
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
}

.card__title::before {
  content: "";
  display: block;
  width: 1.75rem;
  height: 2px;
  margin-bottom: 1rem;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.75;
}

.card__text {
  margin-top: 0.7rem;
  color: var(--fg-muted);
  font-size: 0.9375rem;
  line-height: 1.68;
}

/* --------------------------------------------------------------------------
   7. Kontakt
   -------------------------------------------------------------------------- */

.contact {
  margin-top: 2rem;
}

.contact__link {
  display: inline-block;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--accent-dim);
  color: var(--accent-strong);
  font-size: clamp(1.15rem, 1rem + 1vw, 1.6rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: border-color 0.3s var(--ease);
}

.contact__link:hover {
  border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   8. Patička
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: var(--section-gap);
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  justify-content: space-between;
  align-items: baseline;
  color: var(--fg-muted);
  font-size: 0.8125rem;
}

.site-footer__brand {
  letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   9. Stránka 404
   -------------------------------------------------------------------------- */

.notfound {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: clamp(4rem, 18vh, 10rem);
}

.notfound__code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.24em;
  color: var(--accent);
}

.notfound__title {
  margin-top: 1rem;
  font-size: clamp(1.9rem, 1.4rem + 2.4vw, 3rem);
}

.notfound__text {
  margin-top: 1rem;
  color: var(--fg-soft);
}

.notfound__back {
  margin-top: 2rem;
}

/* --------------------------------------------------------------------------
   10. Nástup obsahu
   -------------------------------------------------------------------------- */

/* Nástup jen pro hlavičku a hero, tedy pro to, co je při načtení vidět.
   Sekce níže se schválně neanimují — uživatel k nim doroluje dávno po doběhnutí
   animace, takže by to nic nepřidalo.

   Animuje se výhradně posun, NIKDY průhlednost. Prohlížeč totiž v neviditelném
   tabu animace neposouvá (currentTime zůstane na nule), takže by se text
   s `opacity: 0` v takovém rendereru vůbec nezobrazil — a přesně takhle
   pracují náhledové roboty, které generují obrázek odkazu. Takhle je nejhorší
   možný výsledek text posunutý o 18 px, čehož si nikdo nevšimne. */
@media (prefers-reduced-motion: no-preference) {
  .hero__body > *,
  .site-header {
    animation: rise 0.7s var(--ease) both;
  }

  .site-header { animation-delay: 0.04s; }
  .hero__body > *:nth-child(1) { animation-delay: 0.12s; }
  .hero__body > *:nth-child(2) { animation-delay: 0.2s; }
  .hero__body > *:nth-child(3) { animation-delay: 0.28s; }
  .hero__body > *:nth-child(4) { animation-delay: 0.36s; }

  @keyframes rise {
    from {
      transform: translateY(18px);
    }
    to {
      transform: none;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --------------------------------------------------------------------------
   11. Malé obrazovky
   -------------------------------------------------------------------------- */

@media (max-width: 30rem) {
  .site-header {
    padding-block: 1.25rem;
  }

  .site-nav {
    font-size: 0.875rem;
  }

  .site-footer {
    flex-direction: column;
  }
}
