/* =====================================================================
   edlir.velaj.net — made only of words.
   Black on white. One typeface, EB Garamond, in two sizes:
   --t for reading and the menu, --s for labels and the record.
   ===================================================================== */

:root {
  --t: 17px;
  --s: 12px;                 /* Garamond runs small; 12px reads like 11 elsewhere */
  --serif: "EB Garamond", Garamond, "Iowan Old Style", Georgia, serif;

  --ink: #000;
  --paper: #fff;
  --grey: #8c8c8c;
  --light: #c4c4c4;

  --edge: 28px;
  --col: clamp(var(--edge), 14vw, 260px);   /* where the menu and the text begin */
  --gut: 32px;               /* the least space between any two things */
  --r: 0px;                  /* record radius, set by vinyl.js */

  color-scheme: light;
}

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

html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t)/1.5 var(--serif);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  text-transform: lowercase;   /* everything in lowercase */
}

p, h1, h2, ol, ul { margin: 0; padding: 0; }
h1, h2 { font: inherit; }
ol, ul { list-style: none; }
svg { display: block; }
svg text { white-space: pre; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: var(--light); }
a:hover { text-decoration-color: var(--ink); }
/* links that open in a new tab carry a small arrow, outside the underline */
a[target="_blank"]::after {
  content: "\2197" / " (new tab)";
  display: inline-block;
  margin-left: .15em;
  font-size: .8em;
  color: var(--grey);
  text-decoration: none;
}
a[target="_blank"]:hover::after { color: var(--ink); }
/* the arrow comes and goes with the letters around it */
a[target="_blank"]::after { transition: opacity .34s ease .25s; }
.veil a[target="_blank"]::after, .pre a[target="_blank"]::after { opacity: 0; transition-delay: 0s; }
button { font: inherit; text-transform: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left; }
:focus-visible { outline: 1px dotted var(--ink); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--paper); }

.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ph { font-style: italic; }   /* placeholder: waiting for real content */

/* the small voice */
.top, .label, .meta {
  font-size: var(--s);
  font-weight: 500;
  letter-spacing: .06em;
  font-variant-numeric: lining-nums tabular-nums;
}
.meta { color: var(--grey); }

/* ---------------------------------------------------------------------
   Page
   --------------------------------------------------------------------- */
.top { padding: var(--edge); position: relative; z-index: 3; display: flex; justify-content: space-between; gap: 1em; }
.top a { text-decoration: none; }
.top__side { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .3em 1.4em; }
.top__side a { color: var(--grey); }
.top__side a:hover { color: var(--ink); }
html:not([lang="en"]) [data-for="en"], html:not([lang="sq"]) [data-for="sq"] { display: none; }

/* Wide screens: the text stops short of the record, so nothing overlaps. */
main {
  position: relative;
  z-index: 2;
  padding: 7vh calc(var(--r) + var(--gut)) 12vh var(--col);
}
.section { max-width: 34em; }
.js main > .section:not(.is-current) { display: none; }
.pre { visibility: hidden; }

/* the menu already says where you are, so the titles are for screen readers only */
.title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.title + p { margin-bottom: 1.4em; }
.label { margin: 3.6em 0 1em; }
.title + .label { margin-top: 0; }
.note { margin-top: 1.4em; }

.list li { margin-bottom: .35em; }
.list .meta { margin-left: .6em; white-space: nowrap; }
.list .links { margin-left: .6em; white-space: nowrap; }

.track { cursor: pointer; }
.track:hover > :first-child { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
/* a tale's own page: its title, its date, the text */
/* the tales keep the case they were written in; everything else is lowercase */
.tale-page__title, .tale__text, .tales a, .oneliners > li > :first-child { text-transform: none; }
/* one-liners: scattered, each its own width and a little tilted, still newest first */
.oneliners > li { width: var(--w); margin: 0 0 2.6em var(--x); transform: rotate(var(--t)); transform-origin: 0 0; }
@media (max-width: 600px) { .oneliners > li { width: max(var(--w), 82%); margin-left: calc(var(--x) * .35); } }
.tale-page__title { font-style: italic; margin-bottom: 1.6em; }
.tale-page .tale-page__date { margin: 2.4em 0 0; text-align: right; }
.tale-page p { margin: 0 0 .8em; }
.tale-page .label { margin: 2em 0 1em; }
.tale-page .tale__sign { margin: 0; color: var(--grey); }
.tale-page p:not(.tale__sign) + .tale__sign { margin-top: 1.6em; }
.tale__langs { color: var(--grey); margin-bottom: 1.6em !important; }
.tale__langs button { color: var(--grey); }
.tale__langs button:hover, .tale__langs button.is-on { color: var(--ink); }
.tales a { text-decoration: none; }
.tales a:hover { text-decoration: underline; text-decoration-color: var(--ink); }

/* the song on the record: a black dot before it, which nudges it along */
li.is-current > .track > :first-child { text-decoration: none; }
/* the bullet is centred on capital height; lowered to the middle of lowercase letters */
li.is-current > .track > :first-child::before { content: "•\00a0"; color: var(--ink); vertical-align: -.07em; }
li.is-playing > .track .meta { color: var(--ink); }

/* the patch of watercolour at the bottom, behind everything (wash.js) */
.wash { position: absolute; z-index: 0; pointer-events: none; }   /* on the paper: it scrolls with the page */

/* ---------------------------------------------------------------------
   The menu: three words below the name, each a little tilted and set a
   little lower or higher than the next. The section you are on is black.
   --------------------------------------------------------------------- */
.menu {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .6em 2.2em;
  padding: 7vh var(--edge) 0 var(--col);
}
.menu a {
  display: inline-block;
  font-style: italic;
  color: var(--grey);
  text-decoration: none;
  transform-origin: 0 50%;
  transition: color .3s ease;
}
.menu a:hover, .menu a.is-on { color: var(--ink); }
.menu a:nth-child(1) { transform: rotate(-2.4deg); margin-top: 0; }
.menu a:nth-child(2) { transform: rotate(1.6deg);  margin-top: 13px; }
.menu a:nth-child(3) { transform: rotate(-.9deg); margin-top: 5px; }
.menu a:nth-child(4) { transform: rotate(1.1deg);  margin-top: 10px; }
.menu a:nth-child(5) { transform: rotate(-1.7deg); margin-top: 3px; }
.menu a:nth-child(6) { transform: rotate(.8deg);  margin-top: 12px; }

/* ---------------------------------------------------------------------
   Letters coming and going
   --------------------------------------------------------------------- */
.sp .l { transition: opacity .34s cubic-bezier(.3, .7, .3, 1); }
.veil .l { opacity: 0; }

/* ---------------------------------------------------------------------
   The record: a quarter of a vinyl in the corner, nothing else
   --------------------------------------------------------------------- */
.vinyl, .vinyl__hit {
  position: fixed;
  right: calc(var(--r) * -1);
  bottom: calc(var(--r) * -1);
  width: calc(var(--r) * 2);
  height: calc(var(--r) * 2);
}
.vinyl { pointer-events: none; z-index: 1; }
.vinyl__disc { position: relative; width: 100%; height: 100%; will-change: transform; }
.vinyl__disc > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.vinyl__hit { border-radius: 50%; z-index: 15; touch-action: none; cursor: grab; }
.vinyl__hit:active { cursor: grabbing; }
.vinyl__hit[hidden] { display: none; }

/* ---------------------------------------------------------------------
   Narrower screens: the text takes the full width. The record is opaque, like a real one: text that
   reaches it slides under its edge, and nowhere else is anything hidden.
   --------------------------------------------------------------------- */
@media (max-width: 1079px) {
  :root { --edge: 20px; --gut: 24px; --col: var(--edge); }
  main { padding: 6vh var(--edge) calc(var(--r) + var(--gut)); }
  .menu { padding-top: 5vh; gap: .6em 1.6em; }
  .section { max-width: 36em; }
  .vinyl { z-index: 4; background: var(--paper); border-radius: 50%; }
}
@media (max-width: 420px) {
  :root { --edge: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .sp .l, .menu a { transition: none !important; }
}
