/* Lato, self-hosted (SIL Open Font License, see fonts/LICENSE-Lato.txt).
   Latin subset, from @fontsource/lato 5.3.0. Light for text, Bold for links. */
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/lato-latin-300-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/lato-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

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

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

body {
  margin: 0;
  font-family: "Lato", system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, picture, video, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }

a { color: inherit; }

input, button, textarea, select { font: inherit; }

/* Tokens: adjust these as the design takes shape */
:root {
  --gutter: clamp(20px, 4.5vw, 64px);
  --text: #f6efe2;          /* light text on the dark band */
  --text-size: clamp(1rem, 0.85rem + 0.65vw, 1.3125rem);   /* 16px on phones, about 18.5–20px on tablets; wide screens set their own below */

  /* Dark band over the photo: fades from --shade-top at its edge to
     --shade-text where the text ends, then to clear over the fade distance.
     Narrow screens: band across the top, fading downward over --fade.
     Wide landscape screens: band down the left, fading rightward over --fade-x. */
  --shade: 26 18 12;        /* warm near-black, as R G B */
  --shade-top: 0.9;
  --shade-text: 0.65;
  --fade: clamp(5rem, 22vh, 12rem);
  --fade-x: clamp(6rem, 14vw, 16rem);
  --col: clamp(30rem, 42vw, 58rem);   /* text column width in the side-by-side layout */
  --col-align: center;                /* vertical position of the text there: start | center | end */

  /* Link palette: deep, earthy, tuned to sit on the dark band */
  --ochre: #956210;
  --burnt-orange: #ad4a1c;
  --forest: #3b6e48;
  --plum: #7e4499;
  --brick: #a1402d;
  --olive: #5f6c25;
  --indigo: #28449a;    /* deep navy-indigo */

  --image-focus: 62% 50%;   /* which part of the photo stays in view when cropped */

  /* Gallery carousel (narrow screens; wide screens set their own below) */
  --panel: #1c1b19;         /* dark neutral ground for slides and captions */
  --panel-text: #e8e3d9;
  --slide-w: min(82vw, 30rem);
  --slide-h: min(52vh, 24rem, calc(var(--slide-w) * 1.1));   /* photo area, roughly square on phones; captions sit below it */
  --slide-gap: 12px;
}

/* Portrait screens use the book prototype as background, centred */
@media (orientation: portrait) {
  :root { --image-focus: 50% 40%; }
}

/* Full-screen background image */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  margin: 0;
  background: #c9a77c; /* kraft-paper tone while the photo loads */
}

/* The <picture> wrapper (it swaps in the portrait photo) must fill the screen too,
   or the image falls back to fitting the width instead of covering. */
.backdrop picture {
  display: block;
  width: 100%;
  height: 100%;
}

.backdrop img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: var(--image-focus);
}

/* Caption for the background photo: pinned bottom-right on every screen, in front of the page,
   tight on a solid dark neutral ground (so nothing shows through it). */
.caption {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 2;
  margin: 0;
  max-width: min(42rem, 100%);
  padding: 0.4em 0.7em;
  background: #1c1b19;
  color: #e8e3d9;
  font-size: 0.8125rem;
  font-weight: 300;
  line-height: 1.45;
  text-wrap: balance;
}

.caption b {
  font-weight: 700;
}

/* Each background has its own caption */
.caption .for-portrait { display: none; }
@media (orientation: portrait) {
  .caption .for-landscape { display: none; }
  .caption .for-portrait { display: inline; }
}

/* Narrow screens (default): full-bleed band at the top, text above and the photo below.
   Wide landscape screens: band down the left, text left and the photo right (see @media below). */
.landing {
  min-height: 100vh;
  min-height: 100svh;
}

.band {
  padding: var(--gutter) var(--gutter) calc(var(--gutter) + var(--fade));
  background: linear-gradient(to bottom,
    rgb(var(--shade) / var(--shade-top)) 0%,
    rgb(var(--shade) / var(--shade-text)) calc(100% - var(--fade)),
    rgb(var(--shade) / 0) 100%);
}

.intro {
  color: var(--text);
  font-size: var(--text-size);
  font-weight: 300;   /* Lato Light; links are Bold */
  line-height: 1.8;
  text-wrap: pretty;   /* no lone word on the last line, evener line endings */
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);
}

/* The name is the page's main heading, set inline so it reads as the start of the sentence */
.intro .name {
  display: inline;
  font: inherit;
  font-weight: 700;
}

/* Gallery: a horizontal carousel of dark slides, each photo shown at most at its real size.
   Narrow screens: below the paragraph, full width. Wide screens: beside it (see @media below). */
.gallery {
  position: relative;
  margin-top: calc(var(--fade) * -0.6);   /* tuck into the band's fade */
  padding-bottom: calc(var(--gutter) + 4.5rem);   /* room to scroll the gallery clear of the pinned caption */
}

.carousel {
  display: flex;
  align-items: stretch;      /* all slides share the tallest slide's height */
  gap: var(--slide-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  padding-inline: var(--gutter);
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }

.slide {
  flex: 0 0 var(--slide-w);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--panel);
  color: var(--panel-text);
}

.slide .frame {
  padding: 12px;
  display: flex;
  justify-content: center;   /* photo docked to the top, centred across */
}

.slide .frame img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: var(--slide-h);
}

.slide figcaption {
  margin-top: auto;          /* caption docked to the bottom */
  padding: 0 14px 14px;
  font-size: 0.8125rem;
  font-weight: 300;
  line-height: 1.5;
  text-wrap: pretty;
}

.slide .date {
  font-weight: 700;
  white-space: nowrap;
  margin-left: 0.2em;
}

.gallery-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px var(--gutter) 0;
  color: var(--text);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.5);
}

.gallery-nav button {
  padding: 0.25em 0.9em;
  border: 0;
  background: var(--text);
  color: rgb(var(--shade));
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  clip-path: polygon(0 0.12em, 100% 0, calc(100% - 0.12em) 100%, 0.1em calc(100% - 0.06em));
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.2s;
}
.gallery-nav .next {
  clip-path: polygon(0.1em 0, calc(100% - 0.06em) 0.12em, 100% 100%, 0 calc(100% - 0.1em));
}
.gallery-nav button:hover:not(:disabled),
.gallery-nav button:focus-visible { transform: translateY(-3px); }
.gallery-nav button:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.gallery-nav button:disabled { opacity: 0.35; cursor: default; }

/* Wide landscape screens: side by side */
@media (min-width: 1024px) and (orientation: landscape) {
  :root {
    --text-size: clamp(1.25rem, 1rem + 0.5vw, 1.5625rem);   /* about 21px at 1024 up to 25px from 1920 */
    --slide-w: min(85%, 38rem);
    --slide-h: min(56vh, 36rem);
  }

  .landing {
    display: flex;
    align-items: center;
  }

  /* The gallery overlaps the band's fade and fills the rest of the width */
  .gallery {
    flex: 1;
    min-width: 0;
    margin: 0 0 0 calc(var(--gutter) - var(--fade-x));
    padding: var(--gutter) 0;
  }

  .carousel {
    padding-inline: 0 var(--gutter);
    scroll-padding-inline: 0;
  }

  .gallery-nav {
    padding-inline: 0;
  }

  .band {
    display: flex;
    align-items: var(--col-align);
    width: calc(var(--col) + var(--gutter) + var(--fade-x));
    min-height: 100vh;
    min-height: 100svh;
    padding: var(--gutter) calc(var(--fade-x)) var(--gutter) var(--gutter);
    background: linear-gradient(to right,
      rgb(var(--shade) / var(--shade-top)) 0%,
      rgb(var(--shade) / var(--shade-text)) calc(100% - var(--fade-x)),
      rgb(var(--shade) / 0) 100%);
  }

  .intro {
    max-width: var(--col);
  }
}

/* Links: each sits on a solid, irregular four-sided panel in its own colour (--c).
   The panel is a clipped layer behind the word (--shape is its four corners).
   On hover or focus the word and its panel rise a few pixels. */
.intro a {
  --c: var(--forest);
  --shape: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  position: relative;
  isolation: isolate;
  display: inline-block;
  white-space: nowrap;
  padding: 0 0.34em;
  margin-inline: -0.06em;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  text-shadow: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.intro a::before {
  content: "";
  position: absolute;
  inset: -0.1em 0;
  z-index: -1;
  background: var(--c);
  clip-path: var(--shape);
}

.intro a:hover,
.intro a:focus-visible {
  transform: translateY(-3px);
}

.intro a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

/* Keeps a link and the punctuation after it together on one line */
.intro .glue {
  white-space: nowrap;
}

/* A long phrase is split into pieces (spans inside one link), each with its own
   panel, so it can wrap between pieces on narrow screens. All pieces rise together. */
.intro a.pieces {
  display: inline;
  padding: 0;
  margin: 0;
  white-space: normal;
}
.intro a.pieces::before { content: none; }

.intro a.pieces .piece {
  position: relative;
  isolation: isolate;
  display: inline-block;
  white-space: nowrap;
  padding: 0 0.34em;
  transition: transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.intro a.pieces .piece::before {
  content: "";
  position: absolute;
  inset: -0.1em 0;
  z-index: -1;
  background: var(--c);
  clip-path: var(--shape);
}
.intro a.pieces .glue .piece::before { clip-path: var(--shape-2, var(--shape)); }

.intro a.pieces:hover,
.intro a.pieces:focus-visible { transform: none; }
.intro a.pieces:hover .piece,
.intro a.pieces:focus-visible .piece { transform: translateY(-3px); }

/* Touch screens have no hover: rise while the link is being tapped */
@media (hover: none) {
  .intro a:active { transform: translateY(-3px); }
  .intro a.pieces:active { transform: none; }
  .intro a.pieces:active .piece { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .intro a,
  .intro a.pieces .piece { transition: none; }
}

/* Each link's colour and panel. Corners run top-left, top-right, bottom-right, bottom-left. */
.intro a.womens-studio-workshop {        /* book maker */
  --c: var(--ochre);
  --shape: polygon(0 0.24em, 100% 0, calc(100% - 0.28em) 100%, 0.12em calc(100% - 0.1em));
}

.intro a.placearts-art-science-video {   /* young people */
  --c: var(--burnt-orange);
  --shape: polygon(0.22em 0, calc(100% - 0.08em) 0.2em, 100% calc(100% - 0.06em), 0 100%);
}

.intro a.accordion-book-project-site {   /* accordion books */
  --c: var(--forest);
  --shape: polygon(0 0.06em, calc(100% - 0.26em) 0, 100% 100%, 0.28em calc(100% - 0.18em));
}

.intro a.unfolding-practice-videos {     /* reflective practice | and creative inquiry */
  --c: var(--indigo);
  --shape: polygon(0.1em 0.18em, calc(100% - 0.16em) 0, 100% calc(100% - 0.12em), 0 100%);
  --shape-2: polygon(0 0.02em, 100% 0.2em, calc(100% - 0.22em) 100%, 0.18em calc(100% - 0.08em));
}

.intro a.art-in-transit-site {           /* metro stations as classrooms */
  --c: var(--plum);
  --shape: polygon(0.24em 0.16em, 100% 0, calc(100% - 0.08em) calc(100% - 0.24em), 0 100%);
}

.intro a.tedx-art-in-transit {           /* public art */
  --c: var(--brick);
  --shape: polygon(0 0, calc(100% - 0.22em) 0.24em, 100% 100%, 0.1em calc(100% - 0.08em));
}

.intro a.festival-of-stories-playlist {  /* story */
  --c: var(--olive);
  --shape: polygon(0.12em 0.22em, 100% 0.04em, calc(100% - 0.26em) 100%, 0 calc(100% - 0.16em));
}

.intro a.say-hello {                     /* Say hello: light panel, dark text, to set it apart as the one action */
  --c: var(--text);
  --shape: polygon(0 0.14em, calc(100% - 0.1em) 0, 100% calc(100% - 0.16em), 0.16em 100%);
  color: rgb(var(--shade));
}
