@font-face {
  font-family: "WTGaramono";
  src: url("Assets/Fonts/WTGaramonoTRIAL-Regular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "WTGaramono";
  src: url("Assets/Fonts/WTGaramonoTRIAL-Italic.otf") format("opentype");
  font-weight: normal;
  font-style: italic;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background-color: rgba(26, 26, 26, 0.15);
  color: #1a1a1a;
}

html, body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: "WTGaramono", Georgia, "Times New Roman", serif;
  background-color: #f0ece4;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
}

.projects-container {
  height: 100%;
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 769px) {
  .projects-container {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .projects-container::-webkit-scrollbar {
    display: none;
  }
}

/* ── Header ── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 32px;
  z-index: 300;
  pointer-events: none;
}

.site-title {
  font-size: 16px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: #1a1a1a;
  pointer-events: auto;
}

.info-toggle {
  font-family: "WTGaramono", Georgia, serif;
  font-size: 16px;
  letter-spacing: 0.04em;
  background: none;
  border: none;
  color: #1a1a1a;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 12px 16px;
  margin: -12px -16px;
}

.info-toggle.revealed {
  opacity: 0.25;
}

.info-toggle.revealed:hover {
  opacity: 1;
}

@media (hover: none) {
  .info-toggle.revealed:hover {
    opacity: 0.25;
  }
  .info-toggle.revealed:active {
    opacity: 1;
  }
}

/* ── About overlay ── */

.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background-color: rgba(240, 236, 228, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s 0.3s;
  will-change: opacity;
}

.about-overlay.visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  cursor: none;
  transition: opacity 0.3s ease, visibility 0s;
}

@media (max-width: 768px) {
  .about-overlay.visible {
    cursor: pointer;
  }
}

.about-content {
  max-width: 760px;
  padding: 32px;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0.02em;
  text-align: left;
  opacity: 0;
  transition: opacity 0.25s ease;
  will-change: opacity;
  cursor: none;
}

.about-overlay.visible .about-content {
  opacity: 1;
  transition: opacity 0.35s ease 0.05s;
}

.material-legend {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 1.2em;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.legend-item.legend-visible {
  opacity: 1;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-label {
  font-size: 16px;
}

.about-links {
  margin-top: 1.2em;
}

.about-links a {
  color: #1a1a1a;
  text-decoration: none;
  opacity: 0.25;
  transition: opacity 0.3s ease;
  cursor: pointer;
  pointer-events: auto;
}

.about-links a.about-link-hidden {
  opacity: 0;
}

.about-links a:hover {
  opacity: 1;
}

@media (hover: none) {
  .about-links a:hover {
    opacity: 0.25;
  }
  .about-links a:active {
    opacity: 1;
  }
}

/* ── Project thumbnails (fixed right) ── */

.project-thumbs {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.project-thumb {
  width: 24px;
  height: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
  display: block;
}

.project-thumb.thumb-visible {
  opacity: 0.25;
}

.project-thumb.thumb-visible.active {
  opacity: 1;
}

.project-thumb.thumb-visible:hover {
  opacity: 1;
}

.project-thumb:focus,
.project-thumb:focus-visible {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
  .project-thumbs {
    display: none;
  }
  .slide-cursor {
    display: none !important;
  }
}

/* ── Project list (fixed bottom-left) ── */

.project-list {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project-list-item {
  line-height: 1.35;
  font-variant-numeric: oldstyle-nums;
  -moz-font-feature-settings: "onum";
  -webkit-font-feature-settings: "onum";
  font-feature-settings: "onum";
  transition: opacity 0.22s ease;
}

.project-list-item.fading-out {
  opacity: 0;
}

.item-title-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.project-list-item .item-title {
  font-size: 16px;
  letter-spacing: 0.04em;
}

.material-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.material-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.project-list-item .item-dimensions,
.project-list-item .item-year {
  display: block;
  font-size: 16px;
  letter-spacing: 0.03em;
  font-style: italic;
}

/* ── Project sections ── */

.slide-zone {
  position: absolute;
  top: 15%;
  bottom: 15%;
  width: 40%;
  z-index: 5;
  cursor: none;
}

.slide-zone-left {
  right: 50%;
}

.slide-zone-right {
  left: 50%;
}

.slide-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-family: "WTGaramono", Georgia, serif;
  font-style: italic;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: #1a1a1a;
  transform: translate(8px, -50%);
  white-space: nowrap;
  transition: opacity 0.08s ease;
}

.project-section {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  overflow: hidden;
}

.slideshow-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  height: 100%;
  padding-bottom: 16px;
}

.slideshow-image {
  display: block;
  max-height: 75vh;
  max-height: 75dvh;
  max-width: 62vw;
  object-fit: contain;
  transform: scale(0.88);
  transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.slideshow-image.project-active {
  transform: scale(1);
}

.slideshow-caption {
  font-style: italic;
  font-size: 12.7px;
  text-align: left;
  position: absolute;
  transition: opacity 0.15s ease;
}

.slideshow-caption.caption-hidden {
  opacity: 0;
}

@keyframes fade-in-only {
  from { opacity: 0; }
  to   { opacity: 1; }
}


.slideshow-image.anim-next,
.slideshow-image.anim-prev {
  animation: fade-in-only 0.9s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

.slideshow-image.anim-wrap,
.description-slide.anim-wrap {
  animation: fade-in-only 0.9s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

@media (max-width: 768px) {
  .slideshow-image.anim-next,
  .slideshow-image.anim-prev {
    animation: fade-in-only 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) both;
  }
  .slideshow-image.anim-wrap,
  .description-slide.anim-wrap {
    animation: fade-in-only 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) both;
  }
  .description-slide.anim-next,
  .description-slide.anim-prev {
    animation: fade-in-only 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) both;
  }
}

/* ── Slideshow controls row ── */

.controls-row {
  position: fixed;
  bottom: 32px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0s ease;
  opacity: 0;
  pointer-events: none;
}

.controls-row.controls-visible {
  transition: opacity 0.4s ease;
  opacity: 1;
  pointer-events: auto;
}


.slideshow-controls {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 16px;
  letter-spacing: 0.04em;
  user-select: none;
}

.slide-number {
  cursor: pointer;
  opacity: 0.25;
  transition: opacity 0.25s ease;
  padding: 2px 0;
}

.controls-row:not(.controls-visible) .slide-number {
  opacity: 0 !important;
  visibility: hidden;
}

.slide-number.active {
  opacity: 1;
}

.slide-number:hover {
  opacity: 1;
}

.slide-number.active:hover {
  opacity: 1;
}

.slide-number::before {
  content: "(";
}
.slide-number::after {
  content: ")";
}

/* ── Description slide ── */

.description-slide {
  display: none;
  max-width: 760px;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0.02em;
  text-align: left;
  padding: 32px;
}

.description-slide.anim-next,
.description-slide.anim-prev {
  animation: fade-in-only 0.9s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

.slide-plus {
  opacity: 0.25;
  transition: opacity 0.3s ease;
}

.slide-plus:hover {
  opacity: 1;
}

/* ── Intro animation ── */

.typewriter-target {
  visibility: hidden;
}

.typewriter-target.typing,
.typewriter-target.typed {
  visibility: visible;
}

.tw-char {
  display: inline;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tw-char.tw-visible {
  opacity: 1;
}

.typewriter-cursor {
  display: inline;
  opacity: 1;
  animation: blink-cursor 0.6s steps(1) infinite;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.fade-in-element {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.fade-in-element.revealed {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-element.fade-only {
  transform: none;
}

.fade-in-element.fade-only.revealed {
  transform: none;
}

/* ── Responsive ── */

@media (max-width: 768px) {
  .site-header {
    padding: 16px 20px;
  }

  .info-toggle {
    position: fixed;
    top: 16px;
    right: 20px;
    bottom: auto;
    padding: 12px 16px;
    margin: -12px -16px 0 0;
  }

  .project-list {
    top: 48px;
    bottom: auto;
    left: 20px;
    gap: 12px;
  }

  .controls-row {
    bottom: 16px;
  }

  .slideshow-wrapper {
    padding-top: 65px;
  }

  .slideshow-image {
    max-width: calc(100vw - 40px);
    max-height: 65vh;
    max-height: 65dvh;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
                opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
  }

  .about-content {
    max-width: 100%;
    padding: 32px 20px;
  }

  .description-slide {
    padding: 32px 20px;
    max-width: 100%;
    text-align: left;
  }
}
