/* Audio guide — designbykatrina.art
   Palette taken from the Kvarken shore: mist, sea, stone, lichen. */

@font-face {
  font-family: "Newsreader";
  src: url("/static/fonts/newsreader-latin-300-normal.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/static/fonts/newsreader-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/static/fonts/newsreader-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  --mist:   #e7edeb;   /* page */
  --ink:    #1d2a2e;   /* text */
  --sea:    #2e5c61;   /* thread, links, controls */
  --stone:  #66706c;   /* secondary text */
  --lichen: #a7b597;   /* unplayed stitches */
  --surface:#f3f6f5;   /* image mat */
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --mist:   #151d20;
    --ink:    #dde6e3;
    --sea:    #86b6ba;
    --stone:  #9aa5a1;
    --lichen: #4f5e55;
    --surface:#1d272a;
  }
}
*, *::before, *::after { box-sizing: inherit; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;          /* 19px: comfortable when standing, phone in hand */
  line-height: 1.6;
  font-optical-sizing: auto;
}

main, .site-footer {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 1.4rem;
}
main { padding-top: 2.2rem; }

/* ---------- Artwork image ---------- */
.artwork {
  margin: 0 -1.4rem 2rem;
  background: var(--surface);
}
.artwork img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

/* ---------- Heading block ---------- */
.artist {
  margin: 0;
  color: var(--stone);
  font-size: 1rem;
  letter-spacing: 0.01em;
}
h1 {
  margin: 0.15rem 0 0;
  font-weight: 300;
  font-size: clamp(2.4rem, 11vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.note {
  margin: 0.6rem 0 0;
  color: var(--stone);
  font-style: italic;
  font-size: 1rem;
}

/* ---------- Player: the stitched line ---------- */
.player {
  margin: 2.2rem 0 2.4rem;
}
.player audio[controls] { width: 100%; }   /* no-JS fallback */

.player .ui {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 1.1rem;
  align-items: center;
}
.play {
  grid-row: 1 / span 2;
  width: 4rem; height: 4rem;
  border: 0;
  border-radius: 50%;
  background: var(--sea);
  color: var(--mist);
  display: grid;
  place-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.play svg { width: 1.6rem; height: 1.6rem; }
.play .i-pause { display: none; }
.player.playing .play .i-play  { display: none; }
.player.playing .play .i-pause { display: block; }
.play:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.track {
  position: relative;
  height: 2.75rem;               /* generous touch target */
}
/* Unplayed: running stitches */
.track::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 50%;
  height: 2px; margin-top: -1px;
  background: repeating-linear-gradient(90deg,
      var(--lichen) 0 9px, transparent 9px 15px);
}
/* Played: continuous thread */
.track .thread {
  position: absolute; left: 0; top: 50%;
  height: 3px; margin-top: -1.5px;
  width: var(--p, 0%);
  background: var(--sea);
  border-radius: 2px;
}
.track .knot {
  position: absolute; top: 50%;
  left: var(--p, 0%);
  width: 11px; height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: var(--sea);
}
.track input[type=range] {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.track:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}
.time {
  margin: 0;
  color: var(--stone);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.pending {
  margin: 0;
  color: var(--stone);
  font-style: italic;
}

/* ---------- Text ---------- */
.text p { margin: 0 0 1.05em; }
.text p:last-child { margin-bottom: 0; }

/* ---------- Index ---------- */
.venue { margin: 0.6rem 0 0; color: var(--stone); }
.lede { margin: 2rem 0 0; }
.works {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  border-top: 1px dashed var(--lichen);
}
.works li { border-bottom: 1px dashed var(--lichen); }
.works a {
  display: block;
  padding: 0.85rem 0;
  font-size: 1.45rem;
  font-weight: 300;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3.5rem;
  padding-top: 1.4rem;
  padding-bottom: 3rem;
  color: var(--stone);
  font-size: 1.1rem;
}
.site-footer a {
  display: inline-block;
  padding: 0.3rem 0;  
}
.site-footer::before {
  content: "";
  display: block;
  height: 2px;
  margin-bottom: 1.4rem;
  background: repeating-linear-gradient(90deg,
      var(--lichen) 0 9px, transparent 9px 15px);
}
.site-footer p { margin: 0 0 0.6rem; }
.exhibition { font-style: italic; }

a { color: var(--sea); text-underline-offset: 0.18em; }

/* Light mode: white photo backgrounds blend into the page */
@media (prefers-color-scheme: light) {
  .artwork { background: transparent; padding: 0 1.4rem; }
  .artwork img { mix-blend-mode: multiply; }
}