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

:root {
  --bg: #f8f7f5;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  font-family: 'Times New Roman', Times, serif;
  color: var(--text);
  cursor: default;
  overflow-x: hidden;
}

.surface {
  position: relative;
  width: 100%;
  min-height: 100vh;
}

/* Images */
.element {
  position: absolute;
  opacity: 0;
  transition: opacity 1.2s ease-out;
}

.element.visible {
  opacity: 1;
}

.element img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  aspect-ratio: auto;
  cursor: pointer;
}

/* Text fragments */
.text-fragment {
  position: absolute;
  max-width: 45vw;
  font-family: 'Botanika Mono', 'Space Mono', 'SF Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: rgba(160, 160, 160, 0.85);
  padding: 0.4rem 0.6rem;
  opacity: 0;
  transition: opacity 1.4s ease-out;
  cursor: pointer;
}

.text-fragment.visible {
  opacity: 1;
}

@media (max-width: 768px) {
  .text-fragment {
    max-width: 85vw;
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
  }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(120, 120, 120, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
  cursor: pointer;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

/* Textbox */
.textbox {
  position: fixed;
  inset: 0;
  background: rgba(120, 120, 120, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
  cursor: pointer;
  padding: 2rem;
}

.textbox.active {
  opacity: 1;
  visibility: visible;
}

.textbox-content {
  position: relative;
  max-width: 700px;
  font-family: 'Botanika Mono', 'Space Mono', 'SF Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.8;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: rgba(80, 80, 80, 0.95);
  padding: 2rem;
}

@media (max-width: 768px) {
  .textbox-content {
    font-size: 0.75rem;
    padding: 1.5rem;
  }
}

.textbox-text {
  white-space: pre-wrap;
}

.textbox-copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: #a0a0a0;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.textbox-copy:hover {
  color: #ffffff;
}

.textbox-copy.copied {
  opacity: 0.5;
}

/* Size variations */
.element.size-large img {
  width: min(70vw, 900px);
}

.element.size-medium img {
  width: min(45vw, 550px);
}

.element.size-small img {
  width: min(28vw, 320px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .element.size-large img {
    width: 85vw;
  }

  .element.size-medium img {
    width: 70vw;
  }

  .element.size-small img {
    width: 50vw;
  }
}

/* Landing */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.landing.hidden {
  display: none;
}

.landing-image {
  max-width: 95vw;
  max-height: 80vh;
  object-fit: contain;
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.landing-contact {
  font-family: 'Botanika Mono', 'Space Mono', 'SF Mono', monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  color: #a0a0a0;
  text-transform: lowercase;
}

.landing-more {
  cursor: pointer;
  transition: color 0.3s ease;
  opacity: 1;
  color: #a0a0a0;
}

.landing-more:hover {
  color: var(--text);
}

.landing-contact a {
  color: #a0a0a0;
  text-decoration: none;
  transition: color 0.3s ease;
}

.landing-contact a:visited,
.landing-contact a:active {
  color: #a0a0a0;
}

.landing-contact a:hover {
  color: var(--text);
}

.landing-contact span:not(.landing-more) {
  margin: 0 1rem;
  opacity: 0.3;
}

/* Gallery */
.gallery {
  display: none;
}

.gallery.active {
  display: block;
}

/* Header */
.header {
  padding: 4rem 0;
  text-align: center;
  font-family: 'Botanika Mono', 'Space Mono', 'SF Mono', monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  color: #a0a0a0;
  text-transform: lowercase;
}

/* Footer */
.footer {
  padding: 4rem 0;
  text-align: center;
  font-family: 'Botanika Mono', 'Space Mono', 'SF Mono', monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  color: #a0a0a0;
  text-transform: lowercase;
}

.footer a {
  color: #a0a0a0;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer a:visited,
.footer a:active {
  color: #a0a0a0;
}

.footer a:hover {
  color: var(--text);
}

.footer span {
  margin: 0 1rem;
  opacity: 0.3;
}
