/* wwronka.com, minimal */

:root {
  --ink: #141414;
  --muted: #6b6b6b;
  --faint: #e6e6e6;
  --accent: #5100ff;
  --bg: #fff;
  --measure: 40rem;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: #bbb; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }

/* ---------- frame ---------- */

.site-header {
  position: fixed;
  top: 0; left: 0;
  padding: 1.4rem 1.6rem;
  z-index: 20;
}
.site-header .name {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-decoration: none;
}

.site-nav {
  position: fixed;
  top: 5.2rem; left: 1.6rem;
  width: 11rem;
  font-size: 0.95rem;
  z-index: 10;
}
.site-nav a { display: block; width: fit-content; padding: 0.18rem 0; text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a.here { color: var(--ink); }
.site-nav a.here { font-weight: 600; }
.site-nav a.sub { padding-left: 1.1rem; font-size: 0.88rem; }
.site-nav .gap { height: 0.9rem; }

.menu-button {
  display: none;
  position: fixed;
  top: 1.15rem; right: 1.2rem;
  z-index: 30;
  border: 0; background: none;
  font: 1.4rem/1 var(--sans);
  color: var(--ink);
  cursor: pointer;
  padding: 0.3rem 0.4rem;
}

main {
  max-width: var(--measure);   /* one column for every page: text, pictures, grids */
  margin: 0 auto;
  padding: 6.5rem 1.4rem 3rem;
}

.site-footer {
  margin-top: 5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--faint);
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 1080px) {
  .menu-button { display: block; }
  .site-header { position: absolute; }
  .site-nav {
    display: none;
    position: fixed; inset: 0;
    top: 0; left: 0; width: 100%;
    padding: 5rem 1.6rem 2rem;
    background: var(--bg);
    font-size: 1.15rem;
    overflow-y: auto;
  }
  .site-nav.open { display: block; }
  main { padding-top: 5rem; }
}

/* ---------- type ---------- */

h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: 1.6rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.15rem; margin: 3rem 0 0.7rem; }
h3 { font-size: 1rem; margin: 1.8rem 0 0.4rem; }
section, [id] { scroll-margin-top: 5rem; }

p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.2rem; margin: 0 0 1rem; }
li { margin-bottom: 0.25rem; }

.lede { font-size: 1.2rem; line-height: 1.5; }
.meta, .muted { color: var(--muted); }
.meta { font-size: 0.92rem; margin-top: 0; }
.small { font-size: 0.88rem; }
.epigraph { font-style: italic; color: var(--muted); margin: 0 0 2.5rem; }
.next { color: var(--muted); font-size: 0.92rem; }

pre, code { font-family: var(--mono); font-size: 0.85rem; }
pre { background: #f6f6f6; padding: 0.9rem 1rem; overflow-x: auto; }

/* key facts */
.facts {
  font-size: 0.93rem;
  border-left: 2px solid var(--faint);
  padding: 0.1rem 0 0.1rem 1rem;
  margin: 1.2rem 0 1.5rem;
}
.facts ul { margin: 0; }

.refs { font-size: 0.85rem; color: var(--muted); }

/* ---------- media ---------- */

img, video { max-width: 100%; height: auto; display: block; }
figure { margin: 1.8rem 0; }
figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 0.45rem; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.6rem; margin: 1.8rem 0; }
.row img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; }
.row.tall img { aspect-ratio: 2 / 3; }
.embed { position: relative; padding-top: 56.25%; margin: 0 0 1.8rem; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* placeholders for media that is not ready yet */
.ph { display: flex; align-items: center; justify-content: center; background: #f2f2f2; color: #b5b5b5; font-size: 0.75rem; letter-spacing: 0.08em; }
.ph-video { aspect-ratio: 16 / 9; }

/* resynthesis samples: original | resynthesis, each figure under its player */
.samples { margin: 1.2rem 0 1.4rem; }
.sample { margin: 0 0 2.4rem; }
.sample p { margin: 0 0 0.7rem; }
.sample b { font-weight: 600; margin-right: 0.3rem; }
.sample .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.sample .label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.2rem; }
.sample audio { display: block; width: 100%; height: 2.2rem; }
.sample img { display: block; width: 100%; height: auto; margin-top: 0.6rem; }
.samples .caption { font-size: 0.82rem; color: var(--muted); margin-top: -1.2rem; }
@media (max-width: 560px) { .sample .pair { grid-template-columns: 1fr; } }

/* lists with a bold lead-in, and plain comparison tables */
ul.plain { list-style: none; padding-left: 0; }
ul.plain li { margin: 0 0 0.55rem; }
.table-wrap { overflow-x: auto; margin: 1.4rem 0 1.6rem; }
table.compare { width: 100%; border-collapse: collapse; font-size: 0.84rem; line-height: 1.4; }
table.compare th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.78rem; border-bottom: 1px solid var(--ink); padding: 0.3rem 0.6rem 0.4rem 0; vertical-align: bottom; }
table.compare td { border-bottom: 1px solid var(--faint); padding: 0.45rem 0.6rem 0.45rem 0; vertical-align: top; }
table.compare tr.this td { font-weight: 600; }
table.compare tr.this td:first-child { color: var(--accent); }
table.compare.num td:nth-child(2) { font-variant-numeric: tabular-nums; }

/* ---------- lists of work ---------- */

.entries { list-style: none; padding: 0; margin: 0 0 1rem; }
.entries li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0 1rem; padding: 0.55rem 0; border-top: 1px solid var(--faint); margin: 0; }
.entries li:last-child { border-bottom: 1px solid var(--faint); }
.entries .when { color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; padding-top: 0.12rem; }
.entries .what { min-width: 0; }
.entries .what span { display: block; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 520px) { .entries li { grid-template-columns: 1fr; } }

.figures { display: flex; flex-wrap: wrap; gap: 1.2rem 2.4rem; margin: 1.5rem 0 2rem; }
.figures div { line-height: 1.2; }
.figures b { display: block; font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; }
.figures span { font-size: 0.85rem; color: var(--muted); }

.route { font-size: 0.92rem; color: var(--muted); margin: 0 0 2rem; }
.route b { color: var(--ink); font-weight: 600; }

.download { margin: 1.4rem 0; }
.download a { font-weight: 600; }

/* ---------- home ---------- */

.home main { padding-top: 5.5rem; }
.contact { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.social { display: flex; gap: 0.75rem; }
.social a { line-height: 0; transition: opacity 0.2s; }
.social a:hover { opacity: 0.7; }
.social .strava { color: #fc4c02; }
.social .instagram { color: #e1306c; }
.social svg { width: 1.05rem; height: 1.05rem; fill: currentColor; }
.social svg[fill="none"] { fill: none; }
.portrait { display: block; width: 100%; height: auto; margin: 0 0 0.4rem; }

/* ---------- word cloud ---------- */

.cloud {
  position: relative;
  width: 100%;
  height: 19rem;
  margin: 0 0 0.5rem;
  user-select: none;
}
.cloud a {
  position: absolute;
  left: 0; top: 0;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.5s ease, color 0.2s ease;
  will-change: transform;
}
.cloud a.minor { color: var(--muted); }
.cloud.ready a { opacity: var(--o, 1); }
.cloud.focus a { opacity: 0.12; transition-duration: 0.25s; }
.cloud.focus a.lit { opacity: 1; color: var(--accent); }
.cloud a:focus-visible { outline: 1px dotted var(--accent); outline-offset: 3px; }
.cloud-legend { font-size: 0.85rem; color: var(--muted); height: 1.3rem; margin: 0 0 0.6rem; }
@media (max-width: 640px) { .cloud { height: 24rem; } }
@media (prefers-reduced-motion: reduce) { .cloud a { transition: none; } }

/* ---------- exhibits (instruments, bikes) ---------- */

.exhibits {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 3rem 2rem;
  margin: 2.5rem 0 3.5rem;
  align-items: start;
}
.exhibit img, .exhibit .ph { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: #f2f2f2; }
.exhibit .ph { display: flex; align-items: center; justify-content: center; color: #b5b5b5; font-size: 0.8rem; letter-spacing: 0.08em; }
.exhibit .label { padding-top: 0.8rem; }
.exhibit .no { display: block; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.exhibit h2 { font-size: 1rem; margin: 0.15rem 0 0.1rem; }
.exhibit .medium { font-size: 0.85rem; font-style: italic; color: var(--muted); margin: 0 0 0.5rem; }
.exhibit p { font-size: 0.93rem; }
.exhibit details { font-size: 0.88rem; border-top: 1px solid var(--faint); padding-top: 0.4rem; }
.exhibit summary { color: var(--muted); cursor: pointer; font-size: 0.82rem; list-style: none; }
.exhibit summary::before { content: "+ "; color: var(--accent); }
.exhibit details[open] summary::before { content: "− "; }
.exhibit details[open] { padding-bottom: 0.4rem; }
.exhibit details > :nth-child(2) { margin-top: 0.7rem; }
.exhibit details p, .exhibit details li { font-size: 0.88rem; }
/* an opened exhibit takes the whole row: picture left, notes right */
.exhibit:has(details[open]) {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 0 2rem;
}
.exhibit:has(details[open]) .label { padding-top: 0; }
@media (max-width: 560px) { .exhibit:has(details[open]) { display: block; } .exhibit:has(details[open]) .label { padding-top: 0.8rem; } }
.spec { display: grid; grid-template-columns: 5rem 1fr; gap: 0.1rem 0.8rem; font-size: 0.85rem; margin: 0.6rem 0 0; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; }

/* ---------- portfolio cards (home) ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 2.2rem 1.6rem;
  margin: 1rem 0 1rem;
}
.card { display: block; text-decoration: none; color: var(--ink); }
.card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #f2f2f2; margin-bottom: 0.7rem; transition: opacity 0.2s; }
.card b { display: block; font-weight: 600; }
.card span { display: block; font-size: 0.88rem; color: var(--muted); line-height: 1.45; margin-top: 0.15rem; }
.card:hover { color: var(--accent); }
.card:hover img { opacity: 0.85; }

.card img.fit { object-fit: contain; background: #f6f6f6; padding: 0.8rem; }

/* ---------- schematics ---------- */

figure.diagram { margin: 1.6rem 0 2rem; }
figure.diagram img { display: block; width: 100%; height: auto; }
.schem { display: block; width: 100%; height: auto; color: var(--ink); overflow: visible; }
.schem text { font: 12px var(--sans); fill: currentColor; stroke: none; }
.schem .m { fill: var(--muted); }
.schem .f { stroke: var(--muted); }
.schem .a { stroke: var(--accent); }
.schem .a2 { fill: var(--accent); }

/* ---------- full-window map (adventures) ---------- */

.map-full { position: relative; width: 100%; height: 100vh; height: 100dvh; background: #f2f2f0; z-index: 1; }
.map-fallback { position: absolute; inset: auto 0 45% 0; text-align: center; color: var(--muted); font-size: 0.9rem; }
.map-down {
  position: absolute; top: calc(100dvh - 3.2rem); left: 50%; transform: translateX(-50%);
  z-index: 5; text-decoration: none; font-size: 1.3rem; color: var(--ink);
  background: rgba(255,255,255,0.85); width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.adventures main { padding-top: 4rem; }
.adventures .site-header, .adventures .site-nav, .adventures .menu-button { z-index: 1000; }
.adventures .site-header .name, .adventures .site-nav a { text-shadow: 0 0 6px #fff, 0 0 2px #fff; }
.adventures .site-header { position: fixed; }
.leaflet-container { font-family: var(--sans); }
.leaflet-tooltip.map-label {
  background: none; border: 0; box-shadow: none; padding: 0;
  font-size: 0.8rem; color: var(--ink); text-shadow: 0 0 4px #fff, 0 0 2px #fff, 0 0 1px #fff;
}
.leaflet-tooltip.map-label::before { display: none; }
@media (max-width: 1080px) { .adventures .site-nav { z-index: 1001; } }
.map-full .leaflet-tile-pane, .map-full .leaflet-gl-layer { filter: grayscale(1) contrast(0.85) brightness(1.08); }
.map-stats { background: rgba(255,255,255,0.88); padding: 0.3rem 0.6rem; font-size: 0.78rem; color: var(--muted); }
.map-stats b { color: var(--ink); font-weight: 600; }
.leaflet-control-layers { border: 0 !important; box-shadow: none !important; background: rgba(255,255,255,0.88) !important; font-size: 0.8rem; }
.leaflet-control-layers-expanded { padding: 0.3rem 0.6rem 0.3rem 0.4rem; }
.adventures .leaflet-top.leaflet-right { top: 3.2rem; }

/* ride map from gpx-overlay (mapa/), full window under the header */
.adventures { overflow: hidden; }
.adventures #map.ridemap { position: fixed; --rm-paper: #fff; --rm-water: #d9e7f4; --rm-coast: #6f9cc9; --rm-ink: #141414; --rm-accent: #5100ff; }
.adventures .rm-card, .adventures .rm-race, .adventures .rm-years { --rm-paper: #fff; --rm-ink: #141414; --rm-accent: #5100ff; }

/* narrow screens: wide figures keep a readable label size and scroll sideways */
@media (max-width: 600px) {
  figure.diagram { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  figure.diagram > img,
  figure.diagram > svg.schem[viewBox^="0 0 640"],
  figure.diagram > svg.schem[viewBox^="0 0 560"] { min-width: 540px; }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* adventures: a short intro over the map */
.rm-intro { position: fixed; top: 1.2rem; right: 1.2rem; z-index: 31; width: 20rem; margin: 0;
  background: #fff; border: 1px solid var(--ink); padding: 0.7rem 0.9rem 0.75rem;
  font-size: 0.8rem; line-height: 1.45; color: var(--ink); }
.rm-intro h1 { font-size: 0.95rem; margin: 0 0 0.25rem; }
.rm-intro p { margin: 0 0 0.4rem; }
.rm-intro ul { list-style: none; padding: 0; margin: 0 0 0.45rem; }
.rm-intro li { margin: 0 0 0.15rem; display: grid; grid-template-columns: 2.4rem 1fr; }
.rm-intro li span.t { color: var(--ink); }
.rm-intro li span { color: var(--muted); font-variant-numeric: tabular-nums; }
.rm-intro .rm-hint { color: var(--muted); margin: 0; }
@media (max-width: 1080px) { .rm-intro { top: 3.4rem; right: 0.8rem; } }
@media (max-width: 600px) {
  .rm-intro { left: 10px; right: 10px; top: 3.2rem; width: auto; padding: 0.55rem 0.7rem; }
  .rm-intro .rm-hint { display: none; }
}
