@font-face {
  font-family: 'PPEditorialNew';
  src: url('PPEditorialNew-Ultralight.otf') format('opentype');
  font-weight: 200;
  font-style: normal;
}

@font-face {
  font-family: 'ABC Areal Mono';
  src: url('ABC Areal/WOFF2/ABCAreal-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'ABC Areal Variable';
  src: url('ABC Areal/WOFF2/ABCArealVariable.woff2') format('woff2-variations'),
       url('ABC Areal/VAR/ABCArealVariable.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
}

/* the real italic cut, so <em> and active filters don't get a faked slant */
@font-face {
  font-family: 'ABC Areal Variable';
  src: url('ABC Areal/WOFF2/ABCAreal-RegularItalic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: 'ABC Areal';
  src: url('ABC Areal/WOFF2/ABCAreal-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}

:root{
  --bg:#ffffff;
  --fg:#000000;
  /* flattened on purpose so MacBook and iMac land close together */
  --fluid: clamp(13px, calc(14.6px + 0.17vw), 19px);
  --hero-font: clamp(33px, calc(58px + 1.57vw), 115px);
  --edge-x: clamp(32px, 7vw, 90px);
}

*{ box-sizing:border-box; }

html,body{
  margin:0;
  padding:0;
  background:var(--bg);
  color:var(--fg);
  font-family:'ABC Areal Mono', monospace;
  cursor: none;
}

/* custom cursor (so mix-blend-mode can apply, which a native CSS cursor
   image can't use) - white fill + difference blend: shows black over the
   white page, inverts to stay visible over images too. follows the
   pointer via moveCursorDot() in script.js */
.cursor-dot{
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
}

/* touch devices never fire mousemove, so the dot would otherwise just
   sit stuck in the top-left corner forever - use the real cursor instead */
@media (hover: none){
  html,body{ cursor: auto; }
  .cursor-dot{ display: none; }
}

body.is-home{
  height: 100vh;
  overflow: hidden;
  display:flex;
  flex-direction: column;
}

body.is-home .site-header{
  flex: 0 0 auto;
}

body.is-home main{
  flex: 1 1 auto;
  min-height: 0;
  display:flex;
}

body.is-detail{
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  display:flex;
  flex-direction: column;
}

/* fixed and transparent, so the image grid can run up behind it */
body.is-detail .site-header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

body.is-detail main{
  flex: 1 1 auto;
  min-height: 0;
  display:flex;
}

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

button{
  font-family:inherit;
  background:none;
  border:none;
  color:inherit;
  padding:0;
}

a:focus-visible, [tabindex]:focus-visible, button:focus-visible{
  outline: 1px solid var(--fg);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce){
  *{ transition-duration: 0.01ms !important; }
}

/* ---------- INTRO ---------- */

.intro{
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display:flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(4px, 1vw, 14px);
  padding: clamp(20px, 4vw, 48px);
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.intro.is-hidden{
  opacity: 0;
}

.intro-line{
  font-family: 'PPEditorialNew', Georgia, serif;
  font-size: var(--hero-font);
  line-height: 1;
  white-space: nowrap;
}

/* matches .wm-char's line-height so the FLIP animation below lands exactly */
.intro-line-top{ text-align: left; line-height: 1.4; }
.intro-line-bottom{ text-align: right; }

/* ---------- HEADER ---------- */

.site-header{
  position: relative;
  display:flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(20px, 4vw, 40px) var(--edge-x) 0;
}

.wordmark{
  min-width: 0;
  font-family: 'PPEditorialNew', Georgia, serif;
  font-size: var(--hero-font);
  line-height: 1.15;
}

.header-right{
  flex-shrink: 0;
  display:flex;
  align-items: baseline;
  gap: 24px;
  white-space: nowrap;
}

.header-nav{
  display:none;
  gap: 24px;
  font-family: 'ABC Areal Variable', 'ABC Areal', sans-serif;
  font-size: calc(var(--fluid) * 1.1);
  letter-spacing: 0.03em;
}

body.is-home .header-nav{
  display:flex;
}

.header-contact{
  font-family: 'ABC Areal Variable', 'ABC Areal', sans-serif;
  font-size: calc(var(--fluid) * 1.1);
  letter-spacing: 0.03em;
}

.site-header.header-detail .header-contact{
  display: none;
}

/* collapses to max-width:0 on project pages, leaving just "eb" */
.wm-char{
  display: inline-block;
  max-width: 999px;
  overflow: hidden;
  line-height: 1.4; /* tall enough that hidden overflow doesn't clip y/j descenders */
  white-space: pre;
  vertical-align: bottom;
  transition: max-width 0.6s ease, opacity 0.5s ease;
}

.site-header.header-detail .wordmark .wm-drop{
  max-width: 0 !important;
  opacity: 0;
}

main{
  min-height: 70vh;
}

/* ---------- HOME: BRACKET ROWS ---------- */

.hero{
  padding: clamp(10px, 3vw, 40px) var(--edge-x) clamp(32px, 7vw, 90px);
  width: 100%;
}

body.is-home .hero{
  display:flex;
  flex-direction: column;
  min-height: 0;
}

.project-table{
  position: relative;
  display:flex;
  flex-direction: column;
  min-height: max(760px, 70vh);
}

body.is-home .project-table{
  flex: 1 1 auto;
  min-height: 0;
}

.project-row{
  flex: 1;
  min-height: 0;
  display:flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
}

.project-row:has(.circle-wrap:hover){
  z-index: 3;
}

.circle-wrap{
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
}

.circle-image{
  display:block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: scale(1.45);
}

.circle-wrap.is-focused{
  z-index: 2;
}

.circle-wrap.is-focused .circle-image{
  transform: scale(1.9);
}

.circle-wrap.is-dimmed .circle-image{
  transform: scale(0.65);
  opacity: 0.5;
}

.hero-tagline{
  font-family: 'PPEditorialNew', Georgia, serif;
  font-size: var(--hero-font);
  line-height: 1;
  text-align: right;
  margin: clamp(16px, 3vw, 32px) 0 0;
}

/* ---------- DETAIL PAGE ---------- */

.detail{
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 var(--edge-x);
}

/* same x as "my name is emily bruenjes" (var(--edge-x)), vertically dead
   centre of the screen, same size as "contact me" */
.detail-title{
  position: absolute;
  top: 50%;
  left: var(--edge-x);
  margin: 0;
  z-index: 10;
  text-align: left;
  font-family: 'ABC Areal Variable', 'ABC Areal', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 18px;
  line-height: 20px;
  pointer-events: none;
  color: #fff;
  mix-blend-mode: difference;
}

/* the year mirrors the title on the right edge and leaves with the grid */
.detail-year{
  position: absolute;
  top: 50%;
  right: var(--edge-x);
  margin: 0;
  z-index: 10;
  text-align: right;
  font-family: 'ABC Areal Variable', 'ABC Areal', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 18px;
  line-height: 20px;
  pointer-events: none;
  color: #fff;
  mix-blend-mode: difference;
  transition: opacity 0.6s ease;
}

.detail.is-text-mode .detail-year{
  opacity: 0;
}

.detail-long{
  font-family: 'ABC Areal Variable', 'ABC Areal', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 18px;
  line-height: 20px;
  text-align: justify;
  text-align-last: left;
  white-space: pre-line;
  margin: 0;
}

.detail-long a{
  text-decoration: underline;
}

.detail-long a:hover{
  opacity: 0.6;
}

/* the asymmetric, self-scrolling image grid: columns of uneven width,
   placed to overlap their neighbours rather than tiled edge to edge, each
   holding its images on an endless upward drift */
.detail-grid{
  position: absolute;
  inset: 0;
}

.grid-col{
  position: absolute;
  top: 0;
  height: 100%;
  overflow: hidden;
}

@keyframes grid-rise{
  from{ transform: translateY(0); }
  to{ transform: translateY(var(--rise)); }
}

.grid-image{
  position: absolute;
  left: 0;
  width: 100%;
  height: auto;
  object-fit: contain;
  animation-name: grid-rise;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  transition: opacity 0.3s ease;
}

.grid-image:hover{
  animation-play-state: paused;
  z-index: 2;
}

.detail-grid:has(.grid-image:hover) .grid-image:not(:hover){
  opacity: 0.45;
}

/* opening the lightbox dims every grid image the same way hovering one
   dims its neighbours - the clicked image's own thumbnail included */
.detail:has(.image-lightbox) .grid-image{
  opacity: 0.45;
}

/* scrolling down sends the grid up and out of the way, barely visible
   rather than fully gone, and brings the text in instead */
.detail-grid{
  transition: transform 0.7s ease, opacity 0.7s ease;
}

.detail.is-text-mode .detail-grid{
  transform: translateY(-60%);
  opacity: 0.08;
  pointer-events: none;
}

/* top matches the title's own top exactly, so the title's baseline and
   the first line of body copy share the same line */
.detail-text{
  position: absolute;
  top: 50%;
  left: calc(var(--edge-x) + clamp(120px, 18vw, 240px));
  right: var(--edge-x);
  bottom: clamp(32px, 6vw, 72px);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.detail.is-text-mode .detail-text{
  opacity: 1;
  pointer-events: auto;
}

.detail-text-part + .detail-text-part{
  margin-top: clamp(48px, 7vw, 90px);
}

.image-lightbox{
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 92vh;
  transform: translateY(-50%);
  display:flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.image-lightbox img,
.image-lightbox video{
  max-height: 85vh;
  max-width: min(94vw, 1300px);
  object-fit: contain;
  box-shadow: 0 30px 70px rgba(0,0,0,0.3);
}

/* fixed to the viewport (always fully visible) but positioned via JS to
   track the actual rendered media's top-right corner, clamped so it can
   never drift off-screen or overlap the media itself */
.image-lightbox-close{
  position: fixed;
  z-index: 501;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid currentColor;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- SIMPLE TEXT PAGE (About) ---------- */

.simple-page{
  /* left/right match the header exactly, so this flush-aligns with the wordmark */
  padding: clamp(24px, 5vw, 56px) var(--edge-x) 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.simple-page,
.simple-page h2,
.simple-page p{
  font-family: 'ABC Areal Variable', 'ABC Areal', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 18px;
  line-height: 20px;
}

.simple-page p{
  margin: 0 0 0.3em;
}

.simple-page h2{
  margin: 1.2em 0 0.5em;
}

.simple-page h2:first-of-type{
  margin-top: 0.2em;
}

.about-columns{
  display: flex;
  gap: clamp(32px, 6vw, 90px);
  align-items: flex-start;
}

.about-col{
  flex: 1 1 0;
  min-width: 0;
}

.about-entry{
  margin: 0 0 0.5em;
}

.about-entry p{
  margin: 0;
}

.about-copyright{
  margin-top: auto;
  padding-top: 40vh;
  font-size: 5px;
}

/* column 1 is just wide enough for "all", the years follow in column 2 */
.about-filters{
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 14px;
  row-gap: 0.5em;
  align-items: baseline;
  margin-top: clamp(48px, 7vw, 90px);
}

.about-filter-row[data-group="all"]{
  grid-column: 1;
  grid-row: 1;
}

.about-filter-row[data-group="year"]{
  grid-column: 2;
  grid-row: 1;
}

.about-filter-row{
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
}

.about-filter-btn{
  font-family: 'ABC Areal Variable', 'ABC Areal', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 20px;
  line-height: 1.15;
  opacity: 0.45;
}

.about-filter-btn.is-active{
  opacity: 1;
  font-style: italic;
}

.about-filter-btn:hover{
  opacity: 0.8;
}

.about-gallery{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: clamp(16px, 2.4vw, 32px);
  margin-top: clamp(32px, 5vw, 56px);
}

.about-gallery-link.is-filtered-out{
  display: none;
}

.about-gallery-link{
  display: block;
}

.about-gallery-item{
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

@media (max-width: 700px){
  /* --hero-font's formula was tuned for MacBook/iMac and never actually
     reaches its own 33px floor on a phone-width viewport (the vw term is
     too shallow to pull it down that far) - this overrides it directly
     so "my name is emily bruenjes" and the tagline still fit one line */
  :root{
    --hero-font: clamp(16px, 5vw, 24px);
  }

  .about-gallery{
    grid-template-columns: repeat(3, 1fr);
  }

  .about-columns{
    flex-direction: column;
  }
}
