/* Teison – plain black, text-only. Edit the variables below to restyle everything. */

/* Type: real Helvetica Neue where it is installed (Apple devices), otherwise the bundled Inter Tight,
   which is a close Helvetica-style match. */
@font-face {
  font-family: "Teison Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: local("Helvetica Neue"), local("HelveticaNeue"), url("fonts/inter-tight-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Teison Sans"; font-weight: 500; font-style: normal; font-display: swap;
  src: local("Helvetica Neue Medium"), local("HelveticaNeue-Medium"), url("fonts/inter-tight-latin-500-normal.woff2") format("woff2");
}

:root {
  --bg: #000;
  --fg: #fff;
  --max: 40rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Teison Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 0.9rem;
  line-height: 1.5;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration: none; }

/* Header + nav: just lines of text */
header { margin-bottom: 2.5rem; }
.name { font-weight: 500; text-decoration: none; }
nav a { margin-right: 1rem; text-decoration: none; }
nav a:hover,
nav a[aria-current="page"] { text-decoration: underline; }

/* Headings are plain text, same size as the rest */
h1, h2 {
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0 0 0.25rem;
}
h1 { margin-bottom: 1.5rem; }
h2 { margin-top: 2rem; }

p { margin: 0 0 1rem; }

/* Lists: lines stacked under each other, no dividers */
ul.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

ul.list > li {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0 1rem;
}

ul.list.live > li { grid-template-columns: 4.5rem 1fr 7.5rem; }
ul.list.plain > li { display: block; }

footer { margin-top: 3rem; font-size: 0.7rem; }

@media (max-width: 30rem) {
  .wrap { padding: 1.5rem 1.25rem 4rem; }
  /* on phones each gig stays on one line: date, venue, city (right-aligned) */
  ul.list.live > li {
    grid-template-columns: 3.4rem minmax(0, 1fr) auto;
    column-gap: 0.75rem;
  }
  ul.list.live > li > span:nth-child(3) { text-align: right; white-space: nowrap; }
}

/* Live + Mixes: a poster / cover pops up when you hover a row (rows opt in with class "has-poster"; desktop only) */
ul.list.live > li, ul.list > li.has-poster { position: relative; }
.poster { display: none; }
@media (hover: hover) and (min-width: 41rem) {
  .poster {
    display: block; visibility: hidden;
    position: absolute; z-index: 10; pointer-events: none;
    width: 17rem; height: auto;
    right: 0; top: calc(100% + 0.4rem);      /* narrower windows: just under the row, over the right side of the list */
  }
  .has-poster:hover .poster, .has-poster:focus-within .poster { visibility: visible; }
}
@media (hover: hover) and (min-width: 76rem) {
  .poster { right: auto; left: calc(100% + 2rem); top: 0; }   /* wide windows: in the margin to the right of the list */
}

/* Track lists under each release */
ol.tracks { margin: 0.1rem 0 0.9rem; padding-left: 1.4rem; }

/* Cover art that pops up beside an EP title on hover */
.release { position: relative; }

/* Single-line rows (the remix): the cover sits right after the text */
.cover-wrap.after { position: relative; display: inline-block; }
.cover-wrap.after .cover { left: 100%; margin-left: 1rem; top: auto; bottom: 0; }
.cover {
  display: none;
  position: absolute;
  left: 19rem;
  top: 0;
  width: 20rem;
  height: 20rem;
  object-fit: cover;
  z-index: 10;
  pointer-events: none;
}
/* The hover area is the whole release block (title + tracklist, no gaps between lines),
   so the cover stays put while the mouse moves down the list. */
.release { display: flow-root; width: fit-content; max-width: 100%; }
.cover-wrap:hover .cover,
.cover-wrap:focus-within .cover,
.release:hover .cover,
.release:has(a:focus-visible) .cover { display: block; }
.platforms { margin: 0.1rem 0 0.2rem; }
.platforms a { margin-right: 1rem; }
/* Touch / small screens: no hover, so show a small cover under each title instead */
@media (max-width: 52rem), (hover: none) {
  .cover-wrap, .cover-wrap.after { display: block; }
  .cover, .cover-wrap:hover .cover {
    display: block;
    position: static;
    width: 6.5rem;
    height: 6.5rem;
    margin: 0.5rem 0 0.7rem;
  }
  .cover-wrap.after .cover { margin-left: 0; }
}

/* Home: bio on the left, photo on the right starting level with the first line of the bio */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 21rem) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
.hero-fig { margin: 0.3rem 0 0; }
.hero-img { display: block; width: 100%; height: auto; }
.hero-fig figcaption { font-size: 0.7rem; margin-top: 0.4rem; text-align: right; }

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

/* on wider screens the photo may extend a little past the text column */
@media (min-width: 56rem) {
  .hero-fig { width: calc(100% + 6rem); }
}

/* phones: photo goes under the bio */
@media (max-width: 40rem) {
  .hero { display: block; }
  .hero-fig { margin-top: 2rem; }
  .hero-fig figcaption { text-align: right; }
  .hero-img {
    max-height: 24rem;
    object-fit: cover;
    object-position: center 20%;
  }
}

/* Home page (index.html): centred photo with text over it (phones).
   Text colour flips per pixel: black on light parts of the photo, white on dark parts
   (img/teison-mask.png is a black/white threshold of the photo, used to fill the letters). */
.overlay { --pw: min(24rem, calc(100vw - 2.5rem)); --ph: calc(var(--pw) * 1.25); position: relative; }
.overlay-img {
  position: absolute; top: 50%; left: 50%;
  width: var(--pw); height: var(--ph);
  transform: translate(-50%, -50%);
  object-fit: cover;
}
.overlay-text {
  position: relative; z-index: 1;
  min-height: var(--ph);
  box-sizing: border-box;
  padding: 1.5rem 0;
  display: flex; flex-direction: column; justify-content: center;
  color: transparent;
  background: url("img/teison-c-mask.png") center / var(--pw) var(--ph) no-repeat, #fff;
  -webkit-background-clip: text; background-clip: text;
}
.overlay-text p { margin: 0 0 1rem; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.overlay-text p:last-child { margin: 1rem 0 0; }  /* Releases sits a little lower */
.overlay.snapped .overlay-img { top: var(--pt); transform: translateX(-50%); }
.overlay.snapped .overlay-text { background-position: center var(--pt), 0 0; }
.overlay-text a { text-decoration-color: currentColor; }
.ot-in { display: flex; flex-direction: column; }

/* Home option B on phones: photo ~95px in from each screen edge, text stays full width */
@media (max-width: 40rem) {
  .overlay { --pw: calc(100vw - 190px); }
}

/* Home page on desktop: the photo is always shown to the right of the bio, with ~3.5cm of the text running over it
   (letters flip black/white against the photo); the bio sits vertically centred against the photo. */
@media (min-width: 641px) and (hover: hover) {
  body:has(.overlay) { overflow-x: clip; }
  .overlay { --ov: 3.5cm; --pw: clamp(7rem, calc(50vw - 18.5rem + 2cm - 1rem), 17rem); --ph: calc(var(--pw) * 1.25); }   /* shrinks on narrow windows so the photo stays on screen */
  .overlay-img { top: 50%; left: calc(100% - var(--ov)); transform: translateY(-50%); pointer-events: none; }
  .overlay-text { background: url("img/teison-c-mask.png") right calc(var(--ov) - var(--pw)) center / var(--pw) var(--ph) no-repeat, #fff; -webkit-background-clip: text; background-clip: text; }
  .ot-in { display: block; }
}

/* Desktop (mouse): the 2nd and 3rd bio paragraphs run together as one; on phones and touch they stay split */
@media (min-width: 641px) and (hover: hover) {
  .hero-text, .overlay-text { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
  .hero-text p.join, .overlay-text p.join { display: inline; }
  .hero-text p:last-child { margin-top: 1rem; }   /* keeps the Releases link a line apart from the merged paragraph */
}

/* Archived home A (home-a.html): justified bio (the Releases link stays left-aligned) */
.hero-text p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.hero-text p:last-child { text-align: left; }

/* Home page: credit shares the footer line with the copyright */
footer.split { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }

/* Alternative desktop layout: everything anchored to the left, like fergusjones.com (phones and touch devices unchanged) */
@media (min-width: 641px) and (hover: hover) {
  .wrap { margin-left: 0.5rem; margin-right: 0; }
}
/* Live posters: there is room beside the list from a narrower window on */
@media (hover: hover) and (min-width: 58rem) {
  .poster { right: auto; left: calc(100% + 2rem); top: 0; }
}

/* Desktop: the photo follows the mouse over the whole screen; the mask that flips the text colour moves with it.
   The menu, the bio and the footer all get the same flip (JS positions each mask; sizes come from --fw / --fh). */
@media (min-width: 641px) and (hover: hover) {
  html.follow .overlay-img { left: 0; top: 0; z-index: 1; transform: translate(var(--ix), var(--iy)); }
  html.follow header, html.follow footer {
    position: relative; z-index: 2;
    color: transparent;
    background: url("img/teison-c-mask.png") -9999px -9999px / var(--fw) var(--fh) no-repeat, #fff;
    -webkit-background-clip: text; background-clip: text;
  }
}

/* Desktop, all pages: © in the bottom-left corner of the page (on the home page the photo credit sits in the bottom-right corner) */
@media (min-width: 641px) and (hover: hover) {
  body { position: relative; min-height: 100vh; }
  body footer, html.follow body footer { position: absolute; left: 2rem; right: 2rem; bottom: 2rem; margin: 0; }
}

/* Phones and touch devices: © sits at the bottom of the screen on pages shorter than the screen (long pages: it follows the content as before) */
@media (max-width: 640px), (hover: none) {
  .wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; box-sizing: border-box; padding-bottom: 2rem; }
  footer { margin-top: auto; padding-top: 3rem; }
}

/* Landscape pop-ups (Mixes) get a wider frame so they stay as large as the portrait ones */
@media (hover: hover) and (min-width: 41rem) {
  .poster.wide { width: 24rem; }
}
@media (hover: hover) and (min-width: 58rem) {
  .poster.wide { width: clamp(17rem, calc(100vw - 42rem), 24rem); }   /* beside the list: never wider than the room that is left */
}

/* Music covers pop out in the same place as the Live / Mixes pop-ups: just right of the list (wide windows); Live thumbnails a bit larger */
@media (hover: hover) and (min-width: 41rem) {
  ul.live .poster { width: 21rem; }
}
@media (hover: hover) and (min-width: 58rem) {
  ul.live .poster { width: clamp(17rem, calc(100vw - 42rem), 21rem); }
  ul.list > li:has(.cover-wrap) { position: relative; }
  .release, .cover-wrap.after { position: static; }
  .cover, .cover-wrap.after .cover { left: calc(100% + 2rem); top: 0; bottom: auto; margin-left: 0; width: clamp(14rem, calc(100vw - 42rem), 20rem); height: clamp(14rem, calc(100vw - 42rem), 20rem); }
}

/* Mixes video pop-ups: larger */
@media (hover: hover) and (min-width: 41rem) {
  video.poster.wide { width: 30rem; }
}
@media (hover: hover) and (min-width: 58rem) {
  video.poster.wide { width: clamp(17rem, calc(100vw - 42rem), 30rem); }
}

/* Contact page, desktop only: same effect as the home page (photo follows the mouse; text flips black/white against it).
   Phones and touch devices: no photo, page unchanged. */
.cfx-img, .credit-desk { display: none; }
@media (min-width: 641px) and (hover: hover) {
  body:has(.cfx) { overflow-x: clip; }
  .cfx { --ov: 3.5cm; --pw: clamp(7rem, calc(50vw - 18.5rem + 2cm - 1rem), 17rem); --ph: calc(var(--pw) * 1.25); position: relative; width: fit-content; max-width: 100%; }
  .cfx-img { display: block; position: absolute; top: 50%; left: calc(100% - var(--ov)); transform: translateY(-50%); width: var(--pw); height: var(--ph); object-fit: cover; pointer-events: none; }
  .cfx-text {
    position: relative; z-index: 1; min-height: var(--ph); box-sizing: border-box;
    color: transparent;
    background: url("img/contact-c-mask.png") right calc(var(--ov) - var(--pw)) center / var(--pw) var(--ph) no-repeat, #fff;
    -webkit-background-clip: text; background-clip: text;
  }
  .cfx-text a { text-decoration-color: currentColor; }
  html.follow .cfx-img { left: 0; top: 0; z-index: 1; transform: translate(var(--ix), var(--iy)); }
  html.follow:has(.cfx) header, html.follow:has(.cfx) footer {
    background: url("img/contact-c-mask.png") -9999px -9999px / var(--fw) var(--fh) no-repeat, #fff;
    -webkit-background-clip: text; background-clip: text;
  }
  .credit-desk { display: inline; }
}
