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

/* ════════════════════════════════════════
   VARIABLES
════════════════════════════════════════ */
:root {
  --bg: #ffffff;
  --text-primary: #111111;
  --text-secondary: #c0c0c0;
  --text-mid: #888888;
  --accent: #aeffd0;
  --max-width: 1200px;
  --page-pad: 64px;
  --gallery-h: 62vh;
  --col-gap: 212px;
}

/* ════════════════════════════════════════
   BASE
════════════════════════════════════════ */
html, body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Funnel Display', sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

/* ════════════════════════════════════════
   CURSOR + PAINT
════════════════════════════════════════ */
#paint-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

#cursor {
  position: fixed;
  width: 8px; height: 8px;
  background: var(--text-primary);
  border-radius: 0;
  pointer-events: none;
  z-index: 100;
  transform: translate(-50%, -50%);
}

/* ════════════════════════════════════════
   PAGE SHELL
════════════════════════════════════════ */
.page {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px var(--page-pad) 96px;
}

/* ════════════════════════════════════════
   ANIMATIONS
════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════
   LOGO
════════════════════════════════════════ */
.logo {
  margin-bottom: 80px;
  opacity: 0;
  animation: fadeUp 0.4s ease 0s forwards;
}

.logo a {
  display: inline-block;
  text-decoration: none;
}

.logo img {
  height: 56px;
  width: auto;
  display: block;
}

/* ════════════════════════════════════════
   NAV (interior pages)
════════════════════════════════════════ */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 80px;
  opacity: 0;
  animation: fadeUp 0.35s ease 0s forwards;
}

.nav .logo {
  margin-bottom: 0;
}

.nav .logo img {
  height: 56px;
  width: auto;
  display: block;
}

/* ════════════════════════════════════════
   HOMEPAGE HERO
════════════════════════════════════════ */
.hero {
  margin-bottom: 96px;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.1s forwards;
}

.hero-line1 {
  font-size: clamp(2.375rem, 6vw, 3.875rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-line2 {
  font-size: clamp(1.9rem, 4.8vw, 3.1rem);
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-top: 0.2em;
}

/* ════════════════════════════════════════
   HOMEPAGE + BOTTOM LINK GRID
════════════════════════════════════════ */
.link-grid {
  display: grid;
  grid-template-columns: max-content max-content max-content;
  gap: 0 var(--col-gap);
}

.link-section {
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.5s ease forwards;
}

.link-section:nth-child(1) { animation-delay: 0.28s; }
.link-section:nth-child(2) { animation-delay: 0.33s; }

.section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.link-list {
  list-style: none;
}

.link-list li {
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.link-list a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  line-height: 1.5;
  transition: color 0.12s;
}

.link-list a:hover { color: var(--text-primary); }

.wip-tag {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border: 1px solid currentColor;
  padding: 1px 4px;
  border-radius: 2px;
  opacity: 0.5;
  line-height: 1;
  flex-shrink: 0;
}

/* ════════════════════════════════════════
   PROJECT HEADER
════════════════════════════════════════ */
.project-header {
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.1s forwards;
}

.project-category {
  display: none;
}

.project-title {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.project-intro {
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.project-additional-details {
  margin-top: 24px;
  padding-top: 24px;
  font-size: 0.7rem;
  font-weight: 200;
  color: var(--text-primary);
  line-height: 1.8;
  letter-spacing: .01em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.2s forwards;
}

.project-details {
  font-size: 1rem;
  font-weight: 200;
  color: var(--text-primary);
  line-height: 1.35;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.2s forwards;
}

.project-details a {
  color: var(--text-secondary);
  text-underline-offset: 3px;
  transition: color 0.12s;
}

.project-details a:hover { color: var(--text-primary); }

/* ════════════════════════════════════════
   PROJECT HERO
════════════════════════════════════════ */
.project-hero {
  margin-bottom: 14px;
}

.hero-single {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  cursor: pointer;
}

.hero-single img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.15s;
}

.hero-single:hover img { opacity: 0.92; }

.hero-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hero-duo-item {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  cursor: pointer;
}

.hero-duo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.15s;
}

.hero-duo-item:hover img { opacity: 0.92; }

/* ════════════════════════════════════════
   JUSTIFIED PHOTO GRID
════════════════════════════════════════ */
.photo-grid {
  /* rows built by JS */
}

.photo-grid.loading {
  min-height: 200px;
}

.grid-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.grid-row:last-child {
  margin-bottom: 0;
}

.grid-item {
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.grid-item.revealed img {
  opacity: 1;
  transform: translateY(0);
}

.grid-item:hover img { opacity: 0.92; }

/* hero reveal */
.hero-single img,
.hero-duo-item img {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.hero-single.revealed img,
.hero-duo-item.revealed img {
  opacity: 1;
  transform: translateY(0);
}

/* ════════════════════════════════════════
   MODAL
════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.95);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal-img-wrap {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.modal-img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  user-select: none;
}

.modal-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: rgba(0,0,0,0.4);
  font-family: 'Syne', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.12s;
}

.modal-close:hover { color: #111; }

.modal-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Syne', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(0,0,0,0.35);
  white-space: nowrap;
}

.modal-prev,
.modal-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 16px 20px;
  color: rgba(0,0,0,0.3);
  transition: color 0.12s;
  font-size: 0;
}

.modal-prev { left: 0; }
.modal-next { right: 0; }
.modal-prev:hover, .modal-next:hover { color: rgba(0,0,0,0.9); }
.modal-prev svg, .modal-next svg { width: 20px; height: 20px; }
.modal-prev.hidden, .modal-next.hidden { opacity: 0; pointer-events: none; }

/* ════════════════════════════════════════
   BOTTOM NAV (interior pages)
════════════════════════════════════════ */
.bottom-nav {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid #efefef;
  display: grid;
  grid-template-columns: max-content max-content max-content;
  gap: 0 var(--col-gap);
}

.bottom-nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.bottom-nav-list {
  list-style: none;
}

.bottom-nav-list li {
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.bottom-nav-list a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  line-height: 1.5;
  transition: color 0.12s;
}

.bottom-nav-list a:hover { color: var(--text-primary); }
.bottom-nav-list a.current { color: var(--text-primary); font-weight: 700; }

/* ════════════════════════════════════════
   WIP NOTICE
════════════════════════════════════════ */
.wip-notice {
  margin-top: 48px;
  padding: 24px;
  border: 1px dashed #e0e0e0;
  border-radius: 2px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  opacity: 0;
  animation: fadeUp 0.4s ease 0.28s forwards;
}

.wip-notice strong { color: var(--text-primary); }

/* ════════════════════════════════════════
   HORIZONTAL GALLERY (legacy scroll strip)
   — kept for reference, not used in grid pages
════════════════════════════════════════ */
.gallery-wrap {
  margin: 48px calc(-1 * var(--page-pad));
  opacity: 0;
  animation: fadeUp 0.4s ease 0.28s forwards;
}

.gallery {
  display: flex;
  gap: 8px;
  height: var(--gallery-h);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--page-pad);
  scrollbar-width: none;
  cursor: none;
}

.gallery::-webkit-scrollbar { display: none; }

.gallery-item {
  flex-shrink: 0;
  height: 100%;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
}

.gallery-item img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: cover;
}

.gallery-item .caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 10px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.45));
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  opacity: 0;
  transition: opacity 0.18s;
  pointer-events: none;
}

.gallery-item:hover .caption { opacity: 1; }

.gallery-dot-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px var(--page-pad) 0;
  user-select: none;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e0e0e0;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.dot.active {
  background: var(--text-primary);
  transform: scale(1.2);
}


/* ── MODAL CAPTION ── */
.modal-caption {
  font-family: 'Syne', sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(0,0,0,0.45);
  pointer-events: none;
  text-align: left;
  padding-top: 12px;
  width: 100%;
}

/* ════════════════════════════════════════
   ABOUT PAGE
════════════════════════════════════════ */
.about-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--col-gap) - 20px);
  margin-top: 24px;
}

/* ════════════════════════════════════════
   MOBILE
════════════════════════════════════════ */
@media (max-width: 580px) {
  :root {
    --page-pad: 24px;
    --gallery-h: 50vw;
  }

  html, body { cursor: auto; }
  #cursor, #paint-canvas { display: none; }

  .link-grid { grid-template-columns: 1fr; }
  .bottom-nav { grid-template-columns: 1fr; gap: 32px 0; }
  .about-columns { grid-template-columns: 1fr; gap: 0; }
  .about-columns .project-additional-details { margin-top: 24px; padding-top: 0; }
  .hero-duo { gap: 6px; }
  .grid-row { gap: 6px; margin-bottom: 6px; }

  .modal-prev { padding: 12px 14px; }
  .modal-next { padding: 12px 14px; }
}
