/* Nunito Sans (SIL Open Font License, see fonts/OFL.txt): variable fonts,
   so one file per style covers every weight from 300 to 600. */
@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/nunito-sans.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/nunito-sans-italic.woff2") format("woff2");
  font-weight: 300 600;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #000;
  /* The logo's main gold (the "IZ" and the outer ring). */
  --gold: #ad9e79;
  --text: #ebe6dc;
  --muted: #9a9a9a;
  --gutter: clamp(20px, 2.6vw, 40px);
  --font: "Nunito Sans", "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  /* One unit that follows the smaller of width and height, so the desktop
     home still fits on one screen on short laptop displays. */
  --u: min(1vw, 1.6vh);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font: 300 16px/1.5 var(--font);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
address {
  margin: 0;
  font: inherit;
}

/* Everything clickable is gold; all other text is soft off-white. */
a {
  color: var(--gold);
  text-decoration: none;
  transition: opacity 0.3s;
}

a:hover {
  opacity: 0.7;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
}

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

/* Video ---------------------------------------------------------------- */

.media {
  position: relative;
  /* Phones: square, but never taller than most of the screen. */
  height: min(100vw, 78svh);
  overflow: hidden;
  background: var(--bg);
}

.hero-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-controls {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  color: var(--gold);
}

.video-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  opacity: 0.75;
  cursor: pointer;
  transition: opacity 0.3s;
}

.video-controls button:hover {
  opacity: 1;
}

.video-controls svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* Keeps the thin gold lines visible on bright frames. */
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.6));
}

.video-pause .icon-play,
.video-pause[aria-pressed="true"] .icon-pause,
.video-sound .icon-waves,
.video-sound[aria-pressed="true"] .icon-muted {
  display: none;
}

.video-pause[aria-pressed="true"] .icon-play,
.video-sound[aria-pressed="true"] .icon-waves {
  display: inline;
}

/* Text panel (Home's right column, and the whole Works page) ----------- */

.panel {
  display: grid;
  align-content: start;
  gap: 56px;
  padding: 32px var(--gutter) max(32px, env(safe-area-inset-bottom));
}

.masthead {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.logo {
  display: block;
  flex: none;
}

.logo img {
  display: block;
  width: 104px;
  height: auto;
}

.masthead nav {
  display: grid;
  gap: 0.35em;
  /* Lets "Latest work at Instagram" wrap on narrow screens. */
  max-width: 14em;
  padding-top: 0.2em;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3;
}

.masthead a[aria-current="page"] {
  opacity: 0.6;
}

/* "Latest work at" reads as plain text; only "Instagram" is gold, but the
   whole line is one link. */
.link-lead {
  color: var(--text);
}

.statement h2 {
  margin-bottom: 0.7em;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.1;
  text-transform: uppercase;
}

.poem {
  font-size: 20px;
  font-style: italic;
  line-height: 1.5;
}

/* Small text one step heavier than the poem, so it stays crisp on black. */
.contact {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
}

.contact address {
  font-style: normal;
}

.nowrap {
  white-space: nowrap;
}

/* Desktop: split screen, everything on one screen ----------------------- */

@media (min-width: 900px) {
  .home {
    height: 100svh;
    overflow: hidden;
  }

  .split {
    display: grid;
    grid-template-columns: 3fr 2fr;
    height: 100svh;
  }

  .media {
    height: 100%;
  }

  .video-controls {
    right: clamp(8px, 1.2vw, 20px);
    bottom: clamp(8px, 1.2vw, 20px);
  }

  .panel {
    grid-template-rows: auto 1fr auto;
    gap: calc(3 * var(--u));
    height: 100svh;
    /* Only on very short windows: the column scrolls instead of clipping. */
    overflow-y: auto;
    padding: calc(5 * var(--u)) clamp(28px, 4.5vw, 96px) calc(4.5 * var(--u));
  }

  .masthead {
    gap: clamp(20px, 2.4 * var(--u), 40px);
  }

  .logo img {
    width: clamp(96px, 10 * var(--u), 160px);
  }

  .masthead nav {
    font-size: clamp(15px, 1.4 * var(--u), 23px);
  }

  /* The poem sits just below the logo; the contact block keeps the bottom. */
  .statement {
    margin-top: calc(1.2 * var(--u));
  }

  .statement h2 {
    font-size: clamp(26px, 3 * var(--u), 48px);
  }

  .poem {
    font-size: clamp(17px, 1.7 * var(--u), 27px);
  }

  .contact {
    font-size: clamp(13px, 1.05 * var(--u), 17px);
  }

  /* Works: the same column, without the video. */
  .page .panel {
    max-width: 960px;
  }
}

/* Works gallery (works-gallery.html, parked) ---------------------------- */

.works {
  font-size: 13px;
  letter-spacing: 0.2em;
}

.works .bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(var(--gutter), env(safe-area-inset-top)) var(--gutter) var(--gutter);
  text-transform: uppercase;
}

.works .contact {
  display: flex;
  justify-content: center;
  gap: 1.2em;
  padding: clamp(80px, 16vh, 200px) var(--gutter) max(var(--gutter), env(safe-area-inset-bottom));
  text-transform: uppercase;
}

.works main {
  padding: clamp(32px, 9vh, 120px) var(--gutter) 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(12px, 3.2vw, 56px);
  max-width: 1500px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.work {
  display: block;
  cursor: zoom-in;
}

.work img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: #0b0b0b;
  transition: opacity 0.4s;
}

@media (hover: hover) {
  .work:hover img {
    opacity: 0.8;
  }
}

/* Large view ----------------------------------------------------------- */

html:has(.viewer[open]) {
  overflow: hidden;
}

.viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: contain;
}

.viewer::backdrop {
  background: var(--bg);
}

.viewer[open] {
  animation: fade-in 0.35s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.viewer figure {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  height: 100%;
  margin: 0;
  padding: var(--gutter);
}

.viewer img {
  display: block;
  width: min(100vw - 2 * var(--gutter), 100dvh - 2 * var(--gutter) - 48px);
  height: auto;
  /* The grid thumbnail, already loaded, shows until the large file arrives. */
  background: #0b0b0b center / cover no-repeat;
}

.viewer figcaption {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.06em;
}

.viewer figcaption span + span::before {
  content: ", ";
}

.viewer figcaption span:empty {
  display: none;
}

.viewer button {
  position: fixed;
  z-index: 1;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.viewer button:hover {
  opacity: 1;
}

.viewer .close {
  top: max(var(--gutter), env(safe-area-inset-top));
  right: max(var(--gutter), env(safe-area-inset-right));
  padding: 12px 0;
  margin: -12px 0;
  text-transform: uppercase;
}

/* Thin chevrons at the screen edges; phones swipe instead. */
.viewer .prev,
.viewer .next {
  top: 50%;
  width: 56px;
  height: 96px;
  margin-top: -48px;
}

.viewer .prev {
  left: max(4px, env(safe-area-inset-left));
}

.viewer .next {
  right: max(4px, env(safe-area-inset-right));
}

.viewer .prev::before,
.viewer .next::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  margin: auto;
  border: solid currentColor;
  border-width: 0 0 1px 1px;
  transform: translateX(3px) rotate(45deg);
}

.viewer .next::before {
  transform: translateX(-3px) rotate(-135deg);
}

@media (pointer: coarse) {
  .viewer .prev,
  .viewer .next {
    display: none;
  }
}

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