:root {
  --page-bg: #fafaf8;
  --text-primary: #1a1a1a;
  --text-secondary: #6b6b6b;
  --text-tertiary: #a0a0a0;
  --rule: #e8e6e2;
  --accent: #c4a882;
  --space: #e8d5b0;
  --microscopic_world: #c8dde8;
  --scientific_exploration: #d4e0c0;
  --computing: #e8c8a0;
  --information_systems: #d0c8e8;
  --personal_historical: #e8b8b0;
  --viewport-bg: #0a1628;
  --signal-cool: rgba(200, 210, 220, 0.6);
  --signal-cool-strong: rgba(230, 235, 240, 0.9);
  --signal-cool-muted: rgba(200, 210, 220, 0.25);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --hero-shift: 0px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: var(--page-bg);
  color: var(--text-primary);
  scroll-behavior: smooth;
}

body {
  font-family: "Courier Prime", monospace;
  overflow-x: hidden;
}

body.overlay-open {
  overflow: hidden;
}

.site {
  width: 100%;
}

.hero {
  background: var(--page-bg);
  padding: 20vh 5vw 14vh;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  transform: translateY(calc(var(--hero-shift) * -1));
  transition: transform 0.3s linear;
}

.hero-kicker,
.hero-subtitle,
.hero-scroll {
  margin: 0;
  text-transform: uppercase;
}

.hero-kicker {
  font-size: 12px;
  letter-spacing: 0.5em;
  color: #999999;
}

.hero-title {
  margin: 24px 0 16px;
  font-family: "EB Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.1;
  color: #1a1a1a;
}

.hero-subtitle {
  font-size: 12px;
  letter-spacing: 0.15em;
  color: #a0a0a0;
}

.hero-rule {
  width: 48px;
  height: 1px;
  margin: 32px auto;
  background: #d0cec8;
}

.hero-scroll {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #c0c0c0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-chevron {
  width: 9px;
  height: 9px;
  border-right: 1px solid #c0c0c0;
  border-bottom: 1px solid #c0c0c0;
  transform: rotate(45deg);
  animation: hero-chevron-bob 2s var(--ease-standard) infinite;
}

[data-anim] {
  opacity: 0;
  transform: translateY(24px);
}

body.is-ready [data-anim] {
  animation: hero-fade-up 0.9s var(--ease-out) forwards;
  animation-delay: var(--delay, 0s);
}

.constellation-shell {
  position: relative;
  width: 100%;
  background: var(--viewport-bg);
  height: max(85vh, 700px);
}

.constellation-shell::before,
.constellation-shell::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 60px;
  pointer-events: none;
  z-index: 3;
}

.constellation-shell::before {
  top: 0;
  background: linear-gradient(
    to bottom,
    #fafaf8 0%,
    #d8dfe8 22%,
    #6080a0 48%,
    #1a3a5e 72%,
    rgba(10, 22, 40, 0) 100%
  );
}

.constellation-shell::after {
  bottom: 0;
  background: linear-gradient(
    to top,
    #fafaf8 0%,
    #d8dfe8 22%,
    #6080a0 48%,
    #1a3a5e 72%,
    rgba(10, 22, 40, 0) 100%
  );
}

.constellation-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.constellation-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  z-index: 1;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(232, 238, 245, 0.85) 0.2px, transparent 0.32px),
    radial-gradient(circle at 80% 70%, rgba(232, 238, 245, 0.72) 0.2px, transparent 0.32px);
  background-size: 3px 3px, 4px 4px;
  mix-blend-mode: soft-light;
}

#constellationCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.constellation-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.legend {
  pointer-events: auto;
  position: absolute;
  top: 22px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: min(330px, calc(100vw - 120px));
}

.legend-item {
  border: 0;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--signal-cool);
  font-family: "Courier Prime", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
  transition: color 0.32s var(--ease-standard), opacity 0.32s var(--ease-standard);
}

.legend-item:hover,
.legend-item.active {
  color: var(--signal-cool-strong);
}

.legend-item.inactive {
  color: var(--signal-cool-muted);
  opacity: 1;
}

.legend-item.inactive .legend-dot {
  opacity: 0.3;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 8px;
}

.connections-toggle {
  pointer-events: auto;
  position: absolute;
  top: 24px;
  right: 24px;
  border: 0;
  background: transparent;
  color: rgba(200, 210, 220, 0.45);
  font-family: "Courier Prime", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 2px 0;
  text-underline-offset: 4px;
  transition: color 0.32s var(--ease-standard), opacity 0.32s var(--ease-standard);
}

.connections-toggle.active {
  color: rgba(232, 213, 176, 0.8);
  text-decoration: underline;
}

.hover-card {
  position: absolute;
  z-index: 5;
  min-width: 220px;
  max-width: 380px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.32s var(--ease-out), transform 0.32s var(--ease-out);
  pointer-events: none;
}

.hover-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.hover-title,
.hover-meta {
  margin: 0;
}

.hover-title {
  font-family: "EB Garamond", serif;
  font-style: italic;
  font-size: 16px;
  color: rgba(236, 228, 212, 0.94);
}

.hover-meta {
  margin-top: 3px;
  font-family: "Courier Prime", monospace;
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(205, 214, 224, 0.52);
}

.timeline {
  pointer-events: auto;
  position: absolute;
  left: 24px;
  right: 140px;
  bottom: 16px;
}

.timeline-scroll {
  width: 100%;
  overflow: hidden;
}

.timeline-track {
  position: relative;
  height: 96px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(8px, 1.2vw, 24px);
}

.timeline-axis {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 32px;
  height: 1px;
  background: rgba(200, 210, 220, 0.2);
}

.timeline-option {
  border: 0;
  background: transparent;
  color: rgba(200, 210, 220, 0.4);
  font-family: "Courier Prime", monospace;
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 48px;
  transition: color 0.32s var(--ease-standard), opacity 0.32s var(--ease-standard);
}

.timeline-option-all {
  min-width: 44px;
}

.timeline-stack {
  display: inline-flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 1px;
  min-height: 22px;
}

.timeline-dot {
  width: 2px;
  height: 2px;
  border-radius: 999px;
  opacity: 0.6;
}

.timeline-tick {
  width: 1px;
  height: 8px;
  background: rgba(200, 210, 220, 0.2);
  transition: height 0.32s var(--ease-standard), background-color 0.32s var(--ease-standard);
}

.timeline-label {
  display: block;
}

.timeline-option:hover,
.timeline-option.active {
  color: rgba(200, 210, 220, 0.8);
}

.timeline-option.active .timeline-dot {
  opacity: 1;
}

.timeline-option.active .timeline-tick {
  height: 12px;
  background: rgba(200, 210, 220, 0.7);
}

.works-count {
  position: absolute;
  right: 24px;
  bottom: 10px;
  margin: 0;
  color: rgba(200, 210, 220, 0.35);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.essay {
  background: var(--page-bg);
  padding: 100px 24px 80px;
}

.essay-wrap {
  max-width: 680px;
  margin: 0 auto;
}

.essay-kicker {
  margin: 0;
  font-family: "Courier Prime", monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #a0a0a0;
  text-align: center;
}

.essay-title {
  margin: 16px 0 0;
  font-family: "EB Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(32px, 4vw, 40px);
  color: #1a1a1a;
  text-align: center;
}

.essay-rule,
.essay-attribution-rule {
  width: 48px;
  border: 0;
  border-top: 1px solid #d0cec8;
  margin: 40px auto;
}

.essay-copy p {
  margin: 0 0 20px;
  font-family: "EB Garamond", serif;
  font-size: 17px;
  line-height: 1.85;
  color: #3a3a3a;
}

.essay-copy em {
  font-style: italic;
}

.essay-pull-quote {
  font-style: italic;
  font-size: clamp(20px, 2.5vw, 24px);
  color: #1a1a1a;
  border-left: 2px solid #c4a882;
  padding-left: 24px;
  margin: 48px 0;
}

.essay-attribution-rule {
  border-top-color: #e8e6e2;
  margin: 40px auto 14px;
}

.essay-attribution {
  margin: 0;
  text-align: center;
  font-family: "Courier Prime", monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #a0a0a0;
}

.about {
  background: var(--page-bg);
  padding: 100px 6vw;
}

.about-wrap {
  max-width: 760px;
  margin: 0 auto;
}

.about-kicker,
.credential-kicker {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.about-title {
  margin: 14px 0 26px;
  font-family: "EB Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(32px, 4vw, 48px);
  color: var(--text-primary);
}

.about-copy p {
  margin: 0 0 20px;
  font-family: "EB Garamond", serif;
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.85;
  color: #3a3a3a;
}

.about-legend {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px 14px;
}

.about-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.about-legend-item .legend-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
}

.about-rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 42px 0 28px;
}

.about-credentials {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.credential-copy {
  margin: 10px 0 0;
  font-family: "EB Garamond", serif;
  font-size: 15px;
  line-height: 1.8;
  color: #4b4b4b;
}

.education {
  margin-top: 32px;
}

.site-footer {
  border-top: 1px solid var(--rule);
  text-align: center;
  padding: 32px 20px 80px;
  background: var(--page-bg);
}

.footer-link {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.footer-link a {
  color: inherit;
  text-decoration: none;
}

.footer-link a:hover {
  text-decoration: underline;
}

.footer-copy {
  margin: 10px 0 0;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #cccccc;
}

.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease-standard), visibility 0.5s var(--ease-standard);
}

.detail-overlay.open {
  opacity: 1;
  visibility: visible;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 18, 32, 0.88);
  backdrop-filter: blur(20px);
  cursor: pointer;
}

.overlay-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(1040px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  transform: translate(-50%, -50%) scale(0.96);
  background: rgba(15, 15, 17, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 24px;
  transition: transform 0.5s var(--ease-out);
}

.detail-overlay.open .overlay-dialog {
  transform: translate(-50%, -50%) scale(1);
}

.overlay-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 22px;
}

.work-nav-btn,
.overlay-close,
.image-nav-btn {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-family: "Courier Prime", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  transition: color 0.32s var(--ease-standard), opacity 0.32s var(--ease-standard);
}

.work-nav-btn:hover,
.overlay-close:hover,
.image-nav-btn:hover {
  color: #ffffff;
}

.work-nav-btn:disabled,
.image-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.overlay-close {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.78);
}

.overlay-work-nav {
  position: absolute;
  top: 50%;
  width: 34px;
  height: 64px;
  transform: translateY(-50%);
  opacity: 0.4;
}

.overlay-work-nav::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  margin: 0 auto;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
}

.overlay-work-nav-prev {
  left: 6px;
}

.overlay-work-nav-prev::before {
  transform: rotate(-135deg);
}

.overlay-work-nav-next {
  right: 6px;
}

.overlay-work-nav-next::before {
  transform: rotate(45deg);
}

.overlay-work-nav:hover {
  opacity: 0.8;
}

.overlay-media {
  margin-top: 10px;
}

.image-frame {
  position: relative;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.detail-image {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.45s var(--ease-standard);
}

.detail-image.visible {
  opacity: 1;
  position: relative;
  z-index: 1;
}

.detail-image:not(.visible) {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 70vh;
  z-index: 0;
}

.image-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
  opacity: 0;
  transition: opacity 0.32s var(--ease-standard);
  z-index: 2;
}

.image-shimmer.visible {
  opacity: 1;
}

.image-nav {
  margin: 14px auto 0;
  max-width: 680px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.image-counter {
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.thumbnail-strip {
  position: relative;
  margin: 14px auto 0;
  max-width: 680px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.thumbnail-strip.overflowing::before,
.thumbnail-strip.overflowing::after {
  content: "";
  position: sticky;
  top: 0;
  width: 20px;
  height: 56px;
  pointer-events: none;
  z-index: 1;
}

.thumbnail-strip.overflowing::before {
  left: 0;
  background: linear-gradient(to right, rgba(15, 15, 17, 0.9), rgba(15, 15, 17, 0));
}

.thumbnail-strip.overflowing::after {
  right: 0;
  margin-left: auto;
  background: linear-gradient(to left, rgba(15, 15, 17, 0.9), rgba(15, 15, 17, 0));
}

.thumbnail-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  width: 68px;
  height: 56px;
  padding: 0;
  flex: 0 0 68px;
  cursor: pointer;
  overflow: hidden;
}

.thumbnail-btn.active {
  border-color: rgba(196, 168, 130, 0.9);
}

.thumbnail-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(0.1);
  background: rgba(255, 255, 255, 0.05);
}

.overlay-meta {
  margin: 24px auto 0;
  max-width: 680px;
}

.detail-category {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.detail-title {
  margin: 14px 0 8px;
  font-family: "EB Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
  color: #ffffff;
}

.detail-facts {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  line-height: 1.7;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.56);
}

.detail-rule {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 18px 0 14px;
}

.detail-statement {
  margin: 0;
  max-width: 560px;
  font-family: "EB Garamond", serif;
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.7);
}

.detail-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}

.detail-link:hover {
  text-decoration: underline;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
}

.reveal-on-scroll.visible {
  animation: reveal-up 0.85s var(--ease-out) forwards;
  animation-delay: var(--reveal-delay, 0s);
}

@keyframes hero-fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-chevron-bob {
  0% {
    transform: rotate(45deg) translateY(0);
  }
  50% {
    transform: rotate(45deg) translateY(4px);
  }
  100% {
    transform: rotate(45deg) translateY(0);
  }
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 1023px) {
  .constellation-shell {
    height: max(70vh, 560px);
  }

  .legend {
    max-width: min(280px, calc(100vw - 112px));
  }

  .overlay-dialog {
    width: 92vw;
    padding: 20px;
  }

  .overlay-work-nav-prev {
    left: 2px;
  }

  .overlay-work-nav-next {
    right: 2px;
  }

  .essay {
    padding: 84px 24px 68px;
  }

  .about {
    padding: 84px 6vw;
  }
}

@media (max-width: 767px) {
  .hero {
    padding: 12vh 6vw 8vh;
  }

  .hero-inner {
    transform: none;
  }

  .hero-kicker,
  .hero-subtitle,
  .hero-scroll,
  .about-kicker,
  .credential-kicker,
  .legend-item,
  .connections-toggle,
  .timeline-option,
  .footer-link,
  .footer-copy,
  .detail-facts,
  .detail-category,
  .detail-link,
  .work-nav-btn,
  .overlay-close,
  .image-nav-btn,
  .image-counter {
    font-size: 10px;
  }

  .constellation-shell {
    height: max(60vh, 420px);
  }

  .legend {
    top: 16px;
    left: 14px;
    gap: 4px;
    max-width: calc(100vw - 102px);
  }

  .connections-toggle {
    top: 16px;
    right: 14px;
  }

  .timeline {
    left: 14px;
    right: 14px;
    bottom: 10px;
  }

  .timeline-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 3px;
  }

  .timeline-track {
    min-width: 760px;
    gap: 12px;
    padding-right: 10px;
  }

  .works-count {
    right: 14px;
    bottom: 2px;
  }

  .about {
    padding: 60px 20px;
  }

  .essay {
    padding: 64px 20px 56px;
  }

  .essay-copy p {
    font-size: 15px;
    line-height: 1.78;
  }

  .essay-pull-quote {
    padding-left: 16px;
    margin: 32px 0;
  }

  .about-copy p {
    font-size: 15px;
    line-height: 1.78;
  }

  .about-legend {
    grid-template-columns: 1fr;
  }

  .about-credentials {
    grid-template-columns: 1fr;
  }

  .overlay-dialog {
    inset: 0;
    top: 0;
    left: 0;
    transform: none;
    width: 100vw;
    height: 100vh;
    max-height: none;
    border: 0;
    border-radius: 0;
    padding: 14px;
  }

  .detail-overlay.open .overlay-dialog {
    transform: none;
  }

  .overlay-header {
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(12, 12, 15, 0.94);
    padding: 4px 0 8px;
  }

  .overlay-work-nav {
    top: 34vh;
  }

  .detail-image {
    max-height: 55vh;
  }

  .detail-image:not(.visible) {
    max-height: 55vh;
  }

  .overlay-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .thumbnail-btn {
    width: 60px;
    height: 50px;
    flex-basis: 60px;
  }

  .overlay-meta {
    margin-top: 16px;
  }

  .detail-statement {
    font-size: 15px;
    line-height: 1.74;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
