/*  ═════════════════════════════════════════════════
   VOJETO STUDIO — site styles
   Colour and type values follow the brand manual, 1 August 2026.
   Palette names mirror its two-ink metaphor: paper, ink, vermilion.
   ═════════════════════════════════════════════════ */

/* ── Schrift ──────────────────────────────────────────────
   Selbst gehostet, kein Google. Alegreya und Alegreya Sans, SIL OFL,
   Lizenztexte liegen in /fonts/ daneben.

   Die Dateien sind Teilmengen: Latin-1, Latin Extended-A (damit ĉ ĝ ĥ ĵ ŝ ŭ
   erhalten bleiben, Kapitel 04), Interpunktion, Kerning. Rund 50 kB je
   Schnitt. WOFF, weil es überall läuft; wer WOFF2 erzeugen kann, hängt es
   als erste Quelle davor — dieselben Teilmengen, etwa ein Fünftel kleiner.
   ───────────────────────────────────────────────────── */

/* Wortmarke und Überschriften stehen in der 500: Die 700 kippt bei der
   kalligrafischen Alegreya ins Verspielte. Die 700 bleibt deklariert, damit
   ein <strong> in Serifentext echt fett wird statt künstlich verdickt; der
   Browser lädt sie nur, wenn sie gebraucht wird. */
@font-face{
  font-family:'Alegreya';
  src:url('/fonts/alegreya-500.woff') format('woff');
  font-weight:500; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'Alegreya';
  src:url('/fonts/alegreya-700.woff') format('woff');
  font-weight:700; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'Alegreya Sans';
  src:url('/fonts/alegreya-sans-400.woff') format('woff');
  font-weight:400; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'Alegreya Sans';
  src:url('/fonts/alegreya-sans-500.woff') format('woff');
  font-weight:500; font-style:normal; font-display:swap;
}

/* Kapitel 04 weist längeren Fließtext eigentlich der Alegreya 400 zu; die
   Seite setzt ihn bewusst in der Alegreya Sans. Deren Kursive trägt nur
   den Schlusssatz der Prosa, der Browser lädt sie erst, wenn sie gebraucht
   wird. (alegreya-400-italic.woff, die Serifen-Kursive, liegt ungenutzt
   bereit.) */
@font-face{
  font-family:'Alegreya Sans';
  src:url('/fonts/alegreya-sans-400-italic.woff') format('woff');
  font-weight:400; font-style:italic; font-display:swap;
}

/* ── Tokens ──────────────────────────────────────────────── */

:root{
  color-scheme: light dark;

  /* Colour — light theme */
  --paper:        #F6F2E9;  /* n-050, the default ground        */
  --paper-raised: #FCFAF3;  /* n-000, cards and raised surfaces */
  --hairline:     #E2DBCB;  /* n-200, rules and frames          */
  --ink:          #22201D;  /* n-800, body copy and the mark    */
  --ink-muted:    #6E685C;  /* n-500, secondary copy and labels */
  --accent:       #9C3520;  /* z-600, the only accent colour    */
  --accent-tint:  #F5E2DB;  /* z-100, selection highlight       */

  /* Secondary copy and the uppercase footer labels run on n-500, never
     n-400: the manual reserves n-400 for placeholders and disabled
     states, and on paper it reaches only 3.0:1, below AA. */

  /* Type */
  --font-serif: 'Alegreya', Iowan Old Style, Palatino, Georgia, serif;
  --font-sans:  'Alegreya Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-mono:  ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Measures */
  --measure: 34rem;  /* reading width for every text column */

  /* Motion — the path forms from the near stone to the far one.
     Every duration lives here so the timing is tuned in one place. */
  --reveal-mark:         1700ms;
  --fade-in:              600ms;
  --delay-wordmark:      1000ms;
  --delay-pronunciation: 1250ms;
  --delay-rule:          1500ms;
  --ease: cubic-bezier(.33, 0, .2, 1);
}

/* Dark theme — chapter 08. The mark stays one and the same file:
   its highlights are holes, so they pick up whatever lies behind. */
@media (prefers-color-scheme: dark){
  :root{
    --paper:        #1A1916;
    --paper-raised: #22211D;
    --hairline:     #383530;
    --ink:          #EFE9DD;
    --ink-muted:    #9D978A;
    --accent:       #D9705A;  /* z-300, or it sinks into the ground */
    --accent-tint:  #3A211A;
  }
}

/* ── Foundation ──────────────────────────────────────────── */

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

/* A column of header (inner pages only), main and footer; main takes
   the slack, so the footer sits at the bottom of short pages. */
body{
  margin: 0;
  min-block-size: 100svh;
  display: flex;
  flex-direction: column;

  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main{ flex-grow: 1; }

::selection{ background: var(--accent-tint); color: var(--ink); }

:where(a){ color: var(--accent); text-underline-offset: .18em; }

:where(a):focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* First stop for keyboard users: out of sight until it has focus. */
.skip-link{
  position: absolute;
  inset-block-start: 1rem;
  inset-inline-start: 1rem;
  z-index: 1;
  padding: .5rem .9rem;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(calc(-100% - 2rem));
}
.skip-link:focus{ transform: none; }

/* ── Card ────────────────────────────────────────────────── */

/* No longer stretched to the full viewport: with text underneath, a
   full-height card hides the fact that there is anything to scroll to.
   The top padding keeps the composition it had. */
.card{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(3.5rem, 11vh, 6rem) 1.5rem .5rem;

  --wordmark-size: clamp(1.9rem, 6.5vw, 2.75rem);

  /* The V's diagonal and the round o read narrower than their outlines,
     so the pronunciation line starts and ends this far inside the
     wordmark (a fraction of its size). It also takes slack out of the
     justified first line. */
  --optical-inset: .12;
}

/* Wordmark and pronunciation share one column, exactly as wide as the
   wordmark: the pronunciation adds nothing to the column's width
   (inline-size: 0) and then fills it (min-inline-size: 100%). */
.title{
  display: flex;
  flex-direction: column;
}

.mark{
  block-size: clamp(4.6rem, 15vw, 7.75rem);
  inline-size: auto;
  color: var(--ink);
}

.wordmark{
  margin: 1.9rem 0 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--wordmark-size);
  line-height: 1.05;
  letter-spacing: -.012em;
}

/* The first line is set justified, so it runs from under the V to under
   the o of "Studio" and the phonetic always starts beneath the word it
   spells. The last line stays centred. */
.pronunciation{
  inline-size: 0;
  min-inline-size: 100%;
  margin: .7rem 0 0;
  padding-inline: calc(var(--optical-inset) * var(--wordmark-size));
  color: var(--ink-muted);
  /* Capped at .47 of the wordmark: between about 460 and 500px the
     wordmark still sits at its minimum while this line already grows,
     and above that ratio "Esperanto" drops off the first line, leaving
     the dash alone in a justified line. */
  font-size: min(clamp(.9rem, 3.4vw, 1.05rem), .47 * var(--wordmark-size));
  text-align: justify;
  text-align-last: center;
}

/* Spans "Vojeto" above at every viewport: from the optical inset inside
   the V to the end of the o, ink to ink.
   Measured: in Alegreya 500 at -.012em tracking, "Vojeto" inks across
   2.515em of the wordmark size; the inset comes off the left end. The
   eleven monospace cells take 11ch;
   the brackets sit inset by about .46ch on the left and .42ch on the
   right (SF Mono; other monospaces within a pixel). The remainder is
   spread over the ten gaps between the characters. The negative start
   margin pulls the bracket's ink flush with the V; the end margin
   cancels the tracking after the last character.
   Re-measure if the wordmark's font, weight or tracking changes. */
.phonetic{
  --track: calc(((2.515 - var(--optical-inset)) * var(--wordmark-size) - 10.13ch) / 10);
  font-family: var(--font-mono);
  font-size: .86em;
  letter-spacing: var(--track);
  margin-inline: -.46ch calc(-1 * var(--track));
}

/* The only vermilion surface on the site — the rule beneath the letterhead.
   Elsewhere the accent appears only as interaction: links, hover, focus. */
.rule{
  inline-size: 2.5rem;
  block-size: 2px;
  margin: 2rem 0 0;
  border: 0;
  background: var(--accent);
}

/* ── Letterhead on inner pages ────────────────────────────
   The title page's card in miniature: mark and name, centred, one link
   home, the sections beneath in the same small capitals as the footer.
   No pronunciation, no rule — those belong to the title page.
   ───────────────────────────────────────────────────── */

.site-header{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  padding: clamp(2.25rem, 7vh, 3.5rem) 1.5rem 0;
}

.home-link{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  padding: .25rem .5rem;
  color: var(--ink);
  text-decoration: none;
}

.home-link .mark{
  block-size: 2.9rem;
}

.home-link__name{
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.3rem;
  line-height: 1.05;
  letter-spacing: -.012em;
}

.home-link:hover .home-link__name{ color: var(--accent); }

.site-nav{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1.5rem;
}

/* Chapter 04 sets labels in Alegreya Sans 500. Header and footer share
   them; the current page and its section read in ink. */
:is(.site-nav, .legal-nav) a{
  padding: .4rem .25rem;
  color: var(--ink-muted);
  font-weight: 500;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
}
:is(.site-nav, .legal-nav) a:hover{ color: var(--accent); }
:is(.site-nav, .legal-nav) a[aria-current]{ color: var(--ink); }

/* ── Prose ────────────────────────────────────────────────
   The card is a title page and stays centred. What follows is a text
   page: one column, left aligned, at a width the eye can track. The
   column itself is centred, so the page keeps its axis.
   ───────────────────────────────────────────────────── */

.prose{
  inline-size: 100%;
  max-inline-size: var(--measure);
  margin-inline: auto;
  padding-inline: 1.5rem;
  padding-block-start: clamp(3rem, 9vh, 4.5rem);
}

.prose:last-of-type{ padding-block-end: 1rem; }

/* Type is shared by the plain text column (.prose) and the pages with
   pictures (.page, below). */

/* Page titles on inner pages: a step below the wordmark, the same voice. */
:is(.prose, .page) h1{
  margin: 0 0 1.5rem;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 6.5vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -.012em;
}

:is(.prose, .page) h2{
  margin: 0 0 .85rem;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.45rem, 5vw, 1.8rem);
  line-height: 1.15;
  letter-spacing: -.01em;
}

:is(.prose, .page) h3{
  margin: 1.75rem 0 .3rem;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.2;
}

:is(.prose, .page) :is(p, address, li){
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.68;
  color: var(--ink);
  text-wrap: pretty;
}

:is(.prose, .page) address{ font-style: normal; }

:is(.prose, .page) :is(p, address, ul) + :is(p, address, ul){ margin-block-start: 1em; }

:is(.prose, .page) ul{
  margin: 0;
  padding-inline-start: 1.2em;
}
:is(.prose, .page) li + li{ margin-block-start: .35em; }
:is(.prose, .page) li::marker{ color: var(--ink-muted); }

/* Alegreya Sans comes in 400 and 500 only; without this a <strong> would
   ask for 700 and get a synthetic bold. */
:is(.prose, .page) strong{ font-weight: 500; }

/* The line a section ends on, set apart in the italic. */
:is(.prose, .page) .coda{ font-style: italic; }

/* The sentence under a page title. */
:is(.prose, .page) .lead{
  margin-block-start: -.75rem;
  font-size: clamp(1.25rem, 4vw, 1.45rem);
  line-height: 1.4;
  text-wrap: balance;
}

/* Hyphenation only where short splits can be ruled out: "ei-nen" or
   "Ent-wickler" do more harm than a ragged line. Browsers that cannot
   limit the split points do not hyphenate at all.
   Four letters on either side of the break; the trailing 5 because
   Chromium counts a following comma or full stop as part of the word
   ("Merkma-len," would pass with 4). */
@supports (hyphenate-limit-chars: 10 4 5){
  :is(.prose, .page) :is(p, li){
    hyphens: auto;
    hyphenate-limit-chars: 10 4 5;
  }
}

/* ── Documents ───────────────────────────────────────────
   Impressum, Datenschutz: many short sections, so the section headings
   step down to the size of a label in the serif and the sections sit
   closer together than the essays on the title page.
   ───────────────────────────────────────────────────── */

.document h2{
  margin: 2.25rem 0 .4rem;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.document h1 + h2{ margin-block-start: 0; }

.document .meta{
  margin-block-start: 2.5rem;
  color: var(--ink-muted);
  font-size: .95rem;
}

/* ── Pages with pictures ─────────────────────────────────
   Text keeps the reading measure of the title page; pictures may step
   out into a wider column on either side. Every child sits in the text
   column unless it is marked .wide.
   ───────────────────────────────────────────────────── */

.page{
  display: grid;
  grid-template-columns:
    [full-start] minmax(1.5rem, 1fr)
    [wide-start] minmax(0, 13rem)
    [content-start] min(calc(var(--measure) - 3rem), calc(100% - 3rem)) [content-end]
    minmax(0, 13rem) [wide-end]
    minmax(1.5rem, 1fr) [full-end];
  padding-block: clamp(3rem, 9vh, 4.5rem) 1rem;
}

.page > *{ grid-column: content; }
.page > .wide{ grid-column: wide; }

/* Sections of a long page are set further apart than paragraphs. */
.page > h2{ margin-block-start: 3.5rem; }

/* The one call to action of a page. Vermilion, because the accent is
   reserved for what can be acted on. */
:is(.prose, .page) .actions{ margin-block-start: 1.75rem; }

.button{
  display: inline-block;
  padding: .7rem 1.25rem;
  border-radius: 5px;
  background: var(--accent);
  color: var(--paper);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.3;
  text-decoration: none;
}
.button:hover{ background: color-mix(in oklab, var(--accent) 82%, var(--ink)); }

:is(.prose, .page) .note{
  margin-block-start: 1rem;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.55;
}

.figure{ margin: 2.75rem 0 0; }

.figure picture{ display: block; }

.figure img{
  display: block;
  inline-size: 100%;
  block-size: auto;
  border-radius: 6px;
  box-shadow:
    0 0 0 1px var(--hairline),
    0 1.25rem 2.5rem -1.5rem rgb(0 0 0 / .45);
}

.figure figcaption{
  margin-block-start: .75rem;
  color: var(--ink-muted);
  font-size: .95rem;
  line-height: 1.5;
}

.gallery{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 2.25rem 1.75rem;
  margin-block-start: 2.75rem;
}
.gallery .figure{ margin: 0; }

/* Term and description side by side while there is room. */
.facts{
  display: grid;
  grid-template-columns: minmax(7rem, max-content) 1fr;
  gap: .55rem 1.5rem;
  margin: 0;
}
.facts dt{
  color: var(--ink-muted);
  font-weight: 500;
  line-height: 1.68;
}
.facts dd{
  margin: 0;
  line-height: 1.68;
  text-wrap: pretty;
}
.facts :is(dt, dd){ font-size: 1.05rem; }

/* The data sources: many short pairs in several lists, a step smaller.
   One fixed term column for all of them, so the sources line up from
   group to group; long terms wrap inside it. */
.facts--sources{ grid-template-columns: minmax(0, 13rem) 1fr; }

@media (max-width: 32rem){
  .facts,
  .facts--sources{ grid-template-columns: 1fr; gap: 0; }
  .facts dd + dt{ margin-block-start: .75rem; }
}

.facts--sources :is(dt, dd){ font-size: .98rem; }
.facts--sources dt{ color: var(--ink); font-weight: 400; }
.facts--sources dd{ color: var(--ink-muted); }

/* ── App cards ───────────────────────────────────────────
   One link per card, on the title; its hit area is stretched over the
   whole card. The picture comes first on screen but last in the
   source, so a screen reader meets the name before anything else.
   ───────────────────────────────────────────────────── */

.app-list{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr));
  gap: 1.75rem;
  margin-block-start: 2.5rem;
}

.app-card{
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--paper-raised);
}

.app-card__picture{ order: -1; }
.app-card__picture img{
  display: block;
  inline-size: 100%;
  block-size: auto;
  border-block-end: 1px solid var(--hairline);
}

.app-card__body{ padding: 1.1rem 1.25rem 1.3rem; }

:is(.prose, .page) .app-card__title{
  margin: 0 0 .3rem;
  font-size: 1.45rem;
}

.app-card__link{
  color: var(--ink);
  text-decoration: none;
}
.app-card__link::after{
  content: "";
  position: absolute;
  inset: 0;
}
.app-card:hover .app-card__link{
  color: var(--accent);
  text-decoration: underline;
}

@supports selector(:has(*)){
  .app-card:has(.app-card__link:focus-visible){
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }
  .app-card__link:focus-visible{ outline: none; }
}

:is(.prose, .page) .app-card__meta{
  margin-block-start: .6rem;
  color: var(--ink-muted);
  font-size: .95rem;
}

/* While there is only one app, it takes the whole width: picture and text
   side by side instead of a lone card at the left of an empty grid. */
.app-card:only-child{ grid-column: 1 / -1; }

@media (min-width: 48rem){
  .app-card:only-child{
    flex-direction: row;
    align-items: center;
  }
  .app-card:only-child .app-card__picture{ flex: 3 1 0; }
  .app-card:only-child .app-card__picture img{
    border-block-end: 0;
    border-inline-end: 1px solid var(--hairline);
  }
  .app-card:only-child .app-card__body{
    flex: 2 1 0;
    padding: 1.5rem 2rem;
  }
}

/* ── Footer ────────────────────────────────────────────── */

.site-footer{
  padding: 2.5rem 1.5rem 1.6rem;
}

.legal-nav{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1.5rem;
}

/* ── Motion ───────────────────────────────────────────────────
   The mark is uncovered along the diagonal the stones lie on:
   near left to far right, the direction you would walk. A mask does
   the uncovering, so the artwork stays a single evenodd path —
   split it up and the highlights stop being holes.

   Only on the title page: inner pages show the mark as it is. The
   prose does not animate either: it is read, not presented, and a
   second reveal would only delay it.
   ─────────────────────────────────────────────────── */

.card .mark{
  -webkit-mask-image: linear-gradient(66deg, #000 42%, transparent 58%);
          mask-image: linear-gradient(66deg, #000 42%, transparent 58%);
  -webkit-mask-size: 260% 260%;
          mask-size: 260% 260%;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
          mask-mode: alpha;
  animation: uncover-path var(--reveal-mark) var(--ease) both;
}

@keyframes uncover-path{
  from{ -webkit-mask-position: 100% 0%;  mask-position: 100% 0%; }
  to  { -webkit-mask-position: 0% 100%;  mask-position: 0% 100%; }
}

.wordmark,
.pronunciation{
  animation: rise-in var(--fade-in) ease-out both;
}
.wordmark     { animation-delay: var(--delay-wordmark); }
.pronunciation{ animation-delay: var(--delay-pronunciation); }

@keyframes rise-in{
  from{ opacity: 0; transform: translateY(7px); }
  to  { opacity: 1; transform: none; }
}

.rule{
  animation: draw-rule 520ms var(--ease) var(--delay-rule) both;
}

@keyframes draw-rule{
  from{ transform: scaleX(0); }
  to  { transform: scaleX(1); }
}

/* Anyone who has switched motion off gets the same picture, unbuilt. */
@media (prefers-reduced-motion: reduce){
  .card .mark{
    -webkit-mask-image: none;
            mask-image: none;
  }
  .card .mark,
  .wordmark,
  .pronunciation,
  .rule{
    animation: none;
  }
}
