/* ---------- TOKENY ---------- */
:root {
  /* Konstanty nezávislé na motivu */
  --accent: #E31E24;        /* barva loga */
  --night: #16130F;
  --cream: #F3EFE8;

  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --wrap: 1320px;
  --gutter: clamp(20px, 4vw, 48px);
  --header-h: 72px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --z-header: 100;
  --z-progress: 110;
  --z-toast: 150;
}

/* Světlý motiv */
:root, [data-theme="light"] {
  color-scheme: light;
  --paper: #F3EFE8;          /* pozadí */
  --paper-2: #EAE4DA;        /* tónované sekce */
  --paper-3: #DFD8CC;
  --surface: #FBF9F5;        /* karty nad pozadím */
  --ink: #16130F;            /* hlavní text */
  --text-2: #4D463E;         /* kontrast 8:1 */
  --muted: #6E665C;          /* kontrast 5:1 */
  --line: rgba(22, 19, 15, .14);
  --line-strong: rgba(22, 19, 15, .28);
  --accent-ink: #C0161C;     /* červená pro malý text */
  --em: #E31E24;
  --on-ink: #F3EFE8;         /* text na inverzních plochách */
  --on-ink-muted: rgba(243, 239, 232, .62);
  --line-ink: rgba(243, 239, 232, .14);
  --accent-on-ink: #FF5257;
  --header-bg: rgba(243, 239, 232, .78);
  --shadow: 0 30px 60px -32px rgba(70, 30, 18, .38), 0 2px 6px -2px rgba(70, 30, 18, .08);
  --grain: .18;
}

/* Tmavý motiv: inverzní plochy (kontakt, tlačítka) se přirozeně otočí na světlé */
[data-theme="dark"] {
  color-scheme: dark;
  --paper: #12100E;
  --paper-2: #1A1714;
  --paper-3: #24201B;
  --surface: #1D1A16;
  --ink: #F2EDE5;
  --text-2: #BDB4A7;
  --muted: #8F867B;
  --line: rgba(242, 237, 229, .11);
  --line-strong: rgba(242, 237, 229, .22);
  --accent-ink: #FF5A5F;
  --em: #FF3F45;
  --on-ink: #12100E;
  --on-ink-muted: rgba(18, 16, 14, .66);
  --line-ink: rgba(18, 16, 14, .16);
  --accent-on-ink: #C0161C;
  --header-bg: rgba(18, 16, 14, .72);
  --shadow: 0 30px 60px -28px rgba(0, 0, 0, .75), 0 0 0 1px rgba(242, 237, 229, .06);
  --grain: .07;
}

/* ---------- BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
}
/* jemné zrno papíru */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.45 0 0 0 0 0.4 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: var(--grain);
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[id] { scroll-margin-top: calc(var(--header-h) + 8px); }

h1, h2, h3 { font-weight: 600; line-height: 1.02; letter-spacing: -.035em; text-wrap: balance; }
h2 { font-size: clamp(2.2rem, 5.4vw, 4.6rem); }
/* Zvýraznění v nadpisech: monospace jako kus kódu */
em { font-family: var(--mono); font-style: normal; font-weight: 500; letter-spacing: -.075em; color: var(--em); }
p { text-wrap: pretty; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.label {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .02em;
  color: var(--muted);
}

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 300;
  padding: 12px 18px; border-radius: 10px; background: var(--ink); color: var(--on-ink); font-weight: 500;
  transform: translateY(-160%); transition: transform .2s var(--ease);
}
.skip-link:focus-visible { transform: none; }

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-progress); height: 2px;
  background: var(--accent); transform-origin: left; transform: scaleX(0);
}

.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.live-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit;
  animation: ping 2.2s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(2.8); opacity: 0; } }

/* Přechod motivu (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 54px; padding: 0 26px; border: 0; border-radius: 12px;
  font-family: var(--sans); font-size: 15px; font-weight: 500; letter-spacing: -.005em; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease), transform .15s var(--ease), translate .5s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-arrow { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }
.btn-sm { height: 42px; padding: 0 18px; font-size: 14px; border-radius: 10px; }

.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--accent); color: #fff; box-shadow: 0 12px 30px -12px rgba(192, 22, 28, .7); }
.btn-light { background: var(--on-ink); color: var(--ink); }
.btn-light:hover { background: var(--accent); color: #fff; }
.btn-outline-light { background: transparent; color: var(--on-ink); box-shadow: inset 0 0 0 1px var(--line-ink); }
.btn-outline-light:hover { box-shadow: inset 0 0 0 1px var(--on-ink); }

.link-arrow {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; padding-block: 6px;
}
.link-arrow::after { content: "→"; transition: transform .3s var(--ease); }
.link-arrow::before {
  content: ""; position: absolute; left: 0; right: 1.4em; bottom: 2px; height: 1px; background: currentColor;
  transform-origin: right; transition: transform .4s var(--ease);
}
.link-arrow:hover::before { transform: scaleX(0); }
.link-arrow:hover::after { transform: translateX(4px); color: var(--em); }

/* ---------- HEADER ---------- */
.site-header { position: fixed; inset: 0 0 auto; z-index: var(--z-header); }
/* Blur na pseudo-elementu: backdrop-filter přímo na headeru by z něj udělal containing block a fixní mobilní menu by se ořízlo */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  opacity: 0; transition: opacity .3s var(--ease);
}
.site-header.scrolled::before { opacity: 1; }
.header-inner {
  max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter);
  height: var(--header-h); display: flex; align-items: center; gap: 12px;
}
.logo { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; font-size: 16px; letter-spacing: -.02em; }
.logo img { height: 28px; width: auto; transition: transform .5s var(--ease); }
.logo:hover img { transform: rotate(-8deg); }
.nav { display: flex; gap: 4px; margin-left: auto; margin-right: 12px; }
.nav a {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 8px 12px; border-radius: 8px; font-size: 14.5px; font-weight: 500; color: var(--text-2);
  transition: color .2s, background-color .2s;
}
.nav-n { font-family: var(--mono); font-size: 11px; color: var(--muted); transition: color .2s; }
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav a[aria-current="true"] { color: var(--ink); }
.nav a[aria-current="true"] .nav-n { color: var(--accent-ink); }
.nav .nav-contact { display: none; }
.burger { display: none; }

.theme-toggle {
  position: relative; display: grid; place-items: center; flex: none;
  width: 42px; height: 42px; border: 0; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background-color .2s, box-shadow .2s, transform .15s var(--ease);
}
.theme-toggle:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); box-shadow: inset 0 0 0 1px var(--ink); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle svg {
  position: absolute; width: 19px; height: 19px;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .5s var(--ease), opacity .3s var(--ease);
}
[data-theme="light"] .icon-sun, [data-theme="dark"] .icon-moon { opacity: 0; transform: rotate(-90deg) scale(.5); }

/* ---------- HERO ---------- */
.hero {
  min-height: 100svh; display: flex; flex-direction: column;
  padding-top: var(--header-h);
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  flex: 1; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px;
  align-items: center; padding-block: clamp(40px, 7vh, 88px);
}
.hero-copy { grid-column: 1 / span 7; }
.hero-label { margin-bottom: clamp(24px, 4vh, 36px); color: var(--text-2); }
.hero-title {
  font-size: clamp(2.9rem, 6.3vw, 6.4rem); line-height: .98; letter-spacing: -.05em;
  margin-bottom: clamp(24px, 4vh, 36px);
}
.hero-title em { letter-spacing: -.03em; }
.hero-sub { color: var(--text-2); font-size: clamp(1rem, 1.25vw, 1.12rem); margin-bottom: 32px; max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }

/* Terminál v hero */
.hero-visual { grid-column: 8 / -1; width: 100%; }
.term {
  --t-bg: #110F0D; --t-fg: #E9E3D9; --t-dim: #8A8177; --t-line: rgba(243, 239, 232, .1);
  display: flex; flex-direction: column; height: clamp(400px, 56vh, 520px); overflow: hidden;
  border-radius: 16px; background: var(--t-bg); color: var(--t-fg);
  box-shadow: 0 40px 80px -36px rgba(40, 12, 8, .55), inset 0 0 0 1px var(--t-line);
  font-family: var(--mono); font-size: 13.5px; line-height: 1.65;
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--t-line); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(243, 239, 232, .14); }
.term-bar i:first-child { background: var(--accent); }
.term-bar span { margin-inline: auto; padding-right: 51px; font-size: 12px; color: var(--t-dim); }
.term-out { flex: 1; overflow-y: auto; padding: 16px 18px 6px; scrollbar-width: thin; scrollbar-color: rgba(243, 239, 232, .18) transparent; }
.term-out:focus { outline: none; }
.t-line { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.65em; }
.t-cmd { color: #fff; }
.t-cmd::before { content: "❯ "; color: #FF5257; }
.t-prompt { padding-right: 6px; font-weight: 600; color: #FF5257; }
.t-dim { color: var(--t-dim); }
.t-ok { color: #A9C79B; }
.t-key { color: #FFD7A8; }
.t-err { color: #FF8A8D; }
.t-acc { color: #FF5257; }
.term-out a { color: #9CC8FF; text-decoration: underline; text-decoration-color: rgba(156, 200, 255, .4); text-underline-offset: 3px; transition: text-decoration-color .2s; }
.term-out a:hover { text-decoration-color: currentColor; }
.term-out a:focus-visible, .term-chips button:focus-visible { outline: 2px solid #FF5257; outline-offset: 2px; }
.t-caret { display: inline-block; width: .6em; height: 1.15em; vertical-align: -.2em; background: var(--t-fg); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes float { 50% { transform: translateY(-10px); } }
.term-form { display: flex; align-items: center; gap: 4px; padding: 10px 18px; border-top: 1px solid var(--t-line); }
.term-in {
  flex: 1; min-width: 0; height: 32px; border: 0; background: transparent; color: #fff;
  font: inherit; caret-color: #FF5257; outline: none;
}
.term-in::placeholder { color: var(--t-dim); opacity: 1; }
.term-form:focus-within { background: rgba(243, 239, 232, .03); }
.term-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 18px 14px; font-size: 12px; color: var(--t-dim); }
.term-chips button {
  height: 28px; padding: 0 10px; border: 0; border-radius: 6px; cursor: pointer;
  background: rgba(243, 239, 232, .07); color: var(--t-fg); font: inherit;
  transition: background-color .2s, color .2s, transform .15s var(--ease);
}
.term-chips button:hover { background: #FF5257; color: #fff; }
.term-chips button:active { transform: scale(.95); }
.term-chips button:disabled { opacity: .4; cursor: default; }

.spec {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.spec > div { padding: 22px 24px 26px 0; }
.spec > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.spec dt { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.spec dd { font-size: 15px; font-weight: 500; }

/* ---------- PÁS ---------- */
.ticker { overflow: hidden; padding: clamp(20px, 3vw, 36px) 0; border-bottom: 1px solid var(--line); }
.ticker-track {
  display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); width: max-content;
  animation: ticker 38s linear infinite;
}
.ticker span, .ticker em { font-size: clamp(2.4rem, 6.5vw, 5.6rem); line-height: 1.1; letter-spacing: -.045em; white-space: nowrap; }
.ticker span { font-weight: 600; }
.ticker .t-outline { color: transparent; -webkit-text-stroke: 1.2px var(--ink); }
.ticker em { letter-spacing: -.02em; padding-right: .06em; }
.ticker b { font-size: clamp(1.4rem, 3vw, 2.4rem); font-weight: 400; color: var(--em); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- SECTIONS ---------- */
.section { padding-block: clamp(96px, 12vw, 160px) clamp(104px, 13vw, 176px); }
.section-tint { background: var(--paper-2); }
.section-head {
  display: grid; grid-template-columns: 3fr 9fr; gap: 24px;
  margin-bottom: clamp(48px, 7vw, 88px);
}
.section-head .label { padding-top: .9em; align-self: start; }
.section-head h2 { max-width: 15ch; }
.lead { max-width: 58ch; margin-top: 28px; color: var(--text-2); font-size: clamp(1.02rem, 1.3vw, 1.15rem); }

/* Odhalení nadpisů po slovech (slova obaluje script.js) */
.reveal.split { opacity: 1; transform: none; }
.split .w { display: inline-block; overflow: clip; overflow-clip-margin: .2em; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
.split em .w { padding-right: .08em; margin-right: -.08em; }
.split .wi { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease); transition-delay: calc(var(--i, 0) * 55ms + var(--d, 0s)); }
.split.in .wi { transform: none; }

/* ---------- SLUŽBY ---------- */
.services { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 64px; border-top: 1px solid var(--line-strong); }
.service {
  position: relative;
  display: grid; grid-template-columns: 48px 1fr 32px; gap: 6px 16px; align-items: start;
  padding: 30px 0 34px; border-bottom: 1px solid var(--line);
}
.service::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease);
}
.service-n { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: .55em; transition: color .3s; }
.service h3 { font-size: clamp(1.45rem, 2.2vw, 1.85rem); letter-spacing: -.03em; transition: transform .5s var(--ease), color .3s; }
.service p { grid-column: 2; color: var(--text-2); font-size: 15.5px; max-width: 44ch; transition: transform .5s var(--ease); }
.service-icon {
  grid-column: 3; grid-row: 1; width: 26px; height: 26px; margin-top: 4px;
  fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke .3s, transform .5s var(--ease);
}
@media (hover: hover) {
  .service:hover::after { transform: scaleX(1); }
  .service:hover .service-n { color: var(--accent-ink); }
  .service:hover h3, .service:hover p { transform: translateX(8px); }
  .service:hover .service-icon { stroke: var(--accent); transform: rotate(-8deg) scale(1.12); }
}

/* ---------- PROJEKTY ---------- */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(56px, 7vw, 96px) 32px; align-items: start; }
.project { display: flex; flex-direction: column; gap: 24px; }
.project-featured { grid-column: 1 / -1; }
.project-featured .project-thumb { aspect-ratio: 21 / 10; }
a.project { border-radius: 18px; }
a.project:focus-visible { outline-offset: 8px; }
.project-thumb {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  position: relative; overflow: hidden; aspect-ratio: 4 / 3;
  border-radius: 18px; background-color: var(--surface);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px; background-position: -1px -1px;
  box-shadow: inset 0 0 0 1px var(--line);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
/* světlo za kurzorem */
.project-thumb::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(380px circle at var(--mx) var(--my), rgba(227, 30, 36, .14), transparent 60%);
  transition: opacity .4s;
}
.project-thumb.is-tilting { transition: transform .12s linear, box-shadow .6s var(--ease); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow); }
.project-thumb.is-tilting::after { opacity: 1; }
.project-thumb-dark {
  background-color: var(--night);
  background-image: radial-gradient(rgba(243, 239, 232, .16) 1.2px, transparent 1.4px);
  background-size: 22px 22px;
  box-shadow: inset 0 0 0 1px rgba(243, 239, 232, .06);
}
.project-mono {
  position: absolute; left: 24px; top: 18px; z-index: 1;
  font-family: var(--mono); font-size: 13px; color: var(--muted);
}
.project-thumb-dark .project-mono { color: rgba(243, 239, 232, .55); }

/* motiv audio přehrávače: vlnový průběh */
.project-wave {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: clamp(6px, 1vw, 10px);
}
.project-wave i {
  display: block; width: clamp(8px, 1.3vw, 14px); height: 30%; border-radius: 99px; background: var(--ink);
  transform-origin: center; animation: wave 1.6s var(--ease) infinite alternate;
}
.project-wave i:nth-child(3n) { background: var(--accent); }
.project-wave i:nth-child(1)  { height: 18%; animation-delay: -.2s; }
.project-wave i:nth-child(2)  { height: 34%; animation-delay: -.9s; }
.project-wave i:nth-child(3)  { height: 52%; animation-delay: -.4s; }
.project-wave i:nth-child(4)  { height: 28%; animation-delay: -1.2s; }
.project-wave i:nth-child(5)  { height: 44%; animation-delay: -.6s; }
.project-wave i:nth-child(6)  { height: 62%; animation-delay: -1.4s; }
.project-wave i:nth-child(7)  { height: 40%; animation-delay: -.1s; }
.project-wave i:nth-child(8)  { height: 22%; animation-delay: -1s; }
.project-wave i:nth-child(9)  { height: 48%; animation-delay: -.5s; }
.project-wave i:nth-child(10) { height: 30%; animation-delay: -1.3s; }
.project-wave i:nth-child(11) { height: 16%; animation-delay: -.7s; }
.project-wave i:nth-child(12) { height: 24%; animation-delay: -.3s; }
@keyframes wave { to { transform: scaleY(.45); } }

/* motiv portálu táborů: špendlíky na mapě */
.project-pins i {
  position: absolute; width: 18px; height: 18px; border-radius: 50% 50% 50% 0;
  background: var(--accent); transform: rotate(-45deg);
  box-shadow: 0 0 0 6px rgba(227, 30, 36, .16);
  animation: pin 3s var(--ease) infinite;
}
.project-pins i::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--night); }
.project-pins i:nth-child(1) { left: 26%; top: 38%; }
.project-pins i:nth-child(2) { left: 62%; top: 26%; animation-delay: -1s; background: var(--cream); box-shadow: 0 0 0 6px rgba(243, 239, 232, .1); }
.project-pins i:nth-child(3) { left: 48%; top: 64%; animation-delay: -2s; }
@keyframes pin { 50% { transform: rotate(-45deg) translate(3px, -3px); } }

.project-info { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.project-info h3 { font-size: 1.45rem; letter-spacing: -.03em; margin-bottom: 6px; }
.project-info p { color: var(--text-2); font-size: 15.5px; max-width: 42ch; }
.status {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  padding: 6px 10px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line-strong);
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
}
.status .live-dot { width: 6px; height: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin-top: 12px; }
.tags li { font-family: var(--mono); font-size: 12px; padding: 4px 8px; border-radius: 6px; background: var(--paper-3); }
.project-info h3 { transition: color .25s; }
a.project:hover h3 { color: var(--accent-ink); }

/* skutečný screenshot projektu */
.project-shot { background-image: none; }
.project-shot img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  transition: transform 1s var(--ease);
}
a.project:hover .project-shot img { transform: scale(1.03); }
.project-shot::before {
  content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--line);
}
.project-info .project-kicker { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.project-facts { list-style: none; display: grid; gap: 6px; margin-top: 16px; }
.project-facts li { position: relative; padding-left: 18px; font-size: 14.5px; color: var(--text-2); }
.project-facts li::before {
  content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 1.5px; background: var(--accent);
}
.project-featured .project-info p:not(.project-kicker) { max-width: 60ch; }
.status-live { color: var(--ink); transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease); }
.status-live svg { width: 14px; height: 14px; transition: transform .3s var(--ease); }
a.project:hover .status-live { background: var(--accent); color: #fff; box-shadow: none; }
a.project:hover .status-live svg { transform: translate(2px, -2px); }

/* ---------- NÁPADY ---------- */
.ideas {
  list-style: none; display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-strong);
}
.idea { padding: 28px 28px 32px 0; border-bottom: 1px solid var(--line); }
.idea:not(:nth-child(3n + 1)) { padding-left: 28px; border-left: 1px solid var(--line); }
.idea h3 { font-size: 1.3rem; letter-spacing: -.025em; margin-bottom: 10px; }
.idea h3::before { content: "✳"; margin-right: 10px; font-weight: 400; color: var(--em); }
.idea p { color: var(--text-2); font-size: 15.5px; max-width: 36ch; }

/* ---------- FAQ ---------- */
.faq { max-width: 920px; margin-left: calc((100% - 24px) / 4 + 24px); border-top: 1px solid var(--line-strong); }
.faq details { border-bottom: 1px solid var(--line); interpolate-size: allow-keywords; }
.faq summary {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 24px 0; cursor: pointer; list-style: none;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem); font-weight: 500; letter-spacing: -.02em;
  transition: color .2s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-family: var(--mono); font-size: 18px; font-weight: 400;
  transition: transform .4s var(--ease), background-color .25s, color .25s, box-shadow .25s;
}
.faq summary:hover { color: var(--accent-ink); }
.faq summary:focus-visible { outline-offset: -2px; }
.faq details[open] summary::after { transform: rotate(45deg); background: var(--ink); color: var(--on-ink); box-shadow: none; }
.faq details p { padding: 0 64px 26px 0; color: var(--text-2); max-width: 64ch; }
.faq details::details-content { block-size: 0; overflow: clip; transition: block-size .45s var(--ease), content-visibility .45s allow-discrete; }
.faq details[open]::details-content { block-size: auto; }

/* ---------- POSTUP ---------- */
.steps { list-style: none; position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.steps::before, .steps::after {
  content: ""; position: absolute; left: 0; right: 0; top: 15px; height: 1px; background: var(--line-strong);
}
.steps::after { background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 1.6s var(--ease) .2s; }
.steps.in::after { transform: scaleX(1); }
.step { position: relative; }
.step-n {
  position: relative; z-index: 1; display: inline-grid; place-items: center;
  height: 31px; padding: 0 10px; margin-bottom: 28px; border-radius: 8px;
  background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong);
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  transition: background-color .4s var(--ease), color .4s var(--ease), box-shadow .4s var(--ease);
}
.steps.in .step-n { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.steps.in .step:nth-child(1) .step-n { transition-delay: .2s; }
.steps.in .step:nth-child(2) .step-n { transition-delay: .6s; }
.steps.in .step:nth-child(3) .step-n { transition-delay: 1s; }
.steps.in .step:nth-child(4) .step-n { transition-delay: 1.4s; background: var(--accent); color: #fff; }
.step h3 { font-size: 1.5rem; margin-bottom: 10px; }
.step p { color: var(--text-2); font-size: 15.5px; max-width: 32ch; }
.steps-cta { margin-top: clamp(48px, 6vw, 72px); }

/* ---------- O MNĚ ---------- */
.about { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(40px, 7vw, 112px); align-items: center; }
.about-photo {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 20px;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 80% at 20% 0%, rgba(227, 30, 36, .16), transparent 60%),
    var(--paper-3);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .6s var(--ease);
}
.about-photo.is-tilting { transition: transform .12s linear; }
.about-photo img { width: 46%; height: auto; filter: drop-shadow(0 24px 32px rgba(120, 14, 18, .25)); animation: float 7s ease-in-out infinite; }
.about-photo img[src$=".jpg"], .about-photo img[src$=".webp"] { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: none; animation: none; }
.about-photo figcaption {
  position: absolute; left: 16px; bottom: 16px;
  padding: 6px 10px; border-radius: 6px; background: color-mix(in srgb, var(--paper) 85%, transparent);
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
}
.about-text h2 { margin: 20px 0 28px; }
.about-text > p:not(.label) { color: var(--text-2); margin-bottom: 16px; max-width: 58ch; font-size: 1.06rem; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); margin-top: 44px; border-top: 1px solid var(--line-strong); }
.stat { display: flex; flex-direction: column-reverse; gap: 4px; padding: 24px 24px 0 0; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat dd { font-size: clamp(2.6rem, 5vw, 4rem); font-weight: 600; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat dt { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

/* Spolupracovník */
.collab { margin-top: 44px; }
.collab-label { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.collab-card {
  display: flex; align-items: flex-start; gap: 18px; padding: 22px;
  border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.collab-avatar {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
  background: var(--ink); color: var(--on-ink); font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: -.02em;
}
.collab-body h3 { font-size: 1.25rem; letter-spacing: -.025em; margin-bottom: 4px; }
.collab-body p { color: var(--text-2); font-size: 15px; max-width: 52ch; }
.collab-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.collab-links a {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--line-strong); font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  transition: background-color .2s, color .2s, box-shadow .2s, transform .15s var(--ease);
}
.collab-links svg { width: 13px; height: 13px; transition: transform .3s var(--ease); }
.collab-links a:hover { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.collab-links a:hover svg { transform: translate(2px, -2px); }
.collab-links a:active { transform: scale(.96); }
@media (max-width: 560px) {
  .collab-card { flex-direction: column; }
}

/* ---------- KONTAKT + FOOTER (inverzní zakončení) ---------- */
.contact, .footer { background: var(--ink); color: var(--on-ink); }
.contact { position: relative; overflow: hidden; isolation: isolate; padding-block: clamp(104px, 13vw, 176px) clamp(72px, 9vw, 120px); }
.contact-glow {
  --mx: 70%; --my: 30%;
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(600px circle at var(--mx) var(--my), rgba(227, 30, 36, .22), transparent 60%);
  transition: background-position .3s;
}
.contact .label { color: var(--on-ink-muted); }
.contact em { color: var(--accent-on-ink); }
.contact-title { font-size: clamp(2.6rem, 7.4vw, 6.6rem); letter-spacing: -.05em; max-width: 13ch; margin: 24px 0 clamp(48px, 6vw, 80px); }
.contact-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px;
  padding-top: 32px; border-top: 1px solid var(--line-ink);
}
.contact-mail {
  position: relative; font-size: clamp(1.3rem, 3vw, 2.2rem); font-weight: 500; letter-spacing: -.03em;
  overflow-wrap: anywhere; transition: color .25s;
}
.contact-mail::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor;
  transform: scaleX(.12); transform-origin: left; transition: transform .5s var(--ease);
}
.contact-mail:hover { color: var(--accent-on-ink); }
.contact-mail:hover::after { transform: scaleX(1); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.contact :focus-visible, .footer :focus-visible { outline-color: var(--accent-on-ink); }

.footer { padding-bottom: 32px; }
.footer-grid {
  display: grid; grid-template-columns: 6fr 3fr 3fr; gap: 40px;
  padding: 56px 0; border-top: 1px solid var(--line-ink);
}
.footer-grid > div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.footer-grid p { color: var(--on-ink-muted); font-size: 15px; }
.footer-brand .logo { margin-bottom: 8px; }
.footer-h { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: .02em; color: var(--on-ink-muted); margin-bottom: 6px; }
.footer-grid a:not(.logo), .footer-bottom a { transition: color .2s; }
.footer-grid a:not(.logo):hover, .footer-bottom a:hover { color: var(--accent-on-ink); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 12px; padding-top: 24px; border-top: 1px solid var(--line-ink);
  font-family: var(--mono); font-size: 12.5px; color: var(--on-ink-muted);
}

/* ---------- TOAST ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: var(--z-toast);
  padding: 12px 18px; border-radius: 10px; background: var(--ink); color: var(--on-ink);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .55);
  font-size: 14.5px; font-weight: 500;
  opacity: 0; transform: translate(-50%, 16px) scale(.96); pointer-events: none;
  transition: opacity .25s var(--ease), transform .35s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ---------- REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.hero-visual.reveal { transform: translateY(28px) scale(.98); transition-duration: 1.2s; }
.hero-visual.reveal.in { transform: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1080px) {
  .hero-grid { row-gap: 56px; }
  .hero-copy { grid-column: 1 / -1; }
  .hero-visual { grid-column: 2 / span 10; max-width: 620px; justify-self: center; }
  .spec { grid-template-columns: repeat(2, 1fr); }
  .spec > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .spec > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .services { column-gap: 40px; }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 48px; }
  .steps::before, .steps::after { display: none; }
  .steps .step-n { background: var(--ink); color: var(--on-ink); box-shadow: none; }
}

@media (max-width: 820px) {
  :root { --header-h: 64px; }
  body { font-size: 16px; }
  .header-cta { margin-left: auto; }
  .nav { margin-right: 0; }
  .burger {
    position: relative; display: grid; place-content: center; gap: 6px; flex: none;
    width: 42px; height: 42px; border: 0; border-radius: 10px; cursor: pointer;
    background: var(--ink); transition: background-color .2s, transform .15s var(--ease);
  }
  .burger:active { transform: scale(.94); }
  .burger span { display: block; width: 16px; height: 1.5px; background: var(--on-ink); border-radius: 2px; transition: transform .35s var(--ease); }
  .burger[aria-expanded="true"] { background: var(--accent); }
  .burger[aria-expanded="true"] span { background: #fff; }
  .burger[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .burger[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .nav {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; justify-content: flex-end; gap: 0;
    padding: calc(var(--header-h) + 24px) var(--gutter) max(40px, env(safe-area-inset-bottom));
    background: var(--paper);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .3s var(--ease), visibility .3s;
  }
  .nav.open { opacity: 1; visibility: visible; pointer-events: auto; }
  .nav a {
    gap: 14px; padding: 14px 0; border-radius: 0; border-bottom: 1px solid var(--line);
    font-size: clamp(2rem, 9vw, 2.8rem); font-weight: 600; letter-spacing: -.04em; color: var(--ink);
    transform: translateY(12px); opacity: 0; transition: transform .5s var(--ease), opacity .5s var(--ease), color .2s;
  }
  .nav a:hover { background: none; color: var(--accent-ink); }
  .nav.open a { transform: none; opacity: 1; }
  .nav.open a:nth-child(2) { transition-delay: .04s; }
  .nav.open a:nth-child(3) { transition-delay: .08s; }
  .nav.open a:nth-child(4) { transition-delay: .12s; }
  .nav.open a:nth-child(5) { transition-delay: .16s; }
  .nav .nav-contact { display: inline-flex; }
  .nav-n { font-size: 12px; }

  .hero { min-height: 0; }
  .hero-grid { padding-block: 40px 56px; }
  .hero-visual { grid-column: 1 / -1; width: 100%; }
  .hero-cta .btn { flex: 1 1 auto; }
  .section-head { grid-template-columns: 1fr; gap: 16px; }
  .section-head .label { padding-top: 0; }
  .services { grid-template-columns: 1fr; }
  .service { grid-template-columns: 40px 1fr 26px; padding: 24px 0 26px; }
  .projects { grid-template-columns: 1fr; gap: 56px; }
  .project-featured .project-thumb { aspect-ratio: 4 / 3; }
  .ideas { grid-template-columns: 1fr 1fr; }
  .idea, .idea:not(:nth-child(3n + 1)) { padding: 24px 20px 26px 0; border-left: 0; }
  .idea:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
  .faq { margin-left: 0; }
  .about { grid-template-columns: 1fr; }
  .about-photo { aspect-ratio: 16 / 11; }
  .about-photo img { width: 30%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .header-cta { display: none; }
  .theme-toggle { margin-left: auto; }
  .spec { grid-template-columns: 1fr; }
  .spec > div, .spec > div + div { padding: 16px 0; border-left: 0; }
  .spec > div + div { border-top: 1px solid var(--line); }
  .term { height: 440px; font-size: 12.5px; }
  .term-out, .term-form { padding-inline: 14px; }
  .term-chips { padding-inline: 14px; }
  .steps { grid-template-columns: 1fr; row-gap: 36px; }
  .project-info { flex-direction: column; gap: 12px; }
  .ideas { grid-template-columns: 1fr; }
  .idea:nth-child(n) { padding: 22px 0 24px; border-left: 0; }
  .faq details p { padding-right: 0; }
  .contact-actions, .contact-actions .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .split .wi { transform: none; }
}

/* Tmavé prvky v tmavém motivu potřebují světlou hranu, jinak splynou s pozadím */
[data-theme="dark"] .term,
[data-theme="dark"] .project-thumb-dark { box-shadow: 0 30px 50px -24px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(243, 239, 232, .14); }
