:root {
  --bg: #f7f7f5;
  --panel-bg: #ffffff;
  --border: #e4e2dd;
  --text: #2a2a28;
  --muted: #77756f;
  --accent: #c9622a;
  --accent-soft: #f1e2d6;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 14px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.site-header {
  padding: 16px 24px 12px;
  text-align: center;
}

.header-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1240px;
  margin: 0 auto 18px;
}

.logo-link {
  display: inline-flex;
  line-height: 0;
}

.header-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin-left: auto;
}

.header-info-text {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.header-info-text a {
  color: var(--accent-dim);
  text-decoration: none;
  font-weight: 500;
}

.header-info-text a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.donate-link {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .header-bar {
    flex-wrap: wrap;
    gap: 6px;
  }
  .header-info {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}

.logo-img {
  height: 56px;
  width: auto;
  border-radius: 6px;
  display: block;
}

.header-years {
  margin-left: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.menu-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.menu-toggle:hover {
  border-color: var(--accent);
}

.main-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  flex-direction: column;
  min-width: 160px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 20;
}

.main-menu.open {
  display: flex;
}

.menu-item {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  text-align: left;
  text-decoration: none;
  padding: 12px 16px;
  cursor: pointer;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:hover {
  background: var(--accent-soft);
}

.site-header h1 {
  margin: 0 0 4px;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.site-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 420px);
  gap: 24px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px 40px;
  align-items: start;
}

@media (max-width: 880px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* ---------- Master panel ---------- */

.master-panel {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  position: sticky;
  top: 16px;
}

@media (max-width: 880px) {
  .master-panel {
    position: static;
  }
}

.fullscreen-lock {
  overflow: hidden;
}

.fullscreen-lock .site-header {
  display: none;
}

.fullscreen-lock .site-footer {
  display: none;
}

.fullscreen-lock .layout {
  display: block;
  padding: 0;
  gap: 0;
  margin: 0;
  max-width: 100%;
}

.fullscreen-lock .layers-panel {
  display: none;
}

.master-panel.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 200;
  margin: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #000;
  padding: 0;
  border: none;
  box-shadow: none;
}

.master-panel.is-fullscreen .master-frame {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  background: #000;
}

.master-panel.is-fullscreen .master-canvas img {
  object-fit: contain;
}

.master-panel.is-fullscreen .master-actions {
  display: none;
}

.master-panel.is-fullscreen .description {
  display: none;
}

.master-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #efefeb repeating-conic-gradient(#e9e9e4 0% 25%, #efefeb 0% 50%) 50% / 24px 24px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.master-canvas {
  position: absolute;
  inset: 0;
}

.master-canvas img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.master-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font-size: 0.9rem;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.master-loading.hidden {
  opacity: 0;
}

.master-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  padding: 8px;
}

.icon-button .opensea-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.reset-btn {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.reset-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.description {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: pre-line;
  max-height: 160px;
  overflow-y: auto;
}

/* ---------- Layers panel ---------- */

.layers-panel h2 {
  margin: 4px 0 6px;
  font-size: 1.15rem;
}

.layers-panel .hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

.layers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  padding-right: 4px;
}

@media (max-width: 880px) {
  .layers-list {
    max-height: none;
  }
}

.layer-card {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}

.layer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.layer-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.layer-artist {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.layer-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.option-thumb {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #efefeb;
  aspect-ratio: 1 / 1;
  padding: 0;
}

.option-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.option-thumb .option-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font-size: 0.65rem;
  text-align: center;
  padding: 2px 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.option-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.option-thumb:hover {
  border-color: var(--accent);
}

.site-footer {
  text-align: center;
  color: #8a877f;
  padding: 14px 24px 34px;
  max-width: 920px;
  margin: 0 auto;
}

.footer-kicker {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: inherit;
  font-weight: 700;
}

.footer-year {
  margin: 4px 0 10px;
  font-size: 1.35rem;
  font-weight: 700;
  color: inherit;
}

.footer-copy {
  margin: 0 0 10px;
  color: inherit;
  font-size: 0.92rem;
  line-height: 1.65;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.site-footer a:hover {
  opacity: 0.78;
}

.site-footer .opensea-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: none;
}

.site-footer .opensea-icon {
  width: 18px;
  height: 18px;
}

.master-frame:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  border: none;
  background: #efefeb;
}

.master-frame:fullscreen .master-loading {
  font-size: 1rem;
}

/* ---------- Info modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 15, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal-content {
  position: relative;
  background: var(--panel-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 480px;
  width: 100%;
  padding: 28px 24px 24px;
}

.modal-content h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.modal-content p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.modal-content p:last-child {
  margin-bottom: 0;
}

.modal-content a {
  color: var(--accent);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

/* ---------- Projects gallery (landing page) ---------- */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px 40px;
}

.project-card {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.project-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #efefeb repeating-conic-gradient(#e9e9e4 0% 25%, #efefeb 0% 50%) 50% / 24px 24px;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
}

.project-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

/* ---------- Static single-image project (e.g. Flowers) ---------- */

.credits-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.credit-item {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.credit-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- Video projects (e.g. Alicia in Technoland) ---------- */

.alicia-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  border-radius: 6px;
}

.master-panel.is-fullscreen .alicia-video {
  border-radius: 0;
}

.frame82-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  border-radius: 6px;
}

.master-panel.is-fullscreen .frame82-video {
  border-radius: 0;
}

.attributes-heading {
  margin: 4px 0 10px;
  font-size: 1.15rem;
}

.attributes-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.attribute-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel-bg);
  padding: 10px 12px;
}

.attribute-key {
  font-size: 0.82rem;
  color: var(--muted);
}

.attribute-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}


.project-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.opensea-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: background 0.15s ease;
}

.opensea-badge:hover {
  background: #ffffff;
}

.opensea-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .site-header {
    padding: 12px 16px 10px;
  }

  .layout {
    padding: 8px 16px 32px;
  }

  .master-panel {
    padding: 12px;
  }

  .projects-grid {
    padding: 8px 16px 32px;
    gap: 14px;
  }

  .project-card-info {
    padding: 10px 12px;
  }

  .layer-options {
    grid-template-columns: repeat(2, 1fr);
  }
}
