/* ── mithal.cz ─ „armor" ──────────────────────────────────────
   Paleta vychází z pancéřové verze loga: temná ocel, nýtované
   pláty, zlatý střed. Pozadí stránky navazuje na fotku loga,
   jejíž okraje vybledají CSS maskou. Nápis MITHAL je vektor
   z PDF ve zlatém přechodu. */

:root {
  --bg: #0e1216;
  --bg-glow: #232b32;
  --panel: #171c21;
  --panel-edge: #3a4149;
  --line: #2b3138;
  --text: #c9cdd1;
  --muted: #82888f;
  --gold: #cfa95c;
  --gold-light: #eed9a0;
  --gold-dark: #96702c;

  --font-display: "Marcellus", "Palatino Linotype", serif;
  --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;

  --gutter: clamp(1.25rem, 4vw, 3rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1100px 750px at 50% 34%, var(--bg-glow) 0%, var(--bg) 55%, #090c0f 100%)
    fixed var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* Jemné filmové zrno přes celou stránku — rozbíjí banding
   tmavých přechodů (dialogy jsou v top-layer, zrno je nekryje) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: url("../assets/noise.png") repeat;
  background-size: 96px 96px;
  opacity: 0.05;
  mix-blend-mode: overlay;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

a { color: var(--gold); text-underline-offset: 3px; }

a:hover { color: var(--gold-light); }

::selection { background: var(--gold); color: var(--bg); }

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

/* ── Horní lišta ─────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gutter);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: block;
  flex-shrink: 0;
}

.brand img {
  display: block;
  height: 1.25rem;
  width: auto;
}

.topnav {
  display: flex;
  gap: 0.25rem;
}

.topnav button {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.45rem 0.8rem;
  border: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.topnav button:hover {
  color: var(--gold-light);
  border-color: var(--gold-dark);
  background: rgba(207, 169, 92, 0.07);
}

/* Burger — na desktopu skrytý */

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0.6rem;
  margin: -0.35rem;
}

.menu-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gold);
  transition: transform 0.2s ease, opacity 0.15s ease;
}

.menu-toggle:hover .menu-toggle-bar {
  background: var(--gold-light);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Na mobilu burger + výsuvný panel pod lištou */
@media (max-width: 44rem) {
  .topbar {
    position: relative;
  }

  .menu-toggle {
    display: flex;
  }

  .topnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem var(--gutter) 0.75rem;
    background: linear-gradient(180deg, #171c21, #10141a);
    border-bottom: 1px solid var(--panel-edge);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  }

  .topnav.open {
    display: flex;
    animation: menu-in 0.18s ease-out;
  }

  .topnav button {
    width: 100%;
    text-align: left;
    padding: 0.8rem 0.5rem;
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .topnav button:last-child {
    border-bottom: 0;
  }
}

@keyframes menu-in {
  from { transform: translateY(-6px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Hero: logo hraje hlavní roli ────────────────────────── */

main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(2rem, 6vh, 4rem) var(--gutter) clamp(3rem, 8vh, 5rem);
}

/* Jeviště: pozadí (gradient stránky) → pulzující podsvícení →
   vyříznuté logo.
   Logem lze otáčet přes vlastnost --logo-rot (viz main.js). */

.hero-stage {
  --logo-rot: 0deg;
  position: relative;
  width: clamp(280px, 52vmin, 560px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  animation: emerge 1.1s ease-out both;
}

/* Podsvícení: zlatá záře za středem loga — pulzuje.
   Předrenderovaný PNG s hladkým útlumem (CSS gradient v tmavých
   barvách dělá viditelné schody — banding). */
.hero-light {
  position: absolute;
  inset: -22%;
  pointer-events: none;
  background: url("../assets/glow.png") center / 100% 100% no-repeat;
  animation: glow-pulse 7s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.98); }
  50%      { opacity: 0.55; transform: scale(1.03); }
}

.hero-spin {
  position: relative;
  z-index: 1;
  width: 86%;
  animation: logo-spin 90s linear infinite;
}

@keyframes logo-spin {
  to { rotate: 360deg; }
}

.hero-spin picture { display: block; }

/* Odlesk: pruh světla občas přejede po kovu — kreslí se jen uvnitř
   siluety loga (maska = průhledný PNG/WebP loga) */
.hero-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg,
    transparent 38%,
    rgba(238, 217, 160, 0.14) 46%,
    rgba(255, 246, 220, 0.32) 50%,
    rgba(238, 217, 160, 0.14) 54%,
    transparent 62%);
  background-size: 320% 320%;
  background-position: 130% 130%;
  mix-blend-mode: screen;
  -webkit-mask-image: url("../assets/logo-armor-transparent.webp");
  mask-image: url("../assets/logo-armor-transparent.webp");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  animation: sheen-sweep 18s ease-in-out infinite;
}

/* přejezd trvá ~2,5 s, zbytek cyklu klid */
@keyframes sheen-sweep {
  0%       { background-position: 130% 130%; }
  14%      { background-position: -130% -130%; }
  100%     { background-position: -130% -130%; }
}

.hero-logo {
  display: block;
  width: 100%;
  height: auto;
  rotate: var(--logo-rot);
  transition: rotate 0.6s ease;
  /* stín už není zapečený ve fotce — kreslí ho drop-shadow podle průhlednosti */
  filter:
    drop-shadow(0 24px 32px rgba(0, 0, 0, 0.55))
    drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
}

@keyframes emerge {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.wordmark {
  margin-top: clamp(0.5rem, 2vh, 1.25rem);
}

.wordmark img {
  display: block;
  width: clamp(220px, 44vw, 440px);
  height: auto;
}

.tagline {
  max-width: 32rem;
  margin-top: 1.5rem;
  color: var(--muted);
}

/* ── Patička ─────────────────────────────────────────────── */

.footer {
  padding: 1.25rem var(--gutter);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Verze webu (pravý spodní roh) ───────────────────────── */

.version {
  position: fixed;
  right: 0.6rem;
  bottom: 0.4rem;
  z-index: 5;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.75;
  pointer-events: none;
  user-select: none;
}

/* ── Popupy (dialog) ─────────────────────────────────────── */

dialog {
  margin: auto;
  width: min(34rem, calc(100vw - 2 * var(--gutter)));
  border: 1px solid var(--panel-edge);
  background: linear-gradient(180deg, #1b2127, var(--panel));
  color: var(--text);
  padding: 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

dialog::backdrop {
  background: rgba(4, 6, 8, 0.72);
}

dialog[open] {
  animation: dlg-in 0.25s ease-out;
}

@keyframes dlg-in {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.dlg-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.dlg-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  line-height: 1.25;
  padding-bottom: 0.75rem;
  color: var(--gold-light);
}

.dlg-close {
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  color: var(--muted);
  transition: color 0.15s;
}

.dlg-close:hover {
  color: var(--gold-light);
}

.dlg-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: grid;
  gap: 0.75rem;
}

.contact-list div {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

.contact-list dt {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  align-self: baseline;
}

/* ── Omezený pohyb ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .hero-stage { animation: none; }
  .hero-spin { animation: none; }
  .hero-light { animation: none; }
  .hero-sheen { animation: none; opacity: 0; }
  .hero-logo { transition: none; }
  dialog[open] { animation: none; }
  .topnav.open { animation: none; }
  .menu-toggle-bar { transition: none; }
  html { scroll-behavior: auto; }
}
