/* ultrabeh.cz — směr „Terén“ */

:root {
  --paper: #F2EFE8;
  --paper-deep: #E6E1D6;
  --ink: #1F211D;
  --ink-soft: #5E5B53;
  --forest: #2E4636;
  --ochre: #8A7A5E;
  --rule: #CFC9BB;
  --rule-strong: #B9B2A2;
  --profile-fill: #D9D3C5;
  --on-forest-label: #C9BD9F;
  --on-forest-muted: #D8D3C4;

  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Hanken Grotesk', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

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

body {
  margin: 0;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--forest); text-decoration: none; }
a:hover { color: var(--ink); }

/* Podtrzeni kreslime jako pozadi, ne jako border: da se animovat a u textu pres
   vic radku se lame spravne. Potrebuji ho hlavne odkazy, ktere uz maji barvu
   --ink, takze zmena barvy na nich neni videt vubec. */
.site-header nav a,
.contact-links a,
.site-footer a,
.tool-name {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size 160ms ease, color 160ms ease;
}

.site-header nav a:hover,
.contact-links a:hover,
.site-footer a:hover,
.tool-link:hover .tool-name { background-size: 100% 1px; }

/* Oba jsou polozky ve flex sloupci, takze by se roztahly na celou sirku a
   podtrzeni by vedlo daleko za text. */
.contact-links a,
.tool-name { align-self: start; }

/* Tyhle uz podtrzeni maji, takze u nich menime jeho vyraznost. */
.site-header .brand,
.contact-mail,
.underline-link { transition: color 160ms ease, border-color 160ms ease; }

.site-header .brand:hover { color: var(--forest); }
.contact-mail:hover { border-bottom-color: var(--ink); }

/* Bez tohohle zustava ovladani klavesnici jen na vychozim obrysu prohlizece. */
a:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
  border-radius: 1px;
}

@media (prefers-reduced-motion: reduce) {
  a, .tool-name { transition: none; }
}

/* height:auto neutralizuje prezentační hint z atributu height="…". Bez toho jsou
   obě dimenze definitivní a aspect-ratio níže se ignoruje (hero by byl 4:3,
   ne 16:9). Atributy zůstávají kvůli CLS. */
img { display: block; width: 100%; height: auto; }

/* Každá fotka má pod sebou svou průměrnou barvu. Full-bleed snímky jsou 600-790 px
   vysoké a jsou lazy-loaded, takže při rychlém scrollu byl jejich rezervovaný box
   chvíli prázdný - přes celou obrazovku svítil papírový podklad. Barvy spočítá
   `npm run images` a vypíše je; při výměně fotky je sem přenes.
   Pozor: musí být na <img>, ne na rodiči - jinak ji nenačtený obrázek nepřekryje. */

/* <picture> nesmí vytvořit vlastní box — v .about a .maine je gridovou
   položkou až <img>, ne wrapper. */
picture { display: contents; }

/* Chrome nedává <source> display:none. Uvnitř inline <picture> to nevadí,
   ale s display:contents by se ze <source> staly gridové položky. */
picture > source { display: none; }

/* Wrapper is the size container so cqw tracks the page width without the scrollbar. */
.page {
  container-type: inline-size;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}

/* Content keeps a ~1280px centre on wide screens; full-bleed photos run edge to edge. */
.page { --gutter: max(5cqw, calc((100cqw - 1280px) / 2)); }

.gx { padding-left: var(--gutter); padding-right: var(--gutter); }

.section-y {
  padding-top: clamp(64px, 9cqw, 128px);
  padding-bottom: clamp(64px, 9cqw, 128px);
}

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 40px min(6cqw, 88px);
}

/* Typography ------------------------------------------------------------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ochre);
}

.label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
}

.h2 {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(36px, 4.6cqw, 68px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

.lead {
  font-size: 19px;
  line-height: 1.6;
  text-wrap: pretty;
}

/* Header ----------------------------------------------------------------- */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 32px;
  padding-top: 28px;
  padding-bottom: 28px;
}

.site-header .brand {
  font-weight: 600;
  letter-spacing: 0.22em;
  font-size: 13px;
  color: var(--ink);
}

.site-header nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-size: 14px;
}

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

/* Hero ------------------------------------------------------------------- */

.hero { padding-top: min(4cqw, 56px); }

.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(64px, 17cqw, 212px);
  line-height: 0.86;
  letter-spacing: -0.035em;
}

.hero-intro {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 32px min(6cqw, 88px);
  margin-top: min(4cqw, 56px);
  padding-bottom: min(4cqw, 56px);
  align-items: end;
}

.hero-name {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hero-claim {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: clamp(26px, 2.9cqw, 40px);
  line-height: 1.18;
  letter-spacing: -0.01em;
  text-wrap: pretty;
  max-width: 22ch;
}

.hero-quals {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 14px 0 0;
  list-style: none;
  font-size: 14px;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
}

.hero-photo { margin: 0; position: relative; }

.hero-photo img {
  background-color: #6a7e90;  /* skalnaty-hreben */
  aspect-ratio: 16 / 9;
  min-height: 420px;
  object-fit: cover;
  object-position: 30% 60%;
}

.km-marks {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 22px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--paper);
  letter-spacing: 0.06em;
}

/* 01 Přístup ------------------------------------------------------------- */

.approach-text { margin: 0; max-width: 36em; }

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 32px;
  margin: 40px 0 0;
}

.pillar {
  border-top: 1px solid var(--rule);
  padding: 14px 0 18px;
  font-size: 15px;
}

.pillar dt { font-weight: 600; }
.pillar dd { margin: 2px 0 0; color: var(--ink-soft); }

/* 02 Data × pocit -------------------------------------------------------- */

.data { background: var(--paper-deep); }
.data .h2 { max-width: 16ch; }

.data-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 40px min(6cqw, 88px);
  margin-top: min(5cqw, 72px);
}

.data-cols h3 { margin: 0; font-weight: 400; }
.data-cols p { margin: 10px 0 0; text-wrap: pretty; }

.profile { margin: min(6cqw, 88px) 0 0; }

.profile svg { display: block; width: 100%; height: 110px; }

/* Barvy drží v tokenech, ne natvrdo v generovaném SVG. */
.profile-fill { fill: var(--profile-fill); }

.profile-line {
  fill: none;
  stroke: var(--forest);
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}

.profile-axis {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule-strong);
  padding-top: 8px;
}

/* Interlude -------------------------------------------------------------- */

.interlude-photo { margin: 0; }

.interlude-photo img {
  background-color: #808884;  /* inverze */
  aspect-ratio: 21 / 9;
  min-height: 320px;
  object-fit: cover;
  object-position: 50% 45%;
}

.interlude-quote {
  padding-top: clamp(48px, 6cqw, 88px);
  display: flex;
  justify-content: center;
}

.interlude-quote p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(26px, 3.2cqw, 46px);
  line-height: 1.25;
  text-align: center;
  max-width: 24ch;
  text-wrap: balance;
}

/* 03 Ultra --------------------------------------------------------------- */

.ultra .lead { margin: 28px 0 0; max-width: 34em; }

.ultra-photo {
  background-color: #5e6971;  /* hero-hreben */
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: 60% 45%;
  margin-top: 40px;
}

.races { align-self: end; }
.races ol { margin: 0; padding: 0; list-style: none; }

.race {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 4px 20px;
  border-top: 1px solid var(--rule);
  padding: 16px 0;
}

.race-date { padding-top: 4px; }
.race-name { font-weight: 600; }
.race-meta { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.race-time { font-family: var(--mono); font-size: 14px; padding-top: 2px; }

.underline-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 14px;
  border-bottom: 1px solid currentColor;
}

.maine {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 40px min(5cqw, 72px);
  margin-top: min(8cqw, 112px);
  align-items: center;
}

.maine img {
  background-color: #7f7b77;  /* maine-kristian */
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.maine-text { max-width: 32em; }

.maine h3 {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 2.8cqw, 40px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.maine p { margin: 18px 0 0; text-wrap: pretty; }

/* 04 O mně --------------------------------------------------------------- */

.about {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  background: var(--forest);
  color: var(--paper);
}

.about img {
  background-color: #9fa0a3;  /* portret-zima */
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  object-position: 75% 40%;
}

.about-text {
  padding: clamp(56px, 7cqw, 104px) 5cqw;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.about .eyebrow { color: var(--on-forest-label); }

.about-lead {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(26px, 2.6cqw, 38px);
  line-height: 1.25;
  text-wrap: pretty;
}

.about-body {
  margin: 24px 0 0;
  color: var(--on-forest-muted);
  max-width: 32em;
  text-wrap: pretty;
}

/* 05 Kvalifikace --------------------------------------------------------- */

.quals { gap: 32px min(6cqw, 88px); }
.quals ul { margin: 0; padding: 0; list-style: none; }

.qual {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
  padding: 16px 0;
}

.qual-name { font-size: 18px; }
.qual-year { padding-top: 4px; }

/* 06 Kontakt ------------------------------------------------------------- */

.contact-photo {
  background-color: #8c8e91;  /* jezero-vecer */
  aspect-ratio: 21 / 9;
  min-height: 300px;
  object-fit: cover;
  object-position: 50% 60%;
}

.contact-body {
  padding-top: clamp(56px, 7cqw, 104px);
  padding-bottom: clamp(56px, 7cqw, 104px);
  gap: 32px min(6cqw, 88px);
}

.contact-mail {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(30px, 4cqw, 60px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  overflow-wrap: anywhere;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: end;
  font-size: 16px;
}

/* Footer ----------------------------------------------------------------- */

.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  padding-bottom: 32px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-soft);
}

.site-footer .label { font-size: 12px; }

/* 404 ------------------------------------------------------------------- */

.notfound {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 52cqw;
  padding-top: clamp(64px, 9cqw, 128px);
  padding-bottom: clamp(64px, 9cqw, 128px);
}

.notfound h1 {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(36px, 4.6cqw, 68px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: pretty;
  max-width: 20ch;
}

.notfound p {
  margin: 24px 0 0;
  color: var(--ink-soft);
  max-width: 34em;
  text-wrap: pretty;
}

.notfound .underline-link { margin-top: 32px; font-size: 16px; }

/* Nástroje --------------------------------------------------------------- */

/* Bez omezení by se nadpis táhl přes celou šířku, zatímco výpis pod ním je užší. */
.tools-title { max-width: 22ch; }

.tools-lead { margin: 28px 0 0; max-width: 34em; }

.tool-list {
  margin: clamp(40px, 5cqw, 72px) 0 0;
  padding: 0;
  list-style: none;
  max-width: 48em;
}

.tool {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px 24px;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
}

/* Odkaz nese padding, takže klikací plocha je celý řádek, ne jen text. */
.tool-link {
  flex: 1 1 20em;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 0 22px;
  color: var(--ink);
}

.tool-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 2.2cqw, 30px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.tool-link:hover .tool-name { color: var(--forest); }

.tool-desc {
  font-size: 15px;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.tool-tag { padding-top: 26px; }
