:root {
  --bg: #000;

  --c1: rgb(212, 183, 12);
  --c2: rgb(235, 90, 12);
  --c3: rgb(15, 123, 167);

  --text: rgb(245, 220, 120);
  --text-sub: rgb(200, 160, 60);
  --text-content: rgba(255, 245, 200, 0.9);
  --text-header: #fff;

  --subsec-color: rgba(235, 225, 200, 0.0);

  --header-height: 48px;
  --header-padding-x: 80px;
  --header-bg: rgba(10, 70, 100, 0.95);
  --header-blur: 12px;
  --header-border: rgba(205, 205, 205, 0.7);

  --icon-size: 26px;
  --icon-bg: rgba(255, 255, 255, 0.08);

  --subsec-width: min(1300px, 90vw);
  --subsec-left-shift: -20px;
  --subsec-max-height: 80vh;

  /* CONTENT SYSTEM */
  --content-max-width: 720px;
  --content-line-height: 1.6;
  --content-font-size: 15px;

  --content-gap-y: 16px;
  --content-gap-x: 16px;

  --media-max-width: 720px;
  --media-radius: 6px;
  --media-shadow: 0 4px 20px rgba(0,0,0,0.25);

  --media-gap: 16px;

  --media-aspect: 16 / 9;
}

* {
  box-sizing: border-box;
}

@font-face {
  font-family: "Bebas";
  src: url("fonts/ZTNature-Regular.otf") format("opentype");
}

html {
  height: 100%;
}

body {
  margin: 0;
  overflow: auto;
  color: var(--text);
  font-family: "Bebas", Arial, sans-serif;
  background: url("background.jpeg") center / cover no-repeat fixed;
}

.section-toggle,
.item-toggle {
  position: relative;
  padding-left: 32px;
}

.section-toggle::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 55, 30, 0.8);
}

.item-toggle::before {
  content: none;
}

.item-toggle {
  padding-left: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(212, 183, 12, 0.5), transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(235, 90, 12, 0.5), transparent 30%),
    radial-gradient(circle at 60% 80%, rgba(15, 123, 167, 0.5), transparent 35%);
  filter: blur(40px);
  z-index: 0;
}

/* HEADER */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  color: var(--text-header);
  transition: opacity 0.8s ease;
}

.site-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--header-bg);
  backdrop-filter: blur(var(--header-blur));
  border-bottom: 1px solid var(--header-border);
}

.header-inner {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--header-padding-x);
}

.site-title-toggle {
  background: none;
  border: none;
  color: var(--c2);
  cursor: pointer;
  font: inherit;
  margin: 0;
  padding: 0;
}

.header-socials {
  display: flex;
  gap: 10px;
}

.social-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--icon-bg);
  color: var(--text-header);
  text-decoration: none;
}

/* BIO */
.site-bio {
  position: absolute;
  top: var(--header-height);
  left: 0;
  width: 100%;
  max-width: 600px;
  background: rgba(0, 0, 0, 0.85);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 0.4s ease,
    opacity 0.4s ease,
    padding 0.4s ease;
  z-index: 1001;
}

.site-bio.open {
  max-height: 400px;
  opacity: 1;
  padding: 16px;
}

/* APP */
#app {
  position: fixed;
  top: calc(var(--header-height) + 40px);
  left: 20px;
  width: 420px;
  padding: 20px;
  overflow: visible;
  z-index: 100;
  border: 4px solid;
  border-color: var(--c3) var(--c2) var(--c1) var(--c3);
  background: rgba(10, 10, 0, 0.80);
  transition:
    width 0.4s ease,
    opacity 0.8s ease,
    background 0.6s ease;
}

#app.expanded {
  width: min(92vw, var(--subsec-width));
}

/* ─── Drawings fullscreen ─────────────────────────────────────────────────── */

#app.drawings-fullscreen {
  left: 0 !important;
  top: var(--header-height) !important;
  width: 100vw !important;
  height: calc(100vh - var(--header-height)) !important;
  border: none !important;
  border-radius: 0 !important;
  background: rgba(10, 20, 20, 0.9) !important;
  padding: 0 !important;
  transition:
    left 0.5s ease,
    top 0.5s ease,
    width 0.5s ease,
    height 0.5s ease,
    opacity 0.8s ease !important;
}

/* Hide the section title entirely in drawings fullscreen */
#app.drawings-fullscreen .section-toggle {
  display: none !important;
}

/* Section body becomes the scrollable canvas */
#app.drawings-fullscreen .section-body.open {
  max-height: none !important;
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 40px 28px 28px;
  opacity: 1;
}

#app.drawings-fullscreen .section-body.open::-webkit-scrollbar {
  width: 6px;
}

#app.drawings-fullscreen .section-body.open::-webkit-scrollbar-thumb {
  background: var(--c3);
}

#app.drawings-fullscreen .section-body.open::-webkit-scrollbar-track {
  background: transparent;
}

/* ─────────────────────────────────────────────────────────────────────────── */

/* Exhibitions section */
#app.exhibitions-open {
  background: rgba(10, 10, 0, 0.25) !important;
  border: 6px solid var(--c3) !important;
}

.app-hidden {
  opacity: 0;
}

/* CONTENT */
.content {
  display: grid;
  gap: 8px;
  max-width: none;
  width: 100%;
  overflow: visible;
  align-content: start;
  padding-right: 6px;
  position: relative;
}

/* TEXT-ONLY SECTIONS */
.main-section {
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.section-toggle,
.item-toggle {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  display: block;
  font-family: inherit;
  position: relative;
}

.section-toggle {
  padding-left: 32px;
  color: var(--text);
  font-size: 36px;
  font-weight: 700;
  margin: 0;
  padding-bottom: 4px;
}

.item-toggle {
  padding-left: 40px;
  color: var(--text-sub);
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}

.section-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-bottom: 0;
  transition:
    max-height 0.35s ease,
    opacity 0.25s ease,
    padding-bottom 0.35s ease;
}

.section-body.open {
  max-height: 1000px;
  opacity: 1;
  padding-bottom: 8px;
}

.item {
  margin-top: 2px;
  position: relative;
  overflow: visible;
}

/* SUBSECTION */
.item-body {
  position: relative;
  isolation: isolate;
  height: 0;
  width: 100%;
  opacity: 0;
  overflow: hidden;
  padding: 0;
  transition:
    height 0.4s ease,
    opacity 0.35s ease,
    padding 0.35s ease;
}

.item-body.open {
  height: var(--subsec-max-height);
  width: var(--subsec-width);
  max-width: var(--subsec-width);
  opacity: 1;
  padding: 24px 28px 28px;
  overflow-y: auto;
  overflow-x: hidden;
  margin-left: var(--subsec-left-shift);
}

.item-body.open::-webkit-scrollbar {
  width: 6px;
}

.item-body.open::-webkit-scrollbar-thumb {
  background: var(--c3);
}

.item-body.open::-webkit-scrollbar-track {
  background: transparent;
}

.item-body.open::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: scaleY(0);
  transform-origin: top;
  animation: subsecExpand 0.35s ease forwards;
  z-index: -1;
}

/* text */
.item-body p {
  max-width: 62ch;
  margin: 0 0 16px;
  color: var(--text-content);
  font-family: Inter, Arial, sans-serif;
  line-height: 1.45;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: var(--media-gap);
  margin-top: 12px;
  max-width: 100%;
}

.item-body img,
.item-body video,
.item-body iframe {
  width: 100%;
  max-width: var(--media-max-width);
  border-radius: var(--media-radius);
  box-shadow: var(--media-shadow);
  display: block;
}

.item-body iframe,
.item-body video {
  aspect-ratio: var(--media-aspect);
  object-fit: cover;
}

.item-body.open > *:last-child {
  margin-bottom: 0;
}

/* SPLASH */
#splash {
  position: fixed;
  inset: 0;
  background: black;
  z-index: 9999;
  cursor: pointer;
  transition: opacity 0.8s ease;
}

#splash.fade-out {
  opacity: 0;
  pointer-events: none;
}

.splash-gif {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gif-back {
  opacity: 0.8;
}

.gif-front {
  opacity: 0.4;
  mix-blend-mode: screen;
}

@keyframes subsecExpand {
  from { transform: scaleY(0); opacity: 0; }
  to { transform: scaleY(1); opacity: 1; }
}

/* when a subsection is open, hide the menu */
#app.subsection-open .section-toggle,
#app.subsection-open .item-toggle {
  display: none;
}

body.subsection-open .corner-gif {
  opacity: 0;
  pointer-events: none;
}

/* hide all items when subsection open */
#app.subsection-open .item {
  display: none;
}

/* keep only the active item visible */
#app.subsection-open .item.active-item {
  display: block;
}

#app.subsection-open .item.active-item .item-body.open {
  display: block;
}

/* title inside opened subsection */
.subsection-title {
  margin: 0 0 18px;
  color: var(--text);
  font-family: inherit;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

#close-btn {
  position: fixed;
  top: calc(var(--header-height) + 50px);
  left: calc(10px + var(--subsec-width));
  transform: translateX(-100%) translateX(-8px);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--c2);
  cursor: pointer;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#close-btn:hover {
  transform: translateX(-100%) translateX(-8px) scale(1.1);
}

#app.subsection-open ~ #close-btn,
body.subsection-open #close-btn {
  opacity: 0.8;
  pointer-events: auto;
}

/* Drawings fullscreen: anchor close btn to top-right */
#app.drawings-fullscreen ~ #close-btn {
  left: auto;
  right: 20px;
  transform: none !important;
}

.video-item {
  margin-bottom: var(--media-gap);
}

.video-item:last-child {
  margin-bottom: 0;
}

.video-caption {
  margin: 0 0 6px;
  color: var(--text-sub);
  font-family: Inter, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  max-width: var(--media-max-width);
}

.gif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 1rem;
}

.gif-grid img {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── DRAWINGS GRID — CSS columns masonry ────────────────────────────────── */

.drawings-grid {
  columns: 4;
  column-gap: 16px;
  padding: 8px 0;
}

.drawing-item {
  break-inside: avoid;
  margin-bottom: 16px;
}

.drawing-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.drawing-title {
  font-size: 13px;
  color: #888;
  text-align: center;
  margin-top: 4px;
  font-family: Inter, Arial, sans-serif;
}

/* ─────────────────────────────────────────────────────────────────────────── */

.corner-gif {
  position: fixed;
  top: 50px;
  right: 0px;
  width: 250px;
  height: 150px;
  z-index: 2000;
  pointer-events: auto;
  cursor: pointer;
  mix-blend-mode: screen;
}

/* =============================================
   MOBILE STYLES
   ============================================= */
@media (max-width: 700px) {
  :root {
    --header-padding-x: 16px;
    --subsec-width: calc(100vw - 32px);
    --subsec-left-shift: 0px;
    --subsec-max-height: 75dvh;
  }

  #app {
    left: 0;
    right: 0;
    width: calc(100vw - 0px) !important;
    top: calc(var(--header-height) + 16px);
    padding: 14px 14px 14px 14px;
    border-width: 3px;
  }

  #app.expanded {
    width: 100vw !important;
  }

  .item-body.open {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    padding: 16px 14px 20px !important;
    height: var(--subsec-max-height);
  }

  .section-toggle {
    font-size: 28px;
  }

  .item-body {
    font-size: var(--content-font-size);
    line-height: var(--content-line-height);
  }

  .item-body p {
    max-width: 100%;
    margin: 0 0 var(--content-gap-y);
    color: var(--text-content);
    font-family: Inter, Arial, sans-serif;
  }

  .media-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 16px;
  }

  .item-body img,
  .item-body video,
  .item-body iframe {
    max-width: 100%;
  }

  .gif-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .drawings-grid {
    columns: 2;
    column-gap: 12px;
  }

  .drawing-item {
    margin-bottom: 12px;
  }

  #app.drawings-fullscreen .section-body.open {
    padding: 40px 14px 20px;
  }

  .corner-gif {
    width: 130px;
    height: 78px;
    top: calc(var(--header-height) + 4px);
  }

  #close-btn {
    left: auto;
    right: 10px;
    top: calc(var(--header-height) + 10px);
    transform: none !important;
    font-size: 26px;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
  }

  .site-bio {
    max-width: 100%;
  }

  .subsection-title {
    font-size: 24px;
    margin-bottom: 12px;
  }
}

/* Moodboard button */
.moodboard-btn {
  background: none;
  border: none;
  color: var(--c2);
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  opacity: 0.85;
  padding: 0;
  transition: opacity 0.15s;
}
.moodboard-btn:hover {
  opacity: 1;
}