:root {
  --bg: #fcfbf8;
  --ink: #141413;
  --ink-2: #57554f;
  --ink-3: #8f8c84;
  --line: #e9e6df;
  --card: #f5f3ee;
  --card-hover: #f1eee7;
  --mars: #c4643c;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --spring: cubic-bezier(.34, 1.3, .64, 1);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --col: 720px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font: 400 15.5px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* soft warm glow at the top, like morning light */
body::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 520px; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 100% at 50% 0%, rgba(232, 190, 150, .16), transparent 70%);
}
a { color: inherit; text-decoration: none; }
b { font-weight: 500; }
.serif { font-family: var(--serif); font-optical-sizing: auto; }
.muted { color: var(--ink-2); }
.dot-sep { color: var(--ink-3); margin: 0 .3em; }
::selection { background: rgba(196, 100, 60, .18); }

/* ── underline that draws in from the left, leaves to the right ── */
.u {
  background: linear-gradient(currentColor, currentColor) right bottom / 0 1px no-repeat;
  transition: background-size .55s var(--ease);
  padding-bottom: 1px;
}
.u:hover, .u:focus-visible { background-size: 100% 1px; background-position: left bottom; }

/* ── top bar (corners, à la zegzulka) ── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 14px 20px; font-size: 13.5px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.topbar-mid { display: flex; gap: 18px; }
.topbar-right { display: flex; gap: 16px; justify-self: end; }
.topbar-name { justify-self: start; font-weight: 500; }

main, .footer { max-width: var(--col); margin: 0 auto; padding: 0 20px; }

/* ── intro ── */
.intro { padding: 72px 0 56px; }
.intro-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
h1 { font-size: 30px; font-weight: 500; letter-spacing: -.01em; line-height: 1.2; }
.intro-head p { font-size: 15px; margin-top: 4px; }
.socials { display: flex; gap: 8px; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 12px; color: var(--ink-2); background: var(--bg);
  transition: transform .4s var(--spring), color .2s, border-color .2s;
}
.icon-btn:hover { transform: translateY(-2px) scale(1.05); color: var(--ink); border-color: #d6d2c8; }

.intro-body { display: grid; grid-template-columns: 1fr 200px; gap: 40px; align-items: center; margin-top: 44px; }
.lede { font-size: 22px; line-height: 1.7; color: #1f1e1c; }
.portrait {
  border-radius: 18px; overflow: hidden; background: #0d0d0d; aspect-ratio: 5 / 7;
  box-shadow: 0 24px 48px -32px rgba(20, 20, 19, .55);
  transition: transform .6s var(--spring), box-shadow .5s;
}
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.portrait:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 30px 56px -30px rgba(20, 20, 19, .6); }
.portrait:hover img { transform: scale(1.04); }

/* hover notes (dotted underline + floating tooltip) */
.note {
  position: relative; cursor: help; outline: none;
  background: linear-gradient(90deg, var(--ink-3) 50%, transparent 0) left bottom / 4px 1px repeat-x;
  padding-bottom: 1px;
}
.note::after {
  content: attr(data-note);
  position: absolute; left: 50%; bottom: calc(100% + 10px); width: max-content; max-width: 260px;
  font: 400 13px/1.45 var(--sans); color: var(--ink-2); text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  box-shadow: 0 8px 24px -12px rgba(20, 20, 19, .25);
  opacity: 0; transform: translate(-50%, 6px); pointer-events: none;
  transition: opacity .25s var(--ease), transform .35s var(--ease);
  z-index: 5;
}
.note:hover::after, .note:focus::after { opacity: 1; transform: translate(-50%, 0); }
.note-mars { background-image: linear-gradient(90deg, var(--mars) 50%, transparent 0); }

/* ── sections ── */
.section { padding: 48px 0; border-top: 1px solid var(--line); }
.label, .sublabel {
  font: 500 15px/1.2 var(--sans); letter-spacing: .11em; text-transform: uppercase; color: var(--ink-2);
  margin-bottom: 30px;
}
.sublabel { font-size: 12px; color: var(--ink-3); margin-bottom: 14px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-aside { font-size: 12.5px; color: var(--ink-3); }

.prose p { color: var(--ink-2); margin-top: 14px; max-width: 62ch; }
.prose p:first-child { margin-top: 0; }
.serif-em { font-family: var(--serif); font-size: 1.12em; color: var(--ink); }

/* reveal on scroll — one gentle fade, once */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ── distance track ── */
.track { position: relative; display: flex; align-items: flex-start; padding: 44px 0 40px; }
.stop { display: flex; flex-direction: column; align-items: center; width: 92px; flex: none; text-align: center; }
.stop-home { align-items: flex-start; text-align: left; width: 70px; }
.stop-mars { align-items: flex-end; text-align: right; width: 70px; }
.pin { width: 11px; height: 11px; border-radius: 50%; background: var(--ink); margin: 0 0 12px; }
.pin-now { box-shadow: 0 0 0 0 rgba(20, 20, 19, .35); animation: ping 2.6s var(--ease) infinite 2.4s; }
.pin-mars { background: var(--mars); width: 13px; height: 13px; margin-top: -1px; }
.stop-name { font: 500 17px/1.2 var(--serif); }
.stop-meta { font-size: 12px; color: var(--ink-3); margin-top: 3px; white-space: nowrap; }
.seg { flex: 1; position: relative; height: 11px; }
.seg::before { content: ""; position: absolute; left: -36px; right: -36px; top: 5px; height: 1px; }
.stop-home + .seg::before { left: -58px; }
.seg-next::before { right: -58px; }
.seg-done::before {
  background: var(--ink); transform-origin: left; transform: scaleX(0);
  transition: transform 2.2s var(--ease) .1s;
}
.in .seg-done::before { transform: scaleX(1); }
.seg-next::before { background: linear-gradient(90deg, var(--ink-3) 40%, transparent 0) 0 0 / 7px 1px repeat-x; }
.seg-label {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  font: 12px var(--mono); color: var(--ink-2); white-space: nowrap;
}
.seg-next .seg-label { color: var(--mars); }

.walker {
  position: absolute; top: 2px; left: 0; width: 26px;
  transition: left 2.2s var(--ease) .1s;
}
.in .walker { left: calc(50% - 13px); }
.astro { display: block; width: 26px; height: auto; shape-rendering: crispEdges; animation: bob 2.4s ease-in-out infinite; }

@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(20,20,19,.3); } 70%, 100% { box-shadow: 0 0 0 10px rgba(20,20,19,0); } }
@keyframes bob { 50% { transform: translateY(-3px); } }

.ms { position: absolute; top: 5px; transform: translate(-50%, -50%); }
.ms i {
  display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%;
  border: 1px solid var(--ink-3); background: var(--bg);
  font: normal 500 10px/1 var(--mono); color: var(--ink-2);
}
.milestones {
  list-style: none; margin: -14px 0 36px calc(50% - 6px); max-width: 360px;
}
.milestones li { display: grid; grid-template-columns: 17px 1fr auto; gap: 10px; align-items: baseline; padding: 4px 0; font-size: 13.5px; color: var(--ink-2); }
.ms-n {
  display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%;
  border: 1px solid var(--ink-3); font: 500 10px/1 var(--mono); align-self: center;
}
.milestones time { font: 12px var(--mono); color: var(--mars); white-space: nowrap; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 36px; }
.stats dt { font-size: 32px; font-weight: 400; line-height: 1.1; letter-spacing: -.01em; }
.stats dd { font-size: 13px; color: var(--ink-2); margin-top: 6px; line-height: 1.45; }

/* ── cards ── */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  transition: transform .5s var(--spring), background-color .3s, border-color .3s, box-shadow .4s;
}
.card:hover {
  transform: translateY(-3px) scale(1.012); background: var(--card-hover); border-color: #e0dcd2;
  box-shadow: 0 16px 36px -24px rgba(20, 20, 19, .28);
}
.card-wide { grid-column: 1 / -1; flex-direction: row; align-items: stretch; }
.card-text { padding: 22px 24px 24px; }
.card-wide .card-text { flex: 1 1 52%; padding: 28px; }
.eyebrow { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.card h3 { font-size: 23px; font-weight: 500; line-height: 1.2; letter-spacing: -.005em; margin-bottom: 8px; }
.card p { font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
.card p b { color: var(--ink); }

.card-art { flex: none; }
.art-center { display: grid; place-items: center; height: 156px; border-bottom: 1px solid var(--line); background: #faf9f6; }
.ascii { font: 13px/1.25 var(--mono); color: var(--ink-2); }
.views { color: var(--ink); }

/* robot tutor scene */
.scene {
  flex: 1 1 48%; margin: 18px 18px 18px 0; border-radius: 12px; min-height: 190px;
  background: #faf9f6; border: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden;
}
.tutor { width: 92%; max-width: 360px; height: auto; overflow: visible; }
.tutor g { transform-box: fill-box; }
.robot { animation: hover 2.4s ease-in-out infinite; }
.tutor .tip { animation: tip 1.6s steps(1) infinite; }
.robot .eye { animation: blink 4.2s steps(1) infinite; transform-box: fill-box; transform-origin: center; }
@keyframes hover { 50% { transform: translateY(-1px); } }
@keyframes tip { 50% { fill: #f2c14e; } }
@keyframes blink { 0%, 94% { transform: scaleY(1); } 95%, 100% { transform: scaleY(.1); } }

/* 7s story: student asks → robot explains → idea clicks */
.bubble { opacity: 0; transform-origin: bottom center; }
.qb { animation: ask 7s var(--ease) infinite; }
.rb { animation: talk 7s var(--ease) infinite; }
.lb { animation: idea 7s var(--spring) infinite; }
.student { animation: hop 7s ease-in-out infinite; }
.dot { animation: dots 1s steps(1) infinite; }
.d2 { animation-delay: .2s; }
.d3 { animation-delay: .4s; }
@keyframes ask  { 0%, 3% { opacity: 0; transform: scale(.6); } 8%, 34% { opacity: 1; transform: none; } 39%, 100% { opacity: 0; } }
@keyframes talk { 0%, 30% { opacity: 0; transform: scale(.6); } 35%, 58% { opacity: 1; transform: none; } 62%, 100% { opacity: 0; } }
@keyframes idea { 0%, 60% { opacity: 0; transform: scale(.4); } 66%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
@keyframes hop  { 0%, 62% { transform: none; } 65% { transform: translateY(-2px); } 68%, 100% { transform: none; } }
@keyframes dots { 50% { opacity: 0; } }

/* ecg */
.ecg { width: 230px; max-width: 80%; height: auto; overflow: visible; }
.ecg polyline {
  fill: none; stroke: var(--ink); stroke-width: 1.3;
  stroke-dasharray: 1; stroke-dashoffset: 0; stroke-linejoin: round;
}
.card:hover .ecg polyline { animation: trace 1.6s linear infinite; }
@keyframes trace { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }

/* video screen */
.screen-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.screen {
  display: grid; place-items: center; width: 118px; height: 66px;
  border: 1px solid var(--ink-2); border-radius: 4px; color: var(--ink);
}
.screen svg { margin-left: 2px; transition: transform .5s var(--spring); }
.card:hover .screen svg { transform: scale(1.3); }

/* earth */
.globe { fill: none; stroke: var(--ink); stroke-width: 1.1; overflow: visible; }
.globe .mer { transition: rx .9s var(--ease); }
.card:hover .globe .m1 { rx: 22px; }
.card:hover .globe .m2 { rx: 4px; }

/* map: Czechia → UK, Germany */
.map { overflow: visible; max-width: 70%; height: auto; }
.map .land { fill: none; stroke: var(--ink-3); stroke-width: .8; stroke-linejoin: round; }
.map .home { stroke: var(--ink); fill: rgba(196, 100, 60, .08); }
.map .route { fill: none; stroke: var(--mars); stroke-width: 1.2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.map .city { fill: var(--ink); }
.map .end { fill: var(--mars); }
.card:hover .map .route { animation: draw 1.4s var(--ease) both; }
.card:hover .map .r2 { animation-delay: .25s; }
.card:hover .map .end { animation: land .4s var(--spring) 1.2s both; transform-box: fill-box; transform-origin: center; }
.card:hover .map .e2 { animation-delay: 1.45s; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes land { from { transform: scale(0); } to { transform: scale(1); } }

/* three small items */
.card-row { display: grid; grid-template-columns: repeat(3, 1fr); }
.card-row:hover { transform: none; box-shadow: none; background: var(--card); }
.mini { padding: 22px 24px 24px; border-left: 1px solid var(--line); transition: background-color .3s; }
.mini:first-child { border-left: 0; }
.mini:hover { background: var(--card-hover); }
.mini h3 { font-size: 19px; }
.mini p { font-size: 13.5px; }

/* ── path rows (à la wustep) ── */
.rows { list-style: none; }
.rows li {
  display: grid; grid-template-columns: 24px 210px 1fr auto; align-items: center; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14.5px;
  transition: padding-left .4s var(--spring);
}
.rows li:first-child { padding-top: 0; }
.rows li:hover { padding-left: 4px; }
.rows span { color: var(--ink-2); }
.rows time { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 14px; }
.mono-ico {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; font: 500 11px var(--mono); color: var(--ink) !important;
}

/* ── vision ── */
.conviction { font-size: 24px; line-height: 1.55; color: #1f1e1c; max-width: 34em; }
.conviction em, .vision em { font-style: italic; }
.visions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 36px; }
.vision {
  padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #fff;
  transition: transform .5s var(--spring), box-shadow .4s;
}
.vision:hover { transform: translateY(-3px); box-shadow: 0 16px 36px -26px rgba(20, 20, 19, .3); }
.v-num { font: 12px var(--mono); color: var(--ink-3); }
.vision h3 { font-size: 23px; font-weight: 500; margin: 8px 0 10px; }
.vision p { font-size: 14.5px; color: var(--ink-2); margin-top: 10px; }

.mars { display: flex; gap: 28px; align-items: center; margin-top: 40px; padding: 8px 0; }
.mars h3 { font-size: 26px; font-weight: 400; font-style: italic; margin-bottom: 6px; }
.mars p { color: var(--ink-2); font-size: 15px; max-width: 54ch; }
.mars-art { position: relative; flex: none; width: 116px; height: 116px; display: grid; place-items: center; }
.planet {
  width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #e08a62, var(--mars) 55%, #8f3f20);
}
.orbit, .spin { position: absolute; border-radius: 50%; }
.orbit { border: 1px dashed #d8cfc2; }
.orbit-inner, .spin-inner { inset: 18px; }
.orbit-outer, .spin-outer { inset: 2px; }
.spin { animation: spin 12s linear infinite; }
/* outer moon runs at ~0.9× the inner one, starting elsewhere on its orbit */
.spin-outer { animation-duration: 13.33s; animation-delay: -5s; }
.moon { position: absolute; top: 0; left: 50%; border-radius: 50%; background: var(--ink); }
.moon-inner { width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; }
.moon-outer { width: 6px; height: 6px; margin: -3px 0 0 -3px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── europe reels ── */
.prose-lead { color: var(--ink-2); margin: -12px 0 24px; max-width: 62ch; }
.reels { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.reels .instagram-media, .reels iframe.instagram-media {
  min-width: 0 !important; width: 100% !important; max-width: none !important; margin: 0 !important;
  border: 1px solid var(--line) !important; border-radius: 18px !important; box-shadow: none !important;
  background: var(--card) !important; overflow: hidden;
}
/* placeholder until Instagram's script swaps it for the player */
.reels blockquote.instagram-media { aspect-ratio: 9 / 16; display: grid; place-items: center; font-size: 13.5px; }

/* ── writing ── */
.papers { display: grid; gap: 14px; }
.paper {
  padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; background: #fff;
  transition: transform .5s var(--spring), box-shadow .4s;
}
.paper:hover { transform: translateY(-3px); box-shadow: 0 16px 36px -26px rgba(20, 20, 19, .3); }
.paper h3 { font-size: 21px; font-weight: 500; line-height: 1.3; margin-bottom: 8px; }
.paper p { font-size: 14.5px; color: var(--ink-2); max-width: 70ch; }
.read { display: inline-block; margin-top: 12px; font-size: 13.5px; }

/* ── about ── */
.facts div { display: grid; grid-template-columns: 160px 1fr; gap: 14px; padding: 10px 0; font-size: 14.5px; }
.facts dt { color: var(--ink-3); }

/* ── footer ── */
.footer { text-align: center; padding-bottom: 64px; }
.footer::before { content: ""; display: block; border-top: 1px solid var(--line); margin-bottom: 56px; }
.cta { font-size: 22px; }
.clocks { font-size: 13px; margin-top: 14px; font-variant-numeric: tabular-nums; }
.footer-mars { margin: 48px auto 0; }

/* ── small screens ── */
@media (max-width: 680px) {
  body { font-size: 15px; }
  .topbar { grid-template-columns: 1fr auto; padding: 12px 16px; }
  .topbar-mid { display: none; }
  main, .footer { padding: 0 16px; }
  .intro { padding: 44px 0 40px; }
  /* phone: small portrait beside name + icons, intro text full width below */
  .intro { display: grid; grid-template-columns: 116px 1fr; grid-template-areas: "photo head" "lede lede"; column-gap: 18px; }
  .intro-body { display: contents; }
  .portrait { grid-area: photo; border-radius: 14px; }
  .intro-head { grid-area: head; flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px; }
  .intro-head h1 { font-size: 27px; }
  .intro-head p { font-size: 14px; line-height: 1.45; }
  .intro-head .dot-sep { display: none; }
  .intro-head .from { display: block; }
  .socials { gap: 6px; }
  .icon-btn { width: 36px; height: 36px; border-radius: 10px; }
  .lede { grid-area: lede; font-size: 19.5px; margin-top: 28px; }
  .note::after { max-width: 220px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 22px 16px; }
  .cards, .visions, .reels { grid-template-columns: 1fr; }
  .card-wide { flex-direction: column; }
  .scene { margin: 0 14px 14px; }
  .card-row { grid-template-columns: 1fr; }
  .mini { border-left: 0; border-top: 1px solid var(--line); }
  .mini:first-child { border-top: 0; }
  .rows li { grid-template-columns: 22px 1fr auto; row-gap: 2px; }
  .rows li span:not(.mono-ico) { grid-column: 2 / 4; grid-row: 2; font-size: 13.5px; }
  .conviction { font-size: 20.5px; }
  .mars { flex-direction: column; align-items: flex-start; gap: 16px; }
    .facts div { grid-template-columns: 1fr; gap: 2px; }
  .stop { width: 70px; }
  .milestones { margin-left: 0; max-width: none; margin-top: -8px; }
  .stop-name { font-size: 15px; }
  .seg-label { font-size: 10.5px; top: auto; bottom: 16px; }
  .stop-meta { font-size: 11px; }
  .track { padding-top: 64px; }
  .walker { top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .tutor .lb { opacity: 1; }
}
