/* styles/story.css - the home page as a story (scripts-dev/generate.mjs: renderStory, renderHomeProjects, renderIdeas, renderIntro). Base layer = Artsy; skin-wiki.css
   and skin-dev.css restyle the same markup. Photos: scripts/story-fx.js draws them in WebGL in
   Artsy; everything here must look right without it.

   No layout shift from photos: every <img> carries width/height, so its box has its ratio before
   a byte arrives; the lead overrides that ratio in CSS (16:9, 4:5 on phones), the grid keeps the
   photo's own, so a landscape slide is never cropped into a portrait. Captions are --ink-quiet,
   the AA step on every ground and wash in tokens.css, in both themes. */

/* ---- under the hero (Maj, 2026-11-09: "hočem manj texta"): the intro and the quiet CTA that
   used to sit in it (generate.mjs renderIntro), then his goal as its own pull quote
   (renderQuote), in every skin. Wikipedia and Dev restyle the same markup; what follows the
   plain rules is Artsy's alone. ---- */
.section--intro { padding-block-end: 0; }
.intro { grid-column: 3 / 11; }
.intro > :first-child { margin-block-start: 0; }
.quote { grid-column: 3 / 11; margin: 0; }

/* ---- the quiet CTA: a line of text, a link and a ghost button. Never a banner. ---- */
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-l);
  margin-block-start: var(--space-xl);
  max-inline-size: 52ch;
  color: var(--ink-quiet);
}
.hero__cta-t { flex-basis: 100%; }
.hero__cta a { white-space: nowrap; }

/* Artsy: the intro as an editorial spread (Maj, 2026-11-09: "da malo bolj popa in da zapolni vse
   praznen prostor"). The paragraph runs the full width in display type, its first line in the
   accent; the CTA hangs at the right under it. */
:root:not([data-skin="wiki"], [data-skin="dev"]) .section--intro { padding-block: var(--space-4xl) var(--space-2xl); }
:root:not([data-skin="wiki"], [data-skin="dev"]) .intro { grid-column: 1 / -1; display: grid; }
:root:not([data-skin="wiki"], [data-skin="dev"]) .intro .hero__lead {
  max-inline-size: none;
  margin: 0;
  font-size: clamp(1.75rem, 0.9rem + 2.6vw, 3.9rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: pretty;
  color: var(--ink-strong);
}
:root:not([data-skin="wiki"], [data-skin="dev"]) .intro .hero__lead::first-line { color: var(--accent); }
:root:not([data-skin="wiki"], [data-skin="dev"]) .intro .hero__cta {
  justify-self: end;
  margin-block-start: var(--space-2xl);
  padding-block-start: var(--space-m);
  border-block-start: 1.5px solid var(--ink-strong);
  font-size: var(--t-1);
}

/* Artsy: the goal as a pull quote, big, between two quotation marks drawn in the hand font. */
:root:not([data-skin="wiki"], [data-skin="dev"]) .section--quote { padding-block: var(--space-3xl); }
:root:not([data-skin="wiki"], [data-skin="dev"]) .quote { grid-column: 2 / 12; display: grid; justify-items: center; padding-inline: clamp(2.5rem, 6vw, 6rem); }
:root:not([data-skin="wiki"], [data-skin="dev"]) .quote .hero__goal {
  margin: 0;
  padding: 0;
  border: 0;
  position: relative;
  max-inline-size: 24ch;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 0.9rem + 2.1vw, 3.25rem);
  font-style: italic;
  font-weight: var(--wt-regular);
  line-height: 1.15;
  text-wrap: balance;
  color: var(--ink-strong);
}
:root:not([data-skin="wiki"], [data-skin="dev"]) .quote .hero__goal::before,
:root:not([data-skin="wiki"], [data-skin="dev"]) .quote .hero__goal::after {
  font-family: var(--ea-script);
  font-size: 2.6em;
  font-style: normal;
  line-height: 0;
  color: var(--accent);
}
/* The opening mark hangs in the margin; the closing one follows the last word. */
:root:not([data-skin="wiki"], [data-skin="dev"]) .quote .hero__goal::before { content: "\201C" / ""; position: absolute; inset: 0.55em auto auto -0.75em; rotate: -8deg; }
:root:not([data-skin="wiki"], [data-skin="dev"]) .quote .hero__goal::after { content: "\201D" / ""; position: relative; inset-block-start: 0.5em; margin-inline-start: 0.08em; }
@media (max-width: 1023px) {
  :root:not([data-skin="wiki"], [data-skin="dev"]) .quote { grid-column: 1 / -1; }
}

/* ---- the space hero (Maj, 2026-11-08: "astronaut floating in space z nežno animacijo full body
   na levi strani ... za njim je vesolje ... v odzadju mora bit zemlja"; 2026-11-09: "kot da je vse
   narisano tako kot moja profila"). A painted sky with Earth along the bottom, the astronaut on
   the left, a small rocket far off, the words on the right; all of it decoration (generate.mjs
   renderHero). Artsy's alone: the scene, the scroll hint and the band below are off unless the
   skin is Artsy (or none, without JS), so Wikipedia and Dev keep their plain hero and no token
   leaks into them. The sky is dark in both themes, so the hero takes the dark theme's ink. ---- */
.hero__space, .hero__more, .theme-cta { display: none; }
:root:not([data-skin="wiki"], [data-skin="dev"]) .hero {
  --ink-strong: #f4f1ea;
  --ink: #dad6ce;
  --ink-quiet: #a9a49a;
  --accent: #e3a468;
  --border-ctrl: #8a857b;
  --focus: #e3a468;
  --btn-solid-bg: #f4f1ea;
  --btn-solid-fg: #101216;
  color-scheme: dark;
  overflow: clip;
  min-block-size: calc(100svh - var(--header-h));
  align-content: center;
  padding-block: clamp(2.5rem, 1rem + 4vh, 4rem) 21vw;   /* the words end above Earth's limb */
  background: #03040b;
}
:root:not([data-skin="wiki"], [data-skin="dev"]) .hero::before,
:root:not([data-skin="wiki"], [data-skin="dev"]) .hero::after { display: none; }   /* no paint washes in space */
/* The header's paper fade would read as grey haze over the sky. */
:root[data-page="home"]:not([data-skin="wiki"], [data-skin="dev"]) .site-header::after { display: none; }
:root:not([data-skin="wiki"], [data-skin="dev"]) .hero__space {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
/* Painted on Higgsfield with Maj's avatar as the style reference: Earth's limb rises to the
   left, under the astronaut, and the sky over the words is dark. Pinned to the bottom. */
.hero__sky {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: 50% 100%;
}
.hero__astronaut {
  position: absolute;
  inset-block-start: clamp(0.5rem, 3%, 2.5rem);
  inset-inline-start: max(calc(var(--gutter) * 0.5), calc((100% - var(--wrap-max)) / 2));
  /* About 1.3x round 2's, capped so the whole figure fits a short screen. */
  inline-size: min(48vw, 720px, calc((100svh - var(--header-h)) * 0.8));
}
.hero__astronaut img { display: block; inline-size: 100%; block-size: auto; transition: filter 400ms ease; }
/* No HTML-in-Canvas (scroll-fx.js): the pointer over the astronaut only lights it a little. */
.hero__astronaut.is-near img { filter: drop-shadow(0 0 22px rgb(150 170 255 / 0.45)); }
/* Far away, top right, above the words: small, and floating on its own clock. */
.hero__rocket {
  position: absolute;
  inset-block-start: clamp(1rem, 5%, 3rem);
  inset-inline-end: max(var(--gutter), calc((100% - var(--wrap-max)) / 2 + var(--gutter)));
  inline-size: clamp(64px, 6.5vw, 100px);
  block-size: auto;
  opacity: 0.92;
}
:root:not([data-skin="wiki"], [data-skin="dev"]) .hero .hero__id { grid-column: 7 / -1; }
/* Tighter than the paper hero, so the words fit above Earth in about one screen. The shadow only
   matters where a line meets the atmosphere's glow. */
:root:not([data-skin="wiki"], [data-skin="dev"]) .hero__id :is(h1, p) { text-shadow: 0 1px 14px rgb(2 3 8 / 0.9); }
:root:not([data-skin="wiki"], [data-skin="dev"]) .hero__id .btn--solid { text-shadow: none; }
/* The outline buttons sit on painted stars and clouds: darken and blur what is behind them so the
   label reads (Maj, 2026-11-09: "backdrop filter brightness -30% in background blur"). */
:root:not([data-skin="wiki"], [data-skin="dev"]) .hero__id .btn--line {
  -webkit-backdrop-filter: brightness(70%) blur(8px);
  backdrop-filter: brightness(70%) blur(8px);
}
:root:not([data-skin="wiki"], [data-skin="dev"]) .hero .hero__actions { margin-block-start: var(--space-xl); gap: var(--space-s) var(--space-m); }
/* "Scroll down 4 more", in his hand, at the foot of the hero (Maj, 2026-11-09). A link to the
   intro; the arrow bobs, and the hint fades out over the first 30vh of scrolling. */
:root:not([data-skin="wiki"], [data-skin="dev"]) .hero__more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  position: absolute;
  inset-block-end: clamp(0.75rem, 3vh, 2rem);
  inset-inline-start: 50%;
  z-index: 2;
  translate: -50% 0;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  background: radial-gradient(closest-side, rgb(3 4 11 / 0.88) 60%, rgb(3 4 11 / 0.55) 85%, transparent);
  font-family: var(--ea-script);
  font-size: var(--t-1);
  line-height: 1.2;
  color: #f4f1ea;
  text-decoration: none;
  text-shadow: 0 1px 3px rgb(2 3 8), 0 0 14px rgb(2 3 8 / 0.95);
  white-space: nowrap;
}
.hero__more svg {
  inline-size: 18px;
  block-size: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgb(2 3 8));
}
:root:not([data-skin="wiki"], [data-skin="dev"]) .hero__more:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 1023px) {
  :root:not([data-skin="wiki"], [data-skin="dev"]) .hero .hero__id { grid-column: 4 / -1; }
  .hero__astronaut { inline-size: 50vw; }
}
/* A squarer screen crops the sky from the sides, so Earth's limb stands higher behind the words. */
@media (min-width: 860px) and (max-width: 1023px) {
  :root:not([data-skin="wiki"], [data-skin="dev"]) .hero { padding-block-end: max(21vw, 44svh); }
  .hero__rocket { inset-inline: 30vw auto; }                 /* the name reaches the right edge here */
}
/* Phones and narrow tablets: the astronaut above the words, Earth under them, the rocket in the
   top right corner. */
@media (max-width: 859px) {
  :root:not([data-skin="wiki"], [data-skin="dev"]) .hero {
    align-content: start;
    min-block-size: 0;
    padding-block: calc(min(80vw, 520px) * 1.12 + 1.5rem) calc(58vw + 3rem);   /* the last link clears the limb */
  }
  :root:not([data-skin="wiki"], [data-skin="dev"]) .hero .hero__id { grid-column: 1 / -1; }
  .hero__astronaut { inline-size: min(80vw, 520px); inset-inline-start: 2vw; inset-block-start: 0.5rem; }
  .hero__rocket { inline-size: 56px; inset-block-start: 4rem; inset-inline-end: var(--gutter); }
  /* A phone's hero is taller than wide: the painted Earth keeps about its width and lies along
     the bottom, under the words, and its sky fades into the hero's. */
  .hero__sky {
    inset-block-start: auto;
    block-size: max(125vw, 420px);
    object-position: 30% 100%;
    mask-image: linear-gradient(transparent, #000 25%);
  }
  /* The painting's starry top right, a second time and larger, behind the astronaut, so the top
     of a tall phone hero is sky rather than flat black (Maj, 2026-11-09: "da bo zgledalo kul na
     telefonu"). The same file the <img> already loaded; it fades out before Earth's limb. */
  .hero__space::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    block-size: min(190vw, 900px);
    background: url("/Images/hero/hero-sky-painted-1280.webp") no-repeat 100% 0 / auto 100%;
    mask-image: linear-gradient(#000 40%, transparent 58%);
  }
}
/* The file the <img> picked, so the layer above never costs a second download: phones always take
   the 1280 (sizes="(max-width: 600px) 420px, 100vw" in generate.mjs), a 2x tablet the 2560.
   ponytail: mirrors srcset's width x DPR pick by media query; off only between 854 and 859 px at
   1.5x, where it fetches the other file once. */
@media (min-width: 641px) and (max-width: 859px) and (min-resolution: 2dppx) {
  .hero__space::before { background-image: url("/Images/hero/hero-sky-painted-2560.webp"); }
}
/* A slow drift and a slight turn, transform only: floating, never bouncing. The lean is in the
   image itself (60° to the left since Maj, 2026-11-09), so the turn here stays within a few
   degrees. The rocket drifts on a longer, offset clock, so the two never move together. */
@keyframes hero-float {
  0%, 100% { transform: translate(0, 0) rotate(-1deg); }
  35% { transform: translate(5px, -9px) rotate(2deg); }
  70% { transform: translate(-4px, -3px) rotate(-2.5deg); }
}
@keyframes hero-rocket {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-7px, 6px) rotate(-3deg); }
}
@keyframes hero-more { 50% { transform: translateY(5px); } }
@keyframes hero-more-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: no-preference) {
  :root[data-js][data-skin="artsy"]:not([data-mode="desktop"], [data-vr="host"]) .hero__astronaut {
    animation: hero-float 11s ease-in-out infinite;
  }
  :root[data-js][data-skin="artsy"]:not([data-mode="desktop"], [data-vr="host"]) .hero__rocket {
    animation: hero-rocket 17s ease-in-out -6s infinite;
  }
  :root[data-js][data-skin="artsy"]:not([data-mode="desktop"], [data-vr="host"]) .hero__more svg {
    animation: hero-more 1.8s ease-in-out infinite;
  }
}
@supports (animation-timeline: scroll()) {
  :root:not([data-skin="wiki"], [data-skin="dev"]) .hero__more:not(:focus-visible) {
    animation: hero-more-out linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 30vh;
  }
}

/* The theme band: one button, mid-screen as you scroll past (Maj, 2026-11-08), under the quote
   since 2026-11-09 and "malo bolj kul": sketch lines in the pen of his avatar run from a loop
   round the button out to both edges of the page and into the sections above and below, as if
   it were stitched into the site. The right side is the left one mirrored. It opens the theme
   wheel (theme-wheel.js), which also reveals it. */
:root:not([data-skin="wiki"], [data-skin="dev"]) .theme-cta:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-block-size: min(36svh, 16rem);
  padding-block: var(--space-xl);
}
.theme-cta__line {
  display: block;
  inline-size: 100%;
  block-size: min(36svh, 16rem);
  overflow: visible;
  fill: none;
  stroke: var(--ink-strong);
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0.6;
  pointer-events: none;
}
.theme-cta__line path, .theme-cta__loop path { vector-effect: non-scaling-stroke; }
.theme-cta__line--r { transform: scaleX(-1); }
.theme-cta__mid { position: relative; display: block; padding-inline: clamp(0.5rem, 2vw, 1.5rem); }
.theme-cta__loop {
  position: absolute;
  inset: -16px calc(clamp(0.5rem, 2vw, 1.5rem) - 22px);
  inline-size: calc(100% - 2 * clamp(0.5rem, 2vw, 1.5rem) + 44px);
  block-size: calc(100% + 32px);
  overflow: visible;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  pointer-events: none;
}
.theme-cta__btn {
  position: relative;
  min-height: 56px;
  padding: var(--space-m) var(--space-xl);
  font-size: var(--t-1);
  text-align: center;
  text-wrap: balance;
}
/* A phone: the button no longer fills the row, so the sketch lines keep a margin to run in. */
@media (max-width: 600px) {
  :root:not([data-skin="wiki"], [data-skin="dev"]) .theme-cta:not([hidden]) { grid-template-columns: minmax(2.25rem, 1fr) auto minmax(2.25rem, 1fr); }
  .theme-cta__btn { max-inline-size: 17.5rem; }
}
@keyframes theme-cta-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@supports (animation-timeline: view()) {
  .theme-cta { view-timeline: --theme-cta block; }
  @media (prefers-reduced-motion: no-preference) {
    :root[data-skin="artsy"]:not([data-mode="desktop"]) :is(.theme-cta__line, .theme-cta__loop) path {
      stroke-dasharray: 1;
      animation: theme-cta-draw linear both;
      animation-timeline: --theme-cta;
      animation-range: entry 10% cover 45%;
    }
  }
}

/* ---- the story: the contents in the margin, the chapters in the prose column (Maj, 2026-10-22:
   "celi stori ... na eni strani nek index"). On wide screens the contents stay in view while the
   chapters scroll past; below 1024 they are a box above the first chapter. ---- */
.section--story { padding-block: var(--section-y); }
.story__index { align-self: start; }
.story__index-h {
  margin-block-end: var(--space-s);
  font-size: var(--t--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.story__toc { display: grid; gap: var(--space-3xs); margin: 0; padding: 0; list-style: none; }
.story__toc a {
  display: flex;
  gap: var(--space-xs);
  padding-block: 0.2em;
  font-size: var(--t--1);
  line-height: var(--lh-meta);
  color: var(--ink-quiet);
  text-decoration: none;
  transition: color var(--d-hover) var(--ease-out);
}
.story__toc a:hover,
.story__toc a[aria-current] { color: var(--ink-strong); }
.story__toc-n { flex: none; min-inline-size: 2ch; color: var(--ink-faint); }
.story__toc a[aria-current] .story__toc-n { color: var(--accent); }
.story__toc--more {
  margin-block-start: var(--space-m);
  padding-block-start: var(--space-m);
  border-block-start: 1px solid var(--rule);
}
.story__body { position: relative; grid-column: 3 / -1; display: grid; gap: var(--space-4xl); }
.story__lede {
  max-inline-size: var(--measure-lead);
  font-family: var(--font-display);
  font-size: var(--t-2);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-2);
  color: var(--ink-strong);
}
/* The photo follows the heading in the markup (the Wikipedia skin floats it); here it closes the
   chapter. */
/* A chapter is a two-column sheet: the text in the measure, the margin beside it for the glyph
   and the handwritten note (each note lands in the row of the paragraph it quotes: auto-placement
   keeps a column-2 item in the row of the column-1 item before it). */
.story__ch {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr);
  column-gap: var(--space-2xl);
  row-gap: var(--space-s);
  align-items: start;
  scroll-margin-block-start: calc(var(--header-h) + var(--space-l));
}
.story__ch > * { grid-column: 1; }
.story__ch > p { max-inline-size: var(--measure); }
.story__ch > .story__fig { order: 1; grid-column: 1 / -1; margin-block-start: var(--space-l); }
.story__n {
  margin-inline-end: 0.35em;
  font-size: 0.5em;
  vertical-align: 0.45em;
  letter-spacing: 0;
  color: var(--accent);
}
.story__t {
  margin-block-end: var(--space-xs);
  font-family: var(--font-display);
  font-size: var(--t-4);
  font-weight: var(--wt-regular);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-4);
  color: var(--ink-strong);
}
@media (min-width: 1024px) {
  .story__index {
    position: sticky;
    top: calc(var(--header-h) + var(--space-xl));
    max-block-size: calc(100vh - var(--header-h) - var(--space-2xl));
    overflow-y: auto;
    padding-inline-end: var(--space-s);
  }
}

.story__fig { margin: 0; }
.story__frame {
  position: relative;
  display: block;
  overflow: clip;            /* not hidden: a scroll container would become the photo's view() timeline */
  border-radius: var(--radius-s);
  background: var(--raised);
}
.story__img { display: block; width: 100%; height: auto; }
.story__fig--lead .story__img { aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 40%; }
.story__img[data-pos="top"] { object-position: 50% 30%; }
.story__fig figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-s);
  margin-block-start: var(--space-xs);
  font-size: var(--t--1);
  line-height: var(--lh-meta);
  letter-spacing: var(--tr--1);
  color: var(--ink-quiet);
}
.story__credit a { color: inherit; text-underline-offset: 0.2em; }

/* story-fx.js: the canvas sits exactly on the photo; the photo hides only once it is drawn. */
.story__gl { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.story__frame.is-gl .story__img { opacity: 0; }

/* No WebGL: the plain photo fades in as it enters, on the compositor, opacity only, so it cannot
   move a pixel of layout. Artsy only, only with JS, never under reduced motion, never in XP, and
   never on a frame story-fx.js has drawn. Scrubbed by the scroll, so a jump or a photo that is
   already on screen at load is past the range and fully opaque. */
@keyframes story-in { from { opacity: 0; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    :root[data-js][data-skin="artsy"]:not([data-mode="desktop"]) .story__frame:not(.is-gl) .story__img {
      animation: story-in 1ms linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }
  }
}

/* ---- projects as cards: the surface .like uses, title link covers the card ---- */
.pcards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gutter);
  margin: 0;
  padding: 0;
  list-style: none;
}
.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  padding: var(--space-l) var(--space-l) var(--space-xl);
  border: 1px solid var(--rule);
  border-radius: 1rem;
  background: color-mix(in oklab, var(--raised) 55%, transparent);
  transition: border-color var(--d-hover) ease;
}
.pcard__t {
  font-size: var(--t-2);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-2);
}
.pcard__t a {
  color: var(--ink-strong);
  text-decoration: none;
  background-image: var(--brush-u);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0.3em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size var(--d-hover) var(--ease-out);
}
.pcard:nth-child(even) .pcard__t a { background-image: var(--brush-u2); }
.pcard__t a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.pcard__b { max-inline-size: 48ch; }
.pcard__why {
  max-inline-size: 48ch;
  font-family: var(--font-display);
  font-size: var(--t-0);
  font-style: italic;
  line-height: var(--lh-snug);
  color: var(--ink-quiet);
}
@media (hover: hover) and (pointer: fine) {
  .pcard:hover { border-color: color-mix(in oklab, var(--accent) 38%, var(--rule)); }
  .pcard:hover .pcard__t a { background-size: 100% 0.42em; }
}
@media (forced-colors: active) { .pcard__t a { text-decoration: underline; } }

/* ---- ideas: a calm closing block ---- */
.ideas__t {
  max-inline-size: 30ch;
  font-family: var(--font-display);
  font-size: var(--t-2);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-2);
  color: var(--ink-strong);
}
.ideas__actions { margin-block-start: var(--space-l); }

/* ---- 1024 to 1439: these sections have no hanging column, so they keep the wide one ---- */
@media (min-width: 1024px) {
  .pcards { grid-column: 3 / -1; }
}

/* ---- smaller screens ---- */
@media (max-width: 1023px) {
  .story__index {
    margin-block-end: var(--space-2xl);
    padding: var(--space-m) var(--space-l);
    border: 1px solid var(--rule);
    border-radius: var(--radius-s);
  }
  .story__toc { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-l); }
  .story__body { grid-column: 1 / -1; gap: var(--space-3xl); }
}
@media (max-width: 639px) {
  .story__toc { grid-template-columns: minmax(0, 1fr); }
  /* Full bleed: a chapter's photo runs to the viewport's edges, its caption stays in the gutter. */
  .story__ch > .story__fig { margin-inline: calc(var(--gutter) * -1); }
  .story__ch > .story__fig .story__frame { border-radius: 0; }
  .story__ch > .story__fig figcaption { padding-inline: var(--gutter); }
  .story__fig--lead .story__img { aspect-ratio: 4 / 5; }
  .pcards { grid-template-columns: minmax(0, 1fr); }
}

/* ---- print: every photo prints as the photo ---- */
@media print {
  .story__gl { display: none; }
  .story__img { opacity: 1 !important; animation: none !important; }
  /* Printers drop the night sky: no scene, and the hero back in the paper's ink. */
  .hero__space, .hero__more { display: none !important; }
  :root:not([data-skin="wiki"], [data-skin="dev"]) .hero {
    --ink-strong: inherit; --ink: inherit; --ink-quiet: inherit; --accent: inherit; --border-ctrl: inherit;
    --focus: inherit; --btn-solid-bg: inherit; --btn-solid-fg: inherit;
    color-scheme: light;
    background: none;
  }
}

/* ==== the engineer who is also an artist (Maj, 2026-10-26) =====================================
   Three hands: the serif tells (titles, prose), the mono measures (.story__spec), the script
   remembers (.hero__hand, .story__note). A copper trace runs down the story in the gutter, one via
   per chapter; scripts/story-fx.js sets --flow (0..1, how far the reader is) and marks the chapter
   being read with .is-current, so the current flows down the board as the page is read. Artsy
   only: skin-wiki.css keeps only the spec line, as a caption; skin-dev.css hides all of it. */
:root { --ea-script: "Segoe Script", "Snell Roundhand", "Bradley Hand", "Ink Free", "Segoe Print", cursive; --ea-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace; }

.hero__hand {
  margin-block: var(--space-s) var(--space-m);
  max-inline-size: 46ch;
  font-family: var(--ea-script);
  font-size: var(--t-1);
  line-height: 1.35;
  color: var(--accent);
  transform: rotate(-1.5deg);
  transform-origin: left center;
}
.hero__hand > span { display: block; }
.hero .wrap { z-index: 1; }

.story__spec {
  margin: 0 0 calc(var(--space-2xs) * -1);
  font: 500 0.78rem/1.4 var(--ea-mono);
  letter-spacing: 0.04em;
  color: var(--accent);
  opacity: 0.9;
}
.story__glyph {
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-self: start;
  inline-size: 84px;
  color: var(--accent);
  opacity: 0.9;
}
.story__note {
  grid-column: 2;
  align-self: start;
  block-size: 0;             /* hangs beside its paragraph, never makes that row taller */
  overflow: visible;
  margin: 0;
  padding-block-start: 0.2em;
  max-inline-size: 18ch;
  font-family: var(--ea-script);
  font-size: var(--t-0);
  line-height: 1.3;
  color: var(--accent);
  transform: rotate(-3deg);
  transform-origin: left center;
}
.story__note::before {                   /* a pen arrow back to the sentence it quotes */
  content: "\2190\00a0";
  font-family: var(--font-text);
}

/* The trace: dim copper the whole way, bright copper as far as the reader has come. */
.story__body::before,
.story__body::after {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: calc(var(--gutter) * -0.5 - 1px);
  inline-size: 2px;
  border-radius: 2px;
  pointer-events: none;
}
.story__body::before { block-size: 100%; background: color-mix(in oklab, var(--accent) 22%, transparent); }
.story__body::after {
  block-size: calc(var(--flow, 0) * 100%);
  background: var(--accent);
  box-shadow: 0 0 10px color-mix(in oklab, var(--accent) 55%, transparent);
}
.story__via {
  position: absolute;
  inset-block-start: 1.9rem;
  inset-inline-start: calc(var(--gutter) * -0.5 - 6px);
  inline-size: 12px;
  block-size: 12px;
  border: 2px solid color-mix(in oklab, var(--accent) 45%, transparent);
  border-radius: 50%;
  background: var(--ground);
}
@media (prefers-reduced-motion: no-preference) {
  .story__via { transition: border-color 300ms var(--ease-out), box-shadow 300ms var(--ease-out); }
}
.story__ch.is-past .story__via { border-color: var(--accent); }
.story__ch.is-current .story__via {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 20%, transparent), 0 0 14px var(--accent);
}

/* Motion, Artsy, never under reduced motion. The notes write themselves in as they scroll into
   view (a clip, left to right, scrubbed by the scroll). */
@keyframes ea-write { from { clip-path: inset(-1em 100% -4em -1em); } to { clip-path: inset(-1em -1em -4em -1em); } }   /* em, not %: a note has no height of its own */
@media (prefers-reduced-motion: no-preference) {
  :root[data-js][data-skin="artsy"] .hero__hand { animation: ea-write 1.4s cubic-bezier(.45, 0, .2, 1) 400ms both; }
  @supports (animation-timeline: view()) {
    :root[data-js][data-skin="artsy"]:not([data-mode="desktop"]) .story__note {
      animation: ea-write 1ms linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 100%;   /* complete by the time it is fully on screen */
    }
  }
}

/* Below 1280 the margin column would be too narrow for a glyph and a note: one column, the glyph
   beside the spec line, the note under the paragraph it quotes. */
@media (max-width: 1279px) {
  .story__ch { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-m); }
  .story__ch > p, .story__ch > .story__spec, .story__ch > .story__t { grid-column: 1 / -1; }
  .story__glyph { grid-column: 2; grid-row: 1; inline-size: 56px; }
  .story__ch > .story__spec { grid-column: 1; grid-row: 1; align-self: center; }
  .story__note {
    grid-column: 1 / -1;
    justify-self: end;
    block-size: auto;
    max-inline-size: none;
    margin-block: calc(var(--space-2xs) * -1) var(--space-2xs);
  }
}
@media (max-width: 1023px) {
  .story__body { padding-inline-start: var(--space-l); }
  .story__body::before, .story__body::after { inset-inline-start: 0.35rem; }
  .story__via { inset-inline-start: calc(0.35rem - 5px - var(--space-l)); }
}

/* ==== robot pairs and the travel map (Maj, 2026-10-27) =========================================
   "več slik robotov robotskih rok": robots and work carry a pair of photos after the chapter's
   lead photo. "dejanski zemljevid ... pini v raznih državah": the travel line gets a real map,
   halftone land from Natural Earth with a pin per place he named (generate.mjs renderMap). */
.story__ch > .story__pair {
  order: 1;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-s);
  margin-block-start: var(--space-s);
}
.story__pair .story__img { aspect-ratio: 4 / 3; object-fit: cover; }
@media (max-width: 639px) {
  .story__ch > .story__pair { grid-template-columns: minmax(0, 1fr); gap: var(--space-m); margin-inline: calc(var(--gutter) * -1); }
  .story__pair .story__frame { border-radius: 0; }
  .story__pair figcaption { padding-inline: var(--gutter); }
}

/* The map follows the travel line it draws (order 0); the chapter's photo still closes it. */
.story__ch > .story__map { order: 0; grid-column: 1 / -1; margin-block: var(--space-s) var(--space-m); }
.map {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr);   /* the world, and Central Europe up close */
  align-items: start;
  view-timeline-name: --map;
}
.map svg { display: block; inline-size: 100%; block-size: auto; overflow: visible; }
.map__dots { fill: none; stroke-linecap: round; stroke-width: 4.4; stroke: color-mix(in oklab, var(--ink) 30%, transparent); }
.map__inset .map__dots { stroke-width: 3.8; }
.map__dots--europe { stroke: color-mix(in oklab, var(--accent) 52%, transparent); }
.map__dots--visited { stroke: var(--accent); }
.map__box, .map__lead, .map__frame { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.map__frame { stroke: var(--rule-strong); }
.map__via { fill: var(--ground); stroke: var(--accent); stroke-width: 2; r: 7px; }
.map__dot { fill: var(--accent); stroke: none; r: 2.6px; }
.map__inset .map__via { r: 5.5px; stroke-width: 1.6; }
.map__inset .map__dot { r: 2px; }
.map__pin--home .map__via { fill: var(--accent); }
.map__pin--home .map__dot { fill: var(--ground); }
.map__label, .map__fig {
  font-family: var(--ea-mono);
  fill: var(--ink-strong);
  paint-order: stroke;
  stroke: var(--ground);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.map__label { font-size: 19px; }
.map__label--inset { font-size: 13px; stroke-width: 3px; }
.map__fig { font-size: 10px; fill: var(--ink-quiet); stroke-width: 3px; letter-spacing: 0.02em; }
@media (max-width: 899px) {
  .map { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-s); }
  .map__lead { display: none; }
}
/* Phones can't hover, so the three world pins keep their names, drawn larger; Mercersburg moves
   under its pin so it never meets Portugal's label on the same line. */
@media (max-width: 759px) {
  .map__world .map__label { font-size: 34px; stroke-width: 7px; }
  .map__world .map__pin--below .map__label { text-anchor: middle; transform: translate(-1em, 1.5em); }
}

/* Pins arrive one by one as the map scrolls in. Artsy, motion allowed, scroll timelines only. */
@keyframes map-pin { from { opacity: 0; transform: scale(0.2); } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* Each part grows from its own centre: the via from the pin, the label from itself. */
    :root[data-skin="artsy"]:not([data-mode="desktop"]) .map__pin > * {
      transform-box: fill-box;
      transform-origin: center;
      animation: map-pin 1ms cubic-bezier(.2, 1.4, .4, 1) both;
      animation-timeline: --map;
      animation-range: entry 25% entry 55%;
    }
    :root[data-skin="artsy"]:not([data-mode="desktop"]) .map__pin:nth-of-type(2) > * { animation-range: entry 32% entry 62%; }
    :root[data-skin="artsy"]:not([data-mode="desktop"]) .map__pin:nth-of-type(3) > * { animation-range: entry 39% entry 69%; }
    :root[data-skin="artsy"]:not([data-mode="desktop"]) .map__pin:nth-of-type(4) > * { animation-range: entry 46% entry 76%; }
    :root[data-skin="artsy"]:not([data-mode="desktop"]) .map__pin:nth-of-type(5) > * { animation-range: entry 53% entry 83%; }
    :root[data-skin="artsy"]:not([data-mode="desktop"]) .map__pin:nth-of-type(6) > * { animation-range: entry 60% entry 90%; }
  }
}
@media (max-width: 759px) {
  .map__world .map__via { r: 11px; stroke-width: 3; }
  .map__world .map__dot { r: 4px; }
}

/* The longer write-up behind a chapter, when there is one. */
.story__more { margin-block-start: var(--space-s); font-size: var(--t--1); }
.story__more a { color: var(--accent); }
