/* Jerry Brito — paste-up homepage */

:root {
  --red: #D8301C;
  --ink: #0E0E10;
  --white: #FFFFFF;
  --paper: #F3F1EC;

  --display: "Archivo", "Arial Narrow", "Helvetica Neue", sans-serif;
  --text: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: dark;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--white);
  font-family: var(--text);
  padding-inline: var(--gutter);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 4px;
}

/* ---------- the photograph ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: var(--ink);
}

.bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: none;
  transform-origin: 60% 40%;
  animation: drift 40s ease-in-out infinite alternate;
  transition: opacity .6s ease;
}

.bg img.is-loading { opacity: 0; }

@keyframes drift {
  from { transform: scale(1.06) translate(0, 0); }
  to   { transform: scale(1.16) translate(-2%, 1%); }
}

/* film grain over everything, so the photo and the paper share one surface */
.grain {
  position: fixed;
  inset: -50%;
  z-index: -1;
  pointer-events: none;
  opacity: .22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Classes that set display (.strip, .pl-ui…) would otherwise un-hide these. */
[hidden] { display: none !important; }

/* ---------- strips ---------- */

.strip {
  --bg: var(--white);
  --fg: var(--ink);
  display: inline-block;
  background: var(--bg);
  color: var(--fg);
  padding: .06em .2em .02em;
  transition: background-color .15s, color .15s;
}

.text-strip {
  font-family: var(--text);
  font-variation-settings: "wdth" 100;
  font-weight: 500;
  letter-spacing: 0;
  font-optical-sizing: auto;
  padding: .28em .5em .3em;
  line-height: 1.2;
}

.mono-tag {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .45em .7em;
  line-height: 1;
}

/* ---------- top bar ---------- */

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) var(--gutter) 0;
  pointer-events: none;
}

.top > * { pointer-events: auto; }

.top .shuffle { margin-left: auto; }

.shuffle {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--red);
  font: 400 26px/1 var(--display);
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: .8;
  transition: opacity .3s, transform .6s ease;
}

.shuffle:hover,
.shuffle:focus-visible { opacity: 1; transform: rotate(72deg); }

.top-right { display: flex; gap: 10px; }

.top .mono-tag:hover { background: var(--red); color: var(--white); }


/* ---------- hero ---------- */

main {
  display: flex;
  flex-direction: column;
  gap: clamp(72px, 12vw, 160px);
  padding-block: clamp(96px, 14vw, 170px) 48px;
  max-width: 1500px;
  margin-inline: auto;
}

.hero {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-weight: 400;
}

.hero .hi {
  font-size: clamp(1.3rem, 3vw, 2.6rem);
  font-weight: 600;
}

.hero .name {
  font-family: var(--display);
  font-variation-settings: "wdth" 62;
  font-weight: 900;
  font-size: clamp(5.2rem, 27vw, 22rem);
  line-height: .8;
  text-transform: uppercase;
  letter-spacing: -.015em;
  padding: .05em .07em 0;
}

.hero .name + .name { margin-top: -.035em; }

.hero .about {
  font-size: clamp(1.3rem, 3vw, 2.6rem);
  font-weight: 600;
}

.hero .about a {
  text-decoration: underline;
  text-decoration-thickness: .08em;
  text-underline-offset: .14em;
  transition: color .15s;
}

.hero .about a:hover,
.hero .about a:focus-visible { color: var(--red); }

@media (prefers-reduced-motion: reduce) {
  .bg img { animation: none; transform: scale(1.06); }
  .strip { transition: none; }
}

/* ---------- the four doors ---------- */

.doors {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(20px, 3.5vw, 44px);
}

.door {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
}


.door .word {
  font-family: var(--display);
  font-variation-settings: "wdth" 62;
  font-weight: 850;
  font-size: clamp(2.8rem, 10vw, 9.5rem);
  line-height: .86;
  text-transform: uppercase;
  letter-spacing: -.01em;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.door .word::after {
  content: "\2009→";
  display: none;
}

.door .note {
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  max-width: min(40ch, 100%);
}

.door:hover .word,
.door:focus-visible .word {
  background: var(--red);
  color: var(--white);
}

.door:hover .word::after,
.door:focus-visible .word::after { display: inline; }


/* ---------- projects ---------- */

.projects {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.projects h2 {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: "wdth" 62;
  font-weight: 900;
  font-size: clamp(3.4rem, 14vw, 13rem);
  line-height: .82;
  text-transform: uppercase;
}

.projects .sub {
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.3rem);
}

.labels {
  list-style: none;
  margin: clamp(36px, 5vw, 64px) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  max-width: 1200px;
}

.label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1rem 1.15rem 1.1rem;
  width: min(21rem, 100%);
}

.label .title {
  font-family: var(--display);
  font-variation-settings: "wdth" 70;
  font-weight: 800;
  font-size: 2rem;
  line-height: .95;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  gap: .5em;
}

.label .arrow {
  font-variation-settings: "wdth" 100;
  font-weight: 500;
  transition: transform .2s ease;
}

.label .desc {
  font-family: var(--text);
  font-variation-settings: "wdth" 100;
  font-weight: 450;
  font-size: 1.25rem;
  line-height: 1.3;
  text-wrap: pretty;
}

.label:hover,
.label:focus-visible {
  background: var(--ink);
  color: var(--white);
}

.label:hover .arrow { transform: translate(.12em, -.12em); }

/* ---------- contact ---------- */

.contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.contact .hello {
  font-family: var(--display);
  font-variation-settings: "wdth" 62;
  font-weight: 900;
  font-size: clamp(3.4rem, 15vw, 14rem);
  line-height: .82;
  text-transform: uppercase;
}

.contact .hello:hover { background: var(--white); color: var(--red); }

.contact .addr {
  font-size: clamp(1rem, 1.8vw, 1.4rem);
}

/* ---------- footer ---------- */

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-block: 40px calc(env(safe-area-inset-bottom, 0px) + 28px);
  max-width: 1500px;
  margin-inline: auto;
}

footer .mono-tag { text-transform: none; letter-spacing: .02em; line-height: 1.4; }

/* ---------- inner pages (policy) ---------- */

.page-head { display: flex; flex-direction: column; align-items: flex-start; }

main.pp { gap: clamp(40px, 6vw, 80px); }

.pp-intro .text-strip {
  margin: 0;
  max-width: 44rem;
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  font-weight: 400;
  line-height: 1.5;
  padding: .9em 1.1em;
}

.pp-intro a,
.pp-list a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(14, 14, 16, .35);
  text-underline-offset: 3px;
}

.pp-intro a:hover,
.pp-list a:hover,
.pp-list a:focus-visible {
  color: var(--red);
  text-decoration-color: var(--red);
}

.pp-index { display: flex; flex-wrap: wrap; gap: 8px; max-width: 60rem; }
.pp-index a:hover,
.pp-index a:focus-visible { background: var(--red); color: var(--white); }
.pp-index .n { opacity: .6; margin-left: .35em; font-variant-numeric: tabular-nums; }

.pp-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  scroll-margin-top: 72px;
}

.pp-head {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: "wdth" 62;
  font-weight: 900;
  font-size: clamp(2.2rem, 6vw, 5.2rem);
  line-height: .86;
  text-transform: uppercase;
  max-width: 100%;
}

.pp-panel {
  background: var(--white);
  color: var(--ink);
  width: 100%;
  max-width: 52rem;
  padding: clamp(20px, 3.5vw, 40px);
}

.pp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  font-family: var(--text);
}

.pp-list a {
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.3;
  text-wrap: pretty;
}

.pp-list .meta {
  display: block;
  margin-top: .15rem;
  font-size: 1rem;
  line-height: 1.4;
  color: rgba(14, 14, 16, .68);
}

.pp-list .kind {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .08em;
  color: var(--red);
  border: 1px solid currentColor;
  padding: .1em .4em;
  margin-left: .5em;
  vertical-align: .25em;
}

.pp-top {
  display: inline-block;
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.pp-top:hover,
.pp-top:focus-visible { color: var(--red); }

@media (max-width: 560px) {
  .label { width: 100%; }
}

.contact .addr:hover,
.contact .addr:focus-visible { background: var(--red); color: var(--white); }

/* ---------- podcast: shared ---------- */

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

.top .brand + .mono-tag { margin-left: auto; }

.text-strip a {
  text-decoration: underline;
  text-decoration-thickness: .06em;
  text-underline-offset: .14em;
}

.text-strip a:hover,
.text-strip a:focus-visible { color: var(--red); }

main.pod,
main.ep { gap: clamp(56px, 8vw, 110px); }

.pod-h1,
.ep-h1 {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
}

.pod-name,
.ep-title {
  font-family: var(--display);
  font-variation-settings: "wdth" 62;
  font-weight: 900;
  line-height: .82;
  text-transform: uppercase;
  letter-spacing: -.01em;
  padding: .05em .07em 0;
  max-width: 100%;
  overflow-wrap: break-word;
}

.pod-name { font-size: clamp(4rem, 17vw, 15rem); }
.pod-name + .pod-name { margin-top: -.035em; }

/* ---------- podcast: index ---------- */

.pod-blurb {
  margin: 0;
  max-width: 40rem;
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  font-weight: 400;
  line-height: 1.5;
  padding: .9em 1.1em;
}

.pod-subscribe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pod-subscribe a:hover,
.pod-subscribe a:focus-visible { background: var(--red); color: var(--white); }

.pod-latest {
  display: grid;
  grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  max-width: 72rem;
}

.pod-latest-cover img,
.ep-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: clamp(8px, 1.2vw, 14px) solid var(--white);
  background: var(--white);
}

.pod-latest-text { display: flex; flex-direction: column; align-items: flex-start; }

.pod-latest-title {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: "wdth" 62;
  font-weight: 900;
  font-size: clamp(2.6rem, 6.5vw, 6rem);
  line-height: .86;
  text-transform: uppercase;
  max-width: 100%;
}

.pod-latest-title a:hover { color: var(--red); }

.pod-latest-author {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.6rem);
  font-weight: 600;
}

.pod-latest-teaser {
  margin: 14px 0 0;
  max-width: 36rem;
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.5;
  padding: .8em 1em;
}

.pod-listen {
  margin-top: 14px;
  font-family: var(--display);
  font-variation-settings: "wdth" 75;
  font-weight: 800;
  font-size: 1.5rem;
  text-transform: uppercase;
  padding: .35em .7em .3em;
}

.pod-listen:hover,
.pod-listen:focus-visible { background: var(--ink); }

/* the shelf */

.pod-shelf { display: flex; flex-direction: column; align-items: stretch; }

.shelf-head { display: flex; flex-direction: column; align-items: flex-start; }

.shelf-count {
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
}

.shelf-filter {
  display: flex;
  align-self: flex-start;
  width: min(28rem, 100%);
  margin-top: 18px;
  padding: 0;
}

.shelf-filter input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 500 1.1rem/1.2 var(--text);
  padding: .75em 1em;
  outline: none;
}

.shelf-filter input::placeholder { color: rgba(14, 14, 16, .5); }
.shelf-filter:focus-within { outline: 3px solid var(--red); outline-offset: 3px; }

.shelf {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 42vw), 1fr));
  gap: 26px 14px;
}

.book { display: flex; flex-direction: column; height: 100%; }

.book-cover {
  position: relative;
  display: block;
  aspect-ratio: 1;
  background: var(--ink);
  overflow: hidden;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}

.book-no {
  position: absolute;
  left: 0;
  top: 0;
  background: var(--ink);
  color: var(--white);
  font: 500 .72rem/1 var(--mono);
  letter-spacing: .04em;
  padding: .45em .55em;
  font-variant-numeric: tabular-nums;
}

.book-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  background: var(--white);
  color: var(--ink);
  padding: .6rem .7rem .7rem;
  font-family: var(--text);
  transition: background-color .15s, color .15s;
}

.book-title { font-weight: 600; font-size: 1rem; line-height: 1.2; text-wrap: balance; }
.book-author { font-size: .92rem; line-height: 1.25; }
.book-date {
  margin-top: auto;
  padding-top: .35rem;
  font: 500 .68rem/1 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .6;
}

.book:hover .book-label,
.book:focus-visible .book-label { background: var(--red); color: var(--white); }
.book:hover .book-cover img { transform: scale(1.04); }
.book:hover .book-no { background: var(--red); }

.shelf-empty { margin: 20px 0 0; align-self: flex-start; font-size: 1.1rem; }

/* ---------- podcast: episode ---------- */

.ep-title.t-s { font-size: clamp(3.6rem, 15vw, 14rem); }
.ep-title.t-m { font-size: clamp(2.8rem, 9.5vw, 8.5rem); }
.ep-title.t-l { font-size: clamp(2.3rem, 6.5vw, 6rem); }

.ep-listen {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 40rem);
  gap: clamp(16px, 2.5vw, 32px);
  align-items: end;
}

.player audio { width: 100%; }

.pl-ui {
  display: flex;
  align-items: stretch;
  background: var(--ink);
  color: var(--white);
}

.pl-play {
  flex: none;
  width: clamp(76px, 9vw, 104px);
  border: 0;
  background: var(--red);
  color: var(--white);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color .15s;
}

.pl-play:hover { background: #B8261A; }

/* play triangle / pause bars, drawn in CSS so they match the type */
.pl-icon {
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 16px 0 16px 26px;
  border-color: transparent transparent transparent currentColor;
  margin-left: 6px;
}

.is-playing .pl-icon {
  width: 24px;
  height: 30px;
  margin-left: 0;
  border: 0;
  border-left: 8px solid currentColor;
  border-right: 8px solid currentColor;
}

.pl-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 14px;
}

.pl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pl-now,
.pl-time,
.pl-btn,
.pl-resume {
  font: 500 .74rem/1 var(--mono);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.pl-time { font-variant-numeric: tabular-nums; white-space: nowrap; }

.pl-seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --pct: 0%;
}

.pl-seek::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(to right, var(--white) var(--pct), rgba(255, 255, 255, .22) var(--pct));
}

.pl-seek::-moz-range-track { height: 6px; background: rgba(255, 255, 255, .22); }
.pl-seek::-moz-range-progress { height: 6px; background: var(--white); }

.pl-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 22px;
  margin-top: -8px;
  background: var(--red);
  border: 0;
  border-radius: 0;
}

.pl-seek::-moz-range-thumb {
  width: 14px;
  height: 22px;
  background: var(--red);
  border: 0;
  border-radius: 0;
}

.pl-controls { justify-content: flex-start; }

.pl-btn {
  border: 1px solid rgba(255, 255, 255, .4);
  background: transparent;
  color: var(--white);
  padding: .55em .7em;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}

.pl-btn:hover,
.pl-btn:focus-visible { background: var(--white); color: var(--ink); border-color: var(--white); }

.pl-dl { margin-left: auto; }
.pl-resume { opacity: .7; text-transform: none; letter-spacing: .02em; }

/* docked mini player, shown while playing and the main player is off screen */
.pl-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: stretch;
  gap: 14px;
  background: var(--ink);
  color: var(--white);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-right: var(--gutter);
}

.pl-dock[hidden] { display: none; }
.pl-dock .pl-play { width: 58px; min-height: 52px; }
.pl-dock .pl-icon { border-width: 10px 0 10px 16px; margin-left: 4px; }
.pl-dock.is-playing .pl-icon { width: 16px; height: 20px; border-width: 0 6px; margin-left: 0; border-style: solid; border-color: currentColor; }

.pl-dock-title {
  flex: 1;
  min-width: 0;
  align-self: center;
  font-family: var(--display);
  font-variation-settings: "wdth" 70;
  font-weight: 800;
  font-size: 1.1rem;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-dock .pl-time { align-self: center; }

.ep-notes { display: flex; flex-direction: column; align-items: flex-start; }

.ep-body {
  font-family: var(--text);
  font-size: 1.15rem;
  line-height: 1.6;
  max-width: 44rem;
}

.ep-body > :first-child { margin-top: 0; }
.ep-body > :last-child { margin-bottom: 0; }
.ep-body p { margin: 0 0 1em; }
.ep-body ul,
.ep-body ol { margin: 0 0 1em; padding-left: 1.3em; }
.ep-body li { margin-bottom: .35em; }
.ep-body a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(14, 14, 16, .35);
  text-underline-offset: 3px;
}
.ep-body a:hover { color: var(--red); text-decoration-color: var(--red); }

.ep-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  max-width: 44rem;
}

.ep-topics a { text-transform: none; letter-spacing: .02em; }
.ep-topics a:hover,
.ep-topics a:focus-visible { background: var(--red); color: var(--white); }

.ep-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ep-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: min(26rem, 100%);
}

.ep-step.is-next { align-items: flex-end; text-align: right; margin-left: auto; }
.ep-step-title { font-size: 1.1rem; font-weight: 600; }
.ep-step:hover .ep-step-title,
.ep-step:focus-visible .ep-step-title { background: var(--red); color: var(--white); }

body.is-ep { padding-bottom: 60px; }

@media (max-width: 760px) {
  .pod-latest,
  .ep-listen { grid-template-columns: minmax(0, 1fr); }
  .pod-latest-cover,
  .ep-cover { max-width: 20rem; }
  .pl-dock .pl-time { display: none; }
}
