/* =========================================================
   ADAMHORAK.CZ — „Excel premium" vzhled
   Barvy a písma — když budeš chtít něco změnit, stačí tady
   ========================================================= */
:root {
  --paper:  #FFFFFF;                    /* pozadí stránky */
  --bar:    #F7F9F8;                    /* světlá lišta (jako Excel) */
  --ink:    #16181D;                    /* hlavní text */
  --mut:    #6B7480;                    /* tlumený text */
  --grid:   rgba(22, 24, 29, 0.09);     /* linky mřížky */
  --grid-soft: rgba(22, 24, 29, 0.055); /* jemnější mřížka v úvodu */
  --grid-faint: rgba(22, 24, 29, 0.032);/* nejjemnější mřížka v dalších sekcích */
  --green:  #107C41;                    /* excelová zelená (akcent) */
  --green-2:#0B6B33;                    /* tmavší zelená (hover) */
  --green-soft: rgba(16, 124, 65, 0.08);
  --on-green: #FFFFFF;                  /* text na zelených tlačítkách */

  /* barvy hravých ukazatelů (podmíněné formátování) */
  --kpi-g-bg:#E8F5EC; --kpi-g-tx:#0B6B33;
  --kpi-y-bg:#FBF3D9; --kpi-y-tx:#8A6A0B;
  --kpi-r-bg:#FBE3E3; --kpi-r-tx:#9B1C1C;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: Consolas, "SF Mono", "Cascadia Mono", monospace;

  --maxw: 1120px;
  --barh: 60px;       /* výška horní lišty */
  --tabsh: 42px;      /* výška spodních záložek */
  --cellw: 96px;      /* šířka buňky mřížky */
  --cellh: 30px;      /* výška buňky mřížky */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* =========================================================
   TMAVÝ REŽIM
   1) sám podle nastavení zařízení (mobil/PC)
   2) nebo ručně tlačítkem ☾/☀ v liště
   ========================================================= */
:root { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper:  #1B1D1F;
    --bar:    #232628;
    --ink:    #E8EAEA;
    --mut:    #9AA3A7;
    --grid:   rgba(255, 255, 255, 0.10);
    --grid-soft: rgba(255, 255, 255, 0.055);
    --grid-faint: rgba(255, 255, 255, 0.03);
    --green:  #21C063;
    --green-2:#3CD97F;
    --green-soft: rgba(33, 192, 99, 0.10);
    --on-green: #0A2E18;
    --kpi-g-bg:#15311F; --kpi-g-tx:#4ADE80;
    --kpi-y-bg:#33290F; --kpi-y-tx:#FACC15;
    --kpi-r-bg:#371717; --kpi-r-tx:#F87171;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper:  #1B1D1F;
  --bar:    #232628;
  --ink:    #E8EAEA;
  --mut:    #9AA3A7;
  --grid:   rgba(255, 255, 255, 0.10);
  --grid-soft: rgba(255, 255, 255, 0.055);
  --grid-faint: rgba(255, 255, 255, 0.03);
  --green:  #21C063;
  --green-2:#3CD97F;
  --green-soft: rgba(33, 192, 99, 0.10);
  --on-green: #0A2E18;
  --kpi-g-bg:#15311F; --kpi-g-tx:#4ADE80;
  --kpi-y-bg:#33290F; --kpi-y-tx:#FACC15;
  --kpi-r-bg:#371717; --kpi-r-tx:#F87171;
}

/* =========================================================
   ZÁKLAD
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.96rem + 0.25vw, 1.0625rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-top: var(--barh);
  padding-bottom: var(--tabsh);
}

h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
p  { margin: 0 0 1.1em; }
a  { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

.mono { font-family: var(--font-mono); }

section { scroll-margin-top: calc(var(--barh) + 16px); }

/* =========================================================
   HORNÍ LIŠTA (plná — mřížka pod ni nezasahuje)
   ========================================================= */
.bar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--barh);
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--grid);
  transition: box-shadow 0.3s var(--ease);
}
.bar.is-scrolled { box-shadow: 0 6px 18px -14px rgba(22, 24, 29, 0.35); }
.bar__inner {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  height: 100%;
}

/* Logo „A · H" + animace při načtení (slétne se a rozjede) */
.brand {
  display: inline-flex;
  align-items: baseline;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand__a, .brand__h, .brand__dot { display: inline-block; }
.brand__dot { color: var(--green); margin: 0 0.13em; }
.brand__a   { animation: brandA 1.6s var(--ease) 0.25s both; }
.brand__h   { animation: brandH 1.6s var(--ease) 0.25s both; }
.brand__dot { animation: brandDot 1.6s var(--ease) 0.25s both; }
@keyframes brandA {
  0%   { transform: translateX(-1.05em); opacity: 0; }
  30%  { transform: translateX(0.34em);  opacity: 1; }
  52%  { transform: translateX(0.34em);  opacity: 1; }
  100% { transform: translateX(0);        opacity: 1; }
}
@keyframes brandH {
  0%   { transform: translateX(1.05em);  opacity: 0; }
  30%  { transform: translateX(-0.34em); opacity: 1; }
  52%  { transform: translateX(-0.34em); opacity: 1; }
  100% { transform: translateX(0);        opacity: 1; }
}
@keyframes brandDot {
  0%, 52% { opacity: 0; transform: scale(0); }
  78%     { opacity: 1; transform: scale(1.35); }
  100%    { opacity: 1; transform: scale(1); }
}

/* Pole s adresou buňky + řádek vzorců (jen ozdoba lišty) */
.bar__ref {
  width: 58px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--mut);
  background: var(--bar);
  border: 1px solid var(--grid);
  border-radius: 6px;
  padding: 0.3rem 0.4rem;
  text-align: center;
  outline: none;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.bar__ref:focus { border-color: var(--green); color: var(--ink); }
.bar__ref.err { color: #C0392B; border-color: rgba(192, 57, 43, 0.45); }
.bar__fx {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--mut);
  background: var(--bar);
  border: 1px solid var(--grid);
  border-radius: 6px;
  padding: 0.28rem 0.8rem;
  flex: 1;
  max-width: 430px;
  white-space: nowrap;
  overflow: hidden;
  cursor: text;
  transition: border-color 0.25s var(--ease);
}
.bar__fx:focus-within { border-color: var(--green); color: var(--ink); }
.bar__fx b { color: var(--green); font-style: italic; font-weight: 700; }
.bar__fx input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  outline: none;
  padding: 0;
}
.fx__count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--mut); padding-left: 0.4rem; white-space: nowrap; }
.fx__count.err { color: #C0392B; }

/* zvýraznění nalezeného textu při hledání */
mark.hl {
  background: var(--green-soft);
  color: inherit;
  border-bottom: 2px solid var(--green);
  border-radius: 2px;
  padding: 0 0.06em;
}
mark.hl.cur { background: var(--green); color: var(--on-green); }

/* Přepínače vpravo v liště (jazyk + světlý/tmavý režim) */
.bar__tools { margin-left: auto; display: flex; gap: 0.45rem; }
.tool {
  min-width: 36px;
  height: 34px;
  padding: 0 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mut);
  background: var(--bar);
  border: 1px solid var(--grid);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.tool:hover { color: var(--ink); border-color: var(--ink); transform: translateY(-1px); }
.tool svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================
   ÚVOD (HERO) — jediná sekce s mřížkou na pozadí
   ========================================================= */
/* Interaktivní mřížka — sekce 01, 04 a 06 (kurzor, výběr, tažení) */
.gridded {
  background-image:
    linear-gradient(var(--grid-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-soft) 1px, transparent 1px);
  background-size: var(--cellw) var(--cellh);
  background-origin: border-box;
}
.gridded > .container { position: relative; z-index: 1; }

.hero {
  position: relative;
  min-height: calc(100svh - var(--barh) - var(--tabsh));
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* „kurzor buňky" — světle zelený obdélník, který skáče po mřížce za myší */
.cellcursor {
  position: absolute;
  top: 0;                 /* důležité: výchozí bod = levý horní roh mřížky */
  left: 0;
  width: var(--cellw);
  height: var(--cellh);
  background: var(--green-soft);
  border: 1px solid rgba(16, 124, 65, 0.28);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s var(--ease); /* posun je okamžitý — jako v opravdovém Excelu */
  will-change: transform;
  z-index: 0;
}

/* buňky „přivybrané" přes Ctrl+klik (drží, dokud neklikneš bez Ctrl) */
.cellpick {
  position: absolute;
  top: 0;                 /* důležité: jinak se čtvereček vykreslí mimo mřížku */
  left: 0;
  width: var(--cellw);
  height: var(--cellh);
  background: var(--green-soft);
  border: 1px solid rgba(16, 124, 65, 0.38);
  pointer-events: none;
  z-index: 0;
}

/* oblast vybraná tažením myši (jako v Excelu) */
.cellrange {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--green-soft);
  border: 1.5px solid var(--green);
  pointer-events: none;
  opacity: 0;
  z-index: 0;
}
.cellrange.show { opacity: 1; }

/* „pochodující mravenci" po Ctrl+C — jako kopírování v Excelu */
.ants {
  border-color: transparent !important;
  background-image:
    linear-gradient(90deg, var(--green) 55%, transparent 45%),
    linear-gradient(90deg, var(--green) 55%, transparent 45%),
    linear-gradient(0deg, var(--green) 55%, transparent 45%),
    linear-gradient(0deg, var(--green) 55%, transparent 45%);
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  background-size: 10px 2px, 10px 2px, 2px 10px, 2px 10px;
  background-position: 0 0, 0 100%, 0 0, 100% 0;
  animation: ants 0.45s linear infinite;
}
@keyframes ants {
  to { background-position: 10px 0, -10px 100%, 0 -10px, 100% 10px; }
}

/* při tažení se nesmí označovat text */
.hero.is-dragging { user-select: none; cursor: cell; }

/* malé adresy buněk u jednotlivých bloků obsahu */
.cellref {
  display: block;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--mut);
  opacity: 0.7;
  margin-bottom: 0.4rem;
}
.tags .cellref, .kpis .cellref { width: 100%; margin-bottom: 0.1rem; }
.photo .cellref { position: absolute; top: 7px; left: 9px; margin: 0; z-index: 1; }
.card .cellref { margin-bottom: 0.45rem; }

/* bliknutí buňky nalezené přes hledání */
.cellflash { animation: cellflash 1.6s var(--ease); }
@keyframes cellflash {
  0%, 65% { outline: 2.5px solid var(--green); outline-offset: 7px; }
  100%    { outline: 2.5px solid transparent; outline-offset: 7px; }
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 4.5rem);
  padding-block: clamp(3.5rem, 8vw, 6rem);
  width: 100%;
}

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--green);
  margin: 0 0 1.3rem;
}

/* Jméno jako vybraná buňka (zelený rámeček + úchyt v rohu) */
.cell {
  position: relative;
  display: inline-block;
  outline: 2.5px solid var(--green);
  outline-offset: 12px;
  animation: cellIn 0.7s var(--ease) 1s both;
}
.cell::after {
  content: "";
  position: absolute;
  right: -17px;
  bottom: -17px;
  width: 10px;
  height: 10px;
  background: var(--green);
  border: 2px solid var(--paper);
  animation: handleIn 0.45s var(--ease) 1.55s both;
}
@keyframes cellIn   { from { outline-color: transparent; } to { outline-color: var(--green); } }
@keyframes handleIn { from { transform: scale(0); } to { transform: scale(1); } }

.hero__title {
  font-size: clamp(2.9rem, 8.5vw, 5.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.hero__lead {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  color: var(--mut);
  max-width: 30ch;
  margin: 2.2rem 0 2.4rem;
  line-height: 1.45;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* Fotka v úvodu — rámeček jako buňka s obrázkem */
.hero__photo {
  margin: 0;
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--bar);
  border: 1px solid var(--grid);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__photo img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.7s var(--ease);
}
.hero__photo:hover img { transform: scale(1.045); }

/* „načítání po buňkách" — dlaždičky nad fotkou zmizí jedna po druhé */
.ph-tiles {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(6, 1fr);
  pointer-events: none;
  z-index: 2;
}
.ph-tiles i {
  background: var(--paper);
  border: 0.5px solid var(--grid-soft);
  opacity: 1;
  transition: opacity 0.45s var(--ease);
}
.ph-tiles.go i { opacity: 0; }
.hero__photo .ph {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--mut);
  padding: 1rem;
}
.hero__photo .ph b { color: var(--green); display: block; margin-bottom: 0.4rem; font-weight: 700; }
/* zelené rohy — vypadá to jako vybraná oblast */
.hero__photo::before, .hero__photo::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border: 2.5px solid var(--green);
  border-radius: 2px;
}
.hero__photo::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.hero__photo::after  { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }

/* =========================================================
   TLAČÍTKA
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.7rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.96rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
              color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--green); color: var(--on-green); }
.btn--primary:hover { background: var(--green-2); }
.btn--ghost { border-color: var(--grid); color: var(--ink); background: var(--paper); }
.btn--ghost:hover { border-color: var(--ink); }

/* =========================================================
   SEKCE (obecné)
   ========================================================= */
.section {
  padding-block: clamp(4.5rem, 10vw, 7.5rem);
  border-top: 1px solid var(--grid);
  /* jemňoučká mřížka i v dalších sekcích — celý web je jeden list */
  background-image:
    linear-gradient(var(--grid-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-faint) 1px, transparent 1px);
  background-size: var(--cellw) var(--cellh);
}
.section__head { margin-bottom: clamp(2rem, 5vw, 3.2rem); }
.section__title { font-size: clamp(1.9rem, 4.5vw, 2.7rem); letter-spacing: -0.025em; }
.section__sub { color: var(--mut); margin: 0.7rem 0 0; }

.lead {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.5;
  max-width: 56ch;
  font-weight: 700;   /* úvodní věta tučně */
}

/* =========================================================
   O MNĚ
   ========================================================= */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.about__body p { color: var(--mut); max-width: 58ch; }
.about__body .lead { color: var(--ink); }

/* klíčová slova — malé „buňky" */
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0;
  margin: 1.8rem 0 0;
}
.tags li {
  padding: 0.42rem 0.95rem;
  border: 1px solid var(--grid);
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--mut);
  background: var(--paper);
}

/* hravé ukazatele (podmíněné formátování) */
.kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.8rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.kpis span { padding: 0.5rem 0.85rem; border-radius: 6px; border: 1px solid var(--grid); }
.kpis .g { background: var(--kpi-g-bg); color: var(--kpi-g-tx); }
.kpis .y { background: var(--kpi-y-bg); color: var(--kpi-y-tx); }
.kpis .r { background: var(--kpi-r-bg); color: var(--kpi-r-tx); }

/* =========================================================
   PRÁCE — karty jako buňky tabulky
   ========================================================= */
.work {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.2rem;
}
.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--grid);
  border-radius: 10px;
  padding: 1.7rem 1.6rem 1.9rem;
  transition: transform 0.3s var(--ease);
}
.card__top {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--mut);
  margin-bottom: 1rem;
}
.card__top b { color: var(--green); font-weight: 700; }
.card__title { font-size: 1.3rem; margin: 0 0 0.5rem; letter-spacing: -0.015em; }
.card__text { color: var(--mut); font-size: 0.95rem; margin: 0; }
/* po najetí se karta „vybere" jako buňka */
.card:hover { transform: translateY(-4px); outline: 2.5px solid var(--green); outline-offset: 3px; }
.card:hover::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 9px;
  height: 9px;
  background: var(--green);
  border: 2px solid var(--paper);
}

/* =========================================================
   JAK PŘEMÝŠLÍM — oblasti s ikonkami
   ========================================================= */
.areas {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  margin-bottom: 1.8rem;
}
.area { padding: 0.85rem 0.85rem 0.95rem; }
/* ikonka sedí ve vlastním „čtverečku" jako v buňce */
.area__ic {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bar);
  border: 1px solid var(--grid);
  border-radius: 8px;
  margin-bottom: 0.6rem;
}
.area__ic svg {
  width: 18px;
  height: 18px;
  stroke: var(--green);
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.area .card__title { font-size: 0.95rem; margin-bottom: 0.25rem; }
.area .card__text { font-size: 0.78rem; line-height: 1.45; }

/* ---------- Dashboard: grafy a čísla ---------- */
.dash {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.2rem;
  align-items: stretch;
}
.dash .card__title { font-size: 1.05rem; margin: 0 0 1rem; }
.dash__trend { display: flex; flex-direction: column; }

/* sloupcový graf (pruhy vyjedou, až na ně doroluješ) */
.bars { display: flex; flex-direction: column; gap: 0.85rem; }
.barrow {
  display: grid;
  grid-template-columns: 92px 1fr 50px;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.88rem;
}
.barrow b { font-family: var(--font-mono); font-weight: 700; font-size: 0.78rem; color: var(--mut); text-align: right; }
.bartrack {
  height: 12px;
  background: var(--bar);
  border: 1px solid var(--grid);
  border-radius: 4px;
  overflow: hidden;
}
.bartrack i {
  display: block;
  height: 100%;
  width: var(--w);
  background: var(--green);
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--ease) 0.25s;
}
.is-visible .bartrack i { transform: scaleX(1); }

/* malý graf růstu (čára se nakreslí, plocha se rozsvítí) */
.spark {
  width: 100%; height: 56px; margin-top: auto;
  stroke: var(--green); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.spark__area { stroke: none; opacity: 0; transition: opacity 0.8s var(--ease) 0.5s; }
.is-visible .spark__area { opacity: 1; }
.spark polyline {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 1.6s var(--ease) 0.3s;
}
.is-visible .spark polyline { stroke-dashoffset: 0; }
.spark circle { fill: var(--green); stroke: none; opacity: 0; transition: opacity 0.4s ease 1.8s; }
.is-visible .spark circle { opacity: 1; }
.trend__cap { margin: 0.8rem 0 0; color: var(--mut); font-size: 0.82rem; }
.trend__cap b { color: var(--green); font-weight: 700; }

/* počítadla */
.dash__nums {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.num {
  border: 1px solid var(--grid);
  border-radius: 10px;
  padding: 1.3rem 1.4rem 1.2rem;
  background: var(--paper);
}
.numlbl { display: block; font-size: 0.75rem; color: var(--green); margin-bottom: 0.55rem; }
.num b { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.numcap { display: block; color: var(--mut); font-size: 0.85rem; margin-top: 0.45rem; }

/* =========================================================
   CITACE + PODPIS
   ========================================================= */
.quote {
  border-top: 1px solid var(--grid);
  padding-block: clamp(3.5rem, 8vw, 5.5rem);
  text-align: center;
  background-image:
    linear-gradient(var(--grid-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-faint) 1px, transparent 1px);
  background-size: var(--cellw) var(--cellh);
}
.quote__inner { display: flex; flex-direction: column; align-items: center; }
.quote__text {
  font-size: clamp(1.3rem, 3.4vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  max-width: 26ch;
  margin: 0.8rem 0 1.7rem;
  line-height: 1.35;
}
/* Podpis: jméno se odkrývá maskou podél skutečné dráhy pera —
   zelený hrot jede po tazích, na konec čárka nad á, podtržení a přitlačení */
.sig { display: flex; justify-content: center; transform: rotate(-1.5deg); }
.sigdraw { width: min(340px, 84vw); height: auto; overflow: visible; }
.sig__text {
  font-family: "Great Vibes", "Fraunces", Georgia, cursive;
  font-size: 54px;
  fill: var(--ink);
}
/* maska: dokud se „nenapíše", jméno není vidět */
.sig__maskpath { stroke-dasharray: 100; stroke-dashoffset: 100; }
.sig.is-visible .sig__maskpath { animation: sdraw 2.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) 0.35s forwards; }
/* hrot pera — jede přesně po dráze psaní */
.sig__pen2 { fill: var(--green); opacity: 0; offset-rotate: 0deg; }
.sig.is-visible .sig__pen2 {
  animation:
    penrun 2.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) 0.35s forwards,
    penfade 0.25s linear 2.8s forwards;
}
@keyframes penrun {
  from { offset-distance: 0%; opacity: 1; }
  to   { offset-distance: 100%; opacity: 1; }
}
@keyframes penfade { to { opacity: 0; } }
.sig__carka {
  fill: none;
  stroke: var(--green);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}
.sig.is-visible .sig__carka { animation: sdraw 0.18s ease-out 2.95s forwards; }
.sig__line2 {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}
.sig.is-visible .sig__line2 { animation: sdraw 0.5s ease-out 3.15s forwards; }
@keyframes sdraw { to { stroke-dashoffset: 0; } }
/* závěrečné „podržení" pera — celý podpis se jemně přitlačí */
.sig.is-visible .sigdraw { animation: sigpress 0.5s var(--ease) 3.75s both; }
@keyframes sigpress {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.05) rotate(-0.5deg); }
  100% { transform: scale(1); }
}

/* =========================================================
   FOTKY — galerie (zatím rámečky, fotky doplníme)
   ========================================================= */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}
.photo {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--bar);
  background-image:
    linear-gradient(var(--grid-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-soft) 1px, transparent 1px);
  background-size: 26px 26px;
  border: 1px solid var(--grid);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
/* dekorativní mini-grafy v prázdné galerii (zmizí, až přijdou fotky) */
.photo .phart { width: 58%; height: auto; color: var(--green); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .ph {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--mut);
  text-align: center;
  padding: 0.8rem;
}
.photo .ph b { color: var(--green); display: block; font-weight: 700; margin-bottom: 0.2rem; }
.photo:hover { border-color: var(--green); transform: translateY(-3px); }

/* =========================================================
   KONTAKT + FORMULÁŘ
   ========================================================= */
.contact { text-align: center; }
.contact__inner { display: flex; flex-direction: column; align-items: center; }
.contact__title { font-size: clamp(2.1rem, 6vw, 3.6rem); margin: 0.4rem 0 0.9rem; letter-spacing: -0.03em; }
.contact__sub { color: var(--mut); margin: 0 0 0.6rem; }
.contact__or { color: var(--mut); font-size: 0.9rem; margin: 2.4rem 0 0.5rem; }
.contact__mail {
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 3vw, 1.5rem);
  color: var(--ink);
  border-bottom: 2px solid var(--grid);
  padding-bottom: 3px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.contact__mail:hover { color: var(--green); border-color: var(--green); }
.contact__socials {
  display: flex;
  gap: 1.6rem;
  margin-top: 2.2rem;
  font-size: 0.92rem;
  font-weight: 500;
}
.contact__socials a { color: var(--mut); transition: color 0.25s var(--ease); }
.contact__socials a:hover { color: var(--green); }

.form { width: 100%; max-width: 560px; margin: 2.2rem auto 0; text-align: left; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form__field { display: flex; flex-direction: column; margin-bottom: 1rem; }
.form__field label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--mut);
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}
.form__field label b { color: var(--green); font-weight: 700; }
.form input, .form textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--grid);
  border-radius: 6px;
  padding: 0.8rem 0.95rem;
  transition: border-color 0.2s var(--ease), outline-color 0.2s var(--ease);
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.form textarea { resize: vertical; min-height: 130px; }
.form input::placeholder, .form textarea::placeholder { color: var(--mut); opacity: 0.65; }
.form input:focus, .form textarea:focus { border-color: var(--green); outline-color: var(--green); }
.form .btn { width: 100%; margin-top: 0.4rem; font-size: 1rem; }
.form .btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.form__honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__status { margin: 1rem 0 0; text-align: center; font-size: 0.95rem; min-height: 1.3em; }
.form__status.ok  { color: var(--green-2); }
.form__status.err { color: #b03a2e; }

/* =========================================================
   STAVOVÝ ŘÁDEK (patička) — jako dole v Excelu
   ========================================================= */
.status {
  border-top: 1px solid var(--grid);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--mut);
  padding-block: 0.9rem;
}
.status__inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.status .ok { color: var(--green); }

/* =========================================================
   ZÁLOŽKY LISTŮ (spodní menu — jako listy v Excelu)
   ========================================================= */
.tabs {
  position: fixed;
  inset: auto 0 0 0;
  height: var(--tabsh);
  z-index: 50;
  background: var(--bar);
  border-top: 1px solid var(--grid);
  display: flex;
  align-items: stretch;
  padding: 0 clamp(0.5rem, 4vw, 2.5rem);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button {
  display: inline-flex;
  align-items: center;
  padding: 0 1.05rem;
  font-family: var(--font-sans);
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--mut);
  background: none;
  border: 0;
  border-right: 1px solid var(--grid);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.tabs a:first-child { border-left: 1px solid var(--grid); }
.tabs a:hover, .tabs button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.7); }
.tabs a.on {
  background: var(--paper);
  color: var(--green);
  font-weight: 700;
  box-shadow: inset 0 2.5px 0 var(--green);
}
.tabs .plus { font-weight: 700; font-size: 1rem; }

/* malé oznámení po kliknutí na „+" */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabsh) + 14px);
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   ANIMACE PŘI ROLOVÁNÍ (objevování obsahu)
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* =========================================================
   MOBIL
   ========================================================= */
@media (max-width: 860px) {
  /* Úvod: fotka jako malý „avatar" nahoře, pod ní jméno a tlačítka */
  .hero { min-height: auto; }
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-block: 2.2rem 3.4rem;
  }
  .hero__photo {
    /* fotka na výšku pod textem — pořádně, ať je efektní */
    width: min(82%, 320px);
    aspect-ratio: 4 / 5;
    border-radius: 12px;
    margin-top: 0.4rem;
    margin-inline: auto;
  }
  .cell { outline-offset: 8px; }
  .cell::after { right: -13px; bottom: -13px; }
  .hero__photo::before, .hero__photo::after { width: 20px; height: 20px; }
  .hero__lead { margin: 1.7rem 0 1.9rem; }
  .hero__actions .btn { flex: 1; min-width: 132px; }

  .about__grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
  .section { padding-block: 3.6rem; }
  .section__head { margin-bottom: 1.8rem; }

  .areas { grid-template-columns: 1fr 1fr; gap: 0.9rem; }
  .area .card__text { font-size: 0.85rem; }
  .dash { grid-template-columns: 1fr; }
  .dash__nums { grid-template-columns: 1fr 1fr; }
  .dash__nums .num:last-child { grid-column: 1 / -1; }
  .barrow { grid-template-columns: 78px 1fr 44px; font-size: 0.82rem; }
}
@media (max-width: 620px) {
  /* hledání zůstává i na mobilu, jen úsporněji */
  .bar__inner { gap: 0.5rem; }
  .bar__fx { padding: 0.28rem 0.55rem; gap: 0.4rem; }
  .bar__ref { padding: 0.28rem 0.45rem; min-width: 44px; }
  .form__row { grid-template-columns: 1fr; }
  .status__inner { justify-content: center; }
  .status .hide-m { display: none; }
  .tabs { padding: 0 0.4rem; }
  .tabs a, .tabs button { padding: 0 0.6rem; font-size: 0.78rem; }
}

/* =========================================================
   OHLEDUPLNOST: vypnout animace, když si to uživatel přeje
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .cell { outline-color: var(--green); }
  .cellcursor { display: none; }
  .sig__maskpath, .sig__carka, .sig__line2 { stroke-dashoffset: 0 !important; }
  .sig__pen2 { display: none; }
}

.section, .quote { position: relative; overflow: hidden; }

/* =========================================================
   FAKTURA — hravé okno s QR kódem
   ========================================================= */
/* úřední políčka nahoře ve faktuře */
.invoice__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.invoice__meta div {
  border: 1px solid rgba(31, 41, 55, 0.16);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  background: #FBFCFB;
}
.invoice__meta i {
  display: block;
  font-style: normal;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6B7480;
  margin-bottom: 0.15rem;
}
.invoice__meta b { font-size: 0.86rem; font-weight: 700; }
.invoice__novat { display: block; font-size: 0.68rem; color: #6B7480; margin: -0.5rem 0 1rem; }

/* editor položek faktury */
.invoice__items td[contenteditable]:focus {
  outline: 2px solid #107C41;
  outline-offset: -1px;
  background: #F3FBF6;
}
.invoice__items .ops, .invoice__items .ops-h {
  width: 70px;
  text-align: right;
  padding: 0.3rem 0.35rem;
  white-space: nowrap;
}
.invoice__items .ops button {
  width: 19px;
  height: 19px;
  border: 1px solid rgba(31, 41, 55, 0.22);
  background: #fff;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  color: #6B7480;
  padding: 0;
  margin-left: 2px;
}
.invoice__items .ops button:hover { color: #107C41; border-color: #107C41; }
.invoice__addrow {
  width: 100%;
  margin: -0.5rem 0 1.1rem;
  padding: 0.45rem;
  border: 1.5px dashed rgba(31, 41, 55, 0.3);
  background: #fff;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #6B7480;
  cursor: pointer;
}
.invoice__addrow:hover { color: #107C41; border-color: #107C41; }
.invoice__actions { display: flex; gap: 0.5rem; margin-top: 1.1rem; }
.inv-act {
  flex: 1;
  padding: 0.55rem;
  border: 1px solid rgba(31, 41, 55, 0.22);
  background: #fff;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #374151;
  cursor: pointer;
}
.inv-act:hover { color: #107C41; border-color: #107C41; }
/* režim zisku 📈 */
.invoice__paper.profit .invoice__items .total td { background: #FFF4D6; }
.invoice__paper.profit .invoice__stamp { color: #B45309; border-color: #B45309; }

.invoice {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.invoice[hidden] { display: none; }
.invoice__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 16, 13, 0.5);
  backdrop-filter: blur(3px);
}
/* faktura je vždy „papír" — schválně i v tmavém režimu */
.invoice__paper {
  position: relative;
  width: min(440px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  color: #1F2937;
  border-radius: 12px;
  padding: 1.6rem 1.5rem 1.3rem;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.55);
}
.invoice__close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(31, 41, 55, 0.18);
  background: #fff;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #6B7480;
}
.invoice__close:hover { color: #1F2937; border-color: #1F2937; }
.inv-no { font-size: 0.74rem; color: #107C41; letter-spacing: 0.06em; }
.invoice__paper h3 { margin: 0.2rem 0 1rem; font-size: 1.35rem; letter-spacing: -0.02em; }
.invoice__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  font-size: 0.84rem;
  margin-bottom: 1rem;
}
.invoice__grid h4 {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #6B7480;
}
.invoice__grid p { margin: 0; line-height: 1.55; }
.invoice__items {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  margin-bottom: 1.1rem;
}
.invoice__items th, .invoice__items td {
  text-align: left;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(31, 41, 55, 0.14);
}
.invoice__items th {
  background: #F3F6F4;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6B7480;
}
.invoice__items td:nth-child(2), .invoice__items th:nth-child(2) { text-align: center; width: 56px; }
.invoice__items td:last-child, .invoice__items th:last-child { text-align: right; width: 104px; }
.invoice__items .total td { font-weight: 700; background: #F3F6F4; }
.invoice__foot {
  position: relative;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.invoice__foot img { border: 1px solid rgba(31, 41, 55, 0.14); border-radius: 8px; display: block; }
.qrwrap { text-align: center; }
.qrwrap small { display: block; font-size: 0.64rem; color: #6B7480; margin-top: 5px; }
.invoice__pay { font-size: 0.78rem; color: #44505E; line-height: 1.75; }
.invoice__stamp {
  position: absolute;
  right: 0;
  bottom: 8px;
  transform: rotate(-9deg);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: #107C41;
  border: 2.5px double #107C41;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  opacity: 0.9;
}
.invoice__note { margin: 1rem 0 0; font-size: 0.78rem; color: #6B7480; text-align: center; }

/* informace o výběru ve stavovém řádku */
#selInfo:not(:empty) { color: var(--green); margin-right: 0.9rem; }

/* klikací IČO v patičce (otevře fakturu) */
.status__ico {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-bottom: 1px dashed var(--grid);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.status__ico:hover { color: var(--green); border-color: var(--green); }

@media (max-width: 480px) {
  .invoice__foot { flex-wrap: wrap; }
  .invoice__stamp { position: static; transform: rotate(-5deg); margin-left: auto; }
}
