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

:root {
  --bg-light: #f9f7f4;
  --bg-dark: #000;
  --text-light: #111;
  --text-dark: #fff;
  --muted: #888;
  --font-serif: 'Georgia', serif;
  --font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
}

/* ── Back link ── */
.back {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 100;
  text-decoration: none;
  font-size: 1.2rem;
  color: inherit;
  opacity: 0.4;
  transition: opacity 0.2s;
  padding: 0.75rem;
}
.back:hover { opacity: 1; }
.dark-page .back { color: var(--text-dark); }

/* ── Homepage ── */
body.home {
  background: var(--bg-light);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.home-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2rem;
}

.home-gif {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.home-name {
  font-family: var(--font-sans);
  font-size: clamp(0.7rem, 1.5vw, 1rem);
  font-weight: bold;
  letter-spacing: 0.02em;
  text-transform: none;
  margin-right: 1.5rem;
}

.home-nav {
  display: flex;
  gap: 2.5rem;
}

.home-nav a {
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.home-nav a:hover { border-color: var(--text-light); }

/* ── Contact ── */
.contact-email {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--text-light);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
  display: block;
}
.contact-email:hover { border-color: var(--text-light); }

/* ── :) placeholder ── */
.smile-placeholder {
  font-size: 4rem;
  color: var(--muted);
}

/* ── Work split screen ── */
body.work-page {
  background: #000;
  overflow-y: auto;
  height: 100%;
}

.split-screen {
  display: flex;
  height: 100vh;
  width: 100vw;
}

.split-panel {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: block;
  text-decoration: none;
  cursor: pointer;
}

.split-panel img,
.split-panel video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.55);
  transition: filter 0.4s ease, transform 0.5s ease;
  pointer-events: none;
}

.split-panel:hover img,
.split-panel:hover video {
  filter: brightness(0.75);
  transform: scale(1.03);
}

.split-panel.still img,
.split-panel.still video {
  opacity: 1;
  filter: brightness(0.55) saturate(0.8);
}

.split-panel.still:hover img,
.split-panel.still:hover video {
  opacity: 1;
  filter: brightness(0.75) saturate(0.8);
}

.panel-label {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  white-space: nowrap;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.split-panel:hover .panel-label { opacity: 1; }

.split-panel + .split-panel {
  border-left: none;
}

.secret-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40vh;
  color: rgba(255,255,255,0.15);
  text-decoration: none;
  font-size: 2rem;
  letter-spacing: 0.2em;
  transition: color 0.4s;
}

.secret-panel:hover {
  color: rgba(255,255,255,0.7);
}

/* ── Grid pages (moving image / still image / ?) ── */
body.dark-page {
  background: var(--bg-dark);
  color: var(--text-dark);
}

body.light-page {
  background: #edeced;
  color: var(--text-light);
}

.grid-page {
  padding: 4rem 2rem 4rem;
  max-width: 1300px;
  margin: 0 auto;
}

body.dark-page .grid-page {
  max-width: 100%;
  padding: 4rem 3rem;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 1.5rem;
  align-items: start;
}

.media-item img,
.media-item video {
  width: 100%;
  display: block;
  height: auto;
  object-fit: contain;
  background: none;
}

.media-item iframe {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
  border: none;
}

.vimeo-wrapper {
  aspect-ratio: 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.vimeo-wrapper iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
}

body.dark-page .media-item video,
body.dark-page .media-item iframe {
  aspect-ratio: unset;
  height: auto;
  object-fit: contain;
  background: #000;
}

.media-caption {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

body.dark-page .media-caption { color: #666; }

body.dark-page .media-item img,
body.dark-page .media-item video {
  aspect-ratio: 1 / 1;
}

body.dark-page .media-grid {
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.5rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .split-screen { flex-direction: column; }
  body.work-page { overflow-y: auto; height: auto; }
  .split-panel { height: 33.33vh; flex: none; }
  .split-panel + .split-panel { border-left: none; border-top: 1px solid rgba(255,255,255,0.1); }
  .media-grid { grid-template-columns: 1fr; }

  /* Still image page on mobile */
  body.light-page .grid-page { padding: 3rem 1rem 3rem; }
  body.light-page .media-item,
  body.light-page .media-item[style*="grid-column"] { grid-column: 1 !important; }
  body.light-page .media-item img {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 200px;
    object-fit: contain;
  }
}
