:root {
  --white: #ffffff;
  --bg: #ffffff;
  --bg-soft: #f5f5f5;
  --ink: #1C2127;
  --muted: #313131;
  --accent: #1e92be;
  --accent-ink: #ffffff;
  --danger: #b61742;
  --danger-rgb: 210, 22, 72;
  --danger-hover: color-mix(in srgb, var(--danger) 78%, #000);
  --danger-ink: var(--danger);
  --danger-soft: color-mix(in srgb, var(--danger) 16%, #fff);
  --danger-soft-strong: color-mix(in srgb, var(--danger) 28%, #fff);
  --line: #e4e4e4;
  --table-line: #cfcfcf;
  --footer: #1C2127;
  --card: #fbfbfb;
  --radius: 0;
  --control-height: 2.75rem;
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Space Grotesk", "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  font-weight: 400;
  letter-spacing: -0.01em;
}

main {
  flex: 1 0 auto;
}

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

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

.wrap {
  width: min(1120px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.wrap.narrow {
  width: min(720px, calc(100% - 2.5rem));
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 20;
  background: #fff;
  padding: 0.5rem 0.75rem;
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-logo {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  color: var(--accent);
  display: block;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 1.35rem;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}

.site-header.is-nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.site-header.is-nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-header.is-nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  position: relative;
}

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

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

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

.nav-portal {
  font-weight: 600;
}

/* ——— Hero ——— */
.hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: grid;
  align-items: center;
  padding: 5rem 0 4rem;
  overflow: hidden;
  background: var(--bg);
}

.hero-visual {
  --parallax-y: 0;
  --parallax-before-y: 0;
  position: absolute;
  right: clamp(0.75rem, calc(2 * 2vw), 500px);
  top: 50%;
  /* Plná velikost od 1800px; pod tím lineárně; mobil min 80×80 */
  width: clamp(80px, 30vw, 480px);
  height: clamp(80px, 30vw, 480px);
  background: var(--accent);
  pointer-events: none;
  will-change: transform;
  transform: translate3d(0, calc(-50% + var(--parallax-y) * 1px), 0);
  animation: block-in 1s ease both;
}

.hero-visual-video {
  position: absolute;
  left: -18%;
  bottom: -12%;
  width: clamp(65px, 12.778vw, 230px);
  height: clamp(65px, 12.778vw, 230px);
  object-fit: cover;
  background: var(--ink);
  will-change: transform;
  transform: translate3d(0, calc(var(--parallax-before-y) * 1px), 0);
  animation: block-in 1.15s 0.12s ease both;
}

@keyframes block-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-visual,
  .hero-visual-video {
    animation: none;
    will-change: auto;
  }

  .hero-visual {
    transform: translate3d(0, -50%, 0);
  }

  .hero-visual-video {
    display: none;
    transform: none;
  }
}

.hero-inner {
  position: relative;
  max-width: 34rem;
  animation: rise 0.85s ease both;
}

/* Pod 1440px: text k levému okraji wrap sloupce (ne na střed viewportu) */
@media (max-width: 1439px) {
  .wrap.hero-inner {
    margin-left: max(1.25rem, calc(100% - 991px));
    margin-right: auto;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  margin: 0 0 1.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-mark {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 700;
  margin: 0 0 1.1rem;
  letter-spacing: -0.045em;
  line-height: 0.95;
  color: var(--ink);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  margin: 0 0 1.75rem;
  max-width: 22ch;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.lead {
  font-size: 1.05rem;
  max-width: 38ch;
  color: var(--muted);
  margin: 0 0 1.75rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.btn,
[class^="btn-"]:not(.btn-dot),
[class*=" btn-"]:not(.btn-dot) {
  font-size: 0.78rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-sizing: border-box;
  min-height: var(--control-height);
  border: 1px solid transparent;
  padding: 0 1.25rem;
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
select,
textarea {
  box-sizing: border-box;
  min-height: var(--control-height);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.25;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 6rem;
  padding: 0.65rem 0.75rem;
  resize: vertical;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent);
  color: #fff;
}

.btn-ghost {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}

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

.btn-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-decoration: none;
  gap: 0.55rem;
  min-height: 0;
}

.btn-link:hover {
  color: var(--accent);
}

.btn-link .btn-dot {
  width: 0.65rem;
  height: 0.65rem;
  background: var(--accent);
  flex-shrink: 0;
}

/* ——— Sections ——— */
.section {
  padding: 2rem 0 5rem;
}

.section-alt {
  background: var(--bg-soft);
  border-block: 1px solid var(--line);
}

.section h1,
.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 0 0 0.75rem;
  line-height: 1.1;
}

.section-lead {
  color: var(--muted);
  margin: 0 0 2.5rem;
  font-size: 1.05rem;
}

#kontakt {
  padding-top: 5rem;
}

.intro-copy {
  max-width: 40rem;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
}

.intro-copy p {
  margin: 0 0 1.25rem;
}

.intro-copy p:last-child {
  margin-bottom: 0;
}

.pillars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

@media (min-width: 800px) {
  .pillars {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pillars li {
  padding: 1.5rem 1.25rem 1.5rem 0;
  border-bottom: 1px solid var(--line);
  animation: rise 0.7s ease both;
}

@media (min-width: 800px) {
  .pillars li {
    padding: 1.75rem 1.5rem 1.75rem 0;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }

  .pillars li:last-child {
    border-right: 0;
    padding-right: 0;
  }

  .pillars li:not(:first-child) {
    padding-left: 1.5rem;
  }
}

.pillars h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.pillars p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.work-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem 1.25rem;
}

@media (min-width: 720px) {
  .work-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.work-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.work-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  object-fit: cover;
  object-position: top center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.work-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ——— Contact ——— */
.contact-layout {
  display: grid;
  gap: 3rem;
}

@media (min-width: 800px) {
  .contact-layout {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: start;
  }
}

.contact-details {
  display: grid;
  gap: 1.5rem;
  margin: 0;
}

.contact-details dt {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contact-details dd {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.contact-details a {
  text-decoration: none;
}

.contact-details a:hover {
  color: var(--accent);
}

.contact-legal {
  padding-top: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

@media (min-width: 800px) {
  .contact-legal {
    border-left: 3px solid var(--accent);
    padding-left: 1.5rem;
  }
}

.contact-legal p {
  margin: 0 0 0.45rem;
}

.contact-legal p:last-child {
  margin-bottom: 0;
}

.contact-legal strong {
  color: var(--ink);
  font-weight: 700;
}

.contact-legal a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.contact-legal a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.flash-ok {
  background: rgba(0, 87, 255, 0.08);
  border: 1px solid rgba(0, 87, 255, 0.25);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

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

/* ——— Footer ——— */
.site-footer {
  background: var(--footer);
  color: rgba(255, 255, 255, 0.65);
  padding: 2.25rem 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.footer-inner p {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.footer-inner .muted {
  color: rgba(255, 255, 255, 0.55);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.footer-brand:hover {
  color: #fff;
}

.footer-brand .brand-logo {
  width: 1.5rem;
  height: 1.5rem;
}

/* ——— Tools ——— */
.tools-grid {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

@media (min-width: 700px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tool-card {
  display: block;
  padding: 1.75rem 1.5rem 1.75rem 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s ease;
}

@media (min-width: 700px) {
  .tool-card:nth-child(odd) {
    padding-right: 1.5rem;
    border-right: 1px solid var(--line);
  }

  .tool-card:nth-child(even) {
    padding-left: 1.5rem;
  }
}

.tool-card:hover {
  color: inherit;
}

.tool-card:hover h2 {
  color: var(--accent);
}

.tool-card h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 0.45rem;
  transition: color 0.2s ease;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.tool-result,
.tool-error {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
}

.tool-error {
  border-color: rgba(var(--danger-rgb), 0.35);
  background: rgba(var(--danger-rgb), 0.06);
  color: var(--danger-ink);
}

/* Tool pages inherit panel styles from tools CSS; keep base forms readable */
.section .btn-primary {
  background: var(--ink);
  color: #fff;
}

@media (max-width: 840px) {
  .nav-toggle {
    display: inline-flex;
    position: relative;
    z-index: 2;
  }

  .nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 1;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0.35rem 1.25rem 1rem;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--line);
  }

  .site-header.is-nav-open .nav {
    display: flex;
  }

  .nav a {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.78rem;
  }

  .nav a:last-child {
    border-bottom: 0;
  }

  .nav a::after {
    bottom: 0.7rem;
    width: 1.25rem;
  }

  .nav a:hover::after,
  .nav a:focus-visible::after {
    transform: scaleX(1);
  }

  .hero {
    min-height: 72vh;
    padding: 4rem 0 3rem;
  }

  .hero-visual {
    /* čtverec na úzkém viewportu; pořád vertikálně se středem hero-inner */
    width: clamp(80px, 30vw, 480px);
    height: clamp(80px, 30vw, 480px);
    opacity: 0.9;
  }

  .hero-visual-video {
    width: clamp(55px, 18vw, 100px);
    height: clamp(55px, 18vw, 100px);
    left: -14%;
    bottom: -10%;
  }
}

@media (max-width: 489px) {
  .hero-visual {
    display: none;
  }
}
