/* Lily Lake — layout and behaviour. Colours and typefaces come from
   content/theme.json via /assets/theme.css; nothing about the palette is
   hard-coded here.

   The original's frame, kept: a white page, the name in Times top-left, a
   short light-weight menu under it, the work centred, a hairline and the
   Instagram mark at the foot. */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
figure { margin: 0; }
button { font: inherit; color: inherit; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--ground); padding: 8px 12px; z-index: 10;
}
.skip:focus { left: 16px; top: 16px; }

:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* ---- frame ------------------------------------------------------------- */
/* Desktop: a fixed left column for the name and menu; the work fills the
   rest. Phone: the name and a Menu button across the top. */

.frame {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-areas:
    "masthead main"
    "nav      main"
    ".        footer";
  grid-template-rows: auto 1fr auto;
  column-gap: 48px;
  max-width: 1440px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 44px 64px 32px;
}

.masthead { grid-area: masthead; }
.nav { grid-area: nav; }
main { grid-area: main; min-width: 0; padding-top: 92px; }
.footer { grid-area: footer; }

.name {
  font-family: var(--font-display);
  font-size: 29px;
  line-height: 1.2;
  font-weight: 400;
  text-decoration: none;
  letter-spacing: 0.005em;
  white-space: nowrap;
}

.menu-toggle { display: none; }

.nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding-top: 92px;
  position: sticky;
  top: 44px;
  align-self: start;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}
.nav a:hover, .nav a.active { color: var(--ink); }
.nav a.active { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 96px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
}
.instagram { display: inline-flex; width: 20px; height: 20px; color: var(--muted); }
.instagram:hover { color: var(--ink); }
.instagram svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; }
.instagram svg .dot { fill: currentColor; stroke: none; }

main section + section { margin-top: 72px; }
main section > * + * { margin-top: 72px; }

/* Captions and running text in the original's Times. */
figcaption, .text, .bio-text, .piece figcaption {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
}

/* ---- home: one image ----------------------------------------------------- */
.feature { max-width: 780px; margin: 0 auto; }
.feature a { display: block; }
.feature figcaption { margin-top: 14px; text-align: center; color: var(--muted); }

/* ---- sound: pieces, one under another ------------------------------------ */
.pieces { display: flex; flex-direction: column; gap: 88px; max-width: 640px; margin: 0 auto; }
.piece figcaption { margin-top: 16px; text-align: center; }
.piece-title { margin: 0 0 18px; text-align: center; font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.25; }
.piece-caption { color: var(--ink); }
.piece-note { font-family: var(--font-body); font-size: 14px; color: var(--muted); margin-top: 6px; }

.facade {
  position: relative;
  display: block;
  overflow: hidden;
  background: #111;
  margin: 0 auto;
}
.facade.shape-wide { aspect-ratio: 16 / 9; width: 100%; }
.facade.shape-square { aspect-ratio: 1 / 1; width: min(100%, 400px); }
.facade.shape-bandcamp { aspect-ratio: 350 / 470; width: min(100%, 350px); background: var(--ground); }
.facade img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease, opacity 0.3s; }
.facade.shape-bandcamp img { height: 74.5%; }
a.facade:hover img { transform: scale(1.02); opacity: 0.92; }
.facade iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
}
.play svg { width: 64px; height: 64px; filter: drop-shadow(0 1px 8px rgba(0, 0, 0, 0.35)); }
.play circle { fill: rgba(255, 255, 255, 0.92); }
.play path { fill: #1d1d1d; }
.facade.shape-bandcamp .play { bottom: 25.5%; }

/* ---- sculpture: a slideshow --------------------------------------------- */
.slideshow { max-width: 720px; margin: 0 auto; }
.slides { display: grid; gap: 48px; }
.slide a { display: block; cursor: zoom-in; }
.slide img { margin: 0 auto; max-height: 78vh; width: auto; }
.slide figcaption { margin-top: 12px; text-align: center; color: var(--muted); }

/* With JS, one slide at a time, stacked in one cell so the height never jumps
   more than the photographs themselves differ. */
.slideshow.is-live .slides { gap: 0; }
.slideshow.is-live .slide { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0s linear 0.35s; }
.slideshow.is-live .slide.is-current { opacity: 1; visibility: visible; transition: opacity 0.35s ease; }

.slide-controls { display: none; }
.thumbs { display: none; }
.slideshow.is-live .slide-controls {
  display: flex; justify-content: center; align-items: center; gap: 28px;
  margin-top: 20px; color: var(--muted); font-size: 13px; letter-spacing: 0.08em;
}
.slide-controls button {
  background: none; border: 0; padding: 6px 10px; cursor: pointer;
  font-size: 18px; color: var(--muted);
}
.slide-controls button:hover { color: var(--ink); }
.slideshow.is-live .thumbs {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px;
}
.thumb {
  width: 64px; height: 64px; padding: 0; border: 0; background: none; cursor: pointer;
  opacity: 0.45; transition: opacity 0.2s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover, .thumb.is-current { opacity: 1; }

/* ---- flowers: a collage --------------------------------------------------- */
.gallery { columns: 3 260px; column-gap: 14px; max-width: 1000px; margin: 0 auto; }
.tile { break-inside: avoid; margin-bottom: 14px; }
.tile a { display: block; cursor: zoom-in; overflow: hidden; }
.tile img { width: 100%; transition: transform 0.6s ease; }
.tile a:hover img { transform: scale(1.02); }
.tile figcaption { margin-top: 6px; font-size: 14px; color: var(--muted); }

/* ---- text ------------------------------------------------------------- */
.text { max-width: 560px; margin-left: auto; margin-right: auto; }
.text p { margin: 0 0 1em; }
.text p:last-child { margin-bottom: 0; }

/* ---- bio ------------------------------------------------------------- */
.bio {
  display: grid;
  grid-template-columns: minmax(0, 330px) minmax(0, 330px);
  gap: 52px;
  justify-content: center;
  align-items: start;
}
.bio-photos { display: grid; gap: 26px; }
.bio-text p { margin: 0 0 1em; }
.bio-email { margin-top: 2.2em !important; }
.bio-email a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.bio-email a:hover { border-color: var(--ink); }

/* ---- cv ------------------------------------------------------------- */
.cv { max-width: 760px; margin: 0 auto; }
.cv-group + .cv-group { margin-top: 44px; }
.cv h2 {
  margin: 0 0 14px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.cv ul { list-style: none; margin: 0; padding: 0; }
.cv li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  padding: 7px 0;
  border-top: 1px solid var(--rule);
  font-size: 15px;
}
.cv li.undated { grid-template-columns: minmax(0, 1fr); }
.cv li:last-child { border-bottom: 1px solid var(--rule); }
.cv .when { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- lightbox ----------------------------------------------------------- */
.lightbox {
  border: 0; padding: 0; margin: 0;
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  background: rgba(255, 255, 255, 0.97);
}
.lightbox::backdrop { background: rgba(255, 255, 255, 0.97); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: calc(100vw - 120px); max-height: calc(100vh - 80px); width: auto; height: auto; }
.lightbox button {
  position: fixed; background: none; border: 0; cursor: pointer;
  font-size: 22px; color: var(--muted); padding: 14px 18px;
}
.lightbox button:hover { color: var(--ink); }
.lightbox .lb-close { top: 10px; right: 12px; font-size: 26px; }
.lightbox .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

/* ---- tablet --------------------------------------------------------------- */
@media (max-width: 1100px) {
  .frame { grid-template-columns: 180px minmax(0, 1fr); column-gap: 32px; padding: 36px 32px 28px; }
  .bio { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
}

/* ---- phone ---------------------------------------------------------------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  /* A column that is at least a screen tall, so the footer sits at the
     bottom of a short page instead of halfway up it. */
  .frame {
    display: flex;
    flex-direction: column;
    padding: 0 16px 24px;
  }
  main { flex: 1 0 auto; }
  .masthead {
    position: sticky; top: 0; z-index: 5;
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 0 14px;
    background: var(--ground);
  }
  .name { font-size: 25px; }
  .menu-toggle {
    display: block;
    background: none; border: 0; padding: 6px 0 6px 12px; cursor: pointer;
    font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  }
  .nav {
    position: static;
    padding: 4px 0 18px;
    gap: 12px;
    font-size: 16px;
  }
  .js .nav { display: none; }
  .js .nav.is-open { display: flex; }
  .nav a { font-size: 16px; }
  main { padding-top: 12px; }
  main section > * + * { margin-top: 56px; }
  .pieces { gap: 64px; }
  .bio { grid-template-columns: minmax(0, 1fr); }
  .bio-text { order: -1; }
  .gallery { columns: 2 140px; column-gap: 8px; }
  .tile { margin-bottom: 8px; }
  .cv li { grid-template-columns: 92px minmax(0, 1fr); gap: 10px; font-size: 14px; }
  .footer { margin-top: 64px; }
  .lightbox img { max-width: 100vw; max-height: calc(100vh - 120px); }
  .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 14px; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
