/* ============================================================
   RESET
   ============================================================ */

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

/* ============================================================
   VARIABLES
   ============================================================ */

:root {
  --bg:    #edece8;
  --ink:   #111110;
  --muted: #8a8a87;
  --font:  'Mundial', 'Helvetica Neue', Helvetica, 'Inter', Arial, sans-serif;
  --pad:   40px;
}

/* ============================================================
   BASE
   ============================================================ */

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  font-family: inherit;
}

/* ============================================================
   HOMEPAGE — no scroll
   ============================================================ */

body.page-home {
  overflow: hidden;
}

/* ============================================================
   UI CHROME — fixed corners (homepage only)
   ============================================================ */

.ui-logo {
  position: fixed;
  top: var(--pad);
  left: var(--pad);
  z-index: 100;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1;
  transition: opacity 0.25s;
}

.ui-logo:hover {
  opacity: 0.4;
}

.ui-nav {
  position: fixed;
  top: var(--pad);
  right: var(--pad);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.ui-nav a {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  transition: opacity 0.25s;
}

.ui-nav a:hover {
  opacity: 0.4;
}

.ui-title {
  position: fixed;
  bottom: var(--pad);
  left: var(--pad);
  z-index: 100;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}

.ui-controls {
  position: fixed;
  bottom: var(--pad);
  right: var(--pad);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 14px;
}

.ctrl-count {
  font-size: 9px;
  font-weight: 400;
  color: var(--muted);
  min-width: 22px;
  text-align: center;
}

.ctrl-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  line-height: 1;
  padding: 2px;
  transition: opacity 0.25s;
}

.ctrl-btn:hover {
  opacity: 0.35;
}

/* ============================================================
   CAROUSEL — homepage
   ============================================================ */

.carousel {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.slide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.85s ease;
  pointer-events: none;
  line-height: 0;
}

.slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.slide img {
  display: block;
  max-width: 50vw;
  max-height: 64vh;
  width: auto;
  height: auto;
  transition: transform 0.5s ease;
}

.slide:hover img {
  transform: scale(1.015);
}

/* ============================================================
   SITE HEADER — in-flow nav (all pages except homepage)
   ============================================================ */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--pad);
}

.site-header .ui-logo,
.site-header .ui-nav {
  position: static;
}

.site-header .ui-nav {
  align-items: flex-end;
}

/* ============================================================
   WORK PAGE — perfect 4-column grid
   ============================================================ */

body.page-work {
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
}

.page-work .site-header {
  padding-bottom: 20px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 20px;
  row-gap: 32px;
  align-items: start;
  padding: 20px var(--pad) 40px;
  max-width: 1280px;
  margin: 0 auto;
}

.work-item {
  display: block;
}

.work-item-img {
  overflow: hidden;
  background: #e2e1dd;
  margin-bottom: 10px;
  aspect-ratio: 8 / 5;
}

.work-item-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.work-item:hover .work-item-img img {
  transform: scale(1.04);
}

.work-item-name {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.work-item-cat {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}

/* ============================================================
   ABOUT PAGE — full-viewport split
   ============================================================ */

body.page-about {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.about-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 60px;
  flex: 1;
  overflow: hidden;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.about-text {
  overflow-y: auto;
  padding: 48px 0 60px;
  display: flex;
  flex-direction: column;
}

.about-bio-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  margin-bottom: 24px;
}

.about-bio p {
  font-size: 13px;
  font-weight: 300;
  line-height: 1.9;
  color: var(--ink);
  margin-bottom: 20px;
  max-width: 480px;
}

.about-cv-link {
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  transition: opacity 0.25s;
}

.about-cv-link:hover {
  opacity: 0.4;
}

.about-footer {
  margin-top: auto;
  padding-top: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
}

.about-footer-links {
  display: flex;
  gap: 20px;
}

.about-footer-links a:hover {
  color: var(--ink);
}

.about-image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  overflow: hidden;
}

.about-image img {
  display: block;
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
}

/* ============================================================
   PROJECT PAGES
   ============================================================ */

body.page-project {
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
}

.p-hero {
  height: 70vh;
  overflow: hidden;
  background: #e2e1dd;
}

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

.p-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px var(--pad) 56px;
  border-bottom: 1px solid rgba(17, 17, 16, 0.1);
}

.p-num {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.07em;
  margin-bottom: 16px;
}

.p-title {
  font-size: clamp(28px, 3.8vw, 50px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.p-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 36px;
  align-items: baseline;
  padding-top: 2px;
}

.p-meta dt {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.p-meta dd {
  font-size: 12px;
  font-weight: 300;
}

.p-desc {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px var(--pad);
  border-bottom: 1px solid rgba(17, 17, 16, 0.1);
}

.p-desc p {
  font-size: 15px;
  line-height: 1.75;
  font-weight: 300;
  max-width: 640px;
}

.p-gallery {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--pad) 80px;
}

.p-gallery-full {
  height: 60vh;
  overflow: hidden;
  background: #e2e1dd;
  margin-bottom: 12px;
}

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

.p-gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.p-gallery-grid-item {
  height: 40vh;
  overflow: hidden;
  background: #e2e1dd;
}

/* Natural-aspect gallery (no crop) */
.p-gallery-natural-single {
  margin-bottom: 12px;
}

.p-gallery-natural-single img {
  display: block;
  width: 100%;
  height: auto;
}

.p-gallery-natural-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.p-gallery-natural-row img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.p-gallery-natural-triple {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 40px;
}

.p-gallery-natural-triple img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.p-gallery-natural-triple .p-gallery-caption {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.p-gallery-caption {
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
  margin-bottom: 20px;
}

.p-nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 52px var(--pad);
  border-top: 1px solid rgba(17, 17, 16, 0.1);
}

.p-nav-back {
  font-size: 11px;
  color: var(--muted);
  transition: color 0.2s;
}

.p-nav-back:hover {
  color: var(--ink);
}

.p-nav-next {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.p-nav-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.p-nav-title {
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 300;
  letter-spacing: -0.015em;
  transition: opacity 0.2s;
}

.p-nav-next:hover .p-nav-title {
  opacity: 0.4;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--pad);
  border-top: 1px solid rgba(17, 17, 16, 0.1);
  font-size: 10px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 22px;
}

.footer-links a:hover {
  color: var(--ink);
}

/* ============================================================
   CV PAGE
   ============================================================ */

.page-cv .cv-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px var(--pad) 80px;
}

.cv-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 48px;
}

.cv-section {
  margin-bottom: 40px;
}

.cv-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 16px;
}

.cv-entries {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cv-entry {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
}

.cv-year {
  font-size: 11px;
  color: var(--muted);
}

.cv-title {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
}

.cv-detail {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ============================================================
   PLACEHOLDER PAGES
   ============================================================ */

.page-placeholder {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.placeholder-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-body p {
  font-size: 11px;
  color: var(--muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 16px;
    row-gap: 28px;
    padding-top: 20px;
  }
}

/* ── Project video ───────────────────────── */
.p-video {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--pad) 60px;
}

.p-video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.p-video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ── Media page ───────────────────────────── */
body.page-media {
  background: var(--bg);
  overflow-y: auto;
}

.media-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 80px var(--pad) 120px;
}

.media-project {
  margin-bottom: 56px;
}

.media-project-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: 16px;
}

.media-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.media-list li {
  border-top: 1px solid #d8d7d3;
  padding: 10px 0;
}

.media-list li:last-child {
  border-bottom: 1px solid #d8d7d3;
}

.media-list a {
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
}

.media-list a:hover {
  color: var(--muted);
}

@media (max-width: 768px) {
  :root { --pad: 20px; }

  .slide img {
    max-width: 85vw;
    max-height: 58vh;
  }

  body.page-about {
    height: auto;
    overflow-y: auto;
  }

  .about-split {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .about-image {
    height: 70vw;
    padding: 0 20px 40px;
    order: -1;
  }

  .about-text {
    overflow-y: visible;
  }

  .p-intro {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .p-gallery-grid {
    grid-template-columns: 1fr;
  }

  .p-gallery-grid-item {
    height: 44vw;
  }
}

@media (max-width: 480px) {
  .ui-nav { gap: 9px; }

  .work-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 12px;
    row-gap: 32px;
  }

  .p-title { font-size: 24px; }

  .footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* ============================================================
   INTERACTIONS — cursor, reveals, tilt, parallax
   ============================================================ */

/* Page entrance */
html.js body {
  opacity: 0;
  transform: translateY(6px);
}

html.js body.is-ready {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

/* Custom cursor */
.c-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  top: 0;
  left: 0;
  width: 5px;
  height: 5px;
  background: var(--ink);
  transition: background 0.2s ease, opacity 0.15s;
}

.c-cursor.is-hover {
  background: #fff;
}

/* Blob cursor — SVG metaball / ferrofluid */
.c-blob {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  top: 0;
  left: 0;
  opacity: 0.4;
  overflow: visible;
  transition: opacity 0.3s ease;
}

.c-blob circle {
  transition: fill 0.3s ease;
}

.c-blob.is-hover {
  opacity: 0.7;
}

.c-blob.is-hover circle {
  fill: #fff;
}

@media (pointer: fine) {
  html.js,
  html.js a,
  html.js button { cursor: none; }
}

/* Scroll reveal */
.sr {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.sr.is-visible {
  opacity: 1;
  transform: none;
}

/* Work grid tilt smoothing */
@media (pointer: fine) {
  .work-item-img {
    transition: transform 0.35s ease;
  }
}

/* Nav magnetic pull smoothing */
.ui-nav a {
  transition: opacity 0.25s, transform 0.3s ease;
}
