/* ───────── tokens ─────────
   Neutrální tmavá škála a jediný limetkový akcent.
   Tvarový systém: tlačítka a štítky jsou plné pilulky, karty 16 px, nic jiného zaoblené není.
   Vrstvy: pozadí 0, obsah 1, lišta 20, skip 50. */
:root {
  --h: 82;                               /* odstín akcentu */
  /* neutrální škála bez barevného nádechu */
  --bg:      #09090b;
  --bg-2:    #101012;                    /* karty */
  --fg:      #e8e8e5;                    /* hlavní text */
  --muted:   #9a9a9f;                    /* 6.9:1 na --bg */
  --dim:     #76767c;                    /* drobné popisky, ~4.6:1 */
  --faint:   #3c3c41;
  --line:    rgba(255, 255, 255, .08);
  --n-a10:   rgba(255, 255, 255, .1);    /* neutrální čáry grafu */
  --n-a20:   rgba(255, 255, 255, .2);

  --accent:     hsl(var(--h) 78% 66%);   /* #c3eb68 */
  --accent-a08: hsl(var(--h) 78% 66% / .08);
  --accent-a20: hsl(var(--h) 78% 66% / .2);
  --accent-a40: hsl(var(--h) 78% 66% / .4);
  --accent-ink: hsl(var(--h) 40% 10%);   /* text na akcentu */

  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1200px;

  --mx: -999px;
  --my: -999px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--muted);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
strong { color: var(--fg); font-weight: 500; }
.mono { font-family: var(--mono); }
.acc { color: var(--accent); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ───────── fotka vpravo ─────────
   .photo       – svislý fade
   .photo__fade – radiální fade, obaluje fotku i světlo (nic nevyjde za okraj) */
.photo {
  position: fixed; right: 0; top: 0; width: 58vw; max-width: 980px; height: 100vh;
  pointer-events: none; z-index: 0;
  transition: opacity 1s var(--ease);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 60%, transparent 95%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 60%, transparent 95%);
}
.photo__fade {
  position: absolute; inset: 0;
  -webkit-mask-image: radial-gradient(ellipse 48% 50% at 52% 40%,
    #000 0%, rgba(0,0,0,.75) 25%, rgba(0,0,0,.4) 50%, rgba(0,0,0,.12) 72%, transparent 92%);
          mask-image: radial-gradient(ellipse 48% 50% at 52% 40%,
    #000 0%, rgba(0,0,0,.75) 25%, rgba(0,0,0,.4) 50%, rgba(0,0,0,.12) 72%, transparent 92%);
}
.photo__img {
  position: absolute; inset: 0;
  background: url("assets/portrait.webp") 46% 26% / cover no-repeat;
  filter: grayscale(1) contrast(1.08);
  opacity: .14;
}
.photo__lamp {
  opacity: .26;
  -webkit-mask-image: radial-gradient(circle 220px at var(--mx) var(--my), #000, rgba(0,0,0,.4) 45%, transparent 100%);
          mask-image: radial-gradient(circle 220px at var(--mx) var(--my), #000, rgba(0,0,0,.4) 45%, transparent 100%);
}
body.is-scrolled .photo { opacity: .45; }

/* ───────── agent runtime: fixní pozadí vlevo ─────────
   graf nahoře, log pod ním; ztlumené a k okrajům se rozplývá do černé */
.rt {
  position: fixed; left: 0; top: 0; z-index: 0;
  width: 50vw; max-width: 760px; height: 100vh;
  margin: 0; padding: 72px 0 40px clamp(16px, 3vw, 48px);
  display: flex; flex-direction: column; justify-content: center;
  pointer-events: none;
  opacity: .36; transition: opacity 1s var(--ease);
  -webkit-mask-image: linear-gradient(to right, #000 60%, transparent 100%), linear-gradient(to bottom, transparent 4%, #000 16%, #000 84%, transparent 98%);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to right, #000 60%, transparent 100%), linear-gradient(to bottom, transparent 4%, #000 16%, #000 84%, transparent 98%);
          mask-composite: intersect;
}
body.is-scrolled .rt { opacity: .2; }
.rt__head {
  display: flex; justify-content: flex-start; align-items: center; gap: 16px;
  padding: 0 0 6px 18px;
  font-size: 11px; color: var(--faint);
}
.rt__live { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; flex-shrink: 0; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.rt__run { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt__body { display: flex; flex-direction: column; gap: 8px; }
.agents { display: block; width: 100%; height: auto; max-height: 42vh; padding: 0; }
.rt__log {
  list-style: none; margin: 0; padding: 0 18px;
  height: 34vh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  font-size: 12px; line-height: 1.75; color: var(--dim);
  -webkit-mask-image: linear-gradient(transparent, #000 30%);
          mask-image: linear-gradient(transparent, #000 30%);
}
.rt__log li { padding-left: calc(var(--d, 0) * 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .5s var(--ease); animation: logIn .3s var(--ease); }
@keyframes logIn { from { opacity: 0; transform: translateY(4px); } }
.rt__log .ts { color: var(--faint); margin-right: 12px; }
.rt__log .who { color: var(--faint); margin-right: 8px; }
.rt__log .dur { color: var(--faint); margin-left: 8px; }
.rt__log .req { color: var(--fg); }
.rt__log .req .who { color: var(--muted); }
.rt__log .plan .who, .rt__log .call .who, .rt__log .spawn .who { color: var(--accent); opacity: .75; }
.rt__log .plan { color: var(--muted); }
.rt__log .spawn { color: var(--fg); }
.rt__log .call { color: #b4b4b9; }
.rt__log .res, .rt__log .ok { color: var(--dim); }
.rt__log .warn { color: var(--muted); }
.rt__log .err { color: #c98a7a; }
.rt__log .done { color: var(--accent); }
.rt__log .cur::after { content: ""; display: inline-block; width: 6px; height: 12px; margin-left: 6px; vertical-align: -1px; background: var(--accent); animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* hrany */
.agents .e { stroke: var(--n-a10); stroke-width: 1; transition: stroke 1.2s var(--ease), opacity .8s var(--ease); }
.agents .e.on { stroke: var(--accent-a40); transition-duration: .25s, .8s; }
.agents .e.dash { stroke-dasharray: 3 4; opacity: 0; }
.agents .e.dash.in { opacity: 1; }
.agents .e.out { opacity: 0; }

/* uzly */
.agents .nd { transition: opacity .8s var(--ease); }
.agents .nd.sp { opacity: 0; }
.agents .nd.sp.in { opacity: 1; }
.agents .n { fill: var(--bg-2); stroke: var(--n-a20); stroke-width: 1; transition: stroke 1s var(--ease); }
.agents .nd-orch .n { stroke: rgba(255, 255, 255, .32); }
.agents .nd-agent .n { stroke: rgba(255, 255, 255, .28); }
.agents .t { font: 10px var(--mono); fill: #5a5a60; letter-spacing: .04em; text-anchor: middle; transition: fill 1s var(--ease); }
.agents .nd-agent .t, .agents .nd-orch .t { fill: #8a8a90; }
.agents .on > .n { stroke: var(--accent); transition-duration: .2s; }
.agents .on > .t { fill: var(--muted); transition-duration: .2s; }
.agents .ring { fill: none; stroke: var(--accent); stroke-width: 1; opacity: 0; transform-box: fill-box; transform-origin: center; }
.agents .on > .ring { animation: ring 1.1s var(--ease); }
@keyframes ring { 0% { opacity: .55; transform: scale(1); } 100% { opacity: 0; transform: scale(3.2); } }
/* sub-agent pracuje = točí se mu vlastní malá smyčka */
.agents .spin { fill: none; stroke: var(--n-a10); stroke-dasharray: 2 5; transform-box: fill-box; transform-origin: center; transition: stroke .4s; }
.agents .busy .spin { stroke: var(--accent-a40); animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* smyčka orchestrátoru: plan → act → observe → reflect */
.agents .loop-ring { fill: none; stroke: var(--n-a10); stroke-dasharray: 1 5; }
.agents .ph { font: 9px var(--mono); fill: #45454b; letter-spacing: .06em; transition: fill .5s var(--ease); }
.agents .ph.on { fill: var(--accent); }
.agents .marker { fill: var(--accent); transform-box: view-box; transform-origin: 200px 150px; transition: transform .7s var(--ease); }

/* pulzy: tam akcent, zpět (výsledek) světle šedá */
.agents .pulse { fill: var(--accent); }
.agents .pulse.back { fill: #b8b8bd; }
.agents .trail { stroke: var(--accent); stroke-width: 1.2; stroke-linecap: round; opacity: .4; }
.agents .trail.back { stroke: #b8b8bd; opacity: .25; }


/* ───────── horní lišta ───────── */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px var(--gutter);
  background: linear-gradient(rgba(9, 9, 11, .94) 40%, transparent);
}
.bar__id { color: var(--fg); font-weight: 600; font-size: 18px; letter-spacing: -.02em; padding: 8px 0; }
.bar__nav { display: flex; gap: 28px; font-size: 14px; }
.bar__nav a { padding: 10px 0; transition: color .2s; position: relative; }
.bar__nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.bar__nav a:hover, .bar__nav a.is-active { color: var(--fg); }
.bar__nav a.is-active::after, .bar__nav a:hover::after { transform: scaleX(1); }

main, .foot { position: relative; z-index: 1; }

/* ───────── hero ───────── */
.hero {
  max-width: var(--max); margin: 0 auto;
  min-height: 100dvh; padding: 96px var(--gutter) 72px;
  display: flex; flex-direction: column; justify-content: center;
}
.hero__kicker {
  margin: 0 0 22px; display: inline-flex; align-items: center; gap: 10px;
  color: var(--accent); font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
}
.hero__name {
  margin: 0; color: var(--fg); font-weight: 600;
  font-size: clamp(52px, 9vw, 120px); line-height: .95; letter-spacing: -.045em;
}
.hero__lede { margin: 28px 0 0; max-width: 34ch; font-size: clamp(18px, 1.7vw, 21px); line-height: 1.5; color: var(--muted); }
.hero__lede .acc { color: var(--fg); background: linear-gradient(transparent 62%, var(--accent-a20) 62%); padding: 0 2px; }

.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }
.btn {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; white-space: nowrap;
  border-radius: 999px; border: 1px solid var(--n-a20); background: rgba(14, 14, 16, .92);
  color: var(--fg); font-size: 15px; font-weight: 500;
  transition: border-color .2s, background .2s, transform .15s var(--ease);
}
.btn:hover { border-color: var(--fg); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: hsl(var(--h) 85% 72%); border-color: hsl(var(--h) 85% 72%); }

/* ───────── sekce: popisek vlevo (sticky), obsah vpravo ───────── */
.sec {
  max-width: var(--max); margin: 0 auto;
  padding: 80px var(--gutter);
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 48px;
}
.sec:first-of-type { border-top: 0; }
.sec__h {
  margin: 0; align-self: start; position: sticky; top: 96px;
  display: flex; gap: 12px; align-items: baseline;
  font-size: clamp(26px, 2.6vw, 34px); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; color: var(--fg);
}
.sec__body { max-width: 680px; }

.prose p { margin: 0 0 16px; }
.big { margin: 0 0 24px; color: var(--fg); font-size: clamp(22px, 2.4vw, 28px); line-height: 1.35; letter-spacing: -.02em; font-weight: 500; }

/* praxe */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 40px; }
.item { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px; }
.item__date { font-size: 12px; color: var(--dim); padding-top: 4px; text-align: right; }
.item:first-child .item__date { color: var(--accent); }
.item h3 { margin: 0 0 8px; color: var(--fg); font-size: 17px; font-weight: 500; line-height: 1.4; }
.item p { margin: 0; font-size: 15px; }

.tags { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font-size: 12px; line-height: 1; padding: 6px 10px; border-radius: 999px;
  color: hsl(var(--h) 60% 76%); background: var(--accent-a08); border: 1px solid hsl(var(--h) 78% 66% / .12);
}

/* projekty */
.projects { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: none; }
.proj--main { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 16px 28px 16px 16px; }
.proj__shot { margin: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--bg); border: 1px solid var(--line); }
.proj__shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .8s var(--ease); }
.proj--main:hover .proj__shot img { transform: scale(1.02); }
.proj:not(.proj--main) { max-width: 560px; margin-left: auto; width: 100%; }
.proj {
  position: relative; padding: 28px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(20, 20, 22, .9), rgba(12, 12, 14, .9));
  transition: border-color .3s, transform .3s var(--ease);
}
.proj__meta { font-size: 12px; color: var(--dim); }
.proj h3 { margin: 10px 0 10px; color: var(--fg); font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.proj p { margin: 0; font-size: 15px; }
.arr { display: inline-block; color: var(--dim); transition: transform .25s var(--ease), color .25s; }
.stretch::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
@media (hover: hover) {
  .proj:hover { border-color: var(--accent-a40); transform: translateY(-2px); }
  .proj:hover .arr { color: var(--accent); transform: translate(2px, -2px); }
}

/* kontakt */
.mail {
  display: inline-flex; gap: 12px; align-items: center;
  color: var(--fg); font-size: clamp(20px, 2.6vw, 28px); font-weight: 500; letter-spacing: -.02em;
  padding: 6px 0; border-bottom: 1px solid var(--accent); max-width: 100%; overflow-wrap: anywhere;
  transition: color .2s;
}
.mail span { color: var(--accent); transition: transform .25s var(--ease); }
.mail:hover { color: var(--accent); }
.mail:hover span { transform: translateX(6px); }

.profiles { display: flex; gap: 28px; margin: 28px 0 0; }
.profiles a { color: var(--muted); padding: 10px 0; transition: color .2s; }
.profiles a:hover { color: var(--accent); }

.foot {
  max-width: var(--max); margin: 0 auto;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 24px var(--gutter) 32px; font-size: 12px; color: var(--dim);
  border-top: 1px solid var(--line);
}

/* reveal */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.rv.in { opacity: 1; transform: none; }

/* ───────── tablet / mobil ───────── */
@media (max-width: 900px) {
  .sec { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 56px var(--gutter); }
  .sec__h { position: static; }
  .proj--main { grid-template-columns: minmax(0, 1fr); padding: 14px 14px 22px; }
  .proj:not(.proj--main) { max-width: none; }
}
@media (max-width: 640px) {
  .bar__nav a:not(:last-child) { display: none; }

  .photo { position: absolute; width: 100%; height: 620px; }
  .photo__img { opacity: .2; background-position: 50% 16%; }
  .photo__fade {
    -webkit-mask-image: radial-gradient(ellipse 50% 46% at 60% 34%, #000 0%, rgba(0,0,0,.6) 35%, rgba(0,0,0,.18) 65%, transparent 92%);
            mask-image: radial-gradient(ellipse 50% 46% at 60% 34%, #000 0%, rgba(0,0,0,.6) 35%, rgba(0,0,0,.18) 65%, transparent 92%);
  }
  .photo__lamp { display: none; }
  body.is-scrolled .photo { opacity: 1; }
  .rt { width: 100vw; max-width: none; padding: 64px 0 24px; opacity: .3; }
  body.is-scrolled .rt { opacity: .15; }
  .rt__log .ts { display: none; }

  .hero { min-height: 88svh; justify-content: flex-end; padding-bottom: 48px; }

  .item { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .item__date { text-align: left; }
  .proj { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .rv { opacity: 1; transform: none; }
}
