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

html {
  font-size: 16px;
  color: #1e1e1e;
  font-family: 'Arial', sans-serif;
  font-weight: 400;
  line-height: 1.25;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: #fff;
}

body a {
  color: #1e1e1e;
  transition: color 0.15s ease;
}

body a:hover {
  color: #888;
}

.content-inner a {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.entry-title.article a {
  border-bottom: none;
}

a.muted {
  color: #a8a8a8;
  border-bottom: none;
}

a.muted:hover {
  color: #cdcdcd;
}

/* iOS Safari needs a non-transformed fixed element with background-color to correctly
   sample the safe area color. pointer-events:none disables this detection. */
#safari-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #fff;
  color: #fff;
  z-index: 9999;
}

/* ─── HERO ─── */
#hero {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  pointer-events: none;
  padding-top: 10vh;
  background: #fff;
}

.title {
  position: fixed;
  z-index: 10000;
  left: 0;
  right: 0;
  font-family: 'EB Garamond', serif;
  text-align: center;
  line-height: 1.25;
  font-size: 1.4rem;
  pointer-events: auto;
  user-select: text;
  cursor: pointer;
  background-color: #fff;
  will-change: transform;
}

/* ─── Desk objects ─── */
#objects {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 8.5rem;
  transition: opacity 0.15s ease;
}

.obj {
  width: 8.75rem;
  height: 11.625rem;
  object-fit: contain;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.obj.visible {
  opacity: 1;
  transform: translateY(0);
}

.obj-placeholder {
  width: 7.5rem;
  height: 10rem;
  background: rgba(0,0,0,0.06);
  border-radius: 4px;
}

.obj-wrap {
  position: relative;
  width: 7.5rem;
  height: 10rem;
  pointer-events: auto;
}

#obj-tooltip {
  position: fixed;
  background: #1e1e1e;
  color: #fff;
  font-family: monospace;
  font-size: 0.625rem;
  line-height: 1.5;
  padding: 0.625rem 0.75rem;
  max-width: 12.5rem;
  pointer-events: none;
  z-index: 100;
  display: none;
}

/* ─── SCROLL ZONE ─── */
#scroll-zone {
  position: relative;
  height: 100vh;
  height: 100svh;
  pointer-events: none;
}

#bio-scroll {
  position: absolute;
  bottom: 26%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  pointer-events: auto;
}

.bio {
  text-align: center;
  max-width: 25rem;
  line-height: 1.25;
  user-select: text;
}

/* ─── NAV ─── */
#nav-wrap {
  position: sticky;
  top: 86px;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 1.4rem 0;
  pointer-events: none;
}

#top-fade {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(13rem + 4rem);
  background: linear-gradient(to bottom, white 0%, white 35%, transparent 100%);
  pointer-events: none;
  z-index: 9;
}

nav {
  display: flex;
  gap: 3rem;
  align-items: center;
  pointer-events: auto;
}

nav a {
  font-family: 'EB Garamond', serif;
  text-decoration: none;
  color: #1e1e1e;
  font-size: 1.25rem;
  transition: color 0.15s ease, transform 0.6s ease-out;
  position: relative;
  padding: 0.45em 0.2em;
  display: inline-block;
}

nav a:hover { color: #888; }

nav a.active { color: #1e1e1e; }

nav a::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% + 2em);
  height: 2.2em;
  border: 1px solid #1e1e1e;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

nav a.active::before {
  opacity: 1;
}

/* ─── CONTENT ─── */
#content-section {
  position: relative;
  z-index: 5;
  background: #fff;
  min-height: 100vh;
  padding: 3rem 0 6rem;
}

#content-section::before {
  content: '';
  position: absolute;
  top: -5rem;
  left: 0;
  right: 0;
  height: 5rem;
  background: linear-gradient(to bottom, transparent, #fff);
  pointer-events: none;
}

.content-inner {
  max-width: 53.75rem;
  margin: 0 auto;
  padding: 0 3rem;
}

.panel {
  display: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.panel.active { display: block; }
.panel.visible { opacity: 1; }

.row {
  display: grid;
  grid-template-columns: 11.875rem 1fr;
  gap: 1.2rem 3rem;
  padding: 1rem 0 1.8rem;
  border-bottom: 1.5px solid #1e1e1e;
}

.row:first-child { border-top: 1.5px solid #1e1e1e; }

.row--full { grid-template-columns: 1fr; }

.row-content {
  min-width: 0;
}

.row-content p + p { margin-top: 0.6rem; }

.entry { margin-bottom: 1rem; }
.entry:last-child { margin-bottom: 0; }

.entry-title {
  font-weight: 400;
  color: #a8a8a8;
}

.entry-title.article {
  color: #1e1e1e;
}

.entry-title.article a {
  text-decoration: none;
  font-style: italic;
}

.entry-subtitle {
  color: #a8a8a8;
}

.row-label {
  font-family: 'Arial', sans-serif;
  font-weight: 700;
}

.entry-img {
  max-width: 100%;
  width: 400px;
  display: block;
  margin: 1.5rem auto;
  cursor: zoom-in;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.6rem;
  padding-top: 1.2rem;
}

.image-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  margin: 0;
  cursor: zoom-in;
}

.carousel {
  position: relative;
  margin: 1.5rem auto;
  width: 400px;
  max-width: 100%;
}

.carousel .entry-img {
  margin: 0;
  width: 100%;
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 1;
}

.carousel-prev { left: 0.5rem; }
.carousel-next { right: 0.5rem; }

.carousel:hover .carousel-btn { opacity: 1; }

@media (hover: none) {
  .carousel-btn,
  .lightbox-nav { display: none; }
}

.carousel-counter {
  display: block;
  font-family: 'Geist', sans-serif;
  font-size: 0.7rem;
  color: #a8a8a8;
  text-align: center;
  margin-top: 0.5rem;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10003;
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

#lightbox.has-carousel .lightbox-nav {
  pointer-events: all;
}

#lightbox.has-carousel:hover .lightbox-nav {
  opacity: 1;
}

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 10002;
  backdrop-filter: blur(16px) brightness(0.75);
  -webkit-backdrop-filter: blur(16px) brightness(0.75);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  pointer-events: none;
  display: flex;
  transition: opacity 0.35s ease;
}

#lightbox.active {
  opacity: 1;
  pointer-events: all;
}

#lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  cursor: default;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── SHORT VIEWPORTS ─── */
@media (max-height: 680px) {
  .obj { width: 5.5rem; height: 7.333rem; }
  .obj-wrap,
  .obj-placeholder { width: 5.5rem; height: 7.333rem; }
  #objects { gap: 1.5rem; margin-bottom: 5rem; }
}

@media (max-height: 580px) {
  #bio-scroll { display: none; }
}

/* ─── MOBILE ─── */
@media (max-width: 640px) {

  html {
    font-size: 14px;
  }

  #objects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 55vw;
    margin-bottom: 0;
  }

  .obj {
    width: 100%;
    height: auto;
    aspect-ratio: 3/4;
    object-fit: cover;
  }

  .obj-wrap,
  .obj-placeholder {
    width: 100%;
    height: auto;
    aspect-ratio: 3/4;
  }

  #bio-scroll {
    bottom: 18%;
  }

  #nav-wrap {
    top: 74px;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.1rem 1.8rem;
    padding: 0 2rem;
  }

  nav a {
    font-size: 1.1rem;
    font-weight: 500;
  }

  .title {
    font-weight: 500;
  }

  .bio {
    padding: 0 2.5rem;
    max-width: 100%;
  }

  #content-section {
    padding: 2rem 0 4rem;
  }

  .content-inner {
    padding: 0 1.25rem;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .row-label {
    font-weight: 700;
    color: #333;
  }


  #content-section::before {
    top: -3rem;
    height: 3rem;
  }
}

@media (max-width: 520px) {
  #bio-scroll { bottom: 21%; }
}
