/* ==========================================================================
   Rozcestník ukázkových webů.
   Záměrně vypadá jinak než ukázky samotné: ty patří klientům, tohle je moje
   stránka. Proto chladná neutrální paleta a petrolejový akcent z portfolia
   místo teplého editorialu (truhlářství) nebo tmavé techniky (autoservis).
   ========================================================================== */

:root {
  --ink: #14181c;
  --ink-2: #545e68;
  /* Nejsvětlejší odstín textu. Tmavší, než vypadá potřeba — na #f4f6f7
     musí i drobný text v zápatí držet kontrast 4,5:1 (vychází 4,58:1). */
  --ink-3: #68717a;

  --bg: #f4f6f7;
  --card: #ffffff;

  --line: #e2e6e9;
  --line-2: #cdd4d9;

  /* Petrolejová z portfolia (tailwind `primary`) */
  --accent: #124e66;
  --accent-deep: #0d3a4c;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-display: "Kanit", "Inter", system-ui, sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --shell: 1120px;
  --pad: 24px;
  --radius: 10px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  /* Vyrovnané řádky — bez osamocených slov na konci nadpisu */
  text-wrap: balance;
}

p { margin: 0; }

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

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

a { color: inherit; }

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

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

.skip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: 6px;
  transform: translateY(-160%);
  transition: transform 180ms var(--ease-out);
}
.skip:focus-visible { transform: translateY(0); }

/* ---------- hlavička ---------- */

.head {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  padding-block: 6px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-text { display: grid; }

.brand-name {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
}

.brand-role {
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--ink-3);
}

.head-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  /* 44px na výšku — na mobilu je to jediný odkaz v hlavičce */
  padding: 11px 2px;
  font-size: 0.875rem;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 200ms ease;
}
.head-back svg { transition: transform 200ms var(--ease-out); }

/* ---------- úvod ---------- */

.intro {
  padding-block: clamp(48px, 8vw, 88px) clamp(32px, 4vw, 48px);
}

.eyebrow {
  margin-bottom: 18px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.intro h1 {
  max-width: 20ch;
  font-size: clamp(2.125rem, 5.4vw, 3.5rem);
}

.lede {
  max-width: 58ch;
  margin-top: 22px;
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: var(--ink-2);
}

/* ---------- ukázky ---------- */

.demos { padding-bottom: clamp(48px, 7vw, 80px); }

.demo-grid {
  display: grid;
  gap: clamp(20px, 2.6vw, 28px);
}

.demo {
  /* Kvůli natažené oblasti odkazu přes celou kartu */
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 220ms ease, box-shadow 220ms ease,
    transform 140ms var(--ease-out);
}

.demo-media {
  margin: 0;
  /* Náhled je snímek stránky v 16:10 — poměr drží layout při načítání */
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.demo-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 420ms var(--ease-out);
}

.demo-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: clamp(20px, 2.4vw, 28px);
}

.demo-kind {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.demo-name { font-size: clamp(1.375rem, 2.4vw, 1.625rem); }

.demo-link {
  text-decoration: none;
  transition: color 200ms ease;
}

/* Klikatelná je celá karta, ale přístupný název odkazu zůstane krátký */
.demo-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* Klávesnicí se obtahuje celá karta, ne jen text názvu.
   Obtažení z odkazu sundává jen prohlížeč, který :has() umí — jinak
   by po zrušení nezůstalo vidět vůbec nic a karta by byla nedostupná. */
@supports selector(:has(a)) {
  .demo:has(.demo-link:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }
  .demo:has(.demo-link:focus-visible) .demo-link { outline: none; }
}

.demo-desc {
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.demo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}

.demo-tags li {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 0.8125rem;
  color: var(--ink-2);
  background: var(--bg);
}

.demo-cue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--accent);
}
.demo-cue svg { transition: transform 240ms var(--ease-out); }

/* ---------- parametry ---------- */

.specs {
  padding-block: clamp(40px, 6vw, 64px);
  border-top: 1px solid var(--line);
}

.specs-title {
  font-size: clamp(1.5rem, 2.8vw, 1.875rem);
  max-width: 24ch;
}

.spec-list {
  display: grid;
  gap: clamp(24px, 3vw, 32px);
  margin-top: clamp(28px, 3.4vw, 40px);
}

.spec-list h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}

.spec-list p {
  margin-top: 6px;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

/* ---------- výzva ---------- */

.cta { padding-bottom: clamp(48px, 7vw, 80px); }

.cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(20px, 3vw, 40px);
}

.cta-copy { max-width: 46ch; }

.cta-copy h2 { font-size: clamp(1.5rem, 2.8vw, 1.875rem); }

.cta-copy p {
  margin-top: 10px;
  color: var(--ink-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 48px;
  padding: 12px 26px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 200ms ease, transform 140ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }

/* ---------- zápatí ---------- */

.foot {
  padding-block: 28px 36px;
  border-top: 1px solid var(--line);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
}

.foot-note {
  max-width: 68ch;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-3);
}

.foot-copy {
  flex: none;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

/* ---------- od tabletu ---------- */

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

@media (min-width: 900px) {
  :root { --pad: 32px; }

  .demo-grid { grid-template-columns: repeat(2, 1fr); }

  .spec-list {
    grid-template-columns: repeat(4, 1fr);
    gap: 32px 28px;
  }
}

/* ---------- hover jen na myši ---------- */

@media (hover: hover) and (pointer: fine) {
  .demo:hover {
    border-color: var(--line-2);
    box-shadow: 0 10px 28px -18px rgba(20, 24, 28, 0.32);
  }
  .demo:hover .demo-media img { transform: scale(1.028); }
  .demo:hover .demo-cue svg { transform: translateX(4px); }
  .demo:hover .demo-link { color: var(--accent); }

  .btn:hover { background: var(--accent-deep); }

  .head-back:hover { color: var(--ink); }
  .head-back:hover svg { transform: translateX(-3px); }
}

/* Karta reaguje i na stisk — potvrzení, že se něco děje */
.demo:has(.demo-link:active) { transform: scale(0.995); }

/* ---------- omezený pohyb ---------- */

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

  .demo,
  .demo-media img,
  .demo-cue svg,
  .head-back svg,
  .btn,
  .skip {
    transition-duration: 120ms;
  }

  /* Posuny a zvětšení pryč, barvy a stín zůstanou */
  .demo:hover .demo-media img,
  .demo:hover .demo-cue svg,
  .head-back:hover svg { transform: none; }

  .demo:has(.demo-link:active) { transform: none; }
  .btn:active { transform: none; }
}
