
@font-face { font-family: y2kneo; src: url(y2kneo.otf); }
@font-face { font-family: andalemono; src: url(andalemono.ttf); }

html, body { margin: 0; padding: 0; 
  overscroll-behavior-y: none;
  overscroll-behavior-x: auto;
}

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

body {
  font-family: andalemono, sans-serif;
  color: black;
  background-color: transparent;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative; /* needed for ::before background layer */
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background-image: url('grid.png');
  background-size: 20px 20px;
  background-repeat: repeat;
}

/* Plain mode overrides */
html.plain-bg body {
  background: #fff !important;
  background-image: none !important;
  background-attachment: initial !important;
}

html.plain-bg body::before {
  display: none; /* hide grid layer in plain mode */
}



.header-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 50px;
  padding-bottom: 10px;
  background-image: url('grid.png') !important;
}

.header-content {
  width: 80%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#header-placeholder {
  position: sticky;
  position: -webkit-sticky;
  top: 0;
  z-index: 150;
}
#header-placeholder .header-bar { position: static; }

.content {
  width: 80%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  flex-grow: 0;
  padding: 0;
  position: relative;
  z-index: 10;
}

.footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  font-size: 15px;
  margin-right: 2px;
  width: 80%;
  margin: 0 auto;
  height: 100px;
  margin-top: 15px;
  background: transparent !important;
  background-image: none !important;
  position: relative;
  z-index: 10;
  border-top: .5px solid black;
}
.footer-left { justify-self: start; }
.footer-center { justify-self: center; }
.footer-right { justify-self: end; display: flex; gap: 20px; }
.footer-icon img { height: 40px; width: auto; display: block; }


.name { font-family: y2kneo, sans-serif; font-size: 30px; }
#name-chip { text-decoration: none; padding-top: 8px; }
.header-bar .name #name-chip {
  font-family: 'y2kneo', var(--font-heading, sans-serif) !important;
  font-weight: 400;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
}

.button {
  text-decoration: underline;
  text-underline-offset: 5px;
  color: black;
  font-size: 16px;
}


.header-bar .buttons .label-desktop { display: inline; }
.header-bar .buttons .label-mobile  { display: none; }

.header-bar .buttons .buttons-toggle {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}


:root { --chip-1:#000; --chip-2:#000; --chip-3:#000; --chip-4:#000; --chip-text:#fff; }
.chip {
  display:inline-block;
  padding:4px 8px;
  background:var(--chip-1);
  color:var(--chip-text);
  text-shadow:none;
  border-radius:0;
  line-height:1.1;
  text-transform:uppercase;
}
.button.chip, .social-button.chip { text-decoration: none; }
.chip--1 { background:var(--chip-1); }
.chip--2 { background:var(--chip-2); }
.chip--3 { background:var(--chip-3); }
.chip--4 { background:var(--chip-4); }


.social-buttons { display: flex; gap: 20px; }
.social-button {
  text-decoration: underline;
  text-underline-offset: 5px;
  font-family: andalemono, sans-serif;
  color: black;
  font-size: 16px;
  backdrop-filter: blur(1px);
}


.home-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 15px;
  width: 100%;
}
.home-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16/5;
  overflow: hidden;
  isolation: isolate;
  border: solid white 1px;
}
.home-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.home-thumb .chip {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}


.card-grid { display:grid; gap:20px; grid-template-columns:repeat(3,1fr); }
@media (max-width:1000px){ .card-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:600px){  .card-grid{ grid-template-columns:1fr; } }

.card { display:block; }
.card-thumb {
  position:relative;
  display:block;
  width:100%;
  aspect-ratio:1/1;
  padding:0;
  border:0;
  background:transparent;
  cursor:pointer;
  border: solid white .5px;
}
.card-thumb img {
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:cover;
  display:block;
}
.card-title {
  position:absolute;
  left:50%; top:50%;
  transform:translate(-50%, -50%);
  white-space:nowrap;
  pointer-events:none;
  text-align: center;
}


body.client .card-grid { grid-template-columns: 1fr; }
body.client .card-thumb { aspect-ratio: 4 / 1; }


.project-row {
  display: flex; 
  align-items: stretch; 
  gap: 12px; 
  margin-top: 5px; 
  margin-bottom: 5px
}
.text-box {
  background: #000; color: #fff;
  font-family: andalemono, sans-serif;
  text-align: left;
  padding: 20px; flex: 1 1 auto; margin-top: 0;
}
.text-content { margin: 0; }
.year-box {
  flex: 0 0 12%;
  min-width: 72px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  font-size: 30px;
  color: #fff;
  padding-top: 4px; padding-bottom: 4px;
  text-align: center;
  line-height: 1.2;
  text-transform: uppercase;
}


#personal-section { padding-top: 130px; margin-top: -100px; }

.gallery, .gallery_squares, .gallery_2 {
  display: flex;
  gap: 20px;
  overflow: hidden;
  padding-bottom: 20px;
  align-items: center;
}
.gallery        { height: 486px; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; }
.gallery_squares{ height: 388px; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; }
.gallery_2      { height: 500px; flex-direction: row; justify-content: center; }

.gallery img, .gallery_squares img, .gallery_long img, .gallery_2 img {
  max-width: 100%; height: 100%;
}

.title-text {
  display: inline-block;
  font-size: 18px;
  margin-top: 5px;
  margin-bottom: 20px;
  padding: 5px;
  color: white;
  background-color: black;
}


.project-block { margin: 5px 0; }


.project-media { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }


.project-media.project-media--full { display: block; }
.project-media.project-media--full img { width: 100%; height: auto; }


.project-media.project-media--grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
  justify-items: center;
}


.project-media.project-media--grid:has(img:nth-child(2)):not(:has(img:nth-child(3))) {
  grid-template-columns: repeat(2, 1fr);
  justify-content: center;
}


.video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.video-embed iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: 0;
}
.video-embed--portrait { aspect-ratio: 4 / 5; }


.card-thumb:hover .chip,
.home-thumb:hover .chip {
  background: #fff;
  color: #000;
  text-shadow: none;
  transition: all 0.2s ease;
}


.bg-toggle {
  width: 28px; height: 28px;
  border: 5px solid #000;
  background-image: url('grid.png');
  background-size: cover;
  background-repeat: repeat;
  cursor: pointer;
  position: relative;
  padding: 0;
}
.bg-toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px; right: 2px; bottom: 2px;
  background: linear-gradient(135deg, transparent 40%, black 40%, black 60%, transparent 60%);
  pointer-events: none;
}
html.plain-bg .bg-toggle::after { display: none; }

.background-rectangles {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 0;
}


.background-rectangles div {
  opacity: 1;
  transition: opacity 0.1s ease;
}


html.plain-bg .background-rectangles div {
  opacity: 0.5;
}


html.plain-bg body {
  background: #fff !important;
  background-image: none !important;
  background-attachment: initial !important;
}
html.plain-bg #header-placeholder,
html.plain-bg #header-placeholder .header-bar {
  background: #fff !important;
  background-image: none !important;
}

.about-portrait {
  width: min(520px, 90vw);
  aspect-ratio: 1/1;
  margin: 0px 0 30px;
  position: relative;
  user-select: none;
  cursor: pointer;
}
.about-portrait svg { display: block; width: 100%; height: 90%; }


/* About page: only split the text + portrait; leave .title-text alone */
.about-split {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) min(520px, 40vw);
  align-items: start;
  column-gap: 24px;
  margin-top: 8px;
}

.about-split .about-portrait {
  justify-self: end;
  inline-size: 100%;
  max-inline-size: 480px;
}

/* Stack on small screens */
@media (max-width: 900px) {
  .about-split {
    display: block;
  }
  .about-split .about-portrait {
    margin-top: 12px;
  }
}

/* If the previous :has(.about-portrait) grid rule still exists, neutralize it */
.content:has(.about-portrait) { display: flex; flex-direction: column; column-gap: 0; }
.content:has(.about-portrait) .title-text { grid-column: auto; }

/* Stack on small screens */
@media (max-width: 900px) {
  .content:has(.about-portrait) {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .content:has(.about-portrait) .about-portrait {
    align-self: flex-end;       /* push to the right edge if desired */
  }
}



@media (min-width: 769px) {

  .header-bar .buttons {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .header-bar .buttons::-webkit-scrollbar { display: none; }

  .header-bar .buttons a.button,
  .header-bar .buttons a.chip {
    padding-left: 10px;
    padding-right: 10px;
  }


  .header-bar .buttons .label-desktop { display: inline; }
  .header-bar .buttons .label-mobile  { display: none !important; }
}


@media (max-width: 900px) {

  .header-bar {
    padding-top: 20px;
    padding-bottom: 10px;
  }

  .header-content { width: 90%; }
  .content { width: 90%; }
  .footer { width: 90%; }
  .project-row { flex-direction: column; align-items: stretch; }
  .year-box {
    align-self: stretch; min-width: 0; justify-content: flex-start;
    margin: 0; padding-left: 15px;
  }

  .home-thumbs { grid-template-columns: 1fr; }


  .header-content {
    flex-direction: column; align-items: flex-start; gap: 10px;
  }
  .name .chip {
    display: inline-block; font-size: 20px; line-height: 1.05; padding: 8px 10px;
  }
  .title .chip {
    display: inline-block; font-size: 12px; letter-spacing: 0px;
    padding: 2px 8px; margin-top: 0;
  }


  .header-bar .buttons {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; overflow-x: visible !important;
  }
  .header-bar .buttons a.button,
  .header-bar .buttons a.chip {
    flex: 1 1 0;
    text-align: left;
    white-space: nowrap;
    padding-top: 10px; padding-bottom: 10px;
    padding-left: 22px; padding-right: 22px;
    letter-spacing: 0px;
    font-size: 14px; line-height: 1.2;
  }


  .header-bar .buttons .label-desktop { display: none !important; }
  .header-bar .buttons .label-mobile  { display: inline !important; }


  .project-media,
  .project-media.project-media--grid {
    grid-template-columns: 1fr;
  }
  .project-media.project-media--full { display: block; }
}


@media (max-width: 420px) {
  .header-bar {
    padding-top: 12px;
  }

  .header-bar .buttons { gap: 12px; }
  .header-bar .buttons a.button,
  .header-bar .buttons a.chip {
    font-size: 13px; padding-left: 18px; padding-right: 18px;
  }
}


.project-media > *,
.project-media.project-media--grid > * { min-width: 0; }


.project-media a { display: block; }


.project-media,
.project-media.project-media--grid { justify-items: stretch; align-items: start; }


.project-media img { max-width: 100%; height: auto; display: block; }


.project-media,
.project-media.project-media--grid {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}


.social-icon-link { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.social-icon { height: 25px; width: auto; display: block; }
.social-icon-link:hover .social-icon { opacity: 0.8; transition: opacity .15s ease; }


.expanded-image {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: block;
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  background: rgba(0,0,0,0.9);
  cursor: zoom-out;
}


body:has(.expanded-image) {
  overflow: hidden;
}


@media (pointer: coarse) {
  .social-icon-link { padding: 2px; }
}

@media (max-width: 1130px) {
  .name { font-family: y2kneo, sans-serif; font-size: 20px; }

}

@media (max-width: 768px) {
  .project-media,
  .project-media.project-media--grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


.project-media > *,
.project-media.project-media--grid > * { min-width: 0; }

.project-media img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}
