/* ==========================================================================
   Reset & Base
   ========================================================================== */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: none !important;
}

html {
  cursor: none !important;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: #1a1a1a;
  background-color: #ffffff;
  padding: 20px 24px 60px;
  overflow-x: hidden;
  transition: background-color 0.6s ease, color 0.6s ease;
  cursor: none;
}

/* Custom cursor */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
}

.cursor-label {
  position: absolute;
  top: 18px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  font-family: "Hanken Grotesk", sans-serif;
  white-space: nowrap;
  color: #000;
  background: #FFC700;
  line-height: 1.3;
}

/* Hide cursor on interactive elements too */
a, button, input, .filter-btn, .carousel-nav, .grid-item, .lightbox-close, .lightbox-nav, .toast-close {
  cursor: none;
}

/* Hide name entry and custom cursor on touch/non-hover devices */
@media (hover: none), (pointer: coarse) {
  .name-entry-btn { display: none !important; }
  .name-popover { display: none !important; }
  .custom-cursor { display: none !important; }
}

/* Also hide below typical tablet widths as a fallback */
@media (max-width: 1024px) {
  .name-entry-btn { display: none !important; }
  .name-popover { display: none !important; }
}

@keyframes btn-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 199, 0, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(255, 199, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 199, 0, 0); }
}

/* Name entry button */
.name-entry-btn {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 7px 16px;
  border-radius: 100px;
  border: 1px solid #FFC700;
  background: #FFC700;
  color: #000;
  cursor: none;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: btn-pulse 2.5s ease infinite;
}

.name-entry-btn.has-name {
  animation: none;
}

.name-entry-btn:hover {
  opacity: 0.8;
}

.name-btn-clear {
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.name-entry-btn:hover .name-btn-clear {
  opacity: 1;
}

/* Name popover */
.name-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 100;
  width: 240px;
}

.name-popover.open {
  display: flex;
}

.name-popover label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
}

.name-input-row {
  display: flex;
  gap: 6px;
}

.name-popover input[type="text"] {
  font-family: inherit;
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  flex: 1;
  min-width: 0;
  cursor: none;
}

.name-popover input[type="text"]:focus {
  border-color: #999;
}

.name-save-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: #1a1a1a;
  color: #fff;
  cursor: none;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.name-save-btn:hover {
  opacity: 0.8;
}

/* Color swatches */
.color-swatches {
  display: flex;
  gap: 6px;
}

.swatch {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: none;
  padding: 0;
  transition: border-color 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.swatch:hover {
  transform: scale(1.15);
}

.swatch.active {
  border-color: #1a1a1a;
}

/* Background gradient overlays — crossfade via opacity */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

#bg-purple {
  background-image: linear-gradient(to right top, #f0e1c1, #e3e5c7, #d9e9d1, #d3eadb, #d1ebe4, #ccebea, #c9eaf0, #c9e8f6, #c8e4ff, #cfdeff, #e0d6ff, #f5cdfc);
}

#bg-cream {
  background-image: linear-gradient(to left bottom, #b3e9cb, #aae8c7, #a1e7c3, #97e6c0, #8de5bc, #83e5c2, #7ae4c8, #70e3ce, #6de2dd, #73dfe9, #80dcf1, #90d9f5);
}

#bg-dark {
  background-image: linear-gradient(to left top, #101c4c, #282358, #3e2962, #53306c, #683675, #5d3a77, #533d77, #483f77, #1c3964, #00304b, #002431, #01171a);
}

/* Scroll-based background themes — activate overlays */
body.theme-purple #bg-purple { opacity: 1; }
body.theme-cream #bg-cream { opacity: 1; }
body.theme-dark #bg-dark { opacity: 1; }

body.theme-purple,
body.theme-cream {
  color: #1a1a1a;
}

body.theme-dark {
  color: #ffffff;
}

body.theme-white {
  color: #1a1a1a;
}

/* Keep pill text color unchanged regardless of theme */
.pill {
  color: #888 !important;
}

/* Keep filter button colors consistent */
.filter-btn {
  color: #888;
}

.filter-btn:hover {
  color: #1a1a1a;
}

.filter-btn.active {
  color: #1a1a1a;
}

/* Transition text elements that should change with theme */
.header-name,
.header-time,
.header-studio,
.section-title,
.about-link,
.underline-link,
.header-bio p {
  transition: color 0.6s ease;
}

/* On dark themes, update specific text elements */
body.theme-dark .header-name,
body.theme-dark .header-time,
body.theme-dark .header-studio,
body.theme-dark .section-title,
body.theme-dark .header-bio p {
  color: #ffffff;
}

body.theme-dark .about-link {
  color: rgba(255, 255, 255, 0.6);
}

body.theme-dark .about-link:hover {
  color: #ffffff;
}

body.theme-dark .underline-link {
  color: #ffffff;
}

/* Carousel nav on dark themes */
body.theme-dark .carousel-nav {
  color: rgba(255, 255, 255, 0.5);
}

body.theme-dark .carousel-nav:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}


img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: none;
  color: inherit;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  margin-bottom: 64px;
}

/* Top row: name / time / studio */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 60px;
}

.header-name {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.header-time {
  font-size: 16px;
  font-weight: 400;
  color: #1a1a1a;
  font-variant-numeric: tabular-nums;
}

.header-studio {
  font-size: 16px;
  font-weight: 400;
}

/* Bio */
.header-bio {
  margin-bottom: 16px;
}

.header-bio p {
  font-size: 16px;
  line-height: 1.6;
  color: #555;
}

.underline-link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.underline-link:hover {
  color: #2B0EEB;
}

/* ==========================================================================
   Pills & Filter Buttons
   ========================================================================== */

/* Name entry wrapper inside bio */
.name-entry-wrapper {
  margin-top: 12px;
}

/* Section-level pills row (pills left, "About this" right) */
.section-pills-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px dashed #BCBCBC;
  background: #ffffff;
  color: #888;
  user-select: none;
}

.about-link {
  font-size: 16px;
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.about-link:hover {
  color: #2B0EEB;
}

/* About accordion */
.about-accordion {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
  overflow: hidden;
}

.about-accordion.open {
  grid-template-rows: 1fr;
}

.about-accordion-inner {
  min-height: 0;
  overflow: hidden;
}

.about-accordion-inner p {
  font-size: 14px;
  line-height: 1.7;
  color: #555;
  max-width: 640px;
  margin-left: auto;
  text-align: right;
}

.about-accordion-inner p + p {
  margin-top: 12px;
}

.about-accordion.open .about-accordion-inner {
  padding-bottom: 12px;
}

/* ==========================================================================
   Project Sections
   ========================================================================== */

.project-section {
  margin-top: 40px;
}

/* Section header row — title left, chevrons right */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.section-title {
  font-size: 16px;
  font-weight: 500;
}

.section-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Carousel chevron buttons */
.carousel-nav {
  font-size: 20px;
  line-height: 1;
  color: #999;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
  user-select: none;
}

.carousel-nav:hover {
  color: #1a1a1a;
  background-color: #f0f0f0;
}

/* ==========================================================================
   Carousel (FERMÀT, Minti, Viafly)
   ========================================================================== */

.carousel {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin-right: -24px; /* bleed off the right edge of the page */
  padding-right: 24px;
  scrollbar-width: none; /* Firefox */
}

.carousel::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.carousel-track {
  display: flex;
  gap: 16px;
  width: max-content;
}

.carousel-track .grid-item {
  flex-shrink: 0;
  width: 400px;
  height: 400px;
}

.carousel-track .placeholder {
  width: 400px;
  height: 400px;
  padding-bottom: 0;
  border-radius: 2px;
}

/* ==========================================================================
   Image Grid (Random collection)
   ========================================================================== */

.image-grid {
  display: grid;
  gap: 16px;
}

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

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

.image-grid.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Grid toggle buttons */
.grid-toggles {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.grid-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  color: #ccc;
  cursor: none;
  transition: color 0.15s ease;
}

.grid-toggle:hover {
  color: #888;
}

.grid-toggle.active {
  color: #1a1a1a;
}

/* Hide grid toggles on mobile/tablet */
@media (max-width: 1024px) {
  .grid-toggles { display: none; }
}

.grid-item {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  cursor: none;
}

.grid-item img,
.grid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder blocks (replace with real images later) */
.image-grid .placeholder {
  width: 100%;
  padding-bottom: 100%; /* 1:1 square */
  border-radius: 2px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: 80px;
  padding-bottom: 40px;
  text-align: center;
}

.footer-message {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.footer-link {
  font-size: 16px;
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: #2B0EEB;
}

/* Footer on dark themes */
body.theme-dark .footer-message {
  color: rgba(255, 255, 255, 0.6);
}

body.theme-dark .footer-link {
  color: #ffffff;
}

body.theme-dark .footer-link:hover {
  color: #2B0EEB;
}

/* Load more button (mobile random collection) */
.load-more-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  background: none;
  border: 1px dashed #BCBCBC;
  border-radius: 8px;
  cursor: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.load-more-btn:hover {
  border-color: #888;
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  padding: 12px 20px;
  border-radius: 8px;
  z-index: 2000;
  transition: top 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.visible {
  top: 20px;
  pointer-events: auto;
}

.toast-check {
  flex-shrink: 0;
}

.toast-text {
  flex: 1;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: none;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.toast-close:hover {
  opacity: 1;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.lightbox-img {
  max-width: 85vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.5);
  cursor: none;
  font-family: inherit;
  font-weight: 400;
  letter-spacing: 0.04em;
  transition: color 0.15s ease;
  z-index: 1001;
}

.lightbox-close:hover {
  color: #1a1a1a;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  color: rgba(0, 0, 0, 0.4);
  cursor: none;
  user-select: none;
  transition: color 0.15s ease, border-color 0.15s ease;
  z-index: 1001;
}

.lightbox-nav:hover {
  color: #1a1a1a;
}

/* On desktop, nav-row is invisible — navs are absolutely positioned */
.lightbox-nav-row {
  display: contents;
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(0, 0, 0, 0.4);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .carousel-track .grid-item,
  .carousel-track .placeholder {
    width: 300px;
    height: 300px;
  }
}

@media (max-width: 600px) {
  body {
    padding: 16px 16px 48px;
  }

  .header-top {
    flex-direction: row;
    gap: 0;
  }

  .header-studio {
    display: none;
  }

  .header-name,
  .header-time {
    font-size: 14px;
  }

  .carousel {
    margin-right: -16px;
    padding-right: 16px;
  }

  .carousel-track .grid-item,
  .carousel-track .placeholder {
    width: 260px;
    height: 260px;
  }

  .section-header {
    flex-direction: row;
    align-items: center;
  }

  .section-header-right {
    display: none;
  }

  .section-pills-row {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

  .section-pills {
    align-self: flex-start;
  }

  /* Lightbox — stack image and nav vertically on mobile */
  .lightbox {
    flex-direction: column;
    justify-content: center;
    padding: 16px;
    gap: 12px;
  }

  .lightbox-img {
    max-width: 100%;
    max-height: 60vh;
  }

  .lightbox-nav {
    position: static;
    transform: none;
    flex: 1;
    width: auto;
    height: 48px;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #1a1a1a;
  }

  .lightbox-nav:hover {
    border-color: #ddd;
  }

  .lightbox-nav-row {
    display: flex;
    gap: 8px;
    width: 100%;
    order: 2;
  }

  .lightbox-counter {
    position: static;
    transform: none;
  }
}
